query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Convert the result object to printable output in structured form.
public function extractOutput($names, $result) { if ($result instanceof OutputDataInterface) { return $result->getOutputData(); } $extractors = $this->getOutputExtractors($names); foreach ($extractors as $extractor) { $structuredOutput = $this->callExtractor($extractor, $result); if (isset($structuredOutput)) { return $structuredOutput; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function print_result(){\n $parsed_result = (array) $this->get_result()->parse_result();\n foreach($parsed_result['items'] as $repository_detail){\n $out .= $repository_detail->full_name.': '.$repository_detail->description.'<br />';\n }\n echo $out;\n }", "protected function formatResult()\n\t{\n\t\t$this->arResult['CLIENT_INFO'] = $this->clientInfo;\n\t\t$this->arResult['ERRORS'] = $this->errors;\n\n\t\t$this->arResult['AP_MANAGE_URL'] = static::PATH_AP_MANAGE;\n\n\t\t$this->arResult['CLIENT_ACCESS'] = $this->clientAccess;\n\t}", "public function __toString()\n {\n \tif ($this->result) {\n \t\treturn $this->result;\n \t}\n }", "public function __toString() {\n\n return $this->result->body;\n }", "public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }", "function printResultForAggregation($result) {\n while (($row = oci_fetch_array($result)) != false) {\n echo \"<p class=\\\"wrapper\\\">\";\n echo $row[1];\n echo \": \";\n echo $row[0];\n echo \"</p>\";\n }\n }", "protected function formatResult()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\t$arResult = array();\n\n\t\t// references\n\t\t$arResult[\"INFO\"][\"STATUS\"] = $this->dbResult['STATUS'];\n\t\t$arResult[\"INFO\"][\"PAY_SYSTEM\"] = $this->dbResult['PAYSYS'];\n\t\t$arResult[\"INFO\"][\"DELIVERY\"] = $this->dbResult['DELIVERY'];\n\t\t$arResult[\"INFO\"][\"DELIVERY_HANDLERS\"] = $this->dbResult['DELIVERY_HANDLERS'];\n\n\t\t$arResult[\"CURRENT_PAGE\"] = $APPLICATION->GetCurPage();\n\t\t$arResult[\"NAV_STRING\"] = $this->dbQueryResult['ORDERS']->GetPageNavString(Localization\\Loc::getMessage(\"SPOL_PAGES\"), $this->arParams[\"NAV_TEMPLATE\"]);\n\n\t\t// bug walkaround\n\t\t$this->arParams[\"PATH_TO_COPY\"] .= (strpos($this->arParams[\"PATH_TO_COPY\"], \"?\") === false ? \"?\" : \"&amp;\");\n\t\t$this->arParams[\"PATH_TO_CANCEL\"] .= (strpos($this->arParams[\"PATH_TO_CANCEL\"], \"?\") === false ? \"?\" : \"&amp;\");\n\n\t\tif(self::isNonemptyArray($this->dbResult['ORDERS']))\n\t\t{\n\t\t\tforeach ($this->dbResult['ORDERS'] as $k => $orderInfo)\n\t\t\t{\n\t\t\t\t$arOrder =& $this->dbResult['ORDERS'][$k]['ORDER'];\n\t\t\t\t$arOBasket =& $this->dbResult['ORDERS'][$k]['BASKET_ITEMS'];\n\n\t\t\t\t$arOrder[\"FORMATED_PRICE\"] = SaleFormatCurrency($arOrder[\"PRICE\"], $arOrder[\"CURRENCY\"]);\n\n\t\t\t\t$this->formatDate($arOrder, $this->orderDateFields2Convert);\n\n\t\t\t\t$arOrder[\"CAN_CANCEL\"] = (($arOrder[\"CANCELED\"] != \"Y\" && $arOrder[\"STATUS_ID\"] != \"F\" && $arOrder[\"PAYED\"] != \"Y\") ? \"Y\" : \"N\");\n\n\t\t\t\t$arOrder[\"URL_TO_DETAIL\"] = CComponentEngine::MakePathFromTemplate($this->arParams[\"PATH_TO_DETAIL\"], array(\"ID\" => urlencode(urlencode($arOrder[\"ACCOUNT_NUMBER\"]))));\n\t\t\t\t$arOrder[\"URL_TO_COPY\"] = CComponentEngine::MakePathFromTemplate($this->arParams[\"PATH_TO_COPY\"], array(\"ID\" => urlencode(urlencode($arOrder[\"ACCOUNT_NUMBER\"])))).\"COPY_ORDER=Y\";\n\t\t\t\t$arOrder[\"URL_TO_CANCEL\"] = CComponentEngine::MakePathFromTemplate($this->arParams[\"PATH_TO_CANCEL\"], array(\"ID\" => urlencode(urlencode($arOrder[\"ACCOUNT_NUMBER\"])))).\"CANCEL=Y\";\n\n\t\t\t\tif(self::isNonemptyArray($arOBasket))\n\t\t\t\t{\n\t\t\t\t\tforeach ($arOBasket as $n => $basketInfo)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arBasket =& $arOBasket[$n];\n\n\t\t\t\t\t\t$arBasket[\"NAME~\"] = $arBasket[\"NAME\"];\n\t\t\t\t\t\t$arBasket[\"NOTES~\"] = $arBasket[\"NOTES\"];\n\t\t\t\t\t\t$arBasket[\"NAME\"] = htmlspecialcharsEx($arBasket[\"NAME\"]);\n\t\t\t\t\t\t$arBasket[\"NOTES\"] = htmlspecialcharsEx($arBasket[\"NOTES\"]);\n\t\t\t\t\t\t$arBasket[\"QUANTITY\"] = doubleval($arBasket[\"QUANTITY\"]);\n\n\t\t\t\t\t\t// backward compatibility\n\t\t\t\t\t\t$arBasket[\"MEASURE_TEXT\"] = $arBasket[\"MEASURE_NAME\"];\n\n\t\t\t\t\t\t$this->formatDate($arBasket, $this->basketDateFields2Convert);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$arResult[\"ORDERS\"] = $this->dbResult['ORDERS'];\n\t\t}\n\t\telse\n\t\t\t$arResult[\"ORDERS\"] = array();\n\n\t\t$this->arResult = $arResult;\n\t}", "protected function formatResult()\n\t{\n\t\t$this->arResult =& $this->dbResult;\n\t\t$this->arResult['ERRORS'] =& $this->errors;\n\n\t\t$this->arResult['FORM_ID'] = 'CRM_LOC_EDIT_FORM';\n\t\t$this->arResult['GRID_ID'] = 'CRM_LOC_EDIT_GRID';\n\n\t\tforeach($this->componentData['FORM_ROWS'] as $code => $row)\n\t\t{\n\t\t\t$required = $row['required'];\n\n\t\t\tif(!$required && mb_substr($code, 0, 5) == 'NAME_')\n\t\t\t\t$required = true;\n\n\t\t\t$this->arResult['FIELDS'][] = array(\n\t\t\t\t'id' => $code,\n\t\t\t\t'name' => $row['title'],\n\t\t\t\t'value' => Helper::makeSafeDisplay($this->arResult['FORM_DATA'][$code], $code),\n\t\t\t\t'required' => $required,\n\t\t\t\t'type' => 'text' // can and will be redefined at the template\n\t\t\t);\n\t\t}\n\n\t\tif($this->checkIsNonemptyArray($this->arResult['EXTERNAL_SERVICES']))\n\t\t{\n\t\t\t$this->arResult['FIELDS'][] = array(\n\t\t\t\t'id' => 'EXTERNAL',\n\t\t\t\t'required' => false\n\t\t\t);\n\t\t}\n\n\t\t$this->arResult['EXTERNAL_TABLE_COLUMNS'] = Helper::getExternalMap();\n\n\t\tunset($this->componentData);\n\t}", "public function printout()\n\t\t{\tif (isset($this->res) && (mysql_num_rows($this->res) > 0))\n\t\t\t{\tmysql_data_seek($this->res, 0);\n\t\t\t\t$num = mysql_num_fields($this->res);\n\n\t\t\t\techo \"<table border=1>\";\n\t\t\t\techo \"<tr>\";\n\n\t\t\t\tfor ($i = 0; $i < $num; $i++)\n\t\t\t\t{\techo \"<th>\";\n\t\t\t\t\techo mysql_field_name($this->res, $i);\n\t\t\t\t\techo \"</th>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\twhile ($row = mysql_fetch_row($this->res))\n\t\t\t\t{\techo \"<tr>\";\n\n\t\t\t\t\tforeach($row as $elem)\n\t\t\t\t\t{\techo \"<td>$elem</td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</table>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t\techo \"There is nothing to print! <br />\";\n\t\t}", "function printResult($result) {\n\t\t\t\techo \"<div class='Pokeguide'>\n\t\t\t\techo \"<table>\";\n\n\t\t\t\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\t\t\tfor ($i = 0; $i < 15; $i++){\n\t\t\t\t\t\techo \"<tr><td>\" . $row[$i] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t\techo \"</div>\";\n\t\t\t}", "function pr($obj) {\n\n if (!$this->is_cli())\n echo '<pre style=\"word-wrap: break-word\">';\n if (is_object($obj))\n print_r($obj);\n elseif (is_array($obj))\n print_r($obj);\n else\n echo $obj;\n if (!$this->is_cli())\n echo '</pre>';\n }", "function get_a($object, $html_format = true)\n{\n if (is_array($object)) {\n $content = print_r($object, true);\n } else {\n ob_start();\n var_dump($object);\n $content = ob_get_contents();\n ob_end_clean();\n }\n if ($html_format) {\n $content = \"<pre>\".htmlentities($content).\"</pre>\";\n }\n return $content;\n}", "public function format($result)\n {\n if (is_object($result) === true && method_exists($result, '__toString') === true) {\n return (string) $result;\n } elseif (is_object($result) === true || is_array($result) === true) {\n return var_export($result, true);\n } elseif (is_bool($result) === true && true === $result) {\n return 'true';\n } elseif (is_bool($result) === true && false === $result) {\n return 'false';\n }\n\n return (string) $result;\n }", "function dump() {\n\t\t$vars = get_object_vars( $this );\n\t\techo '<pre style=\"text-align:left\">';\n\t\tforeach( $vars as $name => $value ) {\n\t\t\techo $name.': '.$value.\"\\n\";\n\t\t}\n\t\techo '</pre>';\n\t}", "public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function __toString() {\r\n\t\treturn $this->getPrint();\r\n\t}", "public function renderResult() {\n\t\t$this->formulaParser->setFormula($this->formula);\n\t\tforeach ($this->parameters as $key => $param) {\n\t\t\t$value = self::formatParameterValue($_POST['parameters'][$param->attributes->name]);\n\t\t\t$this->formulaParser->setParameter($param->attributes->name,$value);\n\t\t}\n\t\t$result = $this->formulaParser->getResult();\n\t\t$numDecimals = strlen(substr(strrchr($result, \".\"), 1));\n\t\t$fResult = number_format($result, $numDecimals, $this->resultDecimalSep, $this->resultThousandsSep);\n\t\techo $fResult;\n\t\twp_die();\n\t}", "public function __toString() {\n\t\treturn $this->getPrint();\n\t}", "public function __toString()\n {\n ob_start();\n $this->output();\n\n return ob_get_clean();\n }", "function printResult($result)\n{\n echo \"<br>Result:<br>\";\n\n // table head\n $ncols = oci_num_fields($result);\n echo \"<table><tr>\";\n for ($i = 1; $i <= $ncols; $i++) {\n $column_name = oci_field_name($result, $i);\n echo \"<th>{$column_name}</th>\";\n }\n echo \"</tr>\";\n\n // table data\n while ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\";\n for ($i = 0; $i < $ncols; $i++) {\n echo \"<td>{$row[$i]}</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function printResult($result) {\n\techo \"result from SQL:\";\n echo \"<table>\";\n\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n echo \"<tr>\\n\";\n foreach ($row as $item) {\n echo \" <td>\" . ($item !== null ? htmlentities($item, ENT_QUOTES) : \"&nbsp;\") . \"</td>\\n\";\n }\n echo \"</tr>\\n\";\n }\n echo \"</table>\\n\";\n}", "public function __toString()\n {\n return $this->output();\n }", "function resultsToTable($results) {\n\t$html = \"<table border='1' cellspacing='0' cellpadding='2'>\\n\";\n\t$html .= \"<tr>\\n<th>ID</th>\\n<th>Name</th>\\n<th>Address</th>\\n<th></th>\\n\";\n\t$html .= \"<th>Region</th>\\n<th>State</th>\\n<th>Status</th>\\n\";\n\t$html .= \"<th>Deactivation Date</th>\\n<th>PWS Type</th>\\n</tr>\";\n\tforeach($results as $object) {\n\t\t$html .= \"\\n<tr>\\n<td>{$object->PWSID}</td>\\n<td>{$object->PWS_NAME}</td>\\n\";\n\t\t$html .= \"<td>{$object->ADDRESS_LINE1}</td>\\n<td>{$object->ADDRESS_LINE2}</td>\\n\";\n\t\t$html .= \"<td>{$object->EPA_REGION}</td>\\n\";\n\t\t$html .= \"<td>{$object->STATE_CODE}</th>\\n<td>{$object->SUBMISSION_STATUS_CODE}</td>\\n\";\n\t\t$html .= \"<td>{$object->PWS_DEACTIVATION_DATE}</td>\\n<td>{$object->PWS_TYPE_CODE}</td>\\n\";\n\t\t$html .= \"</tr>\\n\";\n\t}\n\treturn $html . \"</table>\\n\";\n}", "function printFormatted($return=false){\n\t\t\tif($return){\n\t\t\t\treturn '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}else{\n\t\t\t\techo '<pre>'.print_r( $this->asArray(), true ).'</pre>';\n\t\t\t}\n\t\t}", "public function __tostring()\n\t{\n\t\treturn '<pre>' . print_r($this, true) . '</pre>';\n\t}", "function printResult($result) {\n while (($row = oci_fetch_array($result)) != false) {\n echo \"<p class=\\\"wrapper\\\">\";\n echo $row[0];\n echo \"</p>\";\n }\n }", "public function getResult()\n {\n $json = $this->object->toJsonEncodeable();\n\n if(! $this->showEmpty) {\n $json = $this->removeEmpty($json);\n }\n\n if(! $this->showType) {\n $json = $this->removeType($json);\n }\n\n if($this->dataGroup) {\n $output = new \\stdClass();\n $group = $this->dataGroup;\n\n if(!empty($this->extraInfo) && is_array($this->extraInfo)) {\n foreach($this->extraInfo as $key => $value) {\n if($key === $group) {\n continue;\n }\n\n $output->$key = $value;\n }\n }\n $output->$group = $json;\n\n } else {\n if(!empty($this->extraInfo) && is_array($this->extraInfo)) {\n $output = new \\stdClass();\n foreach($this->extraInfo as $key => $value) {\n if($key === \"body\") {\n continue;\n }\n $output->$key = $value;\n }\n $output->body = $json;\n } else {\n $output = $json;\n }\n }\n\n return json_encode($output, $this->jsonOptions);\n }", "public function __toString()\n {\n return $this->getOutput();\n }", "public function pr($objVar) {\n\t\techo \"<div align='left'>\";\n\t\tif (is_array($objVar) or is_object($objVar)) {\n\t\t\techo \"<pre>\";\n\t\t\tprint_r($objVar);\n\t\t\techo \"</pre>\";\n\t\t} else {\n\t\t\techo str_replace(\"\\n\", \"<br>\", $objVar);\n\t\t}\n\t\techo \"</div><hr>\";\n\t}", "public function toHtml() {\n\t\techo '<pre '.$this->getAttributes().'>'.$this->renderChildren().'</pre>';\n\t}", "public function __toString(){\n\t\t\treturn $this->return_all();\n\t}", "public function toString()\n {\n $data = $this->getProperties();\n $out = get_class($this).' ('.CRLF;\n foreach ($data as $key => $value) {\n $type = gettype($value);\n $value = is_bool($value) ? (int) $value : $value;\n $value = is_string($value) ? '\"'.$value.'\"' : $value;\n $value = is_object($value) ? implode(CRLF.TAB, explode(CRLF, (string) $value)) : $value;\n $value = is_array($value) ? print_r($value, true) : $value;\n $out .= TAB.$key.' ('.$type.')';\n $out .= ': '.$value.CRLF;\n }\n\n return $out.');';\n }", "public function output()\n {\n $this->setFNAppropriately();\n\n\t$text = 'BEGIN:VCARD'. self::endl;\n\t$text .= 'VERSION:'.self::VERSION . self::endl;\n \n $text .= $this->getUIDAsProperty()->output();\n\n // FIXME: Remove the newlines in Property::__toString and add them here.\n\tforeach ($this->data as $key=>$values)\n\t{\n\t if (!\\is_array($values))\n \t {\n\t\t$text .= $values->output();\n\t\tcontinue;\n\t }\n \n\t foreach ($values as $value)\n\t {\n\t\t$text .= $value->output();\n }\n }\n\n\t$text .= 'END:VCARD'.self::endl;\n\treturn self::foldOutput($text);\n }", "protected function processResults($output) {\n switch(strtolower($this->printFormat)) {\n case \"list\":\n $output = explode(\"\\n\",$output);\n if(strlen($output[count($output)-1])==0) {\n unset($output[count($output)-1]);\n }\n \n $html = [\"<ul class='list-group'>\"];\n foreach($output as $row) {\n $html[] = \"<li class='list-group-item'>{$row}</li>\";\n }\n $html[] =\"</ul>\";\n $output = implode(\"\",$html);\n break;\n case \"html\":\n $output = explode(\"\\n\",$output);\n if(strlen($output[count($output)-1])==0) {\n unset($output[count($output)-1]);\n }\n \n $html = [\"<table class='table table-bordered table-hover'>\"];\n foreach($output as $row) {\n $rowArr = explode(\":::\",$row);\n $tr = [\"<tr>\"];\n foreach($rowArr as $td) {\n $tr[] = \"<td>{$td}</td>\";\n }\n $tr[] = \"</tr>\";\n $html[] = implode(\"\",$tr);\n }\n $html[] = \"</table>\";\n $output = implode(\"\",$html);\n break;\n case \"raw\":\n $output = str_replace(':::',\", \",$output);\n $output = explode(\"\\n\",$output);\n if(strlen($output[count($output)-1])==0) {\n unset($output[count($output)-1]);\n }\n if(count($output)==1 && isset($output[0])) $output = $output[0];\n break;\n }\n return $output;\n }", "function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}", "function Dump()\n {\n echo \"<pre>\" . htmlspecialchars($this->ToString()) . \"</pre>\";\n }", "public function print_out()\n {\n echo \"id: \" . $this->id . \"<br/>\";\n echo $this->rewrite;\n echo $this->extension;\n echo $this->stranglerPattern;\n echo $this->continuousEvolution;\n echo $this->split;\n echo $this->processStrategyOthers;\n echo $this->ddd;\n echo $this->functionalDecomposition;\n echo $this->existingStructure;\n echo $this->decompositionStrategyOthers;\n echo $this->SCA;\n echo $this->MDA;\n echo $this->WDA;\n echo $this->DMC;\n echo $this->techniqueOthers;\n echo $this->GR;\n echo $this->MO;\n echo $this->sourceCode;\n echo $this->useCase;\n echo $this->systemSpecification;\n echo $this->API;\n echo $this->inputOthers;\n echo $this->list;\n echo $this->archi;\n echo $this->outputOthers;\n echo $this->experiment;\n echo $this->example;\n echo $this->caseStudy;\n echo $this->noValidation;\n echo $this->maintainability;\n echo $this->performance;\n echo $this->reliability;\n echo $this->scalability;\n echo $this->security;\n echo $this->qualityOthers;\n echo $this->score;\n echo $this->matchScore;\n echo $this->misMatch . \"<br/>\";\n }", "public function __toString(){\n\t\t\t//imprimir resultados\n\t\t\treturn \"<h2>Resultados</h2> <b>Edad: </b>\" .$this->edad. \" a&ntilde;os<br> <b>Altura: </b>\" .$this->altura. \" cm<br> <b>Peso:</b> \" .$this->peso. \" kg<br> <b>IMC:</b> \"\n\t\t\t. self::imc();// . self::registro() ;\t//Llamar a un metodo declarado dentro de la misma clase\n\t\t}", "public function printValues() {\n\t\t//print_r($this->objects);\n\t\tforeach ($this->objects as $value) {\n\t\t\techo \"$value<br/>\";\n\t\t}\n\t}", "public function toHTML() {\n\t\treturn rtrim( static::buildHTML( get_object_vars($this) ), PHP_EOL );\n\t}", "private function pr($var) {\n if (is_object($var)) {\n if (!method_exists($var, 'toArray'))\n return;\n $var = $var->toArray();\n }\n\n echo '<pre style=\"font:15px Consolas;padding:10px;border:1px solid #c2c2c2;border-radius:10px;background-color:f7f7f7;box-shadow:0 1px 2px #ccc;\">';\n print_r($var);\n echo '</pre>';\n }", "public function dump()\n\t{\n\t\treturn $this->parser->parse($this);\n\t}", "public function __toString()\n\t{\n\t\treturn $this->dump();\n\t}", "protected function render($result)\n {\n $editions = preg_split('/\\n{2}/', $result);\n foreach ($editions as $info) {\n $bits = preg_split('/\\-{5,}/', $info);\n $versions = explode(\"\\n\", trim($bits[1]));\n usort($versions, 'version_compare');\n array_walk($versions, function (&$value) {\n $value = array($value);\n });\n $this->out(array(array(\n 'type' => 'table',\n 'data' => array(\n array(trim($bits[0])),\n $versions\n )\n )));\n }\n }", "public function __toString()\n {\n return $this->fetch();\n }", "public function __toString()\n {\n return $this->fetch();\n }", "function printobject ($problem, $objecttype, $objectname, $key) {\n $fields = array();\n $formats = array();\n $specialobjs = specialdisplaytypes();\n fieldsforobject ($problem, $objecttype, $objectname, \"\", $key, 0,\n $fields, $empty, $specialobjs, $dummy, $objecttype,\n $formats);\n if (($objecttype == \"xy_coord\") && (! $nospecial)) {\n echo \"(\" . $fields[0][\"value\"] . \", \" . $fields[1][\"value\"] . \")\" ;\n }\n else if (($objecttype == \"latlong\") && (! $nospecial)) {\n $lat = $fields[0][\"value\"];\n $long = $fields[1][\"value\"];\n echo abs($lat) . (($lat < 0) ? \"S\" : \"N\") . \" \" .\n abs($long) . (($long < 0) ? \"W\" : \"E\");\n }\n else if (($objecttype == \"matrix\") && (! $nospecial)) {\n echo \"<TABLE BORDER=1>\\n\";\n $k = 0;\n for ($i = 0; $i < $fields[0][\"value\"]; $i++) {\n echo \"<TR>\\n\";\n for ($j = 0; $j < $fields[1][\"value\"]; $j++) {\n echo \"<TD>\\n\";\n echo $fields[2][\"list\"][$k++];\n echo \"</TD>\\n\";\n }\n echo \"</TR>\\n\";\n }\n echo \"</TABLE>\\n\";\n }\n else {\n for ($i = 0; $i < sizeof ($fields); $i++) {\n echo \"<TR><TD>\" . $fields[$i][\"field_name\"] . \"</TD><TD>\";\n if ($fields[$i][\"value\"] && $fields[$i][\"isglobalptr\"])\n echo \"<A HREF=\\\"otherdata.php?dataname=\" . $fields[$i][\"value\"] .\n \"&problem=\" . $problem . \"&action=View\\\" >\" .\n $fields[$i][\"value\"] . \"</A>\";\n else if ($fields[$i][\"objvalue\"])\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"objvalue\"], \"internal_key\");\n else if (! $fields[$i][\"islist\"])\n echo $fields[$i][\"value\"];\n else if (sizeof ($fields[$i][\"list\"]) == 0)\n echo \"&nbsp;\";\n else if (! $fields[$i][\"subobjects\"]) {\n// echo \"{\" . $fields[$i][\"list\"][0];\n// for ($j = 1; $j < sizeof ($fields[$i][\"list\"]); $j++)\n// echo \", \" . $fields[$i][\"list\"][$j];\n// echo \"}\";\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++)\n echo ($j ? \", \" : \"\") . $fields[$i][\"list\"][$j];\n }\n else if ($specialobjs[$fields[$i][\"datatype\"]]) {\n echo \"{\";\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++) {\n if ($j != 0)\n echo \", \";\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"list\"][$j], \"internal_key\");\n }\n echo \"}\";\n }\n else {\n for ($j = 0; $j < sizeof ($fields[$i][\"list\"]); $j++) {\n echo \"<TABLE BORDER=1>\\n\";\n printobject ($problem, $fields[$i][\"datatype\"],\n $fields[$i][\"list\"][$j], \"internal_key\");\n echo \"</TABLE>\\n\";\n }\n }\n echo \"</TD></TR>\\n\";\n }\n }\n }", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "public function printResult ($term = NULL) {\n print $this->saveResult($term);\n\n }", "public function __toString()\n {\n return $this->toJson(['pretty' => true]);\n }", "public function __toString()\n {\n return $this->adaptor->render();\n }", "function format_print_r($output) {\n echo '<pre>';\n print_r($output);\n echo '</pre>';\n}", "public function __toString() {\n\t\t$str = parent::__toString();\n\t\treturn $str . \"\\nData:\" . var_export($this->data, true);\n\t}", "public function dump() {\n var_dump ($this->tblAttr, $this->theadAttr, $this->tbodyAttr, $this->thData, $this->tdData);\n }", "public function output($object) {\n\t\t//Zend_Debug::dump($object);\n\t\t$this->out(\"=> \", null, null, false);\n\t\tif (is_object($object)) {\n\t\t\tif(method_exists($object, 'toJson')) {\n\t\t\t\tif($object->toJson() == '[]') {\n\t\t\t\t\t$this->out(\"Blank object of type \" . get_class($object), \"cyan\");\n\t\t\t\t} else {\n\t\t\t\t\t$this->out($this->indent($object->toJson()), \"cyan\") . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif(method_exists($object, 'toArray')) { \n\t\t\t\t$this->out(print_r($object->toArray(), true), \"cyan\") . \"\\n\";\n\t\t\t} else {\n\t\t\t\t$this->out(Zend_Debug::dump($object, \"\", false), \"cyan\") . \"\\n\";\n\t\t\t}\n\t\t} elseif(is_array($object)) {\n\t\t\t$this->out($this->indent(json_encode($object)), \"cyan\") . \"\\n\";\n\t\t} else {\n\t\t\t$this->out(var_export($object, true), \"cyan\") . \"\\n\";\n\t\t}\n\t}", "public function __toString()\n {\n return (string) $this->exportTo(MontacargasPeer::DEFAULT_STRING_FORMAT);\n }", "public function dump()\r\n {\r\n return get_object_vars($this);\r\n }", "public function __toString() {\n return $this->assemble();\n }", "public function output() {}", "public function output($object)\n {\n return strtoupper($this->formatter->output($object));\n }", "public function __toString() {\n\t\t\n\t\t// extract config to this context for convenience\n\t\textract(self::$config);\n\t\t\n\t\t// you can specify dimensions for a scrollble div\n\t\tif ($height !== 'auto' OR $width !== 'auto') {\n\n\t\t\t// add \"px\" to height and width\n\t\t\tif (is_numeric($height) AND ! strstr($height, '%')) $height .= 'px';\n\t\t\tif (is_numeric($width) AND ! strstr($width, '%')) $width .= 'px';\n\t\t\t\n\t\t\t// all scrollables get a border\n\t\t\t$this->style .= \" border: 1px solid #ddd; padding: 10px; overflow-y: scroll; height: $height; width: $width;\";\n\t\t\t\n\t\t}\n\n\t\t// styled pre tag\n\t\t$pre = '<pre style=\"'.$this->style.'\">';\n\n\t\t// iterate over data objects and var_dump 'em\n\t\tforeach ($this->data as $data) {\n\t\t\t\n\t\t\t// pull out data and label\n\t\t\textract($data);\n\t\t\t\n\t\t\t// capture var_dump\n\t\t\tob_start();\n\t\t\tvar_dump($data);\n\t\t\t$data = ob_get_clean();\n\n\t\t\t// special case for NULL values\n\t\t\tif (trim($data) == 'NULL')\n\t\t\t\t$data = '<span style=\"color: #777;\">NULL</span>'.\"\\n\";\n\t\t\t\n\t\t\t// add label\n\t\t\tif (! empty($label))\n\t\t\t\t$data = '<span style=\"color: #222; font-weight: bold; background-color: #eee; font-size: 11px; padding: 3px 5px;\">'.$label.\":</span> $data\";\n\t\t\t\n\t\t\t// compile list of class names by searching: object(PreObject)#4 (2) {\n\t\t\tpreg_match_all('/object\\(([A-Za-z0-9_]+)\\)\\#[0-9]+\\ \\([0-9]+\\)\\ {/', $data, $objects);\n\t\t\t\n\t\t\t// we have some objects w/ class names\n\t\t\tif (! empty($objects)) {\n\t\t\t\n\t\t\t\t// just get the list of object names, without duplicates\n\t\t\t\t$objects = array_unique($objects[1]);\n\n\t\t\t\t// fix all class names to look like this: stdClass#3 object(4) {\n\t\t\t\t$data = preg_replace('/object\\(([A-Za-z0-9_]+)\\)\\#([0-9]+)\\ \\(([0-9]+)\\)\\ {/', '<span style=\"color: #222; font-weight: bold;\">\\\\1</span> <span style=\"color: #444;\">#\\\\2</span> <span style=\"color: #777;\">object(\\\\3)</span> {', $data);\n\n\t\t\t\t// remove class name from private members\n\t\t\t\tforeach ($objects as $object)\n\t\t\t\t\t$data = str_replace(':\"'.$object.'\"', '', $data);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// consistent styling of =>'s\n\t\t\t$arrow = '<span style=\"font-weight: bold; color: #aaa;\"> => </span>';\n\t\t\t\n\t\t\t// style special case NULL\n\t\t\t$data = preg_replace('/=>\\s*NULL/i', '=> <span style=\"color: #777;\">NULL</span>', $data);\n\t\t\t\n\t\t\t// array keys are bolder\n\t\t\t$data = preg_replace('/\\[\\\"([a-z0-9_\\ \\@+\\-\\(\\):]+)\\\"(:?[a-z]*)\\]\\s*=>\\s*/i', '<span style=\"color: #444; font-weight: bold;\">[\\\\1]</span>\\\\2'.$arrow, $data);\n\n\t\t\t// numeric keys are bolder\n\t\t\t$data = preg_replace('/\\[([0-9]+)\\]\\s*=>\\s*/', '<span style=\"color: #444; font-weight: bold;\">[\\\\1]</span>'.$arrow, $data);\n\t\t\t\n\t\t\t// style :private and :protected\n\t\t\t$data = preg_replace('/(:(private|protected))/', '<span style=\"color: #444; font-style: italic;\">\\\\1</span>', $data);\n\n\t\t\t// de-emphasize string labels\n\t\t\t$data = preg_replace('/string\\(([0-9]+)\\)/', '<span style=\"color: #777;\">string(\\\\1)</span>', $data);\n\n\t\t\t// de-emphasize int labels\n\t\t\t$data = preg_replace('/int\\(([0-9-]+)\\)/', '<span style=\"color: #777;\">int(<span style=\"color: #222;\">\\\\1</span>)</span>', $data);\n\t\t\t\n\t\t\t// de-emphasize float labels\n\t\t\t$data = preg_replace('/float\\(([0-9\\.-]+)\\)/', '<span style=\"color: #777;\">float(<span style=\"color: #222;\">\\\\1</span>)</span>', $data);\n\n\t\t\t// de-emphasize bool label\n\t\t\t$data = preg_replace('/bool\\(([A-Za-z]+)\\)/', '<span style=\"color: #777;\">bool(<span style=\"text-transform: uppercase; color: #222;\">\\\\1</span>)</span>', $data);\n\t\t\t// de-emphasize array labels\n\t\t\t$data = preg_replace('/array\\(([0-9]+)\\)/', '<span style=\"color: #777;\">array(\\\\1)</span>', $data);\n\n\t\t\t// boost spacing\n\t\t\t$data = preg_replace_callback('/^(\\s*)(\\S.*)$/m', function($matches) {\n\t\t\t\t// number of spaces that var_dump gave it\n\t\t\t\t$indent = strlen($matches[1]);\n\t\t\t\t// each 2 spaces is one column\n\t\t\t\t$indent = ($indent > 0) ? str_repeat(\" \", $indent/2) : \"\";\n \treturn $indent.$matches[2];\n \t}, $data);\n\n\t\t\t// style opening brackets\n\t\t\t$data = preg_replace('/^(.*)(<\\/span>\\ \\{)$/m', '\\\\1<span style=\"color: #777;\">\\\\2</span>', $data);\n\n\t\t\t// style closing brackets\n\t\t\t$data = preg_replace('/^(\\s*)(\\})$/m', '\\\\1<span style=\"color: #777;\">\\\\2</span>', $data);\n\t\t\t\n\t\t\t// add to pre output\n\t\t\t$pre .= \"$data\";\n\n\t\t}\n\t\t\n\t\t// close pre tag\n\t\t$pre .= \"</pre>\\n\\n\";\n\t\t\n\t\t// reset data\n\t\t$this->data = array();\n\t\t\n\t\t// return output\n\t\treturn $pre;\n\t\t\n\t}", "public function toText() {\n ob_start();\n foreach ($this->_data as $value)\n echo $value;\n return ob_get_clean();\n }", "public function getOutput();", "public function getOutput();", "public function getOutput() {\n $output = array();\n $output[] = '<style>.rb-debug td, .rb-debug th { border: 1px solid #aaa; padding: 3px;}.rb-debug td { text-align: left; }.rb-debug th { font-weight: bold; background-color: #eee; vertical-align: top; }.rb-debug { border: 1px solid #aaa; }</style>';\n $output[] = '<table class=\"rb-debug\" cellspacing=\"0\">';\n\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.header'));\n\n if (!empty($this->query)) {\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.table'),$this->query->getTable());\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.query'),nl2br($this->query->toSql()));\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.pdo_query'),nl2br($this->query->toSql(false)));\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.params'),'<pre>'.var_export($this->query->getParams(),true).'</pre>');\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.total'),$this->total);\n }\n\n if (!empty($this->messages)) {\n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.messages'));\n foreach ($this->messages as $message) {\n $output[] = $this->renderRow('',$message);\n }\n }\n \n $output[] = $this->renderRow($this->modx->lexicon('rowboat.debug.results'));\n\n $idx = 0;\n foreach ($this->results as $result) {\n $row = array();\n $row[] = '<table>';\n foreach ($result as $col => $val) {\n $row[] = $this->renderRow($col,$val == '' ? ' ' : $val);\n }\n $row[] = '</table>';\n $output[] = $this->renderRow('#'.$idx,implode(\"\\n\",$row));\n $idx++;\n }\n $output[] = '</table>';\n return implode(\"\\n\",$output);\n }", "public function outputRaw(){\n\t\techo $this->getFormItBuilderOutput();\n\t\texit();\n\t}", "public function __toString(){\n\t\t$ref = new ReflectionObject($this);\n\t\t$r = \"[\".$ref->getName().\"]\\n\";\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\t$r .= \"\\t - \".$prop->getName().\"=\".$prop->getValue().\"\\n\";\n\t\t}\n\t\treturn $r;\n\t}", "function OutputRemarketingList($remarketingList)\n{\n if ($remarketingList != null)\n {\n printf(\"Description: %s\\n\", $remarketingList->Description);\n if ($remarketingList->ForwardCompatibilityMap != null)\n {\n foreach ($remarketingList->ForwardCompatibilityMap as $pair)\n {\n printf(\"\\tKey: %s\\n\", $pair->Key);\n printf(\"\\tValue: %s\\n\", $pair->Value);\n }\n }\n printf(\"Id: %s\\n\", $remarketingList->Id);\n printf(\"MembershipDuration: %s\\n\", $remarketingList->MembershipDuration);\n printf(\"Name: %s\\n\", $remarketingList->Name);\n printf(\"ParentId: %s\\n\", $remarketingList->ParentId);\n printf(\"Scope: %s\\n\", $remarketingList->Scope);\n printf(\"TagId: %s\\n\\n\", $remarketingList->TagId);\n }\n \n}", "function tidy_get_output(tidy $object) {}", "protected function getOutput() {\n\t\t$output = '<ul>';\n\t\tforeach($this->output as $outputRecord) {\n\t\t\t$output .= '<li><h4><span>' . $outputRecord['title'] . '</span> <em>[' . $outputRecord['version'] . ']</em></h4><p>' . $outputRecord['result'] . '</p></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\t\treturn $output;\n\t}", "public function printResult() {\n $result = array($this->callerFunctionName => array());\n foreach ($this->stacks as $caller_name => $stack_info) {\n $result[$this->callerFunctionName][] = array(\n $caller_name => $stack_info['count'],\n );\n }\n if (is_callable($this->resultPrintFunction)) {\n $this->resultPrintFunction($result);\n }\n }", "public function __toString()\n {\n return $this->assemble();\n }", "function display() {\n $output = '';\n \n $output .= $this->_component_id;\n $output .= '<br/>' . $this->_component_type_id;\n $output .= '<br/>' . $this->_quote_id;\n $output .= '<br/>' . $this->component_name;\n $output .= '<br/>' . $this->metal;\n $output .= '<br/>' . $this->powdercoating;\n $output .= '<br/>' . $this->fabric;\n $output .= '<br/>' . $this->processing;\n $output .= '<br/>' . $this->wastage;\n $output .= '<br/>' . $this->installation;\n $output .= '<br/>' . $this->margin;\n $output .= '<br/>' . $this->other;\n\n $output .= '<br/>';\n \n return $output;\n }", "public function __toString()\n {\n return '' . $this->_rs;\n }", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "public function __toString(){\n return $this->convert();\n }", "public function __toString()\n {\n return (string) $this->exportTo(FeatureCvtermPeer::DEFAULT_STRING_FORMAT);\n }", "public static function dump()\n\t{\n\t\techo nl2br(print_r(self::$data));\n\t}", "function toString(){\n\n $res = '<table border=\"0\" width=\"100%\" cellspacing=\"0\" id=\"' . $this->my_id . '\" >' . \"\\n\";\n $res .=\"<tr><td>\\n\";\n $res .='<table border=\"0\" width=\"100%\" cellspacing=\"0\">' . \"\\n\";\n $res .=\"<tr>\\n\";\n $res .='<td width=\"10\" background=\"field.gif\" >&nbsp;</td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" ><b><FONT FACE=\"Arial\" SIZE=3 COLOR=\"#EEEEEE\">' . $this->title . '</FONT></b></td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popdown.gif\" onclick=\"changepopup(false,' . \"'\" . $this->my_id . \"'\" . ')\"></td>' . \"\\n\";\n $res .='<td bgcolor=\"#3300bb\" width=\"20\"><IMG SRC=\"popup.gif\" onclick=\"changepopup(true,' . \"'\" . $this->my_id . \"'\" . ')\" ></td>' . \"\\n\";\n $res .=\"</tr></table>\\n\";\n $res .=\"</td></tr>\\n\";\n $res .='<tr><td bgcolor = \"#1100bb\">';\n $res .='';\n\n\n /*$tmp = count($this->arrayObj);\n for($i = 0 ; $i<$tmp ; $i++){\n \n\n if(is_object($this->arrayObj[$i])){\n\n $res .= \"<P>\" . $this->arrayObj[$i]->toString() . \"</P>\";\n \n }else{\n $res .= \"<P>\" . $this->arrayObj[$i] . \"</P>\";\n \n }\n }*/\n \n $res .= \"</td></tr></table>\";\n \n return $res;}", "public function format() {\n\n /* * Add the mandatary props* */\n if (!is_null($this->name)) {\n $result[self::NAME_KEY] = $this->name;\n }\n\n /* * Add the optional props if any* */\n if (!is_null($this->optionalProperties)) {\n $result = array_merge($result, $this->optionalProperties);\n }\n\n\n return $result;\n }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function __toString()\n {\n return (string) $this->exportTo(SekolahPaudPeer::DEFAULT_STRING_FORMAT);\n }", "private function processResult($result)\n {\n if (is_object($result) || is_array($result)) {\n if ($result instanceof View) {\n $response = $this->addCorsHeaders(new Response($result->render()));\n $response->display();\n } elseif ($result instanceof Response) {\n $this->addCorsHeaders($result)->display();\n } else {\n $response = $this->addCorsHeaders(new Response(''));\n $response->displayJson($result);\n }\n } else {\n echo $result;\n }\n }", "public function getOutput() {}", "public function printOut() {\n\t\t$html = new Html(\"\");\n\t\t$html->printTeamOut($this->challengeId, $this->challengeName, $this->challengeAmount);\n\t}", "public function __toString()\n {\n try {\n $result = $this->render();\n } catch (PDOException $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>' . ORM::get_last_query() . '<hr>';\n } catch (Exception $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>';\n }\n\n return $result;\n }", "public function __toString()\n {\n try {\n $result = $this->render();\n } catch (PDOException $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>' . ORM::get_last_query() . '<hr>';\n } catch (Exception $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>';\n }\n\n return $result;\n }", "function print_obj($obj)\n{\n echo \"<pre>\".print_r($obj,1).\"</pre>\";\n}", "public function __toString(){\n\t\t\t$str = \"<br/>\" . strtoupper($this->class);\n\t\t\t$str .= \"<br/>Primary Key(s): \";\n\t\t\tforeach ($this->keys as $key => $value) {\n\t\t\t\t$str .= \"($value => \".$this->$value.\")\";\n\t\t\t}\n\t\t\t$str .= \"<br/>Properties: \";\n\t\t\tforeach ($this->columns as $key => $value) {\n\t\t\t\t$str .= \"($value => \".$this->$value.\")\";\n\t\t\t}\n\t\t\treturn $str;\n\t\t}", "public function __toString()\n {\n return (string) $this->exportTo(SanitasiPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n {\n $result = $this->show();\n return $result ? $result : '';\n }", "public function __toString() {\n\t\treturn $this->result . ($this->ordered ? '</ol>' : '</ul>') . PHP_EOL;\n\t}", "function displayResults($results) {\n global $islandora_query;\n\n global $base_url;\n $lines = array();\n\n foreach ($results->response->docs as $doc) {\n $resultsArray = array();\n foreach ($doc as $field => $value) {\n\n if (is_array($value)) {\n $value = implode(\", \", $value);\n }\n $resultsArray[$field] = $value;\n }\n $resultsArray['showAbstract'] = FALSE;\n if (preg_match('/PID:cyct/', $islandora_query)) {\n $resultsArray['showAbstract'] = TRUE;\n }\n $this->resultsArray = $resultsArray;\n $type = $resultsArray['refworks.rt'];\n switch ($type) {\n case \"Journal Article\":\n case \"Magazine Article\":\n $lines[] = array($this->articleDetails());\n break;\n case \"Report\":\n $lines[] = array($this->reportDetails());\n break;\n case \"Book, Whole\":\n case \"Book, Edited\":\n $lines[] = array($this->bookDetails());\n }\n }\n return theme_table(null, $lines);\n }", "private static function pretty_print($result, $n) {\n\t\tfor ($i = 0; $i < $n; $i++) {\n\t\t\t$m = $result[$i]->Count();\n\t\t\t$crawl = $result[$i]->Tail();\n\t\t\tfor ($j = 0; $j < $m; $j++) {\n\t\t\t\techo \"Line : \" . $i;\n\t\t\t\techo \"\\t\\t Value : \" . $crawl->Value();\n\t\t\t\techo \"\\t\\t Column: \" . $crawl->Column();\n\t\t\t\t$crawl = $crawl->Next();\n\t\t\t\techo \"\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function printData(){\r\n\t\tif ($this->options['active']){\r\n\t\t\t$result = $this->options['handler']->printData($this->profiler);\r\n\t\t\r\n\t\t\tif ($this->options['handler']->returnData()){\r\n\t\t\t\treturn $result;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function toHtml() {\n\t\techo '<output '.$this->getAttributes().'/>';\n\t}", "public function dump() {\n $fmt = \"%-25s | %s | %2s | %s\\n\";\n foreach ($this->blocks as $block) {\n printf(\"Team: %25s\\n Rep: %s\\n\", $block->team, $block->representative);\n foreach (array('A', 'B', 'C', 'D') as $div) {\n foreach (array(RP::SKIPPER, RP::CREW) as $role) {\n $section = sprintf('%s_%s', $role, $div);\n foreach ($block->$section as $s) {\n printf($fmt,\n $s->getSailorName(),\n $s->division,\n $s->getSailorYear(),\n DB::makeRange($s->races_nums));\n }\n print(\"\\n\");\n }\n print(\"--------------------\\n\");\n }\n print(\"--------------------\\n\");\n }\n }", "protected function format( $results )\n {\n return json_decode( json_encode( $results ) );\n }", "public function display_data() {\n return format_text($this->data, $this->dataformat, array('overflowdiv' => true));\n }", "public function outputResults()\r\n {\r\n // loop all products and display results per product\r\n foreach ($this->Products->getAllProducts() as $productId => $productName) {\r\n echo \"Product ID: \" . $productId . \"\\n\";\r\n echo \"Product Name: \" . $productName . \"\\n\";\r\n echo \"Total Units Sold: \" . $this->ProductsSold->getSoldTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Pending: \" . $this->ProductsPurchased->getPurchasedPendingTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Received: \" . $this->ProductsPurchased->getPurchasedReceivedTotal($productId) . \"\\n\";\r\n echo \"Current Stock Level: \" . $this->Inventory->getStockLevel($productId) . \"\\n\\n\";\r\n }\r\n }" ]
[ "0.6713846", "0.6393029", "0.6313185", "0.62588376", "0.622455", "0.61752176", "0.617417", "0.61442626", "0.6133002", "0.6101229", "0.6056408", "0.60279536", "0.60184526", "0.6000676", "0.596151", "0.58915585", "0.58915585", "0.58907044", "0.58811915", "0.5881073", "0.5835444", "0.5805529", "0.57854295", "0.57802826", "0.575652", "0.5755395", "0.57402235", "0.5732577", "0.5724994", "0.57157755", "0.56900823", "0.5685405", "0.5677215", "0.5676207", "0.56690955", "0.5661262", "0.56589836", "0.56363535", "0.56358194", "0.5620891", "0.5606898", "0.5606786", "0.5602943", "0.55871093", "0.5587029", "0.55798256", "0.55798256", "0.5577635", "0.5573596", "0.5568275", "0.55666846", "0.55664283", "0.55648893", "0.55647945", "0.5554079", "0.5549522", "0.5544205", "0.5540696", "0.5540536", "0.55404985", "0.55403316", "0.5533935", "0.55307513", "0.5528623", "0.5528623", "0.5527", "0.5525659", "0.5522672", "0.55210537", "0.5519458", "0.55177784", "0.55160475", "0.55127066", "0.55085564", "0.549652", "0.54811555", "0.5472385", "0.5468358", "0.5467887", "0.5466242", "0.5460715", "0.54473674", "0.54449546", "0.54416275", "0.5426598", "0.54232097", "0.5416162", "0.5416162", "0.54156953", "0.5402756", "0.5401501", "0.53993106", "0.5389842", "0.5389607", "0.5389061", "0.53883713", "0.53841597", "0.53816324", "0.5371988", "0.5369514", "0.53680533" ]
0.0
-1
Get a set of hooks with the provided name(s). Include the pre and post hooks, and also include the global hooks ('') in addition to the named hooks provided.
public function getHooks($names, $hooks, $annotationData = null) { return $this->get($this->addWildcardHooksToNames($names, $annotationData), $hooks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get(HookName $name): Hook;", "public function add_hooks() {\n\n\t\t// Add action hooks\n\t\t$this->add_actions();\n\n\t\t// Add filter hooks\n\t\t$this->add_filters();\n\n\t\treturn null;\n\n\t}", "public function getAllHooks() {\n\t\t$this->hooks = $this->getConfig('hooks');\n\t\tif (empty($this->hooks)) {\n\t\t\t$this->hooks = $this->updateBMOHooks();\n\t\t}\n\t\treturn $this->hooks;\n\t}", "public function get($names, $hooks)\n {\n $result = [];\n foreach ((array)$hooks as $hook) {\n foreach ((array)$names as $name) {\n $result = array_merge($result, $this->getHook($name, $hook));\n }\n }\n return $result;\n }", "public function getHooks() { return $this->_hooks; }", "public function hooks()\n {\n foreach ($this->getActions() as $key => $action) {\n switch (true) {\n case $action instanceof HooksAdminInterface:\n if (is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksFrontInterface:\n if (!is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksInterface:\n $action->hooks();\n break;\n }\n }\n }", "public function getHooks() {\n return $this->hooks;\n }", "protected function getHook($name, $hook)\n {\n if (isset($this->hooks[$name][$hook])) {\n return $this->hooks[$name][$hook];\n }\n return [];\n }", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "public static function get($hook_name = '')\n {\n }", "public static function availableHooks() {\n\t\t$data = array(\n\t\t\t'form',\n\t\t\t'input',\n\t\t\t'fieldset',\n\t\t\t'legen',\n\t\t\t'label',\n\t\t\t'select',\n\t\t\t'_token',\n\t\t\t'_edit',\n\t\t\t'_create',\n\t\t\t'_email',\n\t\t\t'extension',\n\t\t\t'_instance'\n\t\t);\n\n\t\treturn $data;\n\t}", "private function hooks() {\n\t\t// Register rewrite tags.\n\t\tadd_action( 'wct_add_rewrite_tags', array( $this, 'add_rewrite_tags' ) );\n\n\t\t// Register the rewrite rules\n\t\tadd_action( 'wct_add_rewrite_rules', array( $this, 'add_rewrite_rules' ) );\n\n\t\t// Register the permastructs\n\t\tadd_action( 'wct_add_permastructs', array( $this, 'add_permastructs' ) );\n\t}", "public function getLocalHooks() {\n\t\treturn $this->localHooks;\n\t}", "function hook(){\n\t\tglobal $listeners;\n\n\t\t$num_args = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif($num_args < 2)\n\t\t\ttrigger_error(\"Insufficient arguments\", E_USER_ERROR);\n\n\t\t// Hook name should always be first argument\n\t\t$hook_name = array_shift($args);\n\t\t// Default return\n\t\t$hook_result = array_shift($args);\n\t\t\n\t\tif(!isset($listeners[$hook_name])) {\n\t\t\treturn $hook_result; // No plugins have registered this hook\n\t\t}\n\t\t\n\t\t$result = NULL;\n\t\tforeach($listeners[$hook_name] as $func){\n\t\t\t$result = call_user_func_array($func, $args);\n\t\t\tif ($result===NULL) {\n\t\t\t\t$result = $hook_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "private function hooks(): void {\n\t\t// Steps loader hooks.\n\n\t\tadd_filter(\n\t\t\t'learndash_breezy_localize_script_data',\n\t\t\t$this->container->callback( Steps\\Loader::class, 'add_scripts_data' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_nopriv_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t}", "public function wrap_hook_callbacks( $name ) {\n\t\tglobal $wp_filter;\n\n\t\t// Short-circuit the 'all' hook if there aren't any callbacks added.\n\t\tif ( ! isset( $wp_filter[ $name ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Run callback before all.\n\t\tif ( $this->before_all_callback ) {\n\t\t\tcall_user_func( $this->before_all_callback, $name );\n\t\t}\n\n\t\t$priorities = array_keys( $wp_filter[ $name ]->callbacks );\n\t\tforeach ( $priorities as $priority ) {\n\t\t\t// @todo If $priority is PHP_INT_MAX, consider moving/merging them to PHP_INT_MAX - 1.\n\t\t\tforeach ( $wp_filter[ $name ]->callbacks[ $priority ] as &$callback ) {\n\t\t\t\t$function = $callback['function'];\n\n\t\t\t\ttry {\n\t\t\t\t\t$source = new Calling_Reflection( $function );\n\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t// Skip if the source callback function cannot be determined by chance.\n\t\t\t\t\t// @todo This should perform a callback to communicate this case.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Prevent wrapping our own hooks.\n\t\t\t\tif ( in_array( $source->get_namespace_name(), $this->ignored_callback_namespaces, true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * A current limitation with wrapping callbacks is that the wrapped function cannot have\n\t\t\t\t * any parameters passed by reference. Without this the result is:\n\t\t\t\t *\n\t\t\t\t * > PHP Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given.\n\t\t\t\t */\n\t\t\t\tif ( $source->has_parameters_passed_by_reference() ) {\n\t\t\t\t\t// @todo This should perform a callback to communicate this case.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$callback['function'] = function() use ( &$callback, $name, $priority, $function, $source ) {\n\t\t\t\t\t// Restore the original callback function after this wrapped callback function is invoked.\n\t\t\t\t\t$callback['function'] = $function;\n\n\t\t\t\t\t$hook_args = func_get_args();\n\n\t\t\t\t\t// @todo Optionally capture debug backtrace?\n\t\t\t\t\t$reflection = $source->get_callback_reflection();\n\t\t\t\t\t$source_file = $source->get_file_name();\n\t\t\t\t\t$function_name = $source->get_name();\n\t\t\t\t\t$is_filter = ! did_action( $name );\n\t\t\t\t\t$value_modified = null;\n\t\t\t\t\t$context = compact( 'name', 'function', 'function_name', 'reflection', 'source_file', 'priority', 'hook_args', 'is_filter' );\n\t\t\t\t\tif ( $this->before_each_callback ) {\n\t\t\t\t\t\tcall_user_func( $this->before_each_callback, $context );\n\t\t\t\t\t}\n\t\t\t\t\t$exception = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$return = call_user_func_array( $function, $hook_args );\n\t\t\t\t\t\tif ( $is_filter && isset( $hook_args[0] ) ) {\n\t\t\t\t\t\t\t$value_modified = ( $return !== $hook_args[0] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t\t$exception = $e;\n\t\t\t\t\t\t$return = null;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $this->after_each_callback ) {\n\t\t\t\t\t\t$context['return'] = $return;\n\t\t\t\t\t\tif ( $is_filter ) {\n\t\t\t\t\t\t\t$context['value_modified'] = $value_modified;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$return_override = call_user_func( $this->after_each_callback, $context );\n\n\t\t\t\t\t\t// Give the opportunity for the after_callback to override the (filtered) hook response, e.g. to add annotations.\n\t\t\t\t\t\tif ( isset( $return_override ) ) {\n\t\t\t\t\t\t\t$return = $return_override;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( $exception ) {\n\t\t\t\t\t\tthrow $exception;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $return;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Run callback after all.\n\t\tif ( $this->after_all_callback ) {\n\t\t\t$after_all_priority = max( $priorities ) + 1;\n\t\t\t$after_all_callback = function () use ( $name, &$after_all_callback, $after_all_priority ) {\n\t\t\t\tremove_filter( $name, $after_all_callback, $after_all_priority ); // Remove self.\n\t\t\t\treturn call_user_func_array( $this->after_all_callback, array_merge( [ $name ], func_get_args() ) );\n\t\t\t};\n\t\t\tadd_filter( $name, $after_all_callback, $after_all_priority, 2 );\n\t\t}\n\t}", "private function getHookNames()\n {\n $container = $this->getContainer();\n\n $gridServiceIds = $container->getParameter('prestashop.core.grid.definition.service_ids');\n $optionsFormHookNames = $container->getParameter('prestashop.hook.option_form_hook_names');\n $identifiableObjectFormTypes = $container->getParameter('prestashop.core.form.identifiable_object.form_types');\n\n $gridDefinitionHooksProvider = $container->get(\n 'prestashop.core.hook.provider.grid_definition_hook_by_service_ids_provider'\n );\n\n $identifiableObjectFormTypeProvider = $container->get(\n 'prestashop.core.hook.provider.identifiable_object_hook_by_form_type_provider'\n );\n\n $gridDefinitionHookNames = $gridDefinitionHooksProvider->getHookNames($gridServiceIds);\n\n $identifiableObjectHookNames = $identifiableObjectFormTypeProvider->getHookNames($identifiableObjectFormTypes);\n\n return array_merge(\n $identifiableObjectHookNames,\n $optionsFormHookNames,\n $gridDefinitionHookNames\n );\n }", "public function set_hooks() {\n\t\tadd_action( 'wp_head', array( $this, 'do_meta_tags' ), 0 );\n\t\t\tadd_filter( 'document_title_parts', array( $this, 'filter__the_title_parts' ), 1, 4 );\n\t}", "private function define_hooks() {\n\n\t\tadd_action( 'add_meta_boxes', array( $this, 'hook_add_meta_boxes' ), 10, 1 );\n\n\t\tadd_action( 'save_post', array( $this, 'hook_save_post' ), 10, 1 );\n\n\t\treturn;\n\t}", "public function attach_hooks() {\n\t\t$this->define_hooks();\n\t}", "public function getHooksToInstall(): array\n {\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force or skip option\n // if specific hooks are set, the use has actively chosen it, so don't ask for permission anymore\n if (!empty($this->hooksToHandle)) {\n return array_map(fn($hook) => false, array_flip($this->hooksToHandle));\n }\n $hooks = Hooks::nativeHooks();\n if ($this->onlyEnabled) {\n $hooks = array_filter(\n $hooks,\n fn($hook) => $this->config->isHookEnabled($hook),\n ARRAY_FILTER_USE_KEY\n );\n }\n return array_map(fn($hook) => true, $hooks);\n }", "private function getHooksFromOnlineDoc() {\n\t\t\t// All hooks\n\t\t\t$allhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php' );\n\t\t\t$allhookdata = unserialize( $allhookdata );\n\t\t\t$allhooks = array();\n\t\t\tforeach ( $allhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$allhooks[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Removed hooks\n\t\t\t$oldhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Removed_hooks&cmlimit=500&format=php' );\n\t\t\t$oldhookdata = unserialize( $oldhookdata );\n\t\t\t$removed = array();\n\t\t\tforeach ( $oldhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$removed[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array_diff( $allhooks, $removed );\n\t}", "public function getPreCommitHookList() {}", "private function hooks() {\n\n\t\t// Filter hook to add custom meta box.\n\t\tadd_filter( 'rwmb_meta_boxes', array( $this, 'wpcd_team_register_meta_boxes' ), 10, 1 );\n\n\t\t// Load up css and js scripts used for managing this cpt data screens.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 10, 1 );\n\n\t\t// Filter to force post status to private.\n\t\tadd_filter( 'wp_insert_post_data', array( $this, 'wpcd_team_force_type_private' ), 10, 1 );\n\n\t\t// Action hook on save post.\n\t\tadd_action( 'save_post', array( $this, 'wpcd_team_save_post' ), 10, 1 );\n\n\t\t// Filter hook to filter team listing.\n\t\tadd_filter( 'parse_query', array( $this, 'wpcd_team_parse_query' ), 10, 1 );\n\n\t\t// Action hook to check if user has permission to edit teams.\n\t\tadd_action( 'load-post.php', array( $this, 'wpcd_team_load_post' ) );\n\n\t\t// Filter hook to change post count on team listing screen based on logged in users permissions.\n\t\tadd_filter( 'views_edit-wpcd_team', array( $this, 'wpcd_team_custom_view_count' ), 10, 1 );\n\n\t\t// Action hook to check if user has capability to access team listing or add new team page.\n\t\tadd_action( 'load-edit.php', array( $this, 'wpcd_team_load_edit_post_new' ) );\n\t\tadd_action( 'load-post-new.php', array( $this, 'wpcd_team_load_edit_post_new' ) );\n\n\t\t// Action hook to add custom back to list button.\n\t\tadd_action( 'admin_footer-post.php', array( $this, 'wpcd_team_backtolist_btn' ) );\n\t\tadd_action( 'admin_footer-post-new.php', array( $this, 'wpcd_team_backtolist_btn' ) );\n\n\t\t// Action hook to register custom meta box for team.\n\t\tadd_action( 'add_meta_boxes', array( $this, 'meta_boxes' ) );\n\n\t\t// Filter hook to add new columns.\n\t\tadd_filter( 'manage_wpcd_team_posts_columns', array( $this, 'wpcd_team_table_head' ), 10, 1 );\n\n\t\t// Action hook to add values in new columns.\n\t\tadd_action( 'manage_wpcd_team_posts_custom_column', array( $this, 'wpcd_team_table_content' ), 10, 2 );\n\n\t\t// Filter hook to change Publish button text.\n\t\tadd_filter( 'gettext', array( $this, 'wpcd_team_text_filter' ), 20, 3 );\n\n\t\t// Action hook to remove team permissions from custom table.\n\t\tadd_action( 'wp_trash_post', array( $this, 'wpcd_team_delete_post' ), 10, 1 );\n\n\t\t// Action hook to restore team permissions to custom table.\n\t\tadd_action( 'untrashed_post', array( $this, 'wpcd_team_untrashed_post' ), 10, 1 );\n\n\t\t// Action hook to show custom section on user profile screen.\n\t\tadd_action( 'show_user_profile', array( $this, 'wpcd_team_user_profile_section' ), 10, 1 );\n\t\tadd_action( 'edit_user_profile', array( $this, 'wpcd_team_user_profile_section' ), 10, 1 );\n\n\t\t// Action hook to check the rules before saving the post.\n\t\tadd_action( 'rwmb_wpcd_team_permissions_before_save_post', array( $this, 'wpcd_team_permissions_before_save_post' ), 10, 1 );\n\n\t}", "public function attach_hooks() {\n\n\t\t$this->define_hooks();\n\n\t}", "public function load_hooks() {\n\t\tadd_action( 'init', [ $this, 'updater' ] );\n\t\t$this->load_settings();\n\t}", "public function registerHooks() {\n\t\t// Nothing to do here right now\n\t\t// Others might want to know about this and get a chance to do their own work (like messing with our's :) )\n\t\tdo_action( 'pixelgrade_portfolio_registered_hooks' );\n\t}", "public function setHooks($value){$this->_hooks = self::forceArray($value);}", "public function getHook(string $name): ?Hook\n {\n # Find hook in list\n foreach ($this->hooks as $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n return $hook;\n }\n }\n\n return null;\n }", "public function hooks() {\n\t\tif ( Helper::get_settings( 'general.beta_optin' ) ) {\n\t\t\t$beta_optin = new Beta_Optin();\n\t\t\t$beta_optin->hooks();\n\t\t}\n\n\t\tif (\n\t\t\tHelper::is_advanced_mode() && (\n\t\t\t\t! Helper::is_plugin_active_for_network() ||\n\t\t\t\tcurrent_user_can( 'setup_network' )\n\t\t\t)\n\t\t) {\n\t\t\t$this->filter( 'rank_math/tools/pages', 'add_status_page' );\n\t\t\t$this->filter( 'rank_math/tools/default_tab', 'change_default_tab' );\n\t\t}\n\n\t\t$this->filter( 'rank_math/admin/dashboard_view', 'network_admin_view', 10, 2 );\n\t\t$this->filter( 'rank_math/admin/dashboard_nav_links', 'network_admin_dashboard_tabs' );\n\t\t$this->action( 'admin_enqueue_scripts', 'enqueue', 20 );\n\n\t\tif ( $this->should_add_json() ) {\n\t\t\t/* translators: Placeholder is version number. */\n\t\t\tHelper::add_json( 'rollbackConfirm', esc_html__( 'Are you sure you want to install version %s?', 'rank-math' ) );\n\t\t}\n\t}", "public function returnHooks($level=1) {\n\t\t$this->activemods = $this->FreePBX->Modules->getActiveModules(false);\n\t\t$hooks = $this->getAllHooks();\n\t\t$o = debug_backtrace();\n\t\t$callingMethod = !empty($o[$level]['function']) ? $o[$level]['function'] : '';\n\t\t$callingClass = !empty($o[$level]['class']) ? $o[$level]['class'] : '';\n\n\t\t$return = array();\n\n\t\t$sortedHooks = array();\n\n\t\tif(!empty($hooks['ModuleHooks'][$callingClass]) && !empty($hooks['ModuleHooks'][$callingClass][$callingMethod])) {\n\t\t\tforeach($hooks['ModuleHooks'][$callingClass][$callingMethod] as $module => $hooks) {\n\t\t\t\tif(isset($this->activemods[$module])) {\n\t\t\t\t\tforeach($hooks as $priority => $hook) {\n\t\t\t\t\t\t$hook['module'] = ucfirst(strtolower($module));\n\t\t\t\t\t\t$hook['namespace'] = !empty($hook['namespace']) ? $hook['namespace'] . '\\\\' : '';\n\t\t\t\t\t\tif(isset($sortedHooks[$priority])) {\n\t\t\t\t\t\t\twhile(isset($sortedHooks[$priority])) {\n\t\t\t\t\t\t\t\t$priority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sortedHooks[$priority] = $hook;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$sortedHooks[$priority] = $hook;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tksort($sortedHooks);\n\t\treturn $sortedHooks;\n\t}", "public function hooks() {\n\t\tadd_action( 'add_meta_boxes', [ $this, 'add_boxes' ] );\n\t\tadd_action( 'save_post', [ $this, 'save' ] );\n\n\t\tforeach ( $this->taxonomy_allowed as $taxonomy ) {\n\t\t\tadd_action( \"{$taxonomy}_edit_form_fields\", [ $this, 'display_taxonomy_boxes' ], 99 );\n\t\t\tadd_action( \"edited_{$taxonomy}\", [ $this, 'save_taxonomy' ] );\n\t\t}\n\t}", "private function hooks() {\n\n\t\t$plugin_admin = shortbuild_bu_hooks();\n add_filter( 'advanced_import_demo_lists', array( $plugin_admin, 'add_demo_lists' ), 10, 1 );\n add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 );\n add_filter( 'wp_ajax_shortbuild_bu_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 );\n\n /*Replace terms and post ids*/\n add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 );\n }", "public function define_hooks()\n\t{\n\t\t$base = new Base;\n\t\t$this->loader->add_action('init', $base, 'add_post_types');\n\t}", "static public function setup_hooks() {\n\n\t\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\t\treturn;\t\n\t\t}\n\n\t\tif(\n\t\t\tisset($_GET) && isset($_GET['fl_builder'])\t// phpcs:ignore\n\t\t) {\n\n\t\t\t// Disable debug\n\t\t\tadd_filter('wsf_debug_enabled', function($debug_render) { return false; }, 10, 1);\n\n\t\t\t// Enqueue all WS Form scripts\n\t\t\tadd_action('wp_enqueue_scripts', function() { do_action('wsf_enqueue_core'); });\n\t\t}\n\t\t\n\t\t// Load custom modules.\n\t\tadd_action( 'init', __CLASS__ . '::load_modules' );\n\t}", "public function getHooks($method = '', $type = 0) {\n\t\treturn $this->wire('hooks')->getHooks($this, $method, $type); \n\t}", "public function getPostCommitHookList() {}", "public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE)\n {\n return $this->get($this->getProjectPath($project_id, 'hooks'), array(\n 'page' => $page,\n 'per_page' => $per_page\n ));\n }", "public function hook();", "public function hook($name, $fn, $args = array()) {\n if (strpos($name, '-') === false) {\n $name = $this->tab() . '-' . $name;\n }\n\n if ($this->isPHPScript($fn)) {\n $scriptId = count($this->hookScripts);\n $this->hookScripts[] = $fn;\n $fn = array($this, 'hookScript_' . $scriptId);\n }\n\n $this->hooks[] = array($name, $fn, $args);\n }", "public function add_all_hook() {\n\t\tadd_action( 'all', [ $this, 'wrap_hook_callbacks' ] );\n\t}", "protected function getActionHooks(): array\n {\n return [\n /** @see \\Vierbeuter\\WordPress\\Feature\\CustomField\\CustomField::enqueueScripts() */\n 'admin_enqueue_scripts' => 'enqueueScripts',\n ];\n }", "public function init_hooks() {\n\t}", "public static function boot()\n {\n $hooks = config('hooks');\n $actions = $hooks['actions'];\n $filters = $hooks['filters'];\n\n foreach ($actions as $action) {\n add_action($action[0], $action[1]);\n }\n\n foreach ($filters as $event => $callback) {\n add_filter($event, $callback);\n }\n }", "function setHooks(array $hookInfo) {\n $hooks = Helper::getHooks();\n $hooksToSet = $hooks->getValue() ?: array();\n foreach ($hookInfo as $currentHook) {\n $hooksToSet[$currentHook['name']] = $hooksToSet[$currentHook['name']] ?: array();\n $hooksToSet[$currentHook['name']][] = array(\n 'class' => isset($currentHook['class']) ? $currentHook['class'] : $this->hookEndpointClass,\n 'function' => $currentHook['function'],\n 'filepath' => isset($currentHook['filepath']) ? $currentHook['filepath'] : Text::getSubstringAfter($this->hookEndpointFilePath, SOURCEPATH, $this->hookEndpointFilePath),\n 'use_standard_model' => isset($currentHook['use_standard_model']) ? $currentHook['use_standard_model'] : false,\n );\n }\n $hooks->setValue($hooksToSet);\n }", "function setHooks() {\n add_filter('manage_pages_columns', array($this, 'addColumn')); \n add_action('manage_pages_custom_column', array($this,'displayTemplateColumn'), 10, 2);\n\n // Hooks for filtering pages by available templates\n add_action('restrict_manage_posts', array($this, 'displayFilterOptions'));\n add_filter('parse_query', array($this, 'getPagesByTemplate'));\n }", "public function register(\\WpOrg\\Requests\\Hooks $hooks)\n {\n }", "public function register(\\WpOrg\\Requests\\Hooks $hooks)\n {\n }", "function apply_filters_ref_array($hook_name, $args)\n {\n }", "public function set_hooks()\n\t{\n\t\tadd_action('init', 'register_shortcodes');\n\t}", "function run_hook($hook_name, $args) {\n\n // Run a hook\n md_run_hook($hook_name, $args);\n \n }", "public static function register_hooks()\n\t{\n\t\tif (static::$hooks_registered) {\n\t\t\treturn;\n\t\t}\n\n\t\t// register all the scripts\n\t\tadd_action('wp_enqueue_scripts', [__CLASS__, '_wp_enqueue_scripts']);\n\n\t\t// add defer/async attributes if they are specified\n\t\tadd_filter('script_loader_tag', [__CLASS__, '_script_loader_tag'], 10, 2);\n\n\t\tadd_action('wp_footer', [__CLASS__, '_wp_footer'], static::$footer_scripts_priority);\n\n\t\tstatic::$hooks_registered = true;\n\t}", "public function add_hooks() {\n\t\tadd_action( 'types_leagacy_editor_callback_init', array( $this, 'remove_presscore_hooks' ) );\n\t}", "function did_filter($hook_name)\n {\n }", "function sa_dumpLiveHooks(){\n // sorted, and grouped\n debugLog(sa_dumpHooks('sidebar')); // sidemenus\n debugLog(sa_dumpHooks('nav-tab')); // nav tabs\n debugLog(sa_dumpHooks(NULL,false,true)); // other\n debugLog(sa_dumpFilters(NULL,false)); // filters \n}", "public function setLocalHooks(array $hooks) {\n\t\t$this->localHooks = $hooks;\n\t}", "public function hook() {\n\t\t// the WPML API is not included by default\n\t\trequire_once ICL_PLUGIN_PATH . '/inc/wpml-api.php';\n\n\t\t$this->hook_actions();\n\t\t$this->hook_filters();\n\t}", "protected function registerHooks() {\n\t\t$hooks = $this->elgg()->hooks;\n\t\t\n\t\t$hooks->registerHandler('action:validate', 'notifications/settings', __NAMESPACE__ . '\\Notifications::saveUserNotificationsSettings');\n\t\t$hooks->registerHandler('entity:url', 'object', __NAMESPACE__ . '\\Widgets::widgetTitleURL');\n\t\t$hooks->registerHandler('export:counters', 'elasticsearch', __NAMESPACE__ . '\\Elasticsearch::exportCounter');\n\t\t$hooks->registerHandler('group_tool_widgets', 'widget_manager', __NAMESPACE__ . '\\Widgets::groupToolBasedWidgets');\n\t\t$hooks->registerHandler('handlers', 'widgets', __NAMESPACE__ . '\\Widgets::registerHandlers');\n\t\t$hooks->registerHandler('prepare', 'notification:create:object:thewire', __NAMESPACE__ . '\\Notifications::prepareNotificationSubject', 600);\n\t\t$hooks->registerHandler('prepare', 'notification:create:object:thewire', __NAMESPACE__ . '\\Notifications::prepareReshareNotification', 700);\n\t\t$hooks->registerHandler('register', 'menu:entity', __NAMESPACE__ . '\\Menus::entityRegisterImprove', 501);\n\t\t$hooks->registerHandler('register', 'menu:social', __NAMESPACE__ . '\\Menus::entityRegisterReshare');\n\t\t$hooks->registerHandler('register', 'menu:entity', __NAMESPACE__ . '\\Menus::entityRegisterFeature');\n\t\t$hooks->registerHandler('register', 'menu:owner_block', __NAMESPACE__ . '\\Menus::ownerBlockRegister');\n\t\t$hooks->registerHandler('register', 'menu:page', __NAMESPACE__ . '\\Menus::pageRegister');\n\t\t$hooks->registerHandler('supported_types', 'entity_tools', __NAMESPACE__ . '\\Migrate::registerClass');\n\t}", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('DpagesMar');\n\n\t\t$m->addHook('Page(pw_template=arproc)::subfunctionUrl', function($event) {\n\t\t\t$event->return = self::subfunctionUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::arprocUrl', function($event) {\n\t\t\t$event->return = self::arprocUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=arproc)::glmainUrl', function($event) {\n\t\t\t$event->return = self::glmainUrl($event->arguments(0));\n\t\t});\n\t}", "public function addHooks() {\n\t\tadd_action( 'after_setup_theme', array( $this, 'bufferStart' ) );\n\t\tadd_action( 'wp_shutdown', array( $this, 'bufferEnd' ) );\n\t}", "private function getHooksFromFile( $file ) {\n\t\t$content = file_get_contents( $file );\n\t\t$m = array();\n\t\tpreg_match_all( '/(?:wfRunHooks|Hooks\\:\\:run|ContentHandler\\:\\:runLegacyHooks)\\(\\s*([\\'\"])(.*?)\\1/', $content, $m );\n\t\treturn $m[2];\n\t}", "function sa_dumpHooks($hookname = NULL,$exclude = false,$actions = false){\n\tglobal $plugins;\n $sa_plugins = $plugins;\n $collapsestr= '<span class=\"sa_expand sa_icon_open\"></span><span class=\"sa_collapse\">'; \n\t$bmark_str = bmark_line();\n $hookdump = '<span class=\"titlebar\">Dumping live hooks: ' . (isset($hookname) ? $hookname : 'All') .$bmark_str.'</span>'.$collapsestr;\n \n asort($sa_plugins);\n \n foreach ($sa_plugins as $hook)\t{\n\t\tif(substr($hook['hook'],-8,9) == '-sidebar'){\n\t\t\t$thishook = 'sidebar';\n\t\t}else\n\t\t{\n\t\t\t$thishook = $hook['hook'];\n\t\t}\n\t\n # _debugLog($hook);\n if(isset($hookname) and $thishook != $hookname and $exclude==false) continue; \n if(isset($hookname) and $thishook == $hookname and $exclude==true) continue; \n if($actions == true and ( $thishook == 'sidebar' or $thishook == 'nav-tab')) continue; \n \n if($hook['file']=='sa_development.php') continue; // remove noisy debug hooks\n\t\t\t\t\t\n # debugPair($hook['hook'],implode(', ',$hook['args'])); \n\n $return = '<span class=\"cm-default\"><span><b>'.$hook['hook'] .'</b><span class=\"cm-tag\"> &rarr; </span></span>'\n .'<span class=\"cm-variable\">' . $hook['function'] . '</span>'\n .'<span class=\"cm-bracket\">(</span>'\n .'<span class=\"\">' . arr_to_csv_line($hook['args']) .'</span>'\n .'<span class=\"cm-bracket\">)</span>'\n .'<span class=\"cm-comment\"> File </span>'\n .'<span class=\"cm-bracket\">[</span>'\n .'<span class=\"cm-atom\" title=\"'.$hook['file'].'\">'. sa_get_path_rel($hook['file']) .'</span>'\n .':'\n .'<span class=\"cm-string\">'. $hook['line'] .'</span>'\n .'<span class=\"cm-bracket\">]</span>' . '</span>';\n \n $hookdump.=$return.'<br/>';\n }\n return $hookdump.'</span>';\n}", "public function getPluginHook($hook_name, $parameters = array(), $default = '')\n\t{\n\t\t$hook_name = strtolower($hook_name);\n\t\t\n\t\tif(empty($this->plugin_hooks[$hook_name]))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t\t\n\t\t$str = '';\n\t\tforeach($this->plugin_hooks[$hook_name] as $callable)\n\t\t{\n\t\t\t$str .= call_user_func_array($callable, $parameters);\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "private function add_hooks(){\n\t\n\t\tadd_action( 'plugin_action_links_' . UCLACOMPONENTSWP_PLUGIN_BASE, array( $this, 'add_plugin_action_link' ), 20 );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts_and_styles' ), 20 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_public_scripts_and_styles' ), 20 );\n\t\n\t}", "private function _createHooks($hooks = FALSE)\n\t{\n\t\t$EE =& get_instance();\n\n\t\tif (!$hooks)\n\t\t\t$hooks = $this->hooks;\n\n\t\t$hook_template = array(\n\t\t\t'class' => __CLASS__,\n\t\t\t'settings' => FALSE,\n\t\t\t'version' => $this->version,\n\t\t);\n\n\t\tforeach ($hooks as $key => $hook)\n\t\t{\n\t\t\tif (is_array($hook))\n\t\t\t{\n\t\t\t\t$data['hook'] = $key;\n\t\t\t\t$data['method'] = (isset($hook['method']) === TRUE) ? $hook['method'] : $key;\n\t\t\t\t$data = array_merge($data, $hook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['hook'] = $data['method'] = $hook;\n\t\t\t}\n\n\t\t\t$hook = array_merge($hook_template, $data);\n\t\t\t$hook['settings'] = serialize($hook['settings']);\n\t\t\t$EE->db->insert('exp_extensions', $hook);\n\t\t}\n\t}", "public function add_hooks() {\n\t\tadd_filter( 'theme_root_uri', array( $this, 'rewrite' ), 99, 1 );\n\t\tadd_filter( 'plugins_url', array( $this, 'rewrite' ), 99, 1 );\n\n\t\t// add rewrite filters for misc scripts and styles\n\t\tadd_filter( 'script_loader_src', array( $this, 'rewrite' ), 99, 1 );\n\t\tadd_filter( 'style_loader_src', array( $this, 'rewrite' ), 99, 1 );\n\t\treturn true;\n\t}", "private function registerHooks(array $hooks, $shopList = null)\n {\n foreach($hooks as $hook) {\n $this->registerHook($hook, $shopList);\n }\n }", "static function hooks() {\n\t\tadd_action( 'after_setup_theme', __CLASS__ . '::custom_header' );\n\n\t\t// Setup the Theme Customizer settings and controls...\n\t\tadd_action( 'customize_register', __CLASS__ . '::register' );\n\n\t\t// Output custom CSS to live site\n\t\tadd_action( 'wp_head', __CLASS__ . '::header_output' );\n\t}", "private function getCoreHokkCallbacks() {\n\n\t\tglobal $wp_filter;\n\t\tif (isset($wp_filter[$this->hookName]))\n\t\t\treturn $wp_filter[$this->hookName];\n\t\telse {\n\t\t\t\treturn array();\n\t\t}\n\t}", "private function hooks() {\n // stripe non3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_non_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_non_3ds' ], 10, 3 );\n\n // process 3ds refund\n add_action( 'dokan_refund_request_created', [ $this, 'process_3ds_refund' ] );\n add_filter( 'dokan_refund_approve_vendor_refund_amount', [ $this, 'vendor_refund_amount_3ds' ], 10, 3 );\n add_action( 'dokan_refund_approve_before_insert', [ $this, 'add_vendor_withdraw_entry_3ds' ], 10, 3 );\n }", "public function hook($hookName, $args = [])\n {\n $args['_viewname'] = $this->getParam('view_name');\n $result = '';\n\n $debug = $this->BDebug->is('DEBUG');\n if ($debug) {\n $result .= \"<!-- START HOOK: {$hookName} -->\\n\";\n }\n\n $result .= implode('', $this->BEvents->fire('BView::hook:before', ['view' => $this, 'name' => $hookName]));\n\n $result .= implode('', $this->BEvents->fire('BLayout::hook:' . $hookName, $args));\n\n $result .= implode('', $this->BEvents->fire('BView::hook:after', ['view' => $this, 'name' => $hookName]));\n\n if ($debug) {\n $result .= \"<!-- END HOOK: {$hookName} -->\\n\";\n }\n\n return $result;\n }", "public static function get_hook_name(){\r\n\t\treturn \"blog\";\r\n\t}", "public function hooks() {\n\n\t\tif ( $this->scopes ) {\n\n\t\t\t// Restrict access to user role promotion.\n\t\t\tadd_filter( 'editable_roles', array( $this, 'editable_roles' ) );\n\n\t\t\t// Scope roles with user capabilities appropriately.\n\t\t\tif ( $this->scoped_capabilities ) {\n\t\t\t\tadd_filter( 'user_has_cap', array( $this, 'user_has_cap' ), 11, 4 );\n\t\t\t}\n\n\t\t\t// Scope roles by specific filters.\n\t\t\tif ( $this->scoped_filters['roles'] ) {\n\n\t\t\t\t// Get the current user object.\n\t\t\t\t$user = wp_get_current_user();\n\n\t\t\t\t// Reduce the list of the current user's roles to those which have a custom filter.\n\t\t\t\t$roles = array_intersect( $user->roles, array_keys( $this->scoped_filters['roles'] ) );\n\n\t\t\t\t// Compile a list of filter functions to initialize.\n\t\t\t\t$filters = array();\n\t\t\t\tforeach ( $roles as $role ) {\n\n\t\t\t\t\t$filters = array_merge( $filters, $this->scoped_filters['roles'][ $role ] );\n\n\t\t\t\t}\n\n\t\t\t\t// Initialize custom filter hooks.\n\t\t\t\tif ( ! empty( $filters ) ) {\n\t\t\t\t\tforeach ( $filters as $filter => $arg_count ) {\n\t\t\t\t\t\tadd_filter( $filter, array( $this, $filter ), 11, $arg_count );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function hook($hookName, $args = array())\n {\n $args['_viewname'] = $this->param('view_name');\n $result = '';\n\n $debug = BDebug::is('DEBUG');\n if ($debug) {\n $result .= \"<!-- START HOOK: {$hookName} -->\\n\";\n }\n\n $result .= join('', BEvents::i()->fire('BView::hook:before', array('view' => $this, 'name' => $hookName)));\n\n $result .= join('', BEvents::i()->fire('BLayout::hook:' . $hookName, $args));\n\n $result .= join('', BEvents::i()->fire('BView::hook:after', array('view' => $this, 'name' => $hookName)));\n\n if ($debug) {\n $result .= \"<!-- END HOOK: {$hookName} -->\\n\";\n }\n\n return $result;\n }", "public function getHooksToInstall(): array\n {\n // callback to write bool true to all array entries\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force option\n $callback = function () {\n return true;\n };\n // if a specific hook is set the user chose it so don't ask for permission anymore\n return empty($this->hookToHandle)\n ? array_map($callback, HookUtil::getValidHooks())\n : [$this->hookToHandle => false];\n }", "protected function get_deprecated_hooks() {\n\n\t\treturn array(\n\t\t\t// TODO remove by January 2020 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_sort_order_items' => array(\n\t\t\t\t'version' => '3.3.5',\n\t\t\t\t'replacement' => 'wc_pip_sort_order_item_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => false,\n\t\t\t),\n\t\t\t// TODO remove by December 2019 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_pick_list_document_table_row_cells' => array(\n\t\t\t\t'version' => '3.6.2',\n\t\t\t\t'replacement' => 'wc_pip_pick_list_grouped_by_category_table_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t);\n\t}", "protected function setup_hooks() {\n\t\tadd_action( 'wp_ajax_nopriv_load_more', [ $this, 'ajax_script_post_load_more' ] );\n\t\tadd_action( 'wp_ajax_load_more', [ $this, 'ajax_script_post_load_more' ] );\n\n\t\t/**\n\t\t * Create a short code.\n\t\t *\n\t\t * Usage echo do_shortcode('[post_listings]');\n\t\t */\n\t\tadd_shortcode( 'post_listings', [ $this, 'post_script_load_more' ] );\n\t}", "protected function add_hooks_and_filters() {\n add_filter( 'slp_widget_settings' , array( $this , 'get_settings' ), 200, 0 );\n add_filter( 'slp_search_default_address', array( $this , 'set_SearchAddressFromRequest' ) );\n add_filter( 'slp_map_center' , array( $this , 'set_SearchCenter' ) );\n add_action( 'wp_enqueue_scripts' , array( $this , 'enqueue_javascript' ) );\n }", "private function hooks() {\n\n\t\tadd_filter( 'wpcd_settings_tabs', array( &$this, 'settings_tabs' ) ); // add a new tab to the settings page.\n\n\t\tadd_filter( 'wpcd_settings_metaboxes', array( &$this, 'settings_metaboxes' ) ); // add new metaboxes to our new tab on the settings pages.\n\n\t}", "public function replace_3rd_party_pugins_hooks(){\n }", "public static function CallHook($name,$data=null){\r\n\t\tself::Debug('Call hook '.$name);\r\n\t\tif(!self::HasHookHandler($name))\r\n\t\t\treturn true;\r\n\t\t$keys=array_keys(self::$Config['extensions'][$name]);\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($keys);\r\n\t\twhile(++$i<$len){\r\n\t\t\tself::Debug('Call '.self::$Config['extensions'][$name][$keys[$i]]);\r\n\t\t\tif(!call_user_func(self::$Config['extensions'][$name][$keys[$i]],$data)){\r\n\t\t\t\tself::Debug('Handler stopped hook execution');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function _wp_call_all_hook($args)\n {\n }", "public function getHookName(): string\n {\n return $this->hook_name;\n }", "function doing_filter($hook_name = \\null)\n {\n }", "protected function setupHookBundles()\n {\n $bundle = new Zikula_HookManager_SubscriberBundle(\n $this->name, 'subscriber.pages.ui_hooks.pages',\n 'ui_hooks',\n $this->__('Pages Hooks')\n );\n $bundle->addEvent('display_view', 'pages.ui_hooks.pages.display_view');\n $bundle->addEvent('form_edit', 'pages.ui_hooks.pages.form_edit');\n $bundle->addEvent('form_delete', 'pages.ui_hooks.pages.form_delete');\n $bundle->addEvent('validate_edit', 'pages.ui_hooks.pages.validate_edit');\n $bundle->addEvent('validate_delete', 'pages.ui_hooks.pages.validate_delete');\n $bundle->addEvent('process_edit', 'pages.ui_hooks.pages.process_edit');\n $bundle->addEvent('process_delete', 'pages.ui_hooks.pages.process_delete');\n $this->registerHookSubscriberBundle($bundle);\n\n $bundle = new Zikula_HookManager_SubscriberBundle(\n $this->name,\n 'subscriber.pages.filter_hooks.pagesfilter',\n 'filter_hooks', $this->__('Pages Filter Hooks')\n );\n $bundle->addEvent('filter', 'pages.filter_hooks.pages.filter');\n $this->registerHookSubscriberBundle($bundle);\n }", "public function execute_hooks() {\n\n\t\t$hooks = get_option( $this->settings_field );\n\n\t\tforeach ( (array) $hooks as $hook => $array ) {\n\n\t\t\t// Add new content to hook.\n\t\t\tif ( ! empty( $array['content'] ) ) {\n\t\t\t\tadd_action( $hook, array( $this, 'execute_hook' ) );\n\t\t\t}\n\n\t\t\t// Unhook stuff.\n\t\t\tif ( isset( $array['unhook'] ) ) {\n\n\t\t\t\tforeach ( (array) $array['unhook'] as $function ) {\n\t\t\t\t\tremove_action( $hook, $function );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private function hooks() {\n\n\t\t\t/** Actions *******************************************************************/\n\n\t\t\t// Build the submenus.\n\t\t\tadd_action( 'admin_menu', array( $this, 'admin_menus' ), 10 );\n\n\t\t\t// Loading the talks edit screen\n\t\t\tadd_action( 'load-edit.php', array( $this, 'load_edit_talk' ) );\n\n\t\t\t// Make sure Editing a plugin's taxonomy highlights the plugin's nav\n\t\t\tadd_action( 'load-edit-tags.php', array( $this, 'taxonomy_highlight' ) );\n\n\t\t\t// Add metaboxes for the post type\n\t\t\tadd_action( \"add_meta_boxes_{$this->post_type}\", array( $this, 'add_metaboxes' ), 10, 1 );\n\t\t\t// Save metabox inputs\n\t\t\tadd_action( \"save_post_{$this->post_type}\", array( $this, 'save_metaboxes' ), 10, 3 );\n\n\t\t\t// Display upgrade notices\n\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\n\t\t\t// Register the settings\n\t\t\tadd_action( 'admin_init', array( $this, 'register_admin_settings' ) );\n\n\t\t\tadd_action( 'load-settings_page_wc_talks', array( $this, 'settings_load' ) );\n\n\t\t\t// Talks columns (in post row)\n\t\t\tadd_action( \"manage_{$this->post_type}_posts_custom_column\", array( $this, 'column_data' ), 10, 2 );\n\n\t\t\t// Maybe neutralize quick edit\n\t\t\tadd_action( 'post_row_actions', array( $this, 'talk_row_actions' ), 10, 2 );\n\n\t\t\t// Do some global stuff here (custom css rule)\n\t\t\tadd_action( 'admin_head', array( $this, 'admin_head' ), 10 );\n\n\t\t\t/** Filters *******************************************************************/\n\n\t\t\t// Updated message\n\t\t\tadd_filter( 'post_updated_messages', array( $this, 'talks_updated_messages' ), 10, 1 );\n\t\t\tadd_filter( 'bulk_post_updated_messages', array( $this, 'talks_updated_bulk_messages' ), 10, 2 );\n\n\t\t\t// Redirect\n\t\t\tadd_filter( 'redirect_post_location', array( $this, 'redirect_talk_location' ), 10, 2 );\n\n\t\t\t// Filter the WP_List_Table views to include custom views.\n\t\t\tadd_filter( \"views_edit-{$this->post_type}\", array( $this, 'talk_views' ), 10, 1 );\n\n\t\t\t// temporarly remove bulk edit\n\t\t\tadd_filter( \"bulk_actions-edit-{$this->post_type}\", array( $this, 'talk_bulk_actions' ), 10, 1 );\n\n\t\t\t// Talks column headers.\n\t\t\tadd_filter( \"manage_{$this->post_type}_posts_columns\", array( $this, 'column_headers' ) );\n\n\t\t\t// Add a link to About & settings page in plugins list\n\t\t\tadd_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );\n\n\t\t\t/** Specific case: ratings ****************************************************/\n\n\t\t\t// Only sort by rates & display people who voted if ratings is not disabled.\n\t\t\tif ( ! wct_is_rating_disabled() ) {\n\t\t\t\tadd_action( \"manage_edit-{$this->post_type}_sortable_columns\", array( $this, 'sortable_columns' ), 10, 1 );\n\n\t\t\t\t// Manage votes\n\t\t\t\tadd_filter( 'wct_admin_get_meta_boxes', array( $this, 'ratings_metabox' ), 9, 1 );\n\t\t\t\tadd_action( 'load-post.php', array( $this, 'maybe_delete_rate' ) );\n\n\t\t\t\t// Custom feedback\n\t\t\t\tadd_filter( 'wct_admin_updated_messages', array( $this, 'ratings_updated' ), 10, 1 );\n\n\t\t\t\t// Help tabs\n\t\t\t\tadd_filter( 'wct_get_help_tabs', array( $this, 'rates_help_tabs' ), 11, 1 );\n\t\t\t}\n\t\t}", "private function hooks() {\n\t\t$this->include_tabs();\n\t\t$this->include_tabs_server();\n\n\t\t// Enable the REST API if the settings allow for it.\n\t\tif ( true === (bool) wpcd_get_early_option( 'wordpress_app_rest_api_enable' ) ) {\n\t\t\t$this->include_rest_api();\n\t\t}\n\n\t\t// Make sure WordPress loads up our css and js scripts.\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'wpapp_enqueue_scripts' ), 10, 1 );\n\n\t\t// Show any admin notices related to upgrades.\n\t\tadd_action( 'admin_notices', array( $this, 'wpapp_upgrades_admin_notice' ) );\n\n\t\t// Actions send from the front-end when installing servers and sites.\n\t\tadd_action( \"wpcd_server_{$this->get_app_name()}_action\", array( &$this, 'do_instance_action' ), 10, 3 );\n\t\tadd_action( \"wpcd_app_{$this->get_app_name()}_action\", array( &$this, 'do_app_action' ), 10, 3 );\n\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_done\", array( &$this, 'get_logs_done' ), 10, 4 );\n\t\tadd_filter( \"wpcd_command_{$this->get_app_name()}_logs_intermed\", array( &$this, 'get_logs_intermed' ), 10, 4 );\n\t\tadd_action( \"wpcd_command_{$this->get_app_name()}_completed\", array( &$this, 'command_completed' ), 10, 2 );\n\t\tadd_filter( 'wpcd_server_script_args', array( $this, 'add_script_args_server' ), 10, 2 );\n\t\tadd_filter( 'wpcd_app_script_args', array( $this, 'add_script_args_app' ), 10, 2 );\n\t\tadd_filter( 'wpcd_actions', array( $this, 'add_post_actions' ), 10, 2 );\n\t\tadd_filter( \"wpcd_script_placeholders_{$this->get_app_name()}\", array( $this, 'script_placeholders' ), 10, 6 );\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_local_status_column' ), 10, 2 ); // Show the server status.\n\t\tadd_filter( 'wpcd_app_server_admin_list_local_status_column', array( &$this, 'app_server_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the local status column - function located in trait file upgrade.php.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_upgrade_status' ), 11, 2 ); // Show the upgrade status in the TITLE column of the app list - function located in trait file upgrade.php.\n\n\t\t// Push commands and callbacks from servers.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_status_completed\", array( &$this, 'push_command_server_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 1 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_sites_status_completed\", array( &$this, 'push_command_sites_status_completed' ), 10, 4 ); // When a server sends us it's daily status report, part 2 - see bash script #24.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_maldet_scan_completed\", array( &$this, 'push_command_maldet_scan_completed' ), 10, 4 ); // When a server sends us a report of maldet scan results - see bash script #26.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_restart_completed\", array( &$this, 'push_command_server_restart_completed' ), 10, 4 ); // When a server sends us a report of restart or shutdown.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_monit_log_completed\", array( &$this, 'push_command_monit_log_completed' ), 10, 4 ); // When a server sends us a monit alert or report.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_start_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_started' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was started for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_end_domain_backup_completed\", array( &$this, 'push_command_domain_backup_v1_completed' ), 10, 4 ); // When a server sends us a notification telling us a scheduled backup was completed for a domain.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_server_config_backup_completed\", array( &$this, 'push_command_server_config_backup' ), 10, 4 ); // When a server sends us a notification telling us a backup of the server configuration has started or ended.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_test_rest_api_completed\", array( &$this, 'push_command_test_rest_api_completed' ), 10, 4 ); // When a server sends us a test notification (initiated from the TOOLS tab on a server screen).\n\n\t\t// Push commands and callbacks from sites.\n\t\tadd_action( \"wpcd_{$this->get_app_name()}_command_schedule_site_sync_completed\", array( &$this, 'push_command_schedule_site_sync' ), 10, 4 ); // When a scheduled site sync has started or ended.\n\n\t\t// After server prepare action hooks.\n\t\t$this->wpcd_after_server_prepare_action_hooks();\n\n\t\t// When we're querying to find out the status of a server.\n\t\tadd_filter( 'wpcd_is_server_available_for_commands', array( &$this, 'wpcd_is_server_available_for_commands' ), 10, 2 );\n\n\t\t// When an app cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_app_after', array( $this, 'wpcd_cleanup_app_after' ), 10, 1 );\n\n\t\t// When a server cleanup script is being run.\n\t\tadd_action( 'wpcd_cleanup_server_after', array( $this, 'wpcd_cleanup_server_after' ), 10, 1 );\n\n\t\t// When WP has been installed, add temp domain to DNS if configured.\n\t\tadd_action( 'wpcd_command_wordpress-app_completed_after_cleanup', array( $this, 'wpcd_wpapp_install_complete' ), 10, 4 );\n\n\t\t// Ajax Hooks.\n\t\tadd_action( \"wp_ajax_wpcd_{$this->get_app_name()}\", array( &$this, 'ajax_server' ) ); // For ajax calls dealing with servers in wp-admin.\n\t\tadd_action( \"wp_ajax_wpcd_app_{$this->get_app_name()}\", array( &$this, 'ajax_app' ) ); // for ajax calls dealing with apps in wp-admin.\n\t\tif ( wpcd_is_woocommerce_activated() ) {\n\t\t\tadd_action( 'wp_ajax_wpcd_wpapp_frontend', array( &$this, 'ajax_wpapp_frontend' ) ); // for ajax calls from the front-end - code in trait files.\n\t\t}\n\n\t\t// Add welcome message to the settings screen.\n\t\tadd_filter( 'wpcd_general_settings_after_welcome_message', array( $this, 'welcome_message_settings' ), 10, 1 );\n\n\t\t// Add some additional instructions to the \"no application servers found\" message.\n\t\tadd_filter( 'wpcd_no_app_servers_found_msg', array( $this, 'no_app_servers_found_msg' ), 10, 1 );\n\n\t\t// Add a state called \"WordPress\" to the app when its shown on the app list.\n\t\tadd_filter( 'display_post_states', array( $this, 'display_post_states' ), 20, 2 );\n\n\t\t// Background actions for SERVER.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_server', array( $this, 'do_deferred_actions_for_server' ), 10 );\n\n\t\t// Background actions for APPS.\n\t\tadd_action( 'wpcd_wordpress_deferred_actions_for_apps', array( $this, 'do_deferred_actions_for_app' ), 10 );\n\n\t\t// Delete temp log files.\n\t\tadd_action( 'wpcd_wordpress_file_watcher', array( $this, 'file_watcher_delete_temp_files' ) );\n\n\t\t/* Do not allow WooCommerce to redirect to their account page */\n\t\tadd_filter( 'woocommerce_prevent_admin_access', array( $this, 'wc_subscriber_admin_access' ), 20, 1 );\n\n\t\t/*********************************************\n\t\t* Hooks and filters for screens in wp-admin\n\t\t*/\n\n\t\t// Filter hook to add new columns to the APP list.\n\t\tadd_filter( 'manage_wpcd_app_posts_columns', array( $this, 'app_posts_app_table_head' ), 10, 1 );\n\n\t\t// Action hook to add values in new columns in the APP list.\n\t\tadd_action( 'manage_wpcd_app_posts_custom_column', array( $this, 'app_posts_app_table_content' ), 10, 2 );\n\n\t\t// Filter hook to add new columns to the SERVER list.\n\t\tadd_filter( 'manage_wpcd_app_server_posts_columns', array( $this, 'app_server_table_head' ), 10, 1 );\n\n\t\t// Show some app details in the wp-admin list of apps.\n\t\tadd_filter( 'wpcd_app_admin_list_summary_column', array( &$this, 'app_admin_list_summary_column' ), 10, 2 );\n\n\t\t// Add the INSTALL WordPress button to the server list.\n\t\tadd_filter( 'wpcd_app_server_table_content', array( &$this, 'app_server_table_content' ), 10, 3 );\n\n\t\t// Filter hook to add a REMOVE SITE link to the hover action on an app.\n\t\tadd_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );\n\n\t\t// Meta box display callback.\n\t\tadd_action( 'add_meta_boxes_wpcd_app', array( $this, 'app_admin_add_meta_boxes' ) );\n\n\t\t// Save Meta Values.\n\t\tadd_action( 'save_post', array( $this, 'app_admin_save_meta_values' ), 10, 2 );\n\n\t\t// Add Metabox.IO metaboxes for the WordPress app into the APP details CPT screen.\n\t\tadd_filter( \"wpcd_app_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes' ), 10, 1 );\n\n\t\t// Add Metabox.IO metaboxes for the SERVER CPT into the server details CPT screen.\n\t\tadd_filter( 'rwmb_meta_boxes', array( $this, 'register_server_metaboxes' ), 10, 1 ); // Register application metabox stub with filter. Note that this is a METABOX.IO filter, not a core WP filter.\n\t\tadd_filter( \"wpcd_server_{$this->get_app_name()}_metaboxes\", array( $this, 'add_meta_boxes_server' ), 10, 1 );\n\n\t\t// Action hook to fire on new site created on WP Multisite.\n\t\tadd_action( 'wp_initialize_site', array( $this, 'wpapp_schedule_events_for_new_site' ), 10, 2 );\n\n\t\t// Action hook to set transient if directory is readable and .txt files are accessible.\n\t\tadd_action( 'admin_init', array( $this, 'wpapp_admin_init' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the readable notice check.\n\t\tadd_action( 'wp_ajax_set_readable_check', array( $this, 'set_readable_check' ) );\n\n\t\t// Action hook to handle ajax request to set transient if user clicked the \"check again\" option in the \"readable check\" notice.\n\t\tadd_action( 'wp_ajax_readable_check_again', array( $this, 'readable_check_again' ) );\n\n\t\t// Action hook to extend admin filter options.\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'wpapp_wpcd_app_table_filtering' ) );\n\n\t\t// Filter hook to filter app listing on custom meta data.\n\t\tadd_filter( 'parse_query', array( $this, 'wpapp_wpcd_app_parse_query' ), 10, 1 );\n\n\t\t// Action hook to handle ajax request to set transient if user closed the notice for cron check.\n\t\tadd_action( 'wp_ajax_set_cron_check', array( $this, 'set_cron_check' ) );\n\t}", "private function hooks() {\n\n\t\t\t// plugin meta\n\t\t\tadd_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), null, 2 );\n\n\t\t\t// Add template folder\n\t\t\tadd_filter( 'affwp_template_paths', array( $this, 'template' ) );\n\n\t\t}", "private function add( $hooks, $hook, $component, $callback, $priority, $acc_args ) {\n\t\t$hooks[] = [\n\t\t\t'hook' => $hook, // tag.\n\t\t\t'component' => $component, // class.\n\t\t\t'callback' => $callback, // method.\n\t\t\t'priority' => $priority, // priority.\n\t\t\t'acc_args' => $acc_args, // accepted args.\n\t\t];\n\n\t\treturn $hooks;\n\t}", "function load_moniker_hooks()\n{\n if (running_script('install')) {\n return;\n }\n\n global $CONTENT_OBS;\n if ($CONTENT_OBS === null) {\n $CONTENT_OBS = function_exists('persistent_cache_get') ? persistent_cache_get('CONTENT_OBS') : null;\n if ($CONTENT_OBS !== null) {\n foreach ($CONTENT_OBS as $ob_info) {\n if (($ob_info['title_field'] !== null) && (strpos($ob_info['title_field'], 'CALL:') !== false)) {\n require_code('hooks/systems/content_meta_aware/' . $ob_info['_hook']);\n }\n }\n\n return;\n }\n\n $no_monikers_in = array( // FUDGE: Optimisation, not ideal! But it saves file loading and memory\n 'author' => true,\n 'banner' => true,\n 'banner_type' => true,\n 'calendar_type' => true,\n 'catalogue' => true,\n 'post' => true,\n 'wiki_page' => true,\n 'wiki_post' => true,\n );\n\n $CONTENT_OBS = array();\n $hooks = find_all_hooks('systems', 'content_meta_aware');\n foreach ($hooks as $hook => $sources_dir) {\n if (isset($no_monikers_in[$hook])) {\n continue;\n }\n\n $info_function = extract_module_functions(get_file_base() . '/' . $sources_dir . '/hooks/systems/content_meta_aware/' . $hook . '.php', array('info'), null, false, 'Hook_content_meta_aware_' . $hook);\n if ($info_function[0] !== null) {\n $ob_info = is_array($info_function[0]) ? call_user_func_array($info_function[0][0], $info_function[0][1]) : eval($info_function[0]);\n\n if ($ob_info === null) {\n continue;\n }\n if (!isset($ob_info['view_page_link_pattern'])) {\n continue;\n }\n $ob_info['_hook'] = $hook;\n $CONTENT_OBS[$ob_info['view_page_link_pattern']] = $ob_info;\n\n if (($ob_info['title_field'] !== null) && (strpos($ob_info['title_field'], 'CALL:') !== false)) {\n require_code('hooks/systems/content_meta_aware/' . $hook);\n }\n }\n }\n\n if (function_exists('persistent_cache_set')) {\n persistent_cache_set('CONTENT_OBS', $CONTENT_OBS);\n }\n }\n}", "public function addHooks($hookName, $callback)\n {\n $this->hooks[$hookName][] = $callback;\n }", "public function registerHooks()\n {\n add_action('wp_enqueue_scripts', [$this, 'load_scripts_n_styles']);\n add_action('after_setup_theme', [$this, 'add_theme_support']);\n add_action('widgets_init', [$this, 'tf_widgets_init']);\n add_action('after_setup_theme', [$this, 'register_menus']);\n\n if( function_exists('acf_add_options_page') ) {\n acf_add_options_page();\n }\n }", "public static function initHooks() {\n\t\t$m = self::pw('modules')->get('DpagesMpm');\n\n\t\t$m->addHook('Page(pw_template=mpm)::subfunctionUrl', function($event) {\n\t\t\t$event->return = self::subfunctionUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=mpm)::mpmUrl', function($event) {\n\t\t\t$event->return = self::mpmUrl($event->arguments(0));\n\t\t});\n\n\t\t$m->addHook('Page(pw_template=mpm)::pmmainUrl', function($event) {\n\t\t\t$event->return = self::pmmainUrl($event->arguments(0));\n\t\t});\n\t}", "protected function extractHooks($hookfile, &$hook_files)\n {\n $hook_array = array();\n if(!is_readable($hookfile)) {\n return;\n }\n include FileLoader::validateFilePath($hookfile);\n if(empty($hook_array)) {\n return;\n }\n foreach($hook_array as $hooks) {\n foreach($hooks as $hook) {\n $hook_files[$hook[2]] = true;\n }\n }\n }", "public function set_hooks() {\n\t\tadd_action( 'init', array( $this, 'manage_linked_taxonomy_caps' ), 50 );\n\t\tadd_filter( 'tmsc_register_taxonomy_object_types', array( $this, 'register_linked_taxonomies' ), 20, 2 );\n\n\n\t\tif ( is_admin() || defined( 'DOING_CRON' ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) {\n\t\t\t// Save our linked taxonomies when a post is created/edited.\n\t\t\tforeach ( $this->linked_types as $post_type => $tax ) {\n\t\t\t\t// Our link save post logic\n\t\t\t\tadd_action( \"save_post_{$post_type}\", array( $this, 'save_linked_taxonomy' ), 20,3 );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure we delete the term data when we delete a post.\n\t\tadd_action( 'before_delete_post', array( $this, 'delete_linked_taxonomy' ) );\n\t\tadd_action( 'before_delete_post', array( $this, 'delete_child_posts' ) );\n\t}", "abstract public function register_hook_callbacks();", "public function getThemeHooksConfiguration(array $hooks)\n {\n $uniqueModuleList = $this->getUniqueModuleToHookList($hooks);\n $currentHooks = $this->hookRepository->getDisplayHooksWithModules();\n\n foreach ($currentHooks as $hookName => $moduleList) {\n foreach ($moduleList as $key => $value) {\n if (in_array($value, $uniqueModuleList)) {\n unset($currentHooks[$hookName][$key]);\n }\n }\n }\n\n foreach ($hooks as $hookName => $modules) {\n $firstNullValueFound = true;\n $existing = isset($currentHooks[$hookName]) ?\n $currentHooks[$hookName] :\n []\n ;\n $currentHooks[$hookName] = [];\n foreach ($modules as $key => $module) {\n if ($module === null && $firstNullValueFound) {\n $firstNullValueFound = false;\n foreach ($existing as $m) {\n $currentHooks[$hookName][] = $m;\n }\n } elseif (is_array($module)) {\n $currentHooks[$hookName][$key] = $module;\n } elseif ($module !== null) {\n $currentHooks[$hookName][] = $module;\n }\n }\n }\n\n return $currentHooks;\n }", "function remove_all_filters($hook_name, $priority = \\false)\n {\n }" ]
[ "0.6414226", "0.64040047", "0.63513833", "0.6348644", "0.6252315", "0.6172856", "0.6169785", "0.60000557", "0.5996285", "0.5996285", "0.5888021", "0.5830659", "0.5800719", "0.57786816", "0.5700305", "0.5673823", "0.5577789", "0.5548268", "0.55185515", "0.5406604", "0.5394493", "0.5394275", "0.5381217", "0.5379545", "0.5354377", "0.5333103", "0.53326416", "0.53320104", "0.5316167", "0.53040755", "0.5290949", "0.5282997", "0.52705383", "0.5252783", "0.5250779", "0.52436787", "0.5243116", "0.5221745", "0.52004945", "0.5195304", "0.5188225", "0.5169391", "0.51569116", "0.5152891", "0.5149185", "0.5132725", "0.51171637", "0.51116246", "0.51116246", "0.5104266", "0.5102044", "0.5092582", "0.50924957", "0.50865304", "0.50766784", "0.50628734", "0.5050863", "0.50490063", "0.50417686", "0.50411695", "0.5029454", "0.50272804", "0.50270796", "0.5024153", "0.5013473", "0.50057137", "0.49944073", "0.49860913", "0.4977853", "0.496934", "0.49637666", "0.49582633", "0.49550855", "0.49510485", "0.49427238", "0.4929284", "0.49154833", "0.49064723", "0.49024886", "0.49015915", "0.48975235", "0.4897472", "0.48941678", "0.48934516", "0.48908117", "0.4890465", "0.48879054", "0.48818088", "0.4873132", "0.4869368", "0.48631957", "0.4859688", "0.48502988", "0.48439893", "0.4838879", "0.4837791", "0.48364568", "0.48307857", "0.4826044", "0.4822529" ]
0.70846665
0
Get a set of hooks with the provided name(s).
public function get($names, $hooks) { $result = []; foreach ((array)$hooks as $hook) { foreach ((array)$names as $name) { $result = array_merge($result, $this->getHook($name, $hook)); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get(HookName $name): Hook;", "public function getHooks($names, $hooks, $annotationData = null)\n {\n return $this->get($this->addWildcardHooksToNames($names, $annotationData), $hooks);\n }", "protected function getHook($name, $hook)\n {\n if (isset($this->hooks[$name][$hook])) {\n return $this->hooks[$name][$hook];\n }\n return [];\n }", "public function getAllHooks() {\n\t\t$this->hooks = $this->getConfig('hooks');\n\t\tif (empty($this->hooks)) {\n\t\t\t$this->hooks = $this->updateBMOHooks();\n\t\t}\n\t\treturn $this->hooks;\n\t}", "public function getHooks() { return $this->_hooks; }", "public function getHooks() {\n return $this->hooks;\n }", "public static function get($hook_name = '')\n {\n }", "private function getHookNames()\n {\n $container = $this->getContainer();\n\n $gridServiceIds = $container->getParameter('prestashop.core.grid.definition.service_ids');\n $optionsFormHookNames = $container->getParameter('prestashop.hook.option_form_hook_names');\n $identifiableObjectFormTypes = $container->getParameter('prestashop.core.form.identifiable_object.form_types');\n\n $gridDefinitionHooksProvider = $container->get(\n 'prestashop.core.hook.provider.grid_definition_hook_by_service_ids_provider'\n );\n\n $identifiableObjectFormTypeProvider = $container->get(\n 'prestashop.core.hook.provider.identifiable_object_hook_by_form_type_provider'\n );\n\n $gridDefinitionHookNames = $gridDefinitionHooksProvider->getHookNames($gridServiceIds);\n\n $identifiableObjectHookNames = $identifiableObjectFormTypeProvider->getHookNames($identifiableObjectFormTypes);\n\n return array_merge(\n $identifiableObjectHookNames,\n $optionsFormHookNames,\n $gridDefinitionHookNames\n );\n }", "public function getLocalHooks() {\n\t\treturn $this->localHooks;\n\t}", "public function getHook(string $name): ?Hook\n {\n # Find hook in list\n foreach ($this->hooks as $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n return $hook;\n }\n }\n\n return null;\n }", "private function getHooksFromOnlineDoc() {\n\t\t\t// All hooks\n\t\t\t$allhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php' );\n\t\t\t$allhookdata = unserialize( $allhookdata );\n\t\t\t$allhooks = array();\n\t\t\tforeach ( $allhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$allhooks[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Removed hooks\n\t\t\t$oldhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Removed_hooks&cmlimit=500&format=php' );\n\t\t\t$oldhookdata = unserialize( $oldhookdata );\n\t\t\t$removed = array();\n\t\t\tforeach ( $oldhookdata['query']['categorymembers'] as $page ) {\n\t\t\t\t$found = preg_match( '/Manual\\:Hooks\\/([a-zA-Z0-9- :]+)/', $page['title'], $matches );\n\t\t\t\tif ( $found ) {\n\t\t\t\t\t$hook = str_replace( ' ', '_', $matches[1] );\n\t\t\t\t\t$removed[] = $hook;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn array_diff( $allhooks, $removed );\n\t}", "public static function availableHooks() {\n\t\t$data = array(\n\t\t\t'form',\n\t\t\t'input',\n\t\t\t'fieldset',\n\t\t\t'legen',\n\t\t\t'label',\n\t\t\t'select',\n\t\t\t'_token',\n\t\t\t'_edit',\n\t\t\t'_create',\n\t\t\t'_email',\n\t\t\t'extension',\n\t\t\t'_instance'\n\t\t);\n\n\t\treturn $data;\n\t}", "public function getHooks($method = '', $type = 0) {\n\t\treturn $this->wire('hooks')->getHooks($this, $method, $type); \n\t}", "public function returnHooks($level=1) {\n\t\t$this->activemods = $this->FreePBX->Modules->getActiveModules(false);\n\t\t$hooks = $this->getAllHooks();\n\t\t$o = debug_backtrace();\n\t\t$callingMethod = !empty($o[$level]['function']) ? $o[$level]['function'] : '';\n\t\t$callingClass = !empty($o[$level]['class']) ? $o[$level]['class'] : '';\n\n\t\t$return = array();\n\n\t\t$sortedHooks = array();\n\n\t\tif(!empty($hooks['ModuleHooks'][$callingClass]) && !empty($hooks['ModuleHooks'][$callingClass][$callingMethod])) {\n\t\t\tforeach($hooks['ModuleHooks'][$callingClass][$callingMethod] as $module => $hooks) {\n\t\t\t\tif(isset($this->activemods[$module])) {\n\t\t\t\t\tforeach($hooks as $priority => $hook) {\n\t\t\t\t\t\t$hook['module'] = ucfirst(strtolower($module));\n\t\t\t\t\t\t$hook['namespace'] = !empty($hook['namespace']) ? $hook['namespace'] . '\\\\' : '';\n\t\t\t\t\t\tif(isset($sortedHooks[$priority])) {\n\t\t\t\t\t\t\twhile(isset($sortedHooks[$priority])) {\n\t\t\t\t\t\t\t\t$priority++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sortedHooks[$priority] = $hook;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$sortedHooks[$priority] = $hook;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tksort($sortedHooks);\n\t\treturn $sortedHooks;\n\t}", "function hook(){\n\t\tglobal $listeners;\n\n\t\t$num_args = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif($num_args < 2)\n\t\t\ttrigger_error(\"Insufficient arguments\", E_USER_ERROR);\n\n\t\t// Hook name should always be first argument\n\t\t$hook_name = array_shift($args);\n\t\t// Default return\n\t\t$hook_result = array_shift($args);\n\t\t\n\t\tif(!isset($listeners[$hook_name])) {\n\t\t\treturn $hook_result; // No plugins have registered this hook\n\t\t}\n\t\t\n\t\t$result = NULL;\n\t\tforeach($listeners[$hook_name] as $func){\n\t\t\t$result = call_user_func_array($func, $args);\n\t\t\tif ($result===NULL) {\n\t\t\t\t$result = $hook_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function getHooks($type, $action) {\n static $hook_cache = array();\n if (!isset($hook_cache[$type][$action])) {\n $factory = new Utility_Hook_Factory();\n $hooks = $factory->fetchAll(\n array('type = ?' => $type,\n 'action = ?' => $action),\n 'weight ASC'\n );\n if ($hooks->count() > 0) {\n foreach ($hooks as $hook) {\n $class = $hook->class.\"_Hook_\".$type;\n $hook_cache[$type][$action][] = new $class();\n }\n }\n else {\n $hook_cache[$type][$action] = array();\n }\n }\n return $hook_cache[$type][$action];\n }", "public function getHooksToInstall(): array\n {\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force or skip option\n // if specific hooks are set, the use has actively chosen it, so don't ask for permission anymore\n if (!empty($this->hooksToHandle)) {\n return array_map(fn($hook) => false, array_flip($this->hooksToHandle));\n }\n $hooks = Hooks::nativeHooks();\n if ($this->onlyEnabled) {\n $hooks = array_filter(\n $hooks,\n fn($hook) => $this->config->isHookEnabled($hook),\n ARRAY_FILTER_USE_KEY\n );\n }\n return array_map(fn($hook) => true, $hooks);\n }", "public function getPreCommitHookList() {}", "private function getHooksFromPath( $path ) {\n\t\t$hooks = array();\n\t\t$dh = opendir( $path );\n\t\tif ( $dh ) {\n\t\t\twhile ( ( $file = readdir( $dh ) ) !== false ) {\n\t\t\t\tif ( filetype( $path . $file ) == 'file' ) {\n\t\t\t\t\t$hooks = array_merge( $hooks, $this->getHooksFromFile( $path . $file ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir( $dh );\n\t\t}\n\t\treturn $hooks;\n\t}", "public static function iterate($name)\n {\n $buffer = [];\n foreach (self::trigger($name) as $hook) {\n $buffer = array_merge($buffer, $hook->getIterations());\n }\n\n return $buffer;\n }", "private function getCoreHokkCallbacks() {\n\n\t\tglobal $wp_filter;\n\t\tif (isset($wp_filter[$this->hookName]))\n\t\t\treturn $wp_filter[$this->hookName];\n\t\telse {\n\t\t\t\treturn array();\n\t\t}\n\t}", "public static function getOnComponentsName($name){\n\t\tif(isset(self::$components[$name])){\n\t\t\treturn self::$components[$name];\n\t\t}\n\t\treturn [];\n\t}", "public function getPostCommitHookList() {}", "public function hooks()\n {\n foreach ($this->getActions() as $key => $action) {\n switch (true) {\n case $action instanceof HooksAdminInterface:\n if (is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksFrontInterface:\n if (!is_admin()) {\n $action->hooks();\n }\n break;\n case $action instanceof HooksInterface:\n $action->hooks();\n break;\n }\n }\n }", "public function getEventHandlers($name)\r\n\t{\r\n\t\tif($this->hasEvent($name))\r\n\t\t{\r\n\t\t\t$name=strtolower($name);\r\n\t\t\tif(!isset($this->_e[$name]))\r\n\t\t\t\t$this->_e[$name]=new CList();\r\n\t\t\treturn $this->_e[$name];\r\n\t\t}\r\n\t}", "public function add_hooks() {\n\n\t\t// Add action hooks\n\t\t$this->add_actions();\n\n\t\t// Add filter hooks\n\t\t$this->add_filters();\n\n\t\treturn null;\n\n\t}", "public function getListeners($name = null);", "public function findTaggedServiceIds($name)\n {\n $tags = array(\n 'events_listener' => $this->getParameter('event_listeners')\n );\n\n return isset($tags[$name]) ? $tags[$name] : array();\n }", "public function getHooksToInstall(): array\n {\n // callback to write bool true to all array entries\n // to make sure the user will be asked to confirm every hook installation\n // unless the user provided the force option\n $callback = function () {\n return true;\n };\n // if a specific hook is set the user chose it so don't ask for permission anymore\n return empty($this->hookToHandle)\n ? array_map($callback, HookUtil::getValidHooks())\n : [$this->hookToHandle => false];\n }", "public function getEventHandlers($name)\n\t{\n\t\tif(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset($this->_e[$name]))\n\t\t\t\t$this->_e[$name]=new TPriorityList;\n\t\t\treturn $this->_e[$name];\n\t\t}\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset(self::$_ue[$name]))\n\t\t\t\tself::$_ue[$name]=new TPriorityList;\n\t\t\treturn self::$_ue[$name];\n\t\t}\n\t\telse if($this->_m!==null&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t{\n\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))\n\t\t\t\t\treturn $behavior->getEventHandlers($name);\n\t\t\t}\n\t\t}\n\t\tthrow new TInvalidOperationException('component_event_undefined',get_class($this),$name);\n\t}", "public function getHooksByToken($token) {\r\n $hooks = array();\r\n foreach ($this->hooks as $hook) {\r\n\t\t\tif ($hook->isValidToken($token)) {\r\n\t\t\t\t$hooks[] = $hook;\r\n\t\t\t}\r\n }\r\n \r\n return $hooks;\r\n }", "public function getHooksByTrigger($trigger) {\r\n return isset($this->triggers[$trigger]) ? $this->triggers[$trigger] : array();\r\n }", "private function getQuestsWithHandlers(string $name): array\n {\n return [\n 'question' => AskForDelQuest::ask($name),\n 'handler' => $this->delDom\n ];\n }", "public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE)\n {\n return $this->get($this->getProjectPath($project_id, 'hooks'), array(\n 'page' => $page,\n 'per_page' => $per_page\n ));\n }", "private function getHooksFromFile( $file ) {\n\t\t$content = file_get_contents( $file );\n\t\t$m = array();\n\t\tpreg_match_all( '/(?:wfRunHooks|Hooks\\:\\:run|ContentHandler\\:\\:runLegacyHooks)\\(\\s*([\\'\"])(.*?)\\1/', $content, $m );\n\t\treturn $m[2];\n\t}", "protected function get_deprecated_hooks() {\n\n\t\treturn array(\n\t\t\t// TODO remove by January 2020 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_sort_order_items' => array(\n\t\t\t\t'version' => '3.3.5',\n\t\t\t\t'replacement' => 'wc_pip_sort_order_item_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => false,\n\t\t\t),\n\t\t\t// TODO remove by December 2019 or by version 4.0.0, whichever comes first {FN 2018-12-11]\n\t\t\t'wc_pip_pick_list_document_table_row_cells' => array(\n\t\t\t\t'version' => '3.6.2',\n\t\t\t\t'replacement' => 'wc_pip_pick_list_grouped_by_category_table_rows',\n\t\t\t\t'removed' => true,\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t);\n\t}", "protected function get_deprecated_hooks() {\n\n\t\t$hooks = array(\n\t\t\t'woocommerce_elavon_vm_icon' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_icon',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'woocommerce_elavon_card_types' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_available_card_types',\n\t\t\t\t'map' => true,\n\t\t\t),\n\t\t\t'wc_payment_gateway_elavon_vm_request_xml' => array(\n\t\t\t\t'version' => '2.0.0',\n\t\t\t\t'removed' => true,\n\t\t\t\t'replacement' => 'wc_' . self::CREDIT_CARD_GATEWAY_ID . '_request_data',\n\t\t\t),\n\t\t);\n\n\t\treturn $hooks;\n\t}", "public function wrap_hook_callbacks( $name ) {\n\t\tglobal $wp_filter;\n\n\t\t// Short-circuit the 'all' hook if there aren't any callbacks added.\n\t\tif ( ! isset( $wp_filter[ $name ] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Run callback before all.\n\t\tif ( $this->before_all_callback ) {\n\t\t\tcall_user_func( $this->before_all_callback, $name );\n\t\t}\n\n\t\t$priorities = array_keys( $wp_filter[ $name ]->callbacks );\n\t\tforeach ( $priorities as $priority ) {\n\t\t\t// @todo If $priority is PHP_INT_MAX, consider moving/merging them to PHP_INT_MAX - 1.\n\t\t\tforeach ( $wp_filter[ $name ]->callbacks[ $priority ] as &$callback ) {\n\t\t\t\t$function = $callback['function'];\n\n\t\t\t\ttry {\n\t\t\t\t\t$source = new Calling_Reflection( $function );\n\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t// Skip if the source callback function cannot be determined by chance.\n\t\t\t\t\t// @todo This should perform a callback to communicate this case.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Prevent wrapping our own hooks.\n\t\t\t\tif ( in_array( $source->get_namespace_name(), $this->ignored_callback_namespaces, true ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * A current limitation with wrapping callbacks is that the wrapped function cannot have\n\t\t\t\t * any parameters passed by reference. Without this the result is:\n\t\t\t\t *\n\t\t\t\t * > PHP Warning: Parameter 1 to wp_default_styles() expected to be a reference, value given.\n\t\t\t\t */\n\t\t\t\tif ( $source->has_parameters_passed_by_reference() ) {\n\t\t\t\t\t// @todo This should perform a callback to communicate this case.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$callback['function'] = function() use ( &$callback, $name, $priority, $function, $source ) {\n\t\t\t\t\t// Restore the original callback function after this wrapped callback function is invoked.\n\t\t\t\t\t$callback['function'] = $function;\n\n\t\t\t\t\t$hook_args = func_get_args();\n\n\t\t\t\t\t// @todo Optionally capture debug backtrace?\n\t\t\t\t\t$reflection = $source->get_callback_reflection();\n\t\t\t\t\t$source_file = $source->get_file_name();\n\t\t\t\t\t$function_name = $source->get_name();\n\t\t\t\t\t$is_filter = ! did_action( $name );\n\t\t\t\t\t$value_modified = null;\n\t\t\t\t\t$context = compact( 'name', 'function', 'function_name', 'reflection', 'source_file', 'priority', 'hook_args', 'is_filter' );\n\t\t\t\t\tif ( $this->before_each_callback ) {\n\t\t\t\t\t\tcall_user_func( $this->before_each_callback, $context );\n\t\t\t\t\t}\n\t\t\t\t\t$exception = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$return = call_user_func_array( $function, $hook_args );\n\t\t\t\t\t\tif ( $is_filter && isset( $hook_args[0] ) ) {\n\t\t\t\t\t\t\t$value_modified = ( $return !== $hook_args[0] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t\t\t$exception = $e;\n\t\t\t\t\t\t$return = null;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $this->after_each_callback ) {\n\t\t\t\t\t\t$context['return'] = $return;\n\t\t\t\t\t\tif ( $is_filter ) {\n\t\t\t\t\t\t\t$context['value_modified'] = $value_modified;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$return_override = call_user_func( $this->after_each_callback, $context );\n\n\t\t\t\t\t\t// Give the opportunity for the after_callback to override the (filtered) hook response, e.g. to add annotations.\n\t\t\t\t\t\tif ( isset( $return_override ) ) {\n\t\t\t\t\t\t\t$return = $return_override;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( $exception ) {\n\t\t\t\t\t\tthrow $exception;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $return;\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Run callback after all.\n\t\tif ( $this->after_all_callback ) {\n\t\t\t$after_all_priority = max( $priorities ) + 1;\n\t\t\t$after_all_callback = function () use ( $name, &$after_all_callback, $after_all_priority ) {\n\t\t\t\tremove_filter( $name, $after_all_callback, $after_all_priority ); // Remove self.\n\t\t\t\treturn call_user_func_array( $this->after_all_callback, array_merge( [ $name ], func_get_args() ) );\n\t\t\t};\n\t\t\tadd_filter( $name, $after_all_callback, $after_all_priority, 2 );\n\t\t}\n\t}", "public function getListeners($hook)\n {\n if (! isset($this->sorted[$hook])) {\n $this->sortListeners($hook);\n }\n\n return $this->sorted[$hook];\n }", "public function removeHook(string $name)\n {\n foreach ($this->hooks as $idx => $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n # Remove it\n unset( $this->hooks[$idx] );\n\n return $this;\n }\n }\n\n return $this;\n }", "public function findTaggedServiceIds($name)\n {\n static $tags = array(\n\n );\n\n return isset($tags[$name]) ? $tags[$name] : array();\n }", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "public static function get_checks( $args = array() ) {\n\t\tif ( ! empty( $args['name'] ) ) {\n\t\t\t$checks = array();\n\t\t\t$names = is_array( $args['name'] ) ? $args['name'] : array( $args['name'] );\n\t\t\tforeach ( $names as $name ) {\n\t\t\t\tif ( isset( self::$instance->checks[ $name ] ) ) {\n\t\t\t\t\t$checks[ $name ] = self::$instance->checks[ $name ];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $checks;\n\t\t}\n\t\treturn self::get_instance()->checks;\n\t}", "public function getHook($id)\n {\n return parent::getHook(strtolower($id));\n }", "public function getHookPath(?string $name = null): string;", "public function setHooks($value){$this->_hooks = self::forceArray($value);}", "private static function _getScripts($name) {\n $script = self::_getRemoteStoreUrlFromDB() . '/' . self::_getRteWebpackageFromDB() . '/' . self::$scripts[$name];\n return $script;\n }", "function apply_filters_ref_array($hook_name, $args)\n {\n }", "public function getList()\n {\n $_params = array();\n return $this->master->call('webhooks/list', $_params);\n }", "function drush_module_builder_callback_data_list() {\n $commands = func_get_args();\n\n // Get our task handler, which checks hook data is ready.\n try {\n $mb_task_handler_report = \\DrupalCodeBuilder\\Factory::getTask('ReportHookData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $time = $mb_task_handler_report->lastUpdatedDate();\n $data = $mb_task_handler_report->listHookData();\n\n if (drush_get_option('raw')) {\n drush_print_r($data);\n return;\n }\n\n if (count($commands)) {\n // Put the requested filenames into the keys of an array, and intersect them\n // with the hook data.\n $files_requested = array_fill_keys($commands, TRUE);\n $data_requested = array_intersect_key($data, $files_requested);\n }\n else {\n $data_requested = $data;\n }\n\n if (!count($data_requested) && count($files_requested)) {\n drush_print(t(\"No hooks found for the specified files.\"));\n }\n\n drush_print(\"Hooks:\");\n foreach ($data_requested as $file => $hooks) {\n drush_print(\"Group $file:\", 2);\n foreach ($hooks as $key => $hook) {\n drush_print($hook['name'] . ': ' . $hook['description'], 4);\n }\n }\n\n // List presets.\n try {\n $mb_task_handler_report_presets = \\DrupalCodeBuilder\\Factory::getTask('ReportHookPresets');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $hook_presets = $mb_task_handler_report_presets->getHookPresets();\n foreach ($hook_presets as $hook_preset_name => $hook_preset_data) {\n drush_print(\"Preset $hook_preset_name: \" . $hook_preset_data['label'], 2);\n foreach ($hook_preset_data['hooks'] as $hook) {\n drush_print($hook, 4);\n }\n }\n\n if (drush_drupal_major_version() == 8) {\n try {\n $mb_task_handler_report_plugins = \\DrupalCodeBuilder\\Factory::getTask('ReportPluginData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_plugins->listPluginData();\n\n drush_print(\"Plugins types:\");\n foreach ($data as $plugin_type_id => $plugin_type_data) {\n drush_print($plugin_type_id, 2);\n }\n\n try {\n $mb_task_handler_report_services = \\DrupalCodeBuilder\\Factory::getTask('ReportServiceData');\n }\n catch (\\DrupalCodeBuilder\\Exception\\SanityException $e) {\n module_builder_handle_sanity_exception($e);\n return;\n }\n\n $data = $mb_task_handler_report_services->listServiceData();\n\n drush_print(\"Services:\");\n foreach ($data as $service_id => $service_info) {\n drush_print($service_id, 2);\n }\n }\n\n $hooks_directory = \\DrupalCodeBuilder\\Factory::getEnvironment()->getHooksDirectory();\n drush_print(t(\"Component data retrieved from @dir.\", array('@dir' => $hooks_directory)));\n drush_print(t(\"Component data was processed on @time.\", array(\n '@time' => date(DATE_RFC822, $time),\n )));\n}", "function getContextSetByName($name)\n {\n return $this->_contextSets[$name];\n }", "public static function CallHook($name,$data=null){\r\n\t\tself::Debug('Call hook '.$name);\r\n\t\tif(!self::HasHookHandler($name))\r\n\t\t\treturn true;\r\n\t\t$keys=array_keys(self::$Config['extensions'][$name]);\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($keys);\r\n\t\twhile(++$i<$len){\r\n\t\t\tself::Debug('Call '.self::$Config['extensions'][$name][$keys[$i]]);\r\n\t\t\tif(!call_user_func(self::$Config['extensions'][$name][$keys[$i]],$data)){\r\n\t\t\t\tself::Debug('Handler stopped hook execution');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "protected static function getList($id, $type, array $data = array())\n\t{\n\t\t$hooks = array();\n\t\t$classDir = self::HOOKS_PAGE_DIR;\n\t\t$classNamespace = self::HOOKS_NAMESPACE;\n\t\t$excludedHooks = \\Bitrix\\Landing\\Site\\Type::getExcludedHooks();\n\n\t\t// first read all hooks in base dir\n\t\tforeach (self::getClassesFromDir($classDir) as $class)\n\t\t{\n\t\t\tif (in_array($class, $excludedHooks))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$classFull = __NAMESPACE__ . $classNamespace . $class;\n\t\t\tif (class_exists($classFull))\n\t\t\t{\n\t\t\t\t$hooks[$class] = new $classFull(\n\t\t\t\t\tself::$editMode,\n\t\t\t\t\t!($type == self::ENTITY_TYPE_SITE)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// sort hooks\n\t\tuasort($hooks, function($a, $b)\n\t\t{\n\t\t\tif ($a->getSort() == $b->getSort())\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->getSort() < $b->getSort()) ? -1 : 1;\n\t\t});\n\n\t\t// check custom exec\n\t\t$event = new Event('landing', 'onHookExec');\n\t\t$event->send();\n\t\tforeach ($event->getResults() as $result)\n\t\t{\n\t\t\tif ($result->getType() != EventResult::ERROR)\n\t\t\t{\n\t\t\t\tif ($customExec = $result->getModified())\n\t\t\t\t{\n\t\t\t\t\tforeach ((array)$customExec as $code => $itemExec)\n\t\t\t\t\t{\n\t\t\t\t\t\t$code = mb_strtoupper($code);\n\t\t\t\t\t\tif (isset($hooks[$code]) && is_callable($itemExec))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hooks[$code]->setCustomExec($itemExec);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset($code, $itemExec);\n\t\t\t\t}\n\t\t\t\tunset($customExec);\n\t\t\t}\n\t\t}\n\t\tunset($event, $result);\n\n\t\t// then fill hook with data\n\t\tif (!empty($hooks) && $id > 0)\n\t\t{\n\t\t\tif (empty($data))\n\t\t\t{\n\t\t\t\t$data = self::getData($id, $type);\n\t\t\t}\n\t\t\tforeach ($hooks as $code => $hook)\n\t\t\t{\n\t\t\t\tif (isset($data[$code]))\n\t\t\t\t{\n\t\t\t\t\t$hook->setData($data[$code]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $hooks;\n\t}", "function did_filter($hook_name)\n {\n }", "private function getBadHooksFromPath( $path ) {\n\t\t$hooks = array();\n\t\t$dh = opendir( $path );\n\t\tif ( $dh ) {\n\t\t\twhile ( ( $file = readdir( $dh ) ) !== false ) {\n\t\t\t\t# We don't want to read this file as it contains bad calls to wfRunHooks()\n\t\t\t\tif ( filetype( $path . $file ) == 'file' && !$path . $file == __FILE__ ) {\n\t\t\t\t\t$hooks = array_merge( $hooks, $this->getBadHooksFromFile( $path . $file ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir( $dh );\n\t\t}\n\t\treturn $hooks;\n\t}", "private function _hooks($event, $import)\n\t{\n\t\t// Array to hold callbacks\n\t\t$callbacks = array();\n\n\t\t// Get hooks on import\n\t\t$hooks = json_decode($import->get('hooks'));\n\n\t\t// Make sure we have this type of hook\n\t\tif (!isset($hooks->$event))\n\t\t{\n\t\t\treturn $callbacks;\n\t\t}\n\n\t\t// Loop through each hook\n\t\tforeach ($hooks->$event as $hook)\n\t\t{\n\t\t\t// Load hook object\n\t\t\t$importHook = Hook::oneOrNew($hook);\n\n\t\t\t// Make sure we have an object\n\t\t\tif (!$importHook->get('id'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Build path to script\n\t\t\t$hookFile = $importHook->fileSpacePath() . DS . $importHook->get('file');\n\n\t\t\t// Make sure we have a file\n\t\t\tif (!is_file($hookFile))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Add callback\n\t\t\t$callbacks[] = function($data, $dryRun) use ($hookFile)\n\t\t\t{\n\t\t\t\treturn include $hookFile;\n\t\t\t};\n\t\t}\n\n\t\t// Return closures as callbacks\n\t\treturn $callbacks;\n\t}", "public function hookManager()\n {\n return $this->hookManager;\n }", "public static function getPageList($name) {\r\n\t$links = array();\r\n\tforeach ($this->getPages() AS $page) {\r\n\t $links[$page->getURL()] = $page->getTitle();\r\n\t}\r\n\treturn $links;\r\n }", "protected function getActionHooks(): array\n {\n return [\n /** @see \\Vierbeuter\\WordPress\\Feature\\CustomField\\CustomField::enqueueScripts() */\n 'admin_enqueue_scripts' => 'enqueueScripts',\n ];\n }", "public function deploymentHooks($deploymentId)\n {\n return $this->request('get', '/api/deployments/'.$deploymentId.'/hooks');\n }", "function remove_all_filters($hook_name, $priority = \\false)\n {\n }", "public function getServiceOptions($name)\n\t{\n\t\tif(!isset($this->_options['services']) || !$this->_options['services'] instanceof Config)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t$path = explode('.', $name);\n\n\t\t$whereTo = $this->_options['services'];\n\t\tforeach($path as $item)\n\t\t{\n\t\t\tif(!isset($whereTo->{$item}))\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$whereTo = $whereTo->__get($item);\n\t\t\tif(!$whereTo instanceof Config)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\t\treturn $whereTo->toArray();\n\t}", "private function getHooksFromDoc( $doc ) {\n\t\tif ( $this->hasOption( 'online' ) ) {\n\t\t\treturn $this->getHooksFromOnlineDoc();\n\t\t} else {\n\t\t\treturn $this->getHooksFromLocalDoc( $doc );\n\t\t}\n\t}", "public function getStickerSet($name){\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }", "public function getHookName(): string\n {\n return $this->hook_name;\n }", "private function getBadHooksFromFile( $file ) {\n\t\t$content = file_get_contents( $file );\n\t\t$m = array();\n\t\t# We want to skip the \"function wfRunHooks()\" one. :)\n\t\tpreg_match_all( '/(?<!function )wfRunHooks\\(\\s*[^\\s\\'\"].*/', $content, $m );\n\t\t$list = array();\n\t\tforeach ( $m[0] as $match ) {\n\t\t\t$list[] = $match . \"(\" . $file . \")\";\n\t\t}\n\t\treturn $list;\n\t}", "public function hook();", "private function getWithoutRegisteredHooks(array $hookNames)\n {\n $hooksProvider = $this->getContainer()->get('prestashop.adapter.legacy.hook');\n $registeredHooks = $hooksProvider->getHooks();\n $registeredHookNames = array_column($registeredHooks, 'name');\n\n return array_diff($hookNames, $registeredHookNames);\n }", "function get_theme_mods()\n {\n }", "public static function getForLanding($id)\n\t{\n\t\tif (!Landing::getEditMode())\n\t\t{\n\t\t\tstatic $hooks = [];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$hooks = [];\n\t\t}\n\n\t\tif (!array_key_exists($id, $hooks))\n\t\t{\n\t\t\t$hooks[$id] = self::getList($id, self::ENTITY_TYPE_LANDING);\n\t\t}\n\n\t\treturn $hooks[$id];\n\t}", "public function getAll($name)\n {\n if (!empty($this->data[$name])) {\n if (is_array($this->data[$name])) {\n return $this->data[$name];\n } else {\n return array($this->data[$name]);\n }\n } else {\n return array();\n }\n }", "private function getHooksFromLocalDoc( $doc ) {\n\t\t\t$m = array();\n\t\t\t$content = file_get_contents( $doc );\n\t\t\tpreg_match_all( \"/\\n'(.*?)':/\", $content, $m );\n\t\t\treturn array_unique( $m[1] );\n\t}", "final public function getHookName() {\n return $this->hookName;\n }", "function setHooks(array $hookInfo) {\n $hooks = Helper::getHooks();\n $hooksToSet = $hooks->getValue() ?: array();\n foreach ($hookInfo as $currentHook) {\n $hooksToSet[$currentHook['name']] = $hooksToSet[$currentHook['name']] ?: array();\n $hooksToSet[$currentHook['name']][] = array(\n 'class' => isset($currentHook['class']) ? $currentHook['class'] : $this->hookEndpointClass,\n 'function' => $currentHook['function'],\n 'filepath' => isset($currentHook['filepath']) ? $currentHook['filepath'] : Text::getSubstringAfter($this->hookEndpointFilePath, SOURCEPATH, $this->hookEndpointFilePath),\n 'use_standard_model' => isset($currentHook['use_standard_model']) ? $currentHook['use_standard_model'] : false,\n );\n }\n $hooks->setValue($hooksToSet);\n }", "public function getConfig(string $name) : array\n {\n if (array_key_exists($name, $this->configs)) {\n return $this->configs[$name];\n } else {\n $config = $this->loadConfig($name);\n\n $this->configs[$name] = $config;\n\n return $config;\n }\n }", "public function getThemeHooksConfiguration(array $hooks)\n {\n $uniqueModuleList = $this->getUniqueModuleToHookList($hooks);\n $currentHooks = $this->hookRepository->getDisplayHooksWithModules();\n\n foreach ($currentHooks as $hookName => $moduleList) {\n foreach ($moduleList as $key => $value) {\n if (in_array($value, $uniqueModuleList)) {\n unset($currentHooks[$hookName][$key]);\n }\n }\n }\n\n foreach ($hooks as $hookName => $modules) {\n $firstNullValueFound = true;\n $existing = isset($currentHooks[$hookName]) ?\n $currentHooks[$hookName] :\n []\n ;\n $currentHooks[$hookName] = [];\n foreach ($modules as $key => $module) {\n if ($module === null && $firstNullValueFound) {\n $firstNullValueFound = false;\n foreach ($existing as $m) {\n $currentHooks[$hookName][] = $m;\n }\n } elseif (is_array($module)) {\n $currentHooks[$hookName][$key] = $module;\n } elseif ($module !== null) {\n $currentHooks[$hookName][] = $module;\n }\n }\n }\n\n return $currentHooks;\n }", "public function allNamed(): array;", "public function add_all_hook() {\n\t\tadd_action( 'all', [ $this, 'wrap_hook_callbacks' ] );\n\t}", "public function load_hooks() {\n\t\tadd_action( 'init', [ $this, 'updater' ] );\n\t\t$this->load_settings();\n\t}", "public function getPluginHook($hook_name, $parameters = array(), $default = '')\n\t{\n\t\t$hook_name = strtolower($hook_name);\n\t\t\n\t\tif(empty($this->plugin_hooks[$hook_name]))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t\t\n\t\t$str = '';\n\t\tforeach($this->plugin_hooks[$hook_name] as $callable)\n\t\t{\n\t\t\t$str .= call_user_func_array($callable, $parameters);\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "private function initHooks() {\r\n if (!is_dir(BotHooks::HOOK_DIR)) {\r\n throw new Slackbot\\Exception\\ConfigException('Cannot locate hook directory \"' . BotHooks::HOOK_DIR . '\"');\r\n }\r\n \r\n $hookFiles = glob(BotHooks::HOOK_DIR . '/[A-Z][a-z]*Hook.php');\r\n foreach ($hookFiles as $hookFile) {\r\n // include the file\r\n require_once $hookFile;\r\n \r\n // load a class that has the same name as the file\r\n $fileName = substr($hookFile, strrpos($hookFile, '/') + 1);\r\n $className = 'Slackbot\\\\Hooks\\\\' . substr($fileName, 0, strlen($fileName) - 4);\r\n $hookInstance = new $className();\r\n if (!class_exists($className) && is_subclass_of($hookInstance, 'Slackbot\\\\Hooks\\\\Hook')) {\r\n unset($hookInstance);\r\n continue;\r\n }\r\n \r\n // store the hook\r\n $this->hooks[$hookInstance->getName()] = $hookInstance;\r\n // process the triggers supported by the hook\r\n $this->loadHookTriggers($hookInstance);\r\n }\r\n \r\n\t\t// process the tokens supported for the hooks\r\n\t\t$this->loadHookConfig();\r\n }", "public function getCheckNames() {\n $commands = drush_get_commands();\n\n // Guess the name of the Drush command.\n $command_name_pieces = preg_split('/(?=[A-Z])/', get_called_class());\n unset($command_name_pieces[0], $command_name_pieces[1], $command_name_pieces[3]);\n $command_name = strtolower(implode('-', $command_name_pieces));\n $command = $commands[$command_name];\n\n drush_command_invoke_all_ref('drush_command_alter', $command);\n\n $checks = array();\n foreach ($command['checks'] as $check) {\n if (is_array($check)) {\n $checks[] = $check['name'];\n require_once $check['location'];\n }\n else {\n $checks[] = $check;\n $base_class_name = 'SiteAuditCheck' . $this->getReportName();\n $class_name = $base_class_name . $check;\n if (!class_exists($class_name)) {\n require_once SITE_AUDIT_BASE_PATH . \"/Check/{$this->getReportName()}/$check.php\";\n }\n }\n }\n\n return $checks;\n }", "public static function getFixtures(string $name)\n {\n if (self::$fixtures !== null) {\n return self::$fixtures[$name] ?? [];\n }\n\n self::$fixtures = Yaml::parseFile(__DIR__ . '/../Resources/fixtures/channel.http_graph.fixtures.yaml');\n\n return self::$fixtures[$name] ?? [];\n }", "public function hook($name, $fn, $args = array()) {\n if (strpos($name, '-') === false) {\n $name = $this->tab() . '-' . $name;\n }\n\n if ($this->isPHPScript($fn)) {\n $scriptId = count($this->hookScripts);\n $this->hookScripts[] = $fn;\n $fn = array($this, 'hookScript_' . $scriptId);\n }\n\n $this->hooks[] = array($name, $fn, $args);\n }", "public function getShortcuts();", "function doing_filter($hook_name = \\null)\n {\n }", "function sa_dumpLiveHooks(){\n // sorted, and grouped\n debugLog(sa_dumpHooks('sidebar')); // sidemenus\n debugLog(sa_dumpHooks('nav-tab')); // nav tabs\n debugLog(sa_dumpHooks(NULL,false,true)); // other\n debugLog(sa_dumpFilters(NULL,false)); // filters \n}", "function getBenchmarksByGroup(string $name){\n $benchmark_group = [];\n foreach($this->benchmarks as $benchmark){\n if($benchmark->getName() == $name || Text::startsWith($benchmark->getName(), $name.'.')){\n $benchmark_group[] = $benchmark;\n }\n }\n return $benchmark_group;\n }", "private function hooks(): void {\n\t\t// Steps loader hooks.\n\n\t\tadd_filter(\n\t\t\t'learndash_breezy_localize_script_data',\n\t\t\t$this->container->callback( Steps\\Loader::class, 'add_scripts_data' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_nopriv_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t}", "protected function getConfig(string $name): array\n {\n return $this->app['config']->get(\n \"{$this->configKey()}.{$name}\",\n ['driver' => $name]\n );\n }", "public function load($path)\n {\n $this->hoos = array(\n 'suite.before' => array()\n , 'suite.after' => array()\n , 'feature.before' => array()\n , 'feature.after' => array()\n , 'scenario.before' => array()\n , 'scenario.after' => array()\n , 'step.before' => array()\n , 'step.after' => array()\n );\n $hooks = $this;\n\n require_once($path);\n\n return $this->hooks;\n }", "private function get_widget_options( $name ) {\n\t\treturn get_option( 'widget_' . $name, array() );\n\t}", "public function defineTag($name, \n array $options = array(), \\Closure $closure = NULL)\n {\n $options = $this->prepareOptions($name, $options);\n $this->validateParams($name, $options, $closure);\n $result = array();\n $result[$name] = $this->constructTagSet($name, $options, $closure);\n $result += $this->exposePropertiesAsTags($name, $options);\n return $result;\n }", "function _wp_call_all_hook($args)\n {\n }", "public function getDataHookOptions(): array\n {\n return $this->dataHookOptions;\n }", "public static function get_all_fonts() {\n\n\t\tif ( self::$fonts_list != null ) {\n\t\t\treturn self::$fonts_list;\n\t\t}\n\n\t\t$typekit_code = bf_get_option( 'typekit_code', Better_Framework::fonts_manager()->option_panel_id );\n\n\t\tself::$fonts_list = array();\n\n\t\tif ( ! empty( $typekit_code ) ) {\n\n\t\t\t// load option\n\t\t\t$typekit_fonts = bf_get_option( 'typekit_fonts', Better_Framework::fonts_manager()->option_panel_id );\n\n\t\t\tforeach ( (array) $typekit_fonts as $font ) {\n\n\t\t\t\tif ( empty( $font['id'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// set ID to name\n\t\t\t\tif ( empty( $font['name'] ) ) {\n\t\t\t\t\t$font['name'] = ucfirst( $font['id'] );\n\t\t\t\t}\n\n\t\t\t\tself::$fonts_list[ $font['id'] ]['id'] = $font['id'];\n\t\t\t\tself::$fonts_list[ $font['id'] ]['type'] = 'typekit-font';\n\t\t\t}\n\t\t}\n\n\n\t\t// save to cache\n\t\treturn self::$fonts_list;\n\t}", "protected function getCheckModifyAccessListHookObjects() {}", "public function prepareLoader(Loader $loader, int $type): array\n {\n $hooks = [];\n $folder = ExtensionManagementUtility::extPath($loader->getExtensionKey()) . 'Classes/Hooks/';\n $files = FileUtility::getBaseFilesInDir($folder, 'php');\n\n /** @var AnnotationReader $annotationReader */\n $annotationReader = GeneralUtility::makeInstance(AnnotationReader::class);\n\n foreach ($files as $hookFile) {\n $hookClass = ClassNamingUtility::getFqnByPath(\n $loader->getVendorName(),\n $loader->getExtensionKey(),\n 'Hooks/' . $hookFile\n );\n if (!$loader->isInstantiableClass($hookClass)) {\n continue;\n }\n\n $reflectionClass = new \\ReflectionClass($hookClass);\n\n // add class hook\n $classHook = $annotationReader->getClassAnnotation($reflectionClass, Hook::class);\n if (null !== $classHook) {\n $hooks[] = [\n 'locations' => $classHook->locations,\n 'configuration' => $hookClass,\n ];\n }\n\n // add method hooks\n foreach ($reflectionClass->getMethods() as $method) {\n $methodHook = $annotationReader->getMethodAnnotation($method, Hook::class);\n if (null !== $methodHook) {\n $hooks[] = [\n 'locations' => $methodHook->locations,\n 'configuration' => $hookClass . '->' . $method->getName(),\n ];\n }\n }\n }\n\n return $hooks;\n }", "public function getTemplatesForEvent($name) {\n\t\t$result = array();\n\t\tforeach($this->templates as $tmpl) {\n\t\t\tforeach($tmpl->getEvents() as $event) {\n\t\t\t\tif($event == $name) {\n\t\t\t\t\t$result[] = $tmpl;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.7099236", "0.67920643", "0.67006207", "0.6566897", "0.6542215", "0.64159197", "0.6369787", "0.5970043", "0.59161294", "0.58713835", "0.5859569", "0.58509904", "0.57568747", "0.57476056", "0.57228607", "0.5664669", "0.56158924", "0.55861354", "0.55176616", "0.55039966", "0.5501111", "0.549644", "0.54504764", "0.5400085", "0.5391983", "0.53753465", "0.5363071", "0.53601646", "0.53396267", "0.53102064", "0.5300231", "0.5278796", "0.52660155", "0.52657753", "0.52479774", "0.5222031", "0.5173342", "0.5172318", "0.51711214", "0.51497954", "0.51095814", "0.5085824", "0.5085824", "0.5069442", "0.5061718", "0.5057312", "0.50333583", "0.5026559", "0.50199175", "0.50155294", "0.50100154", "0.5000077", "0.49277642", "0.49247843", "0.4916328", "0.4914613", "0.4910495", "0.49101695", "0.4884291", "0.48806196", "0.48716688", "0.48709336", "0.48659608", "0.4856743", "0.4856266", "0.48437276", "0.48308697", "0.4821021", "0.48081237", "0.48009732", "0.47901717", "0.4788301", "0.4782575", "0.47816405", "0.477643", "0.47759107", "0.4761966", "0.4750633", "0.47483867", "0.4744055", "0.4732744", "0.47270033", "0.4711767", "0.4707694", "0.4696788", "0.4695103", "0.46948344", "0.46904773", "0.46871385", "0.4682722", "0.46789166", "0.4663942", "0.46537495", "0.46515015", "0.4647684", "0.46466067", "0.46463442", "0.464166", "0.46328452", "0.46291548" ]
0.65842634
3
Get a single named hook.
protected function getHook($name, $hook) { if (isset($this->hooks[$name][$hook])) { return $this->hooks[$name][$hook]; } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get(HookName $name): Hook;", "public static function get($hook_name = '')\n {\n }", "public function getHook(string $name): ?Hook\n {\n # Find hook in list\n foreach ($this->hooks as $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n return $hook;\n }\n }\n\n return null;\n }", "public function getHook($id)\n {\n return parent::getHook(strtolower($id));\n }", "public function getHookName(): string\n {\n return $this->hook_name;\n }", "final public function getHookName() {\n return $this->hookName;\n }", "public function getHookPath(?string $name = null): string;", "public function getIdHookByName($hookName) {\n\t\t$model = new Hook;\n\t\t$result = $model->find(array(\n\t\t\t'condition' => 'LOWER(nama) = :nama',\n\t\t\t'params' => array(\n\t\t\t\t':nama' => strtolower($hookName),\n\t\t\t),\n\t\t));\n\n\t\tif(!$result)\n\t\t\treturn false;\n\t\telse {\n\t\t\treturn $result->id_hook;\n\t\t}\n\t}", "public function lookup($name) {\n return $this->_handler->lookup($name);\n }", "public function getHookConfig(string $hook) : Config\\Hook\n {\n if (!Hook\\Util::isValid($hook)) {\n throw new InvalidArgumentException('Invalid hook name: ' . $hook);\n }\n return $this->hooks[$hook];\n }", "function hook(){\n\t\tglobal $listeners;\n\n\t\t$num_args = func_num_args();\n\t\t$args = func_get_args();\n\n\t\tif($num_args < 2)\n\t\t\ttrigger_error(\"Insufficient arguments\", E_USER_ERROR);\n\n\t\t// Hook name should always be first argument\n\t\t$hook_name = array_shift($args);\n\t\t// Default return\n\t\t$hook_result = array_shift($args);\n\t\t\n\t\tif(!isset($listeners[$hook_name])) {\n\t\t\treturn $hook_result; // No plugins have registered this hook\n\t\t}\n\t\t\n\t\t$result = NULL;\n\t\tforeach($listeners[$hook_name] as $func){\n\t\t\t$result = call_user_func_array($func, $args);\n\t\t\tif ($result===NULL) {\n\t\t\t\t$result = $hook_result;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function sa_get_hook_id(){\n $bt = debug_backtrace();\n foreach($bt as $func){\n if($func['function'] == 'exec_action'){\n return $func['args'][0];\n }\n }\n}", "public function getCode(string $hook): string;", "public static function getNameById($hook_id)\n {\n $cache_id = 'hook_namebyid_'.$hook_id;\n if (!Cache::isStored($cache_id)) {\n Cache::store($cache_id, Db::getInstance()->getValue('\n\t\t\t\tSELECT `name`\n\t\t\t\tFROM `' ._DB_PREFIX_.'hook`\n\t\t\t\tWHERE `id_hook` = ' .(int) $hook_id));\n }\n return Cache::retrieve($cache_id);\n }", "public function getPluginHook($hook_name, $parameters = array(), $default = '')\n\t{\n\t\t$hook_name = strtolower($hook_name);\n\t\t\n\t\tif(empty($this->plugin_hooks[$hook_name]))\n\t\t{\n\t\t\treturn $default;\n\t\t}\n\t\t\n\t\t$str = '';\n\t\tforeach($this->plugin_hooks[$hook_name] as $callable)\n\t\t{\n\t\t\t$str .= call_user_func_array($callable, $parameters);\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "public function hook($project_id, $hook_id)\n {\n return $this->get($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id)));\n }", "public static function get_hook_name(){\r\n\t\treturn \"blog\";\r\n\t}", "public function findHook($sName, $iVersion) {\n try {\n $aFile = $this->findFile('hook_'.$sName.'_'.$iVersion, 'class');\n return $aFile['path'];\n } catch (Exception $oEx) {\n return false;\n }\n }", "public function get($name)\n {\n if (isset($this->calls[$name])) {\n return $this->calls[$name];\n } else {\n return null;\n };\n }", "public function getHooks($names, $hooks, $annotationData = null)\n {\n return $this->get($this->addWildcardHooksToNames($names, $annotationData), $hooks);\n }", "public function latestFailedDeploymentHook()\n {\n return $this->request('get', '/api/latest-failed-hook')['hook'];\n }", "public function getBundle($name);", "public function getArgument(string $name);", "private function extractHookId($hookName, $prefix, $suffix)\n {\n return str_replace([$prefix, $suffix], '', $hookName);\n }", "public function getStep($name)\n {\n return $this->steps[$name];\n }", "function run_hook($hook_name, $args) {\n\n // Run a hook\n md_run_hook($hook_name, $args);\n \n }", "public function get($names, $hooks)\n {\n $result = [];\n foreach ((array)$hooks as $hook) {\n foreach ((array)$names as $name) {\n $result = array_merge($result, $this->getHook($name, $hook));\n }\n }\n return $result;\n }", "public function get(string $name);", "function get_specific_plugin_hook_output($pluginName, $hookName, $args = array())\n{\n // Get the specific hook.\n $pluginBroker = get_plugin_broker();\n $hookNameSpecific = $pluginBroker->getHook($pluginName, $hookName);\n\n // Return null if the specific hook doesn't exist.\n if (!$hookNameSpecific) {\n return null;\n }\n\n // Buffer and return any output originating from the hook.\n ob_start();\n foreach ($hookNameSpecific as $cb) {\n call_user_func($cb, $args);\n }\n $content = ob_get_contents();\n ob_end_clean();\n\n return $content;\n}", "public function getPostHookName() { return $this->_postHookName; }", "public function getArgument($name, $default = null) {\n if (array_key_exists($name, $_GET)) {\n return $_GET[$name];\n }\n\n return $default;\n }", "public function getArgument($name)\n {\n $argument = null;\n if (isset($this->arguments[$name])) {\n $argument = $this->arguments[$name];\n }\n return $argument;\n }", "static public function get($name) {}", "function did_action($hook_name)\n {\n }", "public function getHookCode($name, $object_var = false, $param_list = '')\n\t{\n\t\tif(isset($this->hooks[$name]))\n\t\t{\n\t\t\tif(is_array($this->hooks[$name]) && ! empty($this->hooks[$name]))\n\t\t\t{\n\t\t\t\tif(count($this->hooks[$name]) > 2)\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the array has too many values.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( ! (isset($this->hooks[$name][0]) && is_string($this->hooks[$name][0])))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the first value in the array is not a string.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(isset($this->hooks[$name][1]) && ! is_string($this->hooks[$name][1]))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the first value in the array is not a string.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif( ! is_string($this->hooks[$name]))\n\t\t\t{\n\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Hook: \"'.$name.'\", the callable must be either a string or an array containing one or two strings.');\n\t\t\t}\n\t\t\t\n\t\t\t$hook = array();\n\t\t\tforeach((Array) $this->hooks[$name] as $c)\n\t\t\t{\n\t\t\t\t// remove potential troublemakers\n\t\t\t\t$hook[] = trim((String) $c, \" ();=\\t\\n\\r\");\n\t\t\t}\n\t\t\t\n\t\t\tif(count($hook) == 1)\n\t\t\t{\n\t\t\t\t$hook = array_shift($hook);\n\t\t\t}\n\t\t\t\n\t\t\tif($object_var === false)\n\t\t\t{\n\t\t\t\t// check if the hooks is a static method on the attached object\n\t\t\t\t// also take the __callStatic into account\n\t\t\t\tif(is_string($hook) && (is_callable(array($this->getClass(), $hook)) OR\n\t\t\t\t\tmethod_exists($this->getClass(), '__callStatic')))\n\t\t\t\t{\n\t\t\t\t\treturn $this->getClass().'::'.$hook.'('.$param_list.');';\n\t\t\t\t}\n\t\t\t\t// check if it is a static method or a function\n\t\t\t\telseif(is_callable($hook))\n\t\t\t\t{\n\t\t\t\t\treturn implode('::', (Array)$hook).'('.$param_list.');';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'Callable supplied for hook \"'.$name.'\", callable \"'.$hook.'\".');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// we need a string\n\t\t\t\tif(is_array($hook))\n\t\t\t\t{\n\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The hook \"'.$name.'\" requires a method placed on the described class, not a static method placed on some other class.');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check if it is a method on the object\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// fetch a reflection\n\t\t\t\t\t$ref = new ReflectionClass($this->getClass());\n\t\t\t\t\t\n\t\t\t\t\tif($ref->hasMethod($hook))\n\t\t\t\t\t{\n\t\t\t\t\t\t$m = $ref->getMethod($hook);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// we need to be able to invoke it outside the class\n\t\t\t\t\t\tif( ! $m->isPublic())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The \"'.$this->getClass().'::'.$hook.'\" method is not public, it cannot be used as a hook.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($m->isStatic())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'The \"'.$this->getClass().'::'.$hook.'\" method is static but a non-static method is required.');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $object_var.'->'.$hook.'('.$param_list.');';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// __call works too\n\t\t\t\t\telseif($ref->hasMethod('__call'))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $object_var.'->'.$hook.'('.$param_list.');';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Db_DescriptorException($this->getClass(), 'A method with the name \"'.$hook.'\" is required by a hook to be placed in the class \"'.$this->getClass().'\".');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(ReflectionException $e)\n\t\t\t\t{\n\t\t\t\t\t// TODO: Proper error handling code, convert to a Db_Exception\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No hook for this point\n\t\t\treturn '';\n\t\t}\n\t}", "public function getFromRegistry($name) {\n return Registry::get($name);\n }", "function get_tool($name)\n {\n }", "private function getHooksFromFile( $file ) {\n\t\t$content = file_get_contents( $file );\n\t\t$m = array();\n\t\tpreg_match_all( '/(?:wfRunHooks|Hooks\\:\\:run|ContentHandler\\:\\:runLegacyHooks)\\(\\s*([\\'\"])(.*?)\\1/', $content, $m );\n\t\treturn $m[2];\n\t}", "public static function Get($name);", "private function registerHook($hook_name, $point)\n {\n if (!isset(self::$hook_statistics[$hook_name])) {\n self::$hook_statistics[$hook_name] = [\n 'count' => 0,\n 'time' => 0,\n 'caller' => [],\n 'points' => [],\n 'points_count' => []\n ];\n }\n // Общее количество вызовов хука\n self::$hook_statistics[$hook_name]['count']++;\n\n // Источник, вызвавший хук\n $caller = $this->getCaller();\n $caller['call_id'] = $this->registerCaller($caller, $hook_name, $point);\n\n // Вызовы хука для некоторой точки в коде\n $this->registerPoint($point, self::$hook_statistics[$hook_name]);\n\n return $caller;\n }", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get( $name );", "public static function get($name,$default = null) {\n\t\treturn (isset(self::$state[$name]) ? self::$state[$name] : $default);\n\t}", "public static function get($name) {\r\n return self::getInstance()->getService($name);\r\n }", "public function hook();", "function s2_hook($hook_id)\n{\n if (defined('S2_DISABLE_HOOKS')) {\n return false;\n }\n\n static $hookNames = null;\n\n if ($hookNames === null) {\n if (!defined('S2_DISABLE_CACHE') && file_exists(S2Cache::CACHE_HOOK_NAMES_FILENAME)) {\n $hookNames = include S2Cache::CACHE_HOOK_NAMES_FILENAME;\n }\n if (!is_array($hookNames)) {\n $hookNames = S2Cache::generate_hooks();\n }\n }\n\n if (!isset($hookNames[$hook_id])) {\n return false;\n }\n\n $code = implode(\"\\n\", array_map(static fn(string $filename) => \"\\$_include_result = include S2_ROOT.'$filename'; if (\\$_include_result !== 1) { return \\$_include_result; }\", $hookNames[$hook_id]));\n\n return $code;\n}", "public static function get(string $name)\n {\n return static::$services[$name] ?? null;\n }", "public function handler($name)\n {\n return $this->get($name);\n }", "public function __get($name)\n\t{\n\t\treturn $this->_ci->_module_get($name);\n\t}", "function hook_get_builder($hook, $arg) {\n return hook_get_builder_factory($hook, $arg)->getInstance();\n}", "public function get($name) {}", "public static function CallHook($name,$data=null){\r\n\t\tself::Debug('Call hook '.$name);\r\n\t\tif(!self::HasHookHandler($name))\r\n\t\t\treturn true;\r\n\t\t$keys=array_keys(self::$Config['extensions'][$name]);\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($keys);\r\n\t\twhile(++$i<$len){\r\n\t\t\tself::Debug('Call '.self::$Config['extensions'][$name][$keys[$i]]);\r\n\t\t\tif(!call_user_func(self::$Config['extensions'][$name][$keys[$i]],$data)){\r\n\t\t\t\tself::Debug('Handler stopped hook execution');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function deploymentHook($hookId)\n {\n return $this->request('get', '/api/hooks/'.$hookId);\n }", "public static function getWord($name, $default = '', $hash = 'default')\n {\n return static::getVar($name, $default, $hash, 'word');\n }", "public function removeHook(string $name)\n {\n foreach ($this->hooks as $idx => $hook)\n {\n if ( \\strcasecmp($name, $hook->getName())==0 ) {\n # Remove it\n unset( $this->hooks[$idx] );\n\n return $this;\n }\n }\n\n return $this;\n }", "public function get(string $name): string;", "function doing_action($hook_name = \\null)\n {\n }", "public function getHooks() { return $this->_hooks; }", "public function getArgument($name, $default = null)\n {\n if (array_key_exists($name, $this->arguments)) {\n return $this->arguments[$name];\n }\n return $default;\n }", "public function offsetGet(mixed $name) : mixed\n\t{\n\t\tif ($this->state === self::STATE_INITIAL) {\n\t\t\t$this->boot();\n\t\t}\n\n\t\treturn $this->instanceInjector->get($name);\n\t}", "function get_lang($name) {\n global $lang;\n return $lang->get_phrase($name);\n}", "public function get($name)\n {\n return $this->has($name) ? $this->allStates[$name] : null;\n }", "public static function load_current_page_hook_slug($hook = 'load-'){\r\n global $pagenow;\r\n return $hook.$pagenow;\r\n }", "private function _hook($hook='', $data=array())\n\t{\n\t\tif ($hook AND $this->EE->extensions->active_hook('open_api_'.$hook) === TRUE)\n\t\t{\n\t\t\t$data = $this->EE->extensions->call('open_api_'.$hook, $data);\n\t\t\tif ($this->EE->extensions->end_script === TRUE) return;\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "function getPlugin($name);", "function getParam( $name ) {\n\t\t$db = JFactory::getDbo();\n\t\t$db->setQuery('SELECT manifest_cache FROM #__extensions WHERE name = \"com_mapyandex\"');\n\t\t$manifest = json_decode( $db->loadResult(), true );\n\t\treturn $manifest[ $name ];\n\t}", "protected function _get($name) {}", "protected function getArgument($name, $default = null) {\n $environment = Zibo::getInstance()->getEnvironment();\n return $environment->getArgument($name, $default);\n }", "public function getNamedWidgetArgument($name);", "public function getArgument($name, $default = null)\n {\n return $this->get($name, $default);\n }", "protected function getHookFinderService()\n {\n return $this->services['hook_finder'] = new \\phpbb\\hook\\finder('./../', 'php', ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'});\n }", "function get($name) \n {\n return $this->instance->get($name);\n }", "public function get($name = NULL);", "public function get($name)\n {\n return $this->pluginManager->get($name);\n }", "public function getHint(string $name);", "function get( $name )\n\t{\n\t foreach( $this->inputs as $input ){\n\t // loop over each and see if match\n\t if( $input['name'] == $name ){\n\t // return a reference\n\t return $input;\n\t }\n\t }\n\t}", "protected function getArgument(string $name)\n {\n $this->methodExpectsRequest(__METHOD__);\n $param_infos = $this->getArgumentInfos($name);\n\n if (null === $param_infos) {\n return null;\n }\n $arg = $this->getRequest()->getArg($param_infos['position']);\n return $this->getRequest()->getArg($param_infos['position']);\n }", "public function get($name, $default = null)\n {\n return $this->args[$name] ?? $default;\n }", "public function log($hook_name, $point = '')\n {\n $this->backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n unset($this->backtrace[0], $this->backtrace[1]);\n $caller = $this->registerHook($hook_name, $point);\n return ['hook_name' => $hook_name, 'point' => $point, 'caller' => $caller, 'time' => microtime(true)];\n }", "protected final function get($name){\n\t\tif(!$this->check_hide($name)){\n\t\t\tif(!is_null($this->get_hook)){\n\t\t\t\treturn $this->do_callbacks($this->get_hook,$name);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//if the datatype was create\n\t\t\t\tif(array_key_exists($name, $this->vars)){\n\t\t\t\t\t//check if the datatype has a value\n\t\t\t\t\tif(array_key_exists($name, $this->values)){\n\t\t\t\t\t\treturn $this->values[$name];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "public static function get($name)\n {\n return static::getInstance()->offsetGet($name);\n }", "public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE)\n {\n return $this->get($this->getProjectPath($project_id, 'hooks'), array(\n 'page' => $page,\n 'per_page' => $per_page\n ));\n }", "function &get ($k) {\n\t\t$var_name = \"__fu_$k\";\n\t\treturn $GLOBALS[$var_name];\n\t}", "public function getNamedStringArgument($name);", "protected function getHookname($hookKey)\n {\n return 'actionObject' . static::getSimpleClass() . $hookKey;\n }", "public function get($name)\n {\n return $this->suggesters[$name];\n }", "public static function &getModule($name)\n\t{\n\t\t$result\t\t= null;\n\t\t$modules\t= self::_load();\n\t\tforeach ($modules AS $module) {\n\t\t\t// Match the name of the module\n\t\t\tif ($module->position == $name)\n\t\t\t{\n\t\t\t\treturn $module;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function get($name)\n\t{\n\t\treturn $this->stores[ $name ] ?? $this->resolve($name);\n\t}", "protected function get($name)\n {\n return $this->app->{$name};\n }" ]
[ "0.87501067", "0.7734478", "0.76065654", "0.68650013", "0.66931117", "0.65054524", "0.6401926", "0.6209019", "0.6165243", "0.61402625", "0.61375123", "0.6069707", "0.5993404", "0.5971899", "0.5963461", "0.58497834", "0.58474743", "0.581106", "0.57958055", "0.56708753", "0.5524395", "0.543946", "0.543744", "0.5437387", "0.5426907", "0.541518", "0.5405533", "0.53986406", "0.5390558", "0.53450775", "0.5331004", "0.5322921", "0.5304489", "0.5303463", "0.52892876", "0.52708167", "0.5249641", "0.522843", "0.5221874", "0.52195257", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.52124035", "0.5205394", "0.5202871", "0.51849335", "0.51698446", "0.51488423", "0.51364094", "0.5127647", "0.51065165", "0.5096371", "0.5093303", "0.5092994", "0.5092882", "0.506851", "0.5068475", "0.5066947", "0.50577", "0.505367", "0.5047182", "0.50445986", "0.5035409", "0.50259656", "0.5025616", "0.5014894", "0.5010705", "0.5008595", "0.4997406", "0.49939036", "0.49865207", "0.4977617", "0.49726278", "0.49709755", "0.49572954", "0.49527302", "0.49398836", "0.49371934", "0.49308053", "0.4925479", "0.49245882", "0.49217826", "0.49152792", "0.49137077", "0.48988834", "0.4896993", "0.48934153", "0.48885947", "0.48885027", "0.48872423", "0.48832795" ]
0.7190631
3
Response one data by id
public function getRankingById(Request $request, $rankingId) { $ranking = Ranking::find($rankingId); return response()->json([ 'message' => 'success', 'ranking' => $ranking, ], 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOneRecord($id)\n {\n $data = DB::table('barang')->where('id', $id)->get();\n $result = ['code' => '99', 'data' => $data];\n return response()->json($result);\n }", "public function single(int $id): ResponseInterface;", "public function get_one($id)\n {\n }", "public function get( $id ){}", "public function show($id)\n {\n if($this->model::whereId($id)->first()){\n return json_encode([\n 'status_code' => 200,\n 'data' => $this->model::find($id)->first()\n ]);\n } \n return json_encode([\n 'status_code' => 204,\n 'data' => json_encode([])\n ]);\n\n }", "public function show($id)\n {\n \n return response(\"2\");\n }", "public function get_data_by_id()\n {\n $token = $this->getAuthHeader();\n $data = $this->request->getJSON();\n $ret_data = [];\n\n //init data\n $id = isset( $data->id ) ? $data->id : -1;\n\n $result = $this->_checkToken( $token );\n\n if ( !isset( $result ) ) {\n $dataDB['status'] = \"error\";\n $dataDB['message'] = $this->db->error()['message'];\n $dataDB['data'] = \"\";\n\n return $this->respond( $dataDB, TOKEN_NOT_FOUND );\n }\n\n $db_data = $this->_getCurrentData($id);\n\n if ( $this->db->error()['message'] !== '' ) {\n $dataDB['status'] = \"error\";\n $dataDB['message'] = $this->db->error()['message'];\n $dataDB['data'] = \"\";\n\n return $this->respond( $dataDB, 200 );\n }\n\n if ( !empty($db_data) ) {\n $ret_data[] = $this->_mappingData($db_data);\n $ret_data[] = $this->_mappingData($db_data);\n }\n \n\n $dataDB['status'] = \"success\";\n $dataDB['message'] = \"\";\n $dataDB['data'] = $ret_data;\n\n return $this->respond( $dataDB, 200 );\n }", "public function get( $id );", "public function getById() {}", "public function one($id);", "public function getById($id) {\n $data = Artikel::find($id);\n\n return response()->json(['data' => $data, 'message' => \"Berhasil mengambil data!\"], 200);\n }", "public function getById($id) : Response\n {\n //find the info\n $record = $this->getRecordById($id);\n\n //get the results and append its relationships\n $result = $this->appendRelationshipsToResult($this->request, $record);\n\n return $this->response($this->processOutput($result));\n }", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where($_table, [$_id => $id])->row_array();\n }else{\n $data = $this->db->get($_table)->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "function get_by_id($id = null)\n\t{\n\t\t$data['data'] = 0;\n\t\tif (!empty($id)) {\n\t\t\t$query = $this->cbt_modul_model->get_by_kolom('modul_id', $id);\n\t\t\tif ($query->num_rows() > 0) {\n\t\t\t\t$query = $query->row();\n\t\t\t\t$data['data'] = 1;\n\t\t\t\t$data['id'] = $query->modul_id;\n\t\t\t\t$data['modul'] = $query->modul_nama;\n\t\t\t\t$data['status'] = $query->modul_aktif;\n\t\t\t}\n\t\t}\n\t\techo json_encode($data);\n\t}", "public function one_get(string $id)\n {\n $one = $this->repository->find($id);\n if ($one === null)\n show_404();\n $this->response(ObjectUtils::toArray($one), HTTP_OK);\n }", "public function get(string $id);", "function get($id){ \t\n \tif(isset($id)){\n \t\t$result = $this->model->selectWhere('*',\"id = \".\"'$id'\");\n \t\techo json_encode($result);\n \t}else{\n \t\techo json_encode('failed');\n \t} \t\n }", "public function getOne($id) {\n\n }", "public function getById( $id );", "public function get($id) {\n\t}", "public function show($id)\n {\n $pembeli = Pembeli:: where('id',$id)->first();\n \n return response()->json([\n 'success' => true,\n 'message' => 'Detail Data Pembeli',\n 'data' => $pembeli\n ], 200);\n\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "static function show($id)\n {\n $respuestaBLL = new respuestaBLL();\n $objRespuesta = $respuestaBLL->select($id);\n if ($objRespuesta == null) {\n http_response_code(404);\n return;\n }\n echo json_encode($objRespuesta);\n }", "public function get($id)\n {\n }", "public function get($id)\n {\n }", "function retrieve($id=0)\n\t\t{\n\n\n\t\t\tglobal $connection;\n\t\t\t$query=\"SELECT * FROM entradas_veiculos\";\n\t\t\tif($id != 0)\n\t\t\t{\n\t\t\t\t$query.=\" WHERE id=\".$id.\" LIMIT 1\";\n\t\t\t}\n\t\t\t$response=array();\n\t\t\t$result=mysqli_query($connection, $query);\n\t\t\twhile($row=mysqli_fetch_object($result))\n\t\t\t{\n\t\t\t\t$response[]=$row;\n\t\t\t}\n\t\t\theader('Content-Type: application/json');\n\t\t\techo json_encode($response);\n\t\t}", "public function show($id)\n {\n $empresa = EmpresasAseguradoras::where(\"id_empresa_aseguradora\",\"=\",$id)->get();\n $count = $empresa->count();\n if ($count > 0) {\n return response()->json(['data' => $empresa[0], 'success' => true, 'mensaje' => 'Datos encontrados'], 200);\n } else {\n return response()->json(['data' => [], 'success' => false, 'mensaje' => 'Datos no encontrados'], 200);\n }\n }", "public function get($id){\n }", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function show($id)\n {\n $data = Mahasiswa::where('id', $id)->first();\n if (!$data) {\n return response([\n 'status' => 'error',\n 'message' => 'mahasiswa tidak ada'\n ], 404);\n }\n return response([\n 'status' => 'success',\n 'message' => 'success get data by id',\n 'data' => $data\n ], 200);\n }", "public function getbyid(){\n\n $input_data = $this->request->getJsonRawBody();\n\t$headers = $this->request->getHeaders ();\n\t\tif (empty ( $headers ['Token'] )) {\n\t\t\treturn $this->response->setJsonContent ( [ \n\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\"message\" => \"Please give the token\" \n\t\t\t] );\n\t\t}\n\t\tif (empty ( $input_data )) {\n\t\t\treturn $this->response->setJsonContent ( [ \n\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\"message\" => \"Please give the input datas\" \n\t\t\t] );\n\t\t}\n\t\t$baseurl = $this->config->baseurl;\n\t\t$token_check = $this->tokenvalidate->tokencheck ( $headers ['Token'], $baseurl);\n\t\tif ($token_check->status != 1) {\n\t\t\treturn $this->response->setJsonContent ( [ \n\t\t\t\t\t\"status\" => false,\n\t\t\t\t\t\"message\" => \"Invalid User\" \n\t\t\t] );\n\t\t}\n $id = isset($input_data->nidara_kid_profile_id) ? $input_data->nidara_kid_profile_id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => false,'message' => 'Please select the kid to update the information']);\n else:\n $kidphysical_getbyid = NidaraKidPhysicalInfo::findFirstBynidara_kid_profile_id($id);\n if ($kidphysical_getbyid):\n\t\t\t\n return $this->response->setJsonContent ([ \n\t\t\t\t\t'status' => true,\n\t\t\t\t\t'data' =>$kidphysical_getbyid\n\t\t\t]);\n else:\n return $this->response->setJsonContent(['status' => false, 'message' => 'You have not entered any information',\"data\"=>array()]);\n endif;\n endif;\n }", "static function getOne($id)\n {\n $data = static::find($id);\n return $data;\n }", "public function show(int $id): \\Psr\\Http\\Message\\ResponseInterface\n {\n return $this->data = $this->service->http->get($this->service->host . \"$this->endpoint/$id\");\n }", "public function getById(int $id);", "public function show($id = null)\n\t{\n\t\tif ($id == null) return $this->respond(res400(['message' => 'Bad Request']));\n\t\t$result = $this->model->find($id);\n\t\treturn $this->respond(res200(['data' => $result]));\n\t}", "public function getById()\n {\n }", "public function retrieve(int $id);", "public function actionFind($id){\n \t\n\t\tYii::$app->response->format = Response::FORMAT_JSON;\n\n\t\t$response = null;\n\n\t\tif (Yii::$app->request->isGet){\n\t\t\t\n \t$data_matpel= (new \\yii\\db\\Query())\n ->select(['guru_bahan_ajar_matpel.*','data_matpel.matpel_detail'])\n ->from('guru_bahan_ajar_matpel')\n ->leftjoin('data_matpel','guru_bahan_ajar_matpel.matpel_id = data_matpel.id_matpel')\n ->where('guru_id = \"'.$id.'\" ')\n ->all();\n\t\t\t\n\t\t\t$response['master'] = $data_matpel;\n\t\t}\n\n\t\treturn $response;\n }", "public function show($id) \n {\n $data = [];\n $data['data'] = $this->model->where($this->primary_key, $id)->whereNull('deleted_at')->first();\n\n if ($data['data'] == null) {\n return response()->json([\n 'message' => 'Record not found',\n ], 404);\n \t}\n\n return response()->json($data)->withHeaders([\n 'Access-Control-Allow-Origin' => '*', \n 'Access-Control-Allow-Headers' => 'X-Requested-With, Content-Type, Accept, Origin, Authorization',\n 'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, OPTIONS'\n ]);\n }", "public function GetById($id);", "public function GetById($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public function show($id)\n\t{\n $orden_es_ds = OrdenEsM::where('orden_es_m_id',$id)->get();\n return Response::Json($orden_es_ds);\n\t}", "public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where(\"mobil\", ['id' => $id])->row_array();\n }else{\n $data = $this->db->get(\"mobil\")->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "public function getbyid($id = null) {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => 'Error', 'message' => 'Invalid input parameter']);\n else:\n $collection = GuidedLearningGamesMap::findFirstByid($id);\n if ($collection):\n return Json_encode($collection);\n else:\n return $this->response->setJsonContent(['status' => 'Error', 'Message' => 'Data not found']);\n endif;\n endif;\n }", "public function show($id)\n\n {\n //\n $data = Empresa::find($id);\n $rs = [\"results\"=> $data];\n return response()->json($rs);\n }", "public function show($id)\n {\n if($id != 0) {\n \n $poubelle = Poubelle::find($id) ;\t\n return json_encode( $poubelle ) ;\n\n }\n return 0 ;\n \n }", "public function getById($id)\n {\n }", "public function getById($id)\n {\n }", "public function getById(string $id);", "public function get($id)\n\t{\n\t try {\n if(empty($id)) {\n $this->getResponse()->setStatusCode(400);\n return $this->returnData(array(\"message\" => \"ID is required.\"));\n }\n \n\t\t $value = $this->getMasterTable()->find($id);\n if(empty($value)) {\n $this->getResponse()->setStatusCode(204);\n }\n\t\t\t\n\t\t return $this->returnData($value);\n\t\t}\n\t\tcatch (\\Exception $e) {\n $this->getResponse()->setStatusCode(404);\n \t return $this->returnData(array('message' => $e->getMessage()));\n }\n\t}", "public function show($id)\n {\n $datos=Habito::where('id_habito', $id)->get()->first(); \n if($datos != null){\n return response()->json(['result'=>$datos]);\n }else\n return response()->json(['mensaje'=>\"Registro no encontrado\", 'code'=>'202']);\n }", "public function byId(Request $request, $id)\n {\n \n $patient = Patient::where('id',$id)->first();\n\n return response()->json(['patient' => json_encode($patient)]);\n }", "public abstract function get($id);", "public function show($id)\n {\n $statusCode = 200;\n $response = [\"data\" > \"\"];\n try{\n $store = Store::find($id);\n $response = [ \"data\" => [\n 'id' => (int)$store->bID,\n 'title' => $store->title,\n 'slogan' => $store->slogan,\n 'company_name' => $store->company_name,\n 'address' => $store->address,\n 'state' => $store->state,\n 'city' => $store->city,\n 'zipcode' => $store->zipcode,\n 'phone' => $store->phone,\n 'email' => $store->email,\n 'website' => $store->website,\n 'business_hour' => $store->business_hour,\n 'latitude' => $store->latitude,\n 'longtitude' => $store->longtitude,\n 'overview' => $store->overview,\n 'service' => $store->service,\n 'location' => $store->location,\n 'content' => $store->content\n ]];\n }catch(Exception $e){\n $response = [\n \"error\" => \"File doesn`t exists\"\n ];\n $statusCode = Response::HTTP_NOT_FOUND;\n }finally{\n return \\Response::json($response, $statusCode);\n }\n }", "abstract public function getById($id);", "abstract public function getById($id);", "public function show($id)\n {\n $data = Mall::where('id', $id)->first();\n \n return response()->json([\"data\" => $data]);\n }", "public function show($id)\n {\n //\n $salida=Salidas::findOrFail($id);\n \n return response()->json(compact('salida'),201) ;\n }" ]
[ "0.74679047", "0.742328", "0.7255666", "0.72329074", "0.72178924", "0.71860975", "0.7151621", "0.7140682", "0.7119881", "0.7117715", "0.7113509", "0.709318", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7086882", "0.7072617", "0.7018242", "0.70076907", "0.69930315", "0.69399655", "0.6923408", "0.6904768", "0.68953174", "0.6894563", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.6887233", "0.68822443", "0.68815076", "0.68815076", "0.6873048", "0.6851727", "0.68497026", "0.6841875", "0.6841875", "0.6841875", "0.68399554", "0.6839719", "0.68152905", "0.6807359", "0.6805731", "0.67865765", "0.67724293", "0.6768889", "0.6768212", "0.6761571", "0.6760249", "0.6760249", "0.6752518", "0.6752518", "0.6752518", "0.6752518", "0.6745997", "0.6745997", "0.6745997", "0.67414135", "0.6731158", "0.67286026", "0.67278236", "0.67240566", "0.67207617", "0.67207617", "0.6718059", "0.67142326", "0.67135465", "0.67109036", "0.6703139", "0.6694405", "0.6690413", "0.6690413", "0.668514", "0.6684863" ]
0.0
-1
Update the specified resource in storage.
public function updateRanking(Request $request) { // Update ranking_points $request->validate([ 'name' => 'required|string|between:1,100', 'year' => 'required', ]); $ranking = Ranking::find($request->id); $ranking -> update([ 'name' => $request->name, 'year' => $request->year, ]); return response()->json([ 'message' => 'ranking successfully updated', 'ranking' => $ranking ], 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update($request, $id);", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update($id, $input);", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.74238616", "0.7062842", "0.7057816", "0.6897868", "0.65820867", "0.64505464", "0.6347915", "0.62114644", "0.6145006", "0.61231726", "0.6115922", "0.6100021", "0.6089019", "0.60542375", "0.60187906", "0.6008231", "0.5974106", "0.5944986", "0.59397626", "0.59393746", "0.58937186", "0.58607864", "0.5853811", "0.5853811", "0.58521867", "0.5815276", "0.58061725", "0.57518756", "0.57518756", "0.5736318", "0.57246256", "0.5715636", "0.5696208", "0.5691033", "0.5687788", "0.56692934", "0.56556624", "0.5652178", "0.56494987", "0.5636202", "0.56355816", "0.5632871", "0.563206", "0.56291884", "0.5621382", "0.56087434", "0.5602465", "0.55928403", "0.55825645", "0.55821884", "0.5581833", "0.5576869", "0.55712104", "0.5568173", "0.55648434", "0.5562885", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.55592597", "0.5556131", "0.5555849", "0.5555397", "0.5553912", "0.55530137", "0.5543831", "0.55430055", "0.5540152", "0.5539437", "0.55359006", "0.5535772", "0.5534487", "0.552458", "0.5518245", "0.5515452", "0.55145514", "0.5509227", "0.55079365", "0.55065364", "0.55039924", "0.5501616", "0.5500345", "0.5499738", "0.54980725", "0.5496017", "0.5496017", "0.5494488", "0.5494334", "0.54936594", "0.54934716", "0.5491019", "0.54835314", "0.54795796", "0.5479442", "0.5478275", "0.54646415", "0.54637444", "0.5461914", "0.54562414" ]
0.0
-1
/ Zeigt die Detailseite einer Person an
function detail_person($pid) { include 'php/inc/person_detail.inc.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Person $person)\n {\n //\n }", "public function show(Person $person)\n {\n //\n }", "public function getShowPersonInfor()\n {\n\n }", "public function getDetail();", "public function afficherInformation()\n {\n //la version de la méthode implémenté dans la classe parent (Personne)\n return \"le héro est \".$this->pseudo.\" et est un \".$this->getCote();\n }", "public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }", "public function info(){\n $this->display('Main/Person/info') ;\n }", "public function getPersonne()\n {\n return $this->id_personne;\n }", "function detail()\n {\n }", "public function displayperson() {\r\n if (isset($_GET['id'])) {\r\n $display = $this->model->displayPerson($_GET['id']);\r\n }\r\n return $this->view('/company/displayperson', $display);\r\n }", "function firstentity_person( $person ) {\n $content[] = array(\n '#markup' => l( $person->name , 'person/' . $person->person_id )\n );\n $content[] = field_attach_view( 'person' , $person , 'full' );\n return $content;\n}", "public function detailsAction(Person $person)\n {\n return $this->render(\n 'DematimbreAdminCustomerBundle:Person:details.html.twig',\n array('person' => $person)\n );\n }", "abstract public function getDetails();", "public function show(RelacionMatPerson $relacionMatPerson)\n {\n //\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function __toString() {\r\n return $this->persona->getNombres().' '.$this->persona->getApellidos();\r\n }", "function onShowDetail(&$pr, &$ds) {\n\t$hotel = $this->dTable->detailed($this->entryId)->execute()->getFirst();\n\n\t$this->dsDb->add(\"Hotel\",$hotel->toArray(true));\n\n\t$fn = $this->name() . \"/show.xml\";\n\t$pr->loadPage( $fn );\n }", "public function show(DatosPersonales $datos)\n {\n echo \"<pre>\";\n var_dump($datos);\n echo \"</pre>\";\n }", "public function getPersonInfo()\n {\n return new Model\\PersonInfo(\n $this->properties['first_name']->value,\n $this->properties['last_name']->value,\n $this->properties['ssno']->value,\n $this->properties['sex']->value,\n $this->properties['date_of_birth']->value\n );\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "function createPersona()\n {\n return isset($this->source['persona']) && $this->source['persona'] ? $this->source['persona'] : null;\n }", "public function show(CompradorPersona $compradorAgricultor)\n {\n //\n }", "public function getPersonalInfo(){\r\n\t $this->_personalInfo;\r\n\t}", "public function authorDetails($id);", "public function comerPersona($nombre){\n\t\techo \"Soy el tiburon peligroso $this->nombre y me voy a comer a la persona $nombre\";\n\t}", "public function person () {\n\t\treturn $this->belongsTo(\n\t\t\t'App\\Models\\Person',\n\t\t\t'person_id',\n\t\t\t'person_id'\n\t\t);\n\t}", "public function getPerson()\n {\n return $this->hasOne(Person::className(), ['id' => 'person_id']);\n }", "public function memberinfo(){\n\t\t$pid = \\Input::get('id');\n\t\tMisc::isid_valid($pid, \"Show\");\n\t\t\n \t \tif(! Misc::isid_valid($pid, \"Show\")){\n \t \t\t// invalid access - to handle later\n \t \t\treturn redirect('/') ;\n \t \t}\n\n\t \t$member = Person::where('id','=',$pid)->get(['id','family_id','name','nickname','city','image','gender'])[0];\t \t\n\t \tif($member->image != null) {\n\t \t\t$member->image = $pid .\"f\".$member->family_id.\".\".$member->image ;\n\t \t} \n\t\t$member->name = $this->getfullname($member->id, $member->name, $member->nickname) ;\n\n\t\t$sql = \"select A.id, B.relative_id, A.name , B.relation, C.name as relname \n\t\t from persons A, relations B, persons C\n\t\t where A.id = B.person_id \n\t\t and C.id = B.relative_id\n\t\t and (B.person_id = :id or B.relative_id = :id2) \" ;\n\n \t\t$relatives = \\DB::select($sql, ['id' => $pid, 'id2' => $pid]) ; \t\t\n \t\t$member->relative = \"\";\n \t\t$member->relation = \"\" ;\n \t\tif($relatives[0]->id == $pid){\n \t\t\t$member->relative = $relatives[0]->relname ;\n \t\t\t$member->relation = Misc::get_relation_in_mylang($relatives[0]->relation) ; \t\t\t\n \t\t} else{\n \t\t\t$member->relative = $relatives[0]->name ;\n \t\t\t$member->relation = Misc::get_revrelation_in_mylang($relatives[0]->relation,$member->gender); \t\t\t\n \t\t}\n\n\t \treturn \\Response::make($member);\n\t}", "function VehicleDetails(){\n\t\tparent::getVehicleDetails();\n\t\t$this -> addVehicleDetails();\n\t}", "public function VerPersonaNatural()\n {\n echo json_encode($this->Crud_PersonaNatural->SelectPersonaN());\n }", "function get_detail() {\n return $this->detail;\n }", "public function Person()\n\t{\n\t\treturn $this->belongsTo('ThunderID\\Person\\Models\\Person');\n\t}", "function getPersonID()\n {\n return $this->getValueByFieldName('person_id');\n }", "public function show(VwPerson $vwPerson)\n {\n //\n }", "public function show(Personal $personal)\n {\n //\n }", "public function show(Personal $personal)\n {\n //\n }", "public function getPerson() {\n return $this->getPersoner()->getSingle();\n }", "public function edit(Personne $personne)\n {\n //\n }", "public function action_personEdit() {\r\n // 1. walidacja id osoby do edycji\r\n if ($this->validateEdit()) {\r\n try {\r\n // 2. odczyt z bazy danych osoby o podanym ID (tylko jednego rekordu)\r\n $record = App::getDB()->get(\"person\", \"*\", [\r\n \"id\" => $this->form->id\r\n ]);\r\n // 2.1 jeśli osoba istnieje to wpisz dane do obiektu formularza\r\n $this->form->id = $record['id'];\r\n $this->form->name = $record['name'];\r\n $this->form->surname = $record['surname'];\r\n $this->form->birthdate = $record['birthdate'];\r\n $this->form->jobTitle = $record['job_title'];\r\n $this->form->jobPlace = $record['job_place'];\r\n $this->form->userName = $record['user_name'];\r\n $this->form->role = $record['role'];\r\n } catch (\\PDOException $e) {\r\n Utils::addErrorMessage('Wystąpił błąd podczas odczytu rekordu');\r\n if (App::getConf()->debug)\r\n Utils::addErrorMessage($e->getMessage());\r\n }\r\n }\r\n\r\n // 3. Wygenerowanie widoku\r\n $this->generateView();\r\n }", "public function studiengang_details() {\r\n\r\n //Sprachen rausfinden:\r\n $this->sprachen = StgProfil::getPossibleLanguages();\r\n //Abschlüsse suchen:\r\n $this->abschlusssuche = new SQLSearch(\"SELECT abschluss_id, name FROM abschluss WHERE name LIKE :input\", _(\"Abschluss eingeben\"));\r\n //zulassungsvoraussetzung:\r\n $this->moeglicheZulassungsvoraussetzungen_wise = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_wise\");\r\n $this->moeglicheZulassungsvoraussetzungen_sose = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_sose\");\r\n //Typen von Studiengängen:\r\n $this->moeglicheStgTypen = StgProfil::getMoeglicheTypen();\r\n\r\n $this->studiengaenge = PersonalRechte::meineStudiengaenge(null, true);\r\n $this->abschluesse = Abschluss::findAllUsed();\r\n $this->profile = StgProfil::getMeineProfile(null, Request::get(\"studiengang_id\"), Request::get(\"abschluss_id\"));\r\n\r\n //Neuen Eintrag in stg_profil erstellen\r\n if (Request::get(\"item_id\") === \"neu\" && !Request::get(\"studiengang_id\")) {\r\n //$this->profil = new StgProfil();\r\n $this->fachsuche = new SQLSearch(\"SELECT studiengang_id, name FROM studiengaenge WHERE name LIKE :input OR beschreibung LIKE :input \", _(\"Studiengang eingeben\"));\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n return;\r\n }\r\n\r\n $this->profil = new StgProfil(Request::get(\"studienprofil_id\") !== \"neu\" ? Request::get(\"studienprofil_id\") : null);\r\n if (!$this->profil->hasPermission()) {\r\n throw new AccessDeniedException(_(\"Sie dürfen diesen Studiengang nicht bearbeiten\"));\r\n }\r\n if (Request::get(\"delete_x\") && Request::get(\"item_id\") && Request::get(\"type\") === \"dokument\") {\r\n $this->profil->deleteDoku(Request::get(\"item_id\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung gelöscht\"));\r\n }\r\n if (Request::get(\"addDocument\")) {\r\n $this->profil->addDoku(Request::get(\"addDocument\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung hinzugefügt\"));\r\n }\r\n //Profil ändern, falls Informationen gesendet worden sind:\r\n if (Request::submitted(\"absenden\")) {\r\n if (Request::get(\"studiengang_id\")) {\r\n //Neuen Eintrag in stg_profil machen:\r\n $this->profil['fach_id'] = Request::get(\"studiengang_id\");\r\n $this->profil->store(); //Nachher wird noch einmal gestored, aber jetzt wollen wir IDs bekommen.\r\n }\r\n if (Request::submitted('informationen')) {\r\n $this->profil->setInformation(Request::getArray(\"informationen\"));\r\n }\r\n if (Request::submitted(\"abschluss_id\")) {\r\n $this->profil['abschluss_id'] = Request::get(\"abschluss_id\");\r\n }\r\n if (Request::submitted('settings')) {\r\n $settings = Request::getArray(\"settings\");\r\n foreach ($settings as $key => $value) {\r\n $this->profil[$key] = $value;\r\n }\r\n if (!$settings['sichtbar']) {\r\n $this->profil['sichtbar'] = 0;\r\n }\r\n }\r\n if (Request::submitted(\"zielvereinbarung\")) {\r\n $this->profil['zielvereinbarung'] = Request::get(\"zielvereinbarung\");\r\n }\r\n if (Request::submitted(\"einleitungstext\")) {\r\n $this->profil['einleitungstext'] = Request::get(\"einleitungstext\");\r\n }\r\n if (Request::submitted('typen')) {\r\n $this->profil->setTypen(Request::getArray(\"typen\"));\r\n }\r\n $this->profil->store();\r\n\r\n if (Request::submitted('textcombination')) {\r\n $textcombinations = (array) @$_REQUEST['textcombination'];\r\n Textbaustein::removeCombination($this->profil->getId());\r\n foreach ($textcombinations as $code => $ids) {\r\n Textbaustein::addCombination($this->profil->getId(), $code, $ids);\r\n }\r\n }\r\n\r\n $this->flash_now(\"success\", _(\"Änderungen wurden übernommen\"));\r\n if (Request::get(\"neues_dokument\")) {\r\n $dokument = new StgFile();\r\n if ($_GET['qqfile'] || isset($_FILES['qqfile'])) {\r\n ob_start();\r\n $dokument->upload();\r\n ob_clean();\r\n }\r\n $dokument['name'] = Request::get(\"neues_dokument_name\");\r\n $dokument['sichtbar'] = Request::get(\"neues_dokument_sichtbar\") ? '1' : '0';\r\n $dokument['jahr'] = Request::get(\"neues_dokument_jahr\");\r\n $dokument['doku_typ_id'] = Request::get(\"neues_dokument_doku_typ_id\");\r\n $dokument['quick_link'] = Request::get(\"neues_dokument_quick_link\");\r\n $dokument['user_id'] = $GLOBALS['user']->id;\r\n $dokument->store();\r\n $dokument->setTags(Request::get(\"neues_dokument_tags\"));\r\n $this->profil->addDoku($dokument->getId());\r\n if ($dokument->isPublic()) {\r\n $this->flash_now(\"success\", _(\"Neues Dokument angelegt und hinzugefügt\"));\r\n } else {\r\n $this->flash_now(\"success\", _(\"Neues internes Dokument angelegt und hinzugefügt. Es kann unter Akkreditierung gefunden werden.\"));\r\n }\r\n }\r\n if (Request::get(\"neuer_ansprechpartner\")) {\r\n $kontakt = new StgAnsprechpartner();\r\n $kontakt['range_typ'] = Request::get(\"range_typ\");\r\n $kontakt['range_id'] = Request::get(\"range_typ\") && Request::get(\"range_id\") ? Request::get(\"range_id\") : \"\";\r\n\r\n if (Request::get(\"ansprechpartner_typ_id\")) {\r\n $typen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n foreach ($typen as $typ) {\r\n if ($typ['ansprechpartner_typ_id'] === Request::get(\"ansprechpartner_typ_id\")) {\r\n $kontakt['ansprechpartner_typ_id'] = Request::get(\"ansprechpartner_typ_id\");\r\n }\r\n }\r\n }\r\n $kontakt['freitext_name'] = Request::get(\"freitext_name\");\r\n $kontakt['freitext_mail'] = Request::get(\"freitext_mail\");\r\n $kontakt['freitext_telefon'] = Request::get(\"freitext_telefon\");\r\n $kontakt['freitext_homepage'] = Request::get(\"freitext_homepage\");\r\n if ($kontakt->store()) {\r\n $this->profil->addAnsprechpartner($kontakt->getId());\r\n $this->flash_now(\"success\", _(\"Neuer Ansprechpartner angelegt und hinzugefügt\"));\r\n }\r\n }\r\n }\r\n\r\n //Informationen:\r\n $this->informationen = $this->profil->getInformation();\r\n\r\n //Verlaufspläne\r\n $this->verlaufsplaene = $this->profil->getVerlaufsplaene();\r\n\r\n //Dateien:\r\n $this->dateien = StgFile::getByStgProfil($this->profil->getId());\r\n $this->dokumentensuche = $this->getDokumentensuche();\r\n\r\n //Kontakte:\r\n $this->kontakte = StgAnsprechpartner::getByStgProfil($this->profil->getId());\r\n usort($this->kontakte, function ($a, $b) {\r\n return strcmp($a->getName('no_title_rev'), $b->getName('no_title_rev'));\r\n });\r\n $this->kontakt_neu = new StgAnsprechpartner();\r\n $this->ansprechpartnertypen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n\r\n\r\n //Aufbaustudiengänge:\r\n $this->mutterstudiengaenge = $this->profil->getAufbauendeStudiengaenge();\r\n $this->profilsuche = $this->getProfilSuche();\r\n\r\n\r\n // Textbausteine\r\n $this->textbausteine = array(\r\n 'de' => Textbaustein::loadAll('de'),\r\n 'en' => Textbaustein::loadAll('en'),\r\n );\r\n $this->textcombinations = Textbaustein::loadCombination($this->profil->getId());\r\n\r\n $this->ansprechpartnersuche = $this->getAnsprechpartnersuche();\r\n $this->datei_url = $this->link_for(\"zsb_dateien/download_file\");\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n //hiernach wird nichts weiter ausgegeben\r\n }", "public function edit(Person $person)\n {\n //\n }", "function Person($name,$position,$bio,$img,$email){\n $this->name = $name;\n $this->position = $position;\n $this->bio = $bio;\n $this->img = $img;\n $this->email = $email;\n }", "public function getPerson() {\n return $this->person;\n }", "public function getPerson() {\n return $this->person;\n }", "public function showAction(\\Heiner\\Heiner\\Domain\\Model\\Person $person)\n {\n $persons = $this->personRepository->findAllPersonsBelongingToCompany(\n $person->getFirma()->getUid()\n );\n\n $this->view->assign('persons', $persons);\n }", "public function show(Fornecedores $fornecedores)\n {\n //\n }", "public function getIdPerson()\n {\n return $this->idPerson;\n }", "public function displaySpecificPerson($index)\n {\n $data = file_get_contents('address.json');\n $json_arr = json_decode($data, true);\n // print_r($json_arr[$index]);\n echo \"User First Name : \" . $json_arr[$index][\"firstName\"] . \"\\n\";\n echo \"User First Name : \" . $json_arr[$index][\"lastName\"] . \"\\n\";\n echo \"User Adress : \\n\";\n echo \" State : \" . $json_arr[$index][\"address\"][\"State\"] . \"\\n\";\n echo \" City : \" . $json_arr[$index][\"address\"][\"City\"] . \"\\n\";\n echo \" Zipcode : \" . $json_arr[$index][\"address\"][\"Zipcode\"] . \"\\n\";\n echo \" PhoneNumber : \" . $json_arr[$index][\"address\"][\"PhoneNumber\"] . \"\\n\";\n }", "public function setPersonne($valeur)\n {\n $this->id_personne = $valeur;\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n //recupérer le repo\n $repository = $em->getRepository('InsatGl2Bundle:Personne');\n\n $personnes = $repository->findAll();\n\n\n return $this->render('@InsatGl2\\Personne\\show.html.twig',\n array(\n 'personnes'=> $personnes\n ));\n }", "function person_link(stdClass $person, string $id = 'id'): string {\n\t$text = $person->first_name . ' ' . $person->last_name;\n\t$title = sprintf('View %s\\'s record', $text);\n\t$options = [\n\t\t'title' => $title,\n\t];\n\t$path = 'person/view/' . $person->{$id};\n\treturn create_link($path, $text, $options);\n}", "public function personel()\n {\n return $this->hasOne('App\\Personel', 'id_jabatan');\n }", "public function getPersona()\n {\n return $this->hasOne(Personas::className(), ['id' => 'persona_id']);\n }", "public function person()\n {\n return $this->belongsTo(PersonProxy::modelClass());\n }", "public function person()\n {\n return $this->belongsTo(PersonProxy::modelClass());\n }", "public function __toString()\r\n {\r\n return $this->getName() . ', born on ' . $this->getBirthday() . '. Live in ' . $this->getAddress();\r\n }", "public static function parler()\n {\n echo 'Je suis un personnage <br/>';\n }", "public function show(DetailPelamar $detailPelamar)\n {\n //\n }", "public function detail() {\n $url = explode('/', $_GET['url']);\n $id = $url[2];\n $this->loadView('detail', 'content');\n $client = $this->em->selectById('client', $id);\n $village = $this->em->selectById('village', $client->getIdVillage());\n $this->loadHtml($client->getId(), 'id');\n $this->loadHtml($client->getNomFamille(), 'nomFamille');\n $this->loadHtml($village->getNom(), 'village');\n $this->loadHtml($client->getTelephone(), 'telephone');\n $this->dom->getElementById('lien_client')->href .= $id;\n }", "public function description(){ return $this->name . \" [\" . $this->ID . \"]\"; }", "public function show(Person $person)\n {\n return $this->showOne($person);\n }", "function printUserInfo() {\n return $this->Name.' '.$this->Surname;\n }", "abstract public function information();", "public function edit(Persona $persona)\n {\n //\n }", "public function testCreatePerson()\n {\n }", "public function detail($id)\n {\n //\n }", "public function getNom()\n{\nreturn $this->Nom;\n}", "public function userDetails(){\n\t\t\techo $this->name .\"<br>\";\n\t\t\techo $this->age .\"<br>\";\n\t\t\techo $this->dept .\"<br>\";\n\t\t}", "public function author(){\n return $this->belongsTo('App\\Profile');// belogns c'est a dire contient on \n //l'a fait dans l'objet qui contient la clés etrangére\n }", "public function __toString() \n\t\t{\n\t\t\treturn $this->autid.' - '.$this->autnom;\n\t\t}", "public function show(FakturReturBeliDetail $fakturReturBeliDetail)\n {\n //\n }", "public function getPersona()\n\t{\n\t $persona=Persona::model()->find(\"id_usuario = \".$this->id);\n\t if($persona)\n\t \treturn $persona->nombre.', '.$persona->apellido;\n\t else\n\t \treturn \"Falta completar datos\";\n\t}", "function getPersonDetails($id)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $They_Vote_Key;\r\n\r\n\t\t$url = \t\"https://theyvoteforyou.org.au/api/v1/people/\".$id.\".json\";\r\n\r\n\t\t$data = array('key'=> $They_Vote_Key);\r\n\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\r\n\t\t//translate fullBio into a usable form\r\n\t\t$fullDetails = json_decode(file_get_contents($GETurl));\r\n\t\t\r\n\t\tif(isset($fullDetails->error))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $fullDetails;\t\r\n\t}", "public function detail($id){\n \n $this->_contratante->_setIdTableValue($id);\n $params['rsContratante'] = $this->_contratante->getRecord();\n \\kerana\\View::showView($this->_current_module,'contratante/detail',$params);\n \n }", "function personne($id){\r\n\t\treturn mysql_fetch_assoc(mysql_query(\"SELECT * FROM personnes WHERE id='$id'\"));\r\n\t}", "public function show(Representante $representante)\n {\n //\n }", "public function recoverPersonUsingCity(Person $person)\n {\n }", "public function details() {\n return \"My name is {$this->name} and I am {$this->age} years old.\";\n }", "public function show($id)\n {\n //\n return Persona::findOrFail($id);\n }", "public function detail($id)\n\t{\n\t\t$this->load->model('AnnonceModel');\n\t\t// on appelle la methode liste() du modele, qui retourne le tableau de resultat ici affecté dans la variable $adetail (un tableau)\n\t\t$detailannonce = $this->AnnonceModel->Detail($id);\n\t\t// var_dump($Annonceannonce);\n\t\t$variables_details['dtls'] = $detailannonce;\n\t\t$this->load->view('header');\n\t\t$this->load->view('details', $variables_details);\n\t\t$this->load->view('footer');\n\t}", "public function getDetail( $parameter )\n {\n $id = $parameter[ 'id' ];\n $friend = $this->em->getEntity( 'friends\\model\\Friends', $id );\n return $this->showDetail( $friend );\n }", "public function displayReviewPerson()\n {\n $persons = Person::orderBy('first_name')->get();\n\n return view('review.person.display')->with([\"persons\" => $persons]);\n }", "public static function details($name,$phone){\n\t\t\techo \"Name is:\".self::$Name=$name.\"<br>\";\n\t\t\techo \"Phone is:\".self::$Phone=$phone.\"<br>\";\n\t\t}", "abstract public function getAuthor();", "public function show(Nomination $id)\n {\n //\n }", "public function getIdPersonaje()\n {\n return $this->idPersonaje;\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function testUpdatePerson()\n {\n }", "public function getPersonal();", "function author($id)\n{\n global $app;\n\n $details = $app->calibre->authorDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug(\"no author\");\n $app->notFound();\n }\n $app->render('author_detail.html', [\n 'page' => mkPage(getMessageString('author_details'), 3, 2),\n 'author' => $details['author'],\n 'books' => $details['books']]);\n}", "public function currentPerson();", "public function show() {\n $view = $this->model->record($id);\n return view('persons/record', compact('view'));\n }", "public function getAdrPersonne()\n {\n return $this->adrPersonne;\n }", "public function getIdpersona()\n {\n return $this->idpersona;\n }", "public function get_author_permastruct()\n {\n }", "public function getPersonId()\n {\n return $this->personId;\n }" ]
[ "0.65418273", "0.65418273", "0.641743", "0.635534", "0.63483375", "0.62682486", "0.6168848", "0.6161162", "0.61373264", "0.6120123", "0.61185324", "0.60816044", "0.6072147", "0.6071867", "0.60434604", "0.60434604", "0.6014927", "0.59942037", "0.5993849", "0.593667", "0.59088814", "0.5873986", "0.5814262", "0.5813521", "0.5803312", "0.5781153", "0.5755555", "0.57413375", "0.5740543", "0.5740533", "0.5739643", "0.57376134", "0.57367814", "0.5732865", "0.57242525", "0.5719961", "0.5719961", "0.5702794", "0.5682954", "0.56770414", "0.56643397", "0.56593835", "0.56547266", "0.56368357", "0.56368357", "0.56340337", "0.56217784", "0.56201977", "0.5601709", "0.56010586", "0.55989593", "0.5596743", "0.5584315", "0.5580004", "0.55771375", "0.55771375", "0.5571859", "0.55717593", "0.5569745", "0.55677146", "0.5562781", "0.5559946", "0.55589986", "0.55564743", "0.5555174", "0.5524404", "0.55123574", "0.55096483", "0.5508181", "0.5498272", "0.5497507", "0.54957825", "0.54897773", "0.54795426", "0.5476055", "0.54691386", "0.546803", "0.54669315", "0.54614204", "0.5459811", "0.5456048", "0.5451689", "0.5448755", "0.54469633", "0.5446759", "0.54462487", "0.54376876", "0.543251", "0.543251", "0.5430947", "0.5430947", "0.5430947", "0.5429727", "0.5423655", "0.5421901", "0.5417173", "0.54140455", "0.54096836", "0.5409496", "0.53986454", "0.5397779" ]
0.0
-1
Convert date to yyyymmdd
private function processTransaction($arTransaction, $lineNumber = "Unknown") { $date = false; if (preg_match("/([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{2,4})/", $arTransaction["DATE"], $arMatches)) { // dd.mm.yyyy $date = $arMatches[3]."-".$arMatches[2]."-".$arMatches[1]; } else if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $arTransaction["DATE"], $arMatches)) { // mm/dd/yyyy $date = $arMatches[3]."-".$arMatches[1]."-".$arMatches[2]; } else if (preg_match("/([0-9]{2,4})\.([0-9]{1,2})\.([0-9]{1,2})/", $arTransaction["DATE"], $arMatches)) { // yyyy-mm-dd $date = $arMatches[1]."-".$arMatches[2]."-".$arMatches[3]; } else { $this->errors[] = "Invalid date in line ".$lineNumber.": ".$arTransaction["DATE"]; return false; } $dateStamp = strtotime($date); if ($dateStamp <= $this->dateStartStamp) { // Already imported, skip. return true; } // Convert amount to float $amount = false; if (preg_match("/^[+-]?[0-9\.]+\,[0-9]{2}$/", $arTransaction["AMOUNT"])) { // e.g. 1.000,00 = 1000 $amount = floatval( str_replace(",", ".", str_replace(".", "", $arTransaction["AMOUNT"])) ); } else if (preg_match("/^[+-]?[0-9\,]+\.[0-9]{2}$/", $arTransaction["AMOUNT"])) { // e.g. 1,000.00 = 1000 $amount = floatval( str_replace(".", ",", str_replace(",", "", $arTransaction["AMOUNT"])) ); } else { $this->errors[] = "Invalid amount in line ".$lineNumber.": ".$arTransaction["AMOUNT"]; return false; } // Get subject $subject = $arTransaction["SUBJECT"]; // Process $id_target = null; $result = true; $action = "SKIP"; $notice = ""; if ($date == $this->dateToday) { $action = "PENDING"; $notice = "Umsätze vom aktuellen Tag werden noch nicht verarbeitet."; } else if ($amount > 0) { // Received payment if (preg_match("/".preg_quote($this->configBankTransfer["PREFIX"])."\-([0-9]+)\-([0-9]+)/i", $subject, $arMatches)) { $action = "SUCCESS"; $id_user = (int)$arMatches[1]; $id_target = (int)$arMatches[2]; $id_transaction = md5("I".$id_target."_D".$date."_A".$amount); $billingInvoiceManagement = BillingInvoiceManagement::getInstance($this->db); $ar_invoice = $billingInvoiceManagement->fetchById($id_target); if ($ar_invoice === false) { $notice = "Ungültige Rechnungs-Nr ".$id_target." (Zeile ".$lineNumber.")"; $action = "ERROR"; } else if ($ar_invoice["FK_USER"] != $id_user) { $notice = "Ungültiger Benutzer für ".$this->getLink("invoice", $id_target)." (Zeile ".$lineNumber.")"; $action = "ERROR"; } else { $billingInvoiceTransactionManagement = BillingInvoiceTransactionManagement::getInstance($this->db); if ($billingInvoiceTransactionManagement->countByParam(array("TRANSACTION_ID" => $id_transaction)) == 0) { // New payment $paymentResult = $billingInvoiceTransactionManagement->createInvoiceTransaction(array( 'FK_BILLING_INVOICE' => $id_target, 'TYPE' => BillingInvoiceTransactionManagement::TYPE_DEFAULT, 'STAMP_CREATE' => $date, 'DESCRIPTION' => $subject, 'TRANSACTION_ID' => $id_transaction, 'PRICE' => $amount )); if ($paymentResult === null) { $notice = "Fehler beim hinzufügen der Zahlung für ".$this->getLink("invoice", $id_target)."! (Zeile ".$lineNumber.")"; $action = "ERROR"; } } else { $notice = "Identische Zahlung für ".$this->getLink("invoice", $id_target)." bereits gebucht (Zeile ".$lineNumber.")"; $action = "NOTICE"; } } } } $this->addProcess($action, $id_target, $arTransaction["NAME"], $arTransaction["ACCOUNT"], $arTransaction["BANK"], $date, $amount, $subject, $notice); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_date_to_daymmdd($date) {\n\t$date = date('l m/d', strtotime($date));\n\n\treturn $date;\n}", "function convert_date_to_mmdd($date) {\n\t$date = date('m/d', strtotime($date));\n\n\treturn $date;\n}", "function conv_date($date)\n\t{\n\t\t$arr = explode(' ', $date);\n\t\t$y = $arr[2];\n\t\t$m = $this->convert_month_name('Eng-Num', str_replace(',','',$arr[0]));\n\t\t$d = $arr[1];\n\t\t\n\t\treturn $y.'-'.$m.'-'.$d; // output : 1986-1-24\n\t}", "function uwwtd_get_DD_MM_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('d/m/Y');\n }\n return $return;\n}", "function uwwtd_get_MM_DD_YYYY_from_YYYY_MM_DD_XXX($date) {\n $return = '';\n if (!empty($date)) {\n if (strlen($date) > 10) {\n $date = substr($date, 0, 10);\n }\n $dateObj = new DateTime($date);\n $return = $dateObj->format('m/d/Y');\n }\n return $return;\n}", "function dateToDDMMYYYY ($dateSource, $date) {\n\t$dateOUT = \"\";\n\t$dateSource = strtolower($dateSource);\n\t// Replace '/' by '-' from original date. This allow me use \"sscanf($date,\"%d %d %d\")\"\n\t$date = str_ireplace(\"/\", \"-\", $date);\n\tif ($date != \"\") {\n\t\tif ($dateSource == \"yyyymmdd\")\n\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"ddmmyyyy\")\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"yyyyddmm\")\n\t\t\tlist($year, $day, $month) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"mmyyyydd\")\n\t\t\tlist($month, $year, $day) = sscanf($date,\"%d %d %d\");\n\t\tif ($dateSource == \"\") {\n\t\t\t// Autodetect mode [Supported modes: (YYYYMMDD) Or (DDMMYYYY)]\n\t\t\tlist($day, $month, $year) = sscanf($date,\"%d %d %d\");\n\t\t\tif (strlen($year) <= 3) {\n\t\t\t\tlist($year, $month, $day) = sscanf($date,\"%d %d %d\");\n\t\t\t}\n\t\t}\n\t\t$dateOUT = sprintf (\"%02d/%02d/%04d\", abs($day), abs($month), abs($year));\n\t}\n\treturn ($dateOUT);\n}", "public function toDateString()\n {\n return $this->toLocalizedString('yyyy-MM-dd');\n }", "function format_date_YYYYMMDD($filename = '')\n{\n $dff = date_from_filename($filename);\n if (count($dff) == 0) return '';\n return join('', $dff);\n}", "public function transform($date)\n {\n if ($date === null) {\n return '';\n }\n return $date->format('d') . '/' . $date->format('m') . '/' . $date->format('Y');\n }", "function convertDate($date){\n\treturn implode('.', array_reverse(explode('-', $date)));\n}", "public function transform($date)\n {\n if (null === $date) {\n return '';\n }\n return $date->format('d') . '/' . $date->format('m') . '/' . $date->format('Y');\n }", "public function fixdate($olddate) {\n return date('Y-m-d', self::date_to_timestamp($olddate));\n }", "public static function formatDateYmd2Dmy($date){\n\t\t$newdate = new DateTime($date);\n\t\treturn $newdate->format('d/m/Y');\n\t}", "function convertdateanglais($date){\n\t$ladate=explode('-',$date);\n\t$jour=$ladate[2];\n\t$moi=$ladate[1];\n\t$anne=$ladate[0];\n\t$madate=date(\"d/m/Y\", mktime(0, 0, 0, $moi, $jour, $anne));\n\treturn $madate;\n}", "public function convertCCYYMMDD($date = null);", "function dbdate($date){\n\t\t$date=explode(\"-\",$date);\n\t\t$year=explode(\" \",$date[2]);\n\t\t$date1=$year[0].\"-\";\n\t\tif($date[1]<10 && (substr($date[1],0,1)!=0))\n\t\t\t$date1.=\"0\".$date[1].\"-\";\n\t\telse\n\t\t\t$date1.=$date[1].\"-\";\n\t\tif($date[0]<10 && (substr($date[0],0,1)!=0))\n\t\t\t$date1.=\"0\".$date[0].\" \".$year[1];\n\t\telse\n\t\t$date1.=$date[0].\" \".$year[1];\n\t\treturn $date1;\n\t}", "public static function convertStringToDate($date) {\n $date = new DateTime($date); \n $date = $date->format(\"Y-m-d\"); \n return $date;\n }", "function formatDate($date){\r\n\t\t\t\t$dateObject = date_create($date);\r\n\t\t\t\treturn date_format($dateObject, \"j F Y\");\r\n\t\t\t}", "function formatDate($date){\n\tif(validateDate($date)){\n\t\t$year = substr($date,0,4);\n\t\t$month = substr($date,4,2);\n\t\t$day = substr($date,6,2);\n\t\treturn $year.C('STR_YEAR').$month.C('STR_MONTH').$day.C('STR_DAY');\n\t}\n\telse\n\t\treturn C('STR_FORMAT_DATE_FAIL');\n}", "function convertdate($date) {\n\t$date = strtotime($date);\n\treturn date(\"M j, Y g:ia\", $date);\n}", "public static function formatDate($date): string\n\t{\n\t\treturn ($timestamp = strtotime($date)) ?\n\t\t\tdate('d/m/Y', $timestamp) :\n\t\t\t'-';\n\t}", "function convert_date( $uglydate ){\n\t$date = new DateTime( $uglydate );\n\treturn $nicedate = $date->format('F j, Y');\n}", "protected function formatDate($date)\n {\n $date = explode('-', $date);\n\n $month = $date[0];\n\n $day = $date[1];\n\n $year = $date[2];\n\n return implode('-', [$year, $month, $day]);\n }", "protected function cnew_convert_date_to_db( $date ) {\r\n $current_date = DateTime::createFromFormat('d/m/Y', $date );\r\n return $current_date ? $current_date->format('Y-m-d') : $current_date;\r\n }", "function dateToGoodFormat($date){\n\t\t$toTest = explode(\"/\",$date);\n\t\t$jj = intval($toTest[0]);\n\t\t$mm = intval($toTest[1]);\n\t\t$aaaa = intval($toTest[2]);\n\t\treturn ($aaaa.\"-\".$mm.\"-\".$jj);\n\t}", "public function convert_date_format($created_date){\n\t\tif($created_date != ''){\n\t\t\t$c_d = date('Y-m-d', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "function dateFix($date) {\n\n $dateArray = explode(\"-\",$date);\n\n $year = $dateArray[0];\n $month = $dateArray[1];\n $day = $dateArray[2];\n\n return date(\"Y-m-d\",mktime(0,0,0,$month,$day,$year));\n\n}", "private function convert_date_db_format($date)\n {\n $str_date = strtotime($date);\n $db_date = date('Y-m-d', $str_date);\n return $db_date;\n }", "public function format_date($date) {\n //split date by delimter\n $new_date = explode('/', $date);\n //reverse the order from dd,mm,yy to yy,mm,dd\n $new_date = array_reverse($new_date);\n //join together again with - as delimiter\n $new_date = implode('-', $new_date);\n return $new_date;\n }", "public function toDateString()\n {\n return $this->format('Y-m-d');\n }", "private function convertDate($date)\n {\n $strDate = implode(\"-\",array_reverse(explode(\"/\", $date)));\n #CONVERTE AS DATAS DE STRING PARA DATE\n $dateConverted = new \\DateTime($strDate);\n #RETORNA DATA CONVERTIDA\n return $dateConverted;\n }", "function sc_us_date_format($date){\n\treturn date('m/d/Y', $date);\n}", "function create_date_value($date) {\n\t\t// Since no calendar is specified, should we always convert to gregorian?\n\t\t$date=$date->convert_to_cal('gregorian');\n\t\treturn\n\t\t\t($date->y==0 ? '????' : $date->Format('Y')) .'-'.\n\t\t\t($date->m==0 ? '??' : $date->Format('m')) .'-'.\n\t\t\t($date->d==0 ? '??' : $date->Format('d'));\n\t}", "function format_date($date) {\n return substr($date, 8, 2) . '/' . substr($date, 5, 2) . '/' . substr($date, 0, 4);\n }", "public function toFormattedDateString()\n {\n return $this->toLocalizedString('MMM d, yyyy');\n }", "function remove_day_from_date_and_format($date_in)\n{\n//print_r($date_ro);\n // $date_out = substr_replace($date_in, \"\", 4);\n $date_in = explode(' ', $date_in);\n $date_out = $date_in[3] . \"-\" . $date_in[2] . \"-\" . $date_in[1];\n return $date_out;\n}", "public function getDate4String($date=null){\n\t\treturn $this->getDateLang(date_format($this->createDate($date),\"d M Y\"));\n\t}", "function date($date) {\n\t\tif (!is_int($date)) {\n\t\t\t$date = strtotime($date);\n\t\t}\n\t\t$format = 'd. M y @ H:i';\n\t\tif (date('Y', $date) == date('Y')) {\n\t\t\t$format = 'd. M @ H:i';\n\t\t}\n\t\treturn date($format, $date);\n\t}", "public function getDate4Integer($date=null){\n\t\treturn date_format($this->createDate($date),\"d-m-Y\");\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function codeDate ($date) {\r\n\t $tab = explode (\"-\", $date);\r\n\t $r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\t return $r;\r\n\t}", "function convertdate($date) {\r\n\t$date = strtotime($date);\r\n\treturn date(\"M j, Y g:ia\", $date);\r\n}", "static public function formatDate($date)\n {\n $objDate = new DateTime($date);\n return $objDate->format('d/m/Y');\n }", "public static function short($date){\n if (empty($date)) return;\n $php_date = strtotime($date);\n $formatted_date = date('M. j, Y (D)', $php_date);\n return $formatted_date;\n }", "function convertDate_jmA_Amj($date)\r\n{\r\n\tsetlocale (LC_TIME, 'en_EN','en');\r\n\treturn strftime(\"%Y-%m-%d\", strtotime($date));\r\n}", "function format_date($d) {\r\n\t$month = array(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\r\n\t$date = explode(\"-\",$d);\r\n\tif(($date[1]-1) != 10) $index = str_replace(\"0\",\"\",$date[1]-1);\r\n\telse $index = $date[1]-1;\r\n\treturn $date[2].\" \".$month[$index].\" \".$date[0];\r\n}", "private function formatDate($date) {\n\t\tif ($date === '' || !$date) {\n\t\t\treturn;\n\t\t}\n\t\tif (DateTime::createFromFormat('Y-m-d', $date)) {\n\t\t\t$formatedDate = $date;\n }elseif (\\Zend_Date::isDate($date, \\Zend_Date::ISO_8601)) {\n $tmpDt = new \\Zend_Date($date, \\Zend_Date::ISO_8601);\n $formatedDate = $tmpDt->toString('Y-MM-dd');\n\t\t} else {\n\t\t\t$tmpDt = DateTime::createFromFormat('d/m/Y', $date);\n\t\t\t$formatedDate = $tmpDt->format('Y-m-d');\n\t\t}\n\t\treturn $formatedDate;\n\t}", "private function formatDate($data)\n {\n if ($data['year'] == '') {\n $data['year'] = '0000';\n }\n\n if ($data['month'] == '') {\n $data['month'] = '00';\n } elseif ($data['month'] < 10) {\n $data['month'] = '0' . $data['month'];\n }\n\n if ($data['day'] == '') {\n $data['day'] = '00';\n } elseif ($data['day'] < 10) {\n $data['day'] = '0' . $data['day'];\n }\n\n return $data['year'] . $data['month'] . $data['day'];\n }", "public function getDate($date){\n\t\t$date = explode('-', $date);\n\t\t$year = intval($date[0]);\n\t\t$month = $this->getMonthName(intval($date[1]));\n\t\t$day = intval($date[2]);\n\t\t\t\n\t\treturn $month . ' ' . $day . ', ' . $year;\n\t}", "function formatDate($date){\n $newDate = strtotime($date);\n $newFormat = date('D j/n Y', $newDate);\n echo $newFormat;\n}", "public function transform($date)\n {\n if (null === $date) {\n return '';\n }\n\n return $date->format('Y');\n }", "private function _radius_format_date($d){\n $arr_date = explode('/',$d);\n $month = intval($arr_date[0]);\n $m_arr = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');\n $day = intval($arr_date[1]);\n $year = intval($arr_date[2]);\n return \"$day \".$m_arr[($month-1)].\" $year\";\n }", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "private function convertMonthToDay($date)\n {\n $string = null;\n switch ($date) {\n case 1:\n $string = 'Senin';\n break;\n case 2:\n $string = 'Selasa';\n break;\n case 3:\n $string = 'Rabu';\n break;\n case 4:\n $string = 'Kamis';\n break;\n case 5:\n $string = 'Jumat';\n break;\n case 6:\n $string = 'Sabtu';\n break;\n case 7:\n $string = 'Minggu';\n break;\n default:\n $string = \"Undefined\";\n break;\n }\n return $string;\n }", "function dateformatusa($date)\n{\n\t$ndate = explode(\"-\",$date);\n\t$year = $ndate[2];\n\t$day = $ndate[0];\n\t$month = $ndate[1];\n\t\n\treturn $year . \"-\" . $month . \"-\" . $day;\n}", "function dateFormat($date){\n return strftime(\"%d. %m. %Y\", strtotime($date));\n}", "public function convertDate($date)\n {\n global $lng;\n \n return ilDatePresentation::formatDate(new ilDateTime($date,IL_CAL_DATETIME));\n }", "public function formatDate ($date)\n\t{\n\t\tif (!$date) {\n\t\t\treturn '';\n\t\t}\n\t\treturn date('m/d/Y', strtotime($date));\n\t}", "private function to_zruth_date($date) {\n if (strlen($date) >= 10 && substr($date, 4, 1) == '-' && substr($date, 7, 1) == '-')\n return substr($date, 8, 2) . '-' . substr($date, 5, 2) . '-' . substr($date, 0, 4);\n else\n return $date;\n }", "function convert_date($date) {\n\t// Bad date format: 01.09.2012\n\n\t// Detect date format\n\tif (preg_match('/20[0-9][0-9]-[0-9][0-9]-[0-3][0-9]/', $date)) {\n\t\t// Good format already\n\t\treturn $date;\n\t}\n\t$d = date_parse_from_format('j.n.Y', $date);\n\treturn date('Y-m-d', mktime(0,0,0,$d['month'], $d['day'], $d['year']));\n}", "private function formatDate($date)\n\t{\n\t\t$date_ary = date_parse($date);\n\t\treturn $date_ary['year'] . '-'\n\t\t\t\t. str_pad($date_ary['month'], 2, \"0\", STR_PAD_LEFT). '-'\n\t\t\t\t. str_pad($date_ary['day'], 2, \"0\", STR_PAD_LEFT) . 'T'\n\t\t\t\t. str_pad($date_ary['hour'], 2, \"0\", STR_PAD_LEFT) . ':'\n\t\t\t\t. str_pad($date_ary['minute'], 2, \"0\", STR_PAD_LEFT) . ':'\n\t\t\t\t. str_pad($date_ary['second'], 2, \"0\", STR_PAD_LEFT);\n\t}", "public static function StrToDate($date) {\n $ar = explode('/',$date);\n return $ar[2].'-'.$ar[1].'-'.$ar[0];\n }", "function dateformat($date)\n{\n\tif($date != \"0000-00-00\")\n\t{\n\t$ndate = explode(\"-\",$date);\n\t$year = $ndate[0];\n\t$day = $ndate[2];\n\t$month = intval($ndate[1])-1;\n\t$montharr = array(\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\");\n\t$month1 = $montharr[$month];\n\t\n\t\n\treturn $day . \" \" . $month1 . \" \" . $year;\n\t}\n\telse\n\treturn \"\";\n}", "function dateToDBDate($date)\n\t{\n\n\t\tif (is_numeric($date))\n\t\t{\n\t\t\treturn date('Y-m-d', $date);\n\t\t}\n\t\telse if (preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/', $date))\n\t\t{\n\t\t\t$arDate = explode('.', $date);\n\n\t\t\treturn $arDate[2].'-'.$arDate[1].'-'.$arDate[0];\n\t\t}\n\t\telse if (strtotime($date) > 0)\n\t\t{\n\t\t\treturn date('Y-m-d', strtotime($date));\n\t\t}\n\n\t\treturn '0000-00-00';\n\n\t}", "function dateFormat($date)\n{\n\t$date = date('y-m-d',strtotime($date));\n\treturn $date;\n}", "function formatDate(string $date): string\n{\n $dateTimeObject = new DateTime($date);\n $formattedDate = $dateTimeObject->format('d F Y');\n\n return $formattedDate;\n}", "function date_encode($date) {\n\tif (is_numeric(substr($date, 2, 1))) {\n\t\t$day = substr($date, 8, 2);\n\t\t$month = substr($date, 5, 2);\n\t\t$year = substr($date, 0, 4);\n\t} else {\n\t\t$day = substr($date, 0, 2);\n\t\t$month = substr($date, 3, 2);\n\t\t$year = substr($date, 6, 4);\n\t}\n\treturn $year . '-' . $month . '-' . $day;\n}", "protected function _convert_date($date)\n {\n }", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "function dateFormat($date)\n{\n\t$date_formated = '';\n \tif($date!='')\n \t{\n \t$date_formated = date('Y-m-d',strtotime($date));\n \t}\n \treturn $date_formated; \n}", "private static function formatQueryDate($date) {\n\t\t$dateComponents = self::parseDateArgument($date);\n\t\t$y = $dateComponents[0];\n\t\t$m = $dateComponents[1];\n\t\t$d = $dateComponents[2];\n\t\t$format = 'j M Y';\n\t\tif( preg_match('/[?]/', $d) ) {\n\t\t\t$format = 'M Y';\n\t\t\t$d = 1;\n\t\t}\n\t\tif( preg_match('/[?]/', $m) ) {\n\t\t\t$format = 'Y';\n\t\t\t$m = 1;\n\t\t}\n\t\tif( preg_match('/[?]/', $y) ) {\n\t\t\treturn $y;\n\t\t}\n\t\t$timestamp = mktime(0, 0, 0, intval($m) , intval($d), intval($y));\n\t\t$date = new DateTime(\"@$timestamp\");\n\t\treturn $date->format($format); // e.g. 1 Jan 2018 (no leading zero on days)\n\t}", "public function formatDate($var, DataContainer $dc)\r\n {\r\n\r\n $datum = date(\"Y-m-d\", $var);\r\n return $datum;\r\n }", "public function convertDateToDB($_date) {\n\t\tif(ereg(\"^([0-9]{1,2})-([0-9]{1,2})-([0-9]{4}).*$\",\n\t\t\t$_date, $_arrdt) !== false) {\n\t\t\treturn sprintf(\"%04.4d-%02.2d-%02.2d\",\n\t\t\t\t$_arrdt[3], $_arrdt[2], $_arrdt[1]);\n\t\t\t}\n\t\treturn false;\n\t}", "function datum($db_date) {\r\n return strftime('%d.%m.%Y', strtotime($db_date));\r\n }", "function date2YearMonth($date=null){\n if(!empty($date)){\n return date('Ym', strtotime($date));\n }else{\n return '';\n }\n }", "function codeDate ($date) \r\n\r\n{\r\n\r\n\t$tab = explode (\"-\", $date);\r\n\r\n\t$r = $tab[1].\"/\".$tab[2].\"/\".$tab[0];\r\n\r\n\treturn $r;\r\n\r\n}", "function dateformatindia($date)\n{\n\t$ndate = explode(\"-\",$date);\n\t$year = $ndate[0];\n\t$day = $ndate[2];\n\t$month = $ndate[1];\n\t\n\tif($date == \"0000-00-00\" || $date ==\"\")\n\treturn \"\";\n\telse\n\treturn $day . \"-\" . $month . \"-\" . $year;\n\t\n}", "public function convertDateToHTML($_date) {\n\t\tif(ereg(\"^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}).*$\",\n\t\t\t$_date, $_arrdt) !== false) {\n\t\t\treturn sprintf(\"%02.2d-%02.2d-%04.4d\",\n\t\t\t\t$_arrdt[3], $_arrdt[2], $_arrdt[1]);\n\t\t\t}\n\t\treturn $_date;\n\t}", "protected function makeDateString($dateArray) {\n\t\t\tswitch ($this->simu->getDateFormat()) {\n\t\t\t\tcase 'd/m/Y':\n\t\t\t\t\treturn $dateArray['day'] . \"/\" . $dateArray['month'] . \"/\" . $dateArray['year'];\n\t\t\t\tcase 'm/d/Y':\n\t\t\t\t\treturn $dateArray['month'] . \"/\" . $dateArray['day'] . \"/\" . $dateArray['year'];\n\t\t\t\tcase 'd-m-Y':\n\t\t\t\t\treturn $dateArray['day'] . \"-\" . $dateArray['month'] . \"-\" . $dateArray['year'];\n\t\t\t\tcase 'm-d-Y':\n\t\t\t\t\treturn $dateArray['month'] . \"-\" . $dateArray['day'] . \"-\" . $dateArray['year'];\n\t\t\t\tcase 'd.m.Y':\n\t\t\t\t\treturn $dateArray['day'] . \".\" . $dateArray['month'] . \".\" . $dateArray['year'];\n\t\t\t\tcase 'm.d.Y':\n\t\t\t\t\treturn $dateArray['month'] . \".\" . $dateArray['day'] . \".\" . $dateArray['year'];\n\t\t\t\tcase 'Y-m-d':\n\t\t\t\t\treturn $dateArray['year'] . \"-\" . $dateArray['month'] . \"-\" . $dateArray['day'];\n\t\t\t\tcase 'Y.m.d':\n\t\t\t\t\treturn $dateArray['year'] . \".\" . $dateArray['month'] . \".\" . $dateArray['day'];\n\t\t\t\tcase 'Y/m/d':\n\t\t\t\t\treturn $dateArray['year'] . \"/\" . $dateArray['month'] . \"/\" . $dateArray['day'];\n\t\t\t\tcase 'Y-d-m':\n\t\t\t\t\treturn $dateArray['year'] . \"-\" . $dateArray['day'] . \"-\" . $dateArray['month'];\n\t\t\t\tcase 'Y.d.m':\n\t\t\t\t\treturn $dateArray['year'] . \".\" . $dateArray['day'] . \".\" . $dateArray['month'];\n\t\t\t\tcase 'Y/d/m':\n\t\t\t\t\treturn $dateArray['year'] . \"/\" . $dateArray['day'] . \"/\" . $dateArray['month'];\n\t\t\t}\n\t\t\treturn null;\n\t}", "function date_sql2en($date)\r\n\t{\r\n\t\tif (!empty($date))\r\n\t\t{\r\n\t\t\t$date = explode(\"-\", $date);\r\n\t\t\t$date_fr = $date[1].\"/\".$date[2].\"/\".$date[0];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$date_fr = \"\";\r\n\t\t}\r\n\t\treturn $date_fr;\r\n\t}", "function diaMesAno($data1) {\n\t$myDateTime = DateTime::createFromFormat('Y-m-d', $data1);\n\t$convertida = $myDateTime->format('d/m/Y');\n\treturn ($convertida);\n}", "function get_date_numeral($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', '9999', $format);\n\t$format = str_replace('m', '99', $format);\n\t$format = str_replace('d', '99', $format);\n\treturn $format;\n}", "private function formatDate($date)\n {\n if (!$date instanceof \\DateTime) {\n return date(self::DATE_FORMAT, strtotime($date));\n }\n\n return $date->format(self::DATE_FORMAT);\n }", "static function convert_dateEnFr($date) {\r\n $tab = explode('-', $date);\r\n $result = $tab['2'] . \"-\" . $tab['1'] . \"-\" . $tab['0'];\r\n return $result;\r\n }", "public function changeDate($d) {\n\n $str = strtotime($d);\n\n return date('M d Y', $str);\n }", "static function convert_dateFrEn($date) {\r\n $tab = explode('-', $date);\r\n $result = $tab['0'] . \"-\" . $tab['1'] . \"-\" . $tab['2'];\r\n return $result;\r\n }", "public function convert_month_year_display($created_date){\n\t\tif(($created_date != '') && ($created_date != '0000-00-00') && ($created_date != '0000-00-00 00:00:00')){\n\t\t\t$c_d = date('M-Y', strtotime($created_date));\n\t\t\treturn $c_d;\n\t\t}\n\t}", "public function to_s() {\n $format = \"%04d-%02d-%02d\";\n\n return sprintf($format, $this->year, $this->month, $this->day);\n }", "function convDate($arg1) {\n\t\t$arr = explode(\"/\",$arg1);\n\t\treturn $arr[2].\"/\".$arr[0].\"/\".$arr[1];\n\t}", "public function getMDY($leadingZeros = false)\r\n\t{\r\n\t\tif ($leadingZeros)\r\n\t\t{\r\n\t\t\treturn $this->format('m/d/Y');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->format('n/j/Y');\r\n\t\t}\r\n\t}", "function COM_JSdate(&$date) {\r\n\t//note: the \"intval\" removes the leading zero which JS interprets as octal number;\r\n\t//\t\"-1\" needed because JS expects month rel to 0 (but not day) and same as \"intval\")\r\n\treturn $date->format(\"Y\").\",\".($date->format(\"m\")-1).\",\".intval($date->format(\"d\"));\r\n}", "public function format_date($created_date){\n \tif(($created_date != '') && ($created_date != '0000-00-00')){\n\t\t\t$f_d = date('jS M Y', strtotime($created_date));\n\t\t\treturn $f_d;\n\t\t}\n\t}", "public function dateStartFriendly(): string\n {\n return Carbon::parse($this->date_start)->format('d-m-Y');\n }", "function get_date_textual($format = 'Y-m-d') {\n\t$format = ($format == '') ? 'Y-m-d' : $format;\n\t$format = str_replace('Y', 'yyyy', $format);\n\t$format = str_replace('m', 'mm', $format);\n\t$format = str_replace('d', 'dd', $format);\n\treturn $format;\n}", "function DBDatetoDate($date, $dateOnly = true)\n\t{\n\n\t\tif ($date == '0000-00-00') return '';\n\n\t\tif ($dateOnly && strtotime($date) != 0) return date('d.m.Y', strtotime($date));\n\t\telse if (strtotime($date) != 0) return date('d.m.Y H:i:s', strtotime($date));\n\n\t}" ]
[ "0.762564", "0.7561066", "0.72350526", "0.7060821", "0.70260435", "0.685888", "0.66640884", "0.66613054", "0.6552548", "0.6547757", "0.65348643", "0.65010464", "0.64746785", "0.63732475", "0.6325718", "0.6311091", "0.6290509", "0.62798303", "0.6250596", "0.621686", "0.6216576", "0.6209414", "0.62075245", "0.6173168", "0.6171446", "0.616683", "0.6155377", "0.6152524", "0.61178714", "0.6117035", "0.6104115", "0.6068794", "0.60667235", "0.6066258", "0.6065491", "0.60642654", "0.605746", "0.60563636", "0.6056258", "0.60391444", "0.60391444", "0.60391444", "0.60391444", "0.60391444", "0.60391444", "0.60391444", "0.60391444", "0.6036733", "0.60207844", "0.6014402", "0.6010211", "0.6004846", "0.59971255", "0.59861535", "0.5983159", "0.597689", "0.5952055", "0.59506166", "0.59428436", "0.59373116", "0.5932056", "0.5930328", "0.59296876", "0.5924216", "0.5909037", "0.59020686", "0.59001416", "0.58679307", "0.5864519", "0.5860527", "0.58549494", "0.58483833", "0.5848103", "0.5842668", "0.5840102", "0.5840102", "0.583741", "0.58324414", "0.5823003", "0.5805153", "0.58050776", "0.57929444", "0.57912123", "0.5790254", "0.5787126", "0.5784127", "0.5779185", "0.5770451", "0.5768113", "0.57674426", "0.57667416", "0.57636344", "0.5752665", "0.5740721", "0.5722578", "0.5719482", "0.57169926", "0.5713358", "0.57091135", "0.57068914", "0.5704837" ]
0.0
-1
Display a listing of the resource.
public function __construct() { // $this->middleware(['role:admin ']); }
{ "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
// $supplier::where('s_no',$req>id)>update(['supplier_name'=>$req>supplier_name,'supplier_mobile'=>$req>supplier_mobile, 'supplier_phone'=>$req>supplier_phone,'supplier_email'=>$req>supplier_email,'supplier_photo'=>$req>supplier_photo, 'supplier_address'=>$req>supplier_address, 'supplier_acc_no'=>$req>supplier_acc_no, 'create_date'=>$req>create_date, 'supplier_remark'=>$req>supplier_remark, 'is_active'=>$req>is_active, ]);
public function edit_row(Request $req){ $affected1= Supplier::where('s_no',$req->s_no)->update(['supplier_name'=>$req->supplier_name,'supplier_mobile'=>$req->supplier_mobile, 'supplier_phone'=>$req->supplier_phone,'supplier_email'=>$req->supplier_email,'supplier_photo'=>$req->supplier_photo, 'supplier_address'=>$req->supplier_address, 'supplier_acc_no'=>$req->supplier_acc_no, 'create_date'=>$req->create_date, 'supplier_remark'=>$req->supplier_remark, 'is_active'=>$req->is_active, ]); $affected = Supplier::where('is_deleted',0)->paginate(7); //return "in edit function "; return redirect('displaySupplier')->with('Success','Supplier has been updateded successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request,Supplier $supplier)\n {\n\n $this->validate($request,[\n 'name' =>'required',\n // 'description' =>'required',\n 'status' =>'required|in:active,in-active',\n 'supplier_category_id' =>'required|exists:supplier_categories,id',\n 'company_name' =>'required',\n 'email' =>'required|email',\n 'address' =>'required|min:5',\n 'phone1' =>'required|numeric',\n // 'phone2' =>'numeric',\n // 'phone3' =>'numeric',\n 'mobile1' =>'required|numeric',\n // 'mobile2' =>'numeric',\n // 'mobile3' =>'numeric',\n ]);\n $theRequest = $request->all();\n $theRequest['mobile1'] = $request->mobile1;\n if (!empty($request->mobile2)){\n $theRequest['mobile2'] = $request->mobile2;\n }\n if (!empty($request->mobile3)){\n $theRequest['mobile3'] = $request->mobile3;\n }\n\n $theRequest['phone1'] = $request->phone1;\n if (!empty($request->phone2)){\n $theRequest['phone2'] = $request->phone2;\n }\n if (!empty($request->phone3)){\n $theRequest['phone3'] = $request->phone3;\n }\n\n $theRequest['staff_id'] = Auth::id();\n if ($supplier->update($theRequest)) {\n return redirect()\n ->route('system.supplier.edit', $supplier->id)\n ->with('status', 'success')\n ->with('msg', __('Successfully Edit Supplier'));\n }\n else {\n return redirect()\n ->route('system.supplier.edit')\n ->with('status', 'danger')\n ->with('msg', __('Sorry Couldn\\'t Edit Supplier'));\n }\n }", "public function UpdateSupplier(Request $request,$id){\n\n $validateData = $request->validate([\n 'name' => 'required|max:255',\n 'email' => 'required|max:255',\n 'phone' => 'required|max:255',\n 'address' => 'required',\n 'city' => 'required',\n ]);\n\n\n $data=array();\n $data['name']=$request->name;\n $data['email']=$request->email;\n $data['phone']=$request->phone;\n $data['address']=$request->address;\n $data['shop']=$request->shop;\n $data['accountholder']=$request->accountholder;\n $data['accountnumber']=$request->accountnumber;\n $data['bankname']=$request->bankname;\n $data['branchname']=$request->branchname;\n $data['city']=$request->city;\n $data['type']=$request->type;\n $image = $request->photo;\n\n $img=DB::table('suppliers')->where('id',$id)->first();\n if($image){\n $image_name = uniqid('uploads__',true);\n $ext= strtolower($image->getClientOriginalExtension());\n $image_full_name=$image_name.'.'.$ext;\n $upload_path='public/supplier/';\n $image_url=$upload_path.$image_full_name;\n $success=$image->move($upload_path,$image_full_name);\n $data['photo']=$image_url;\n $image_path = $img->photo;\n $done=unlink($image_path);\n $user=DB::table('suppliers')->where('id',$id)->update($data);\n return redirect()->route('all.supplier')->with('message','Supplier Updated Successfully.');\n \n }\n $user=DB::table('suppliers')->where('id',$id)->update($data);\n\n return redirect()->route('all.supplier')->with('message','Supplier Updated Successfully.');\n\n\n}", "public function update(Request $request, Supplier $supplier)\n {\n // return $request->all();\n\n $request->validate([\n 'supplier_name'=>'required|min:3',\n 'supplier_brand'=>'required',\n 'phone'=>'required|min:11|max:15',\n 'email'=>'required',\n ],[\n\n ]);\n $url_slug = Str::of($request->supplier_name)->slug('-');\n $data = [\n 'supplier_name'=>$request->supplier_name,\n 'supplier_brand'=>$request->supplier_brand,\n 'address'=>$request->address,\n 'phone'=>$request->phone,\n 'email'=>$request->email,\n 'supplier_slug'=>$url_slug,\n 'updated_at'=>Carbon::now()->toDateTimeString(),\n ];\n\n //image file update\n\n if($request->hasFile('supplier_img')){\n $image = $request->file('supplier_img');\n $image_name = $url_slug.'('.$request->id.')'.time().'.'.$image->getClientOriginalExtension();\n Image::make($image)->resize(250,250)->save(base_path('public/uploads/suppliers/'.$image_name));\n $data['supplier_img'] = $image_name;\n }\n $update = Supplier::where('supplier_status',1)\n ->where('id',$request->id)->update($data);\n\n if($update){\n Session::flash('update_success','Suppliers Information Updated Successfully !');\n return redirect('/admin/suppliers/view/'.$url_slug);\n }\n else{\n Session::flash('update_error','Something were wrong');\n return redirect('/admin/suppliers/view/'.$url_slug);\n }\n\n }", "public function update(Request $request, $id)\n {\n $supplier=Supplier::find($id);\n $this->validate($request,[\n 'name'=>'string|required',\n 'cnumber'=>['required', new PhoneNumber],\n 'email'=>'email|required',\n 'address' =>'string|required',\n ]);\n $data=$request->all();\n // return $data;\n $status=$supplier->fill($data)->save();\n if($status){\n request()->session()->flash('success','Supplier successfully updated');\n }\n else{\n request()->session()->flash('error','Error, Please try again');\n }\n return redirect()->route('supplier.index');\n }", "public function update(Request $request, charges $charges) \n {\n $this->authorize('sysAdmin');\n\n $data = request()->validate([\n\n 'name' => ['required', 'string', 'max:255'],\n 'email' => ['required', 'string', 'max:255'],\n 'password' => ['sometimes','string'],\n // 'contactNo' => ['required'],\n 'gender' => 'required',\n // 'jobtitle' => ['required']\n ]);\n\n // $job_id = jobtitles::where('title', $request['jobtitle'])->first()->id;\n\n // $check = charges::where('shiptype', $request['name'])->where('shiparea', $request['gender'])->where('shipweight', $request['email'])->get();\n\n //if(count($check)>0){\n // return back()->withErrors('alert','You are not allow to perfom such action!');\n // return Redirect::to('staff/charges/create')->withErrors('Duplicate input, Please check.')->withInput();\n // }else{\n \n $charges->shiptype = $request['name'];\n $charges->shipweight = $request['email'];\n $charges->shipfee =$request['password'];\n // $charges->shipfee = $request['contactNo'];\n $charges->shiparea = $request['gender'];\n // $charges->jobtitles_id = $job_id;\n $charges->save();\n $user_id = Auth::user()->id;\n $user_name1 = Auth::user()->custname;\n $user_name2 = Auth::user()->stfName;\n if(isset( $user_name1)){\n \n $user_name = $user_name1;\n }else{\n $user_name =$user_name2;\n }\n \n \n \n \n \n syslog::create([\n 'userid' => $user_id,\n 'username' => $user_name ,\n 'oid' => $charges->chargeid,\n 'action' => \"Shipment Fee edited, chargesController.update\",\n 'actioncode' => '3',\n \n \n \n ]);\n // }\n return redirect('staff/charges')->with('message', 'Shipment Fee record is Updated!');\n }", "public function update(Request $request, $id)\n {\n //\n \n // // dd($request->address);\n // Customer::where('id',$id)->update(\n // ['nama_customer'=>$request->nama_customer,\n // 'phone'=>$request->phone,\n // 'address'=>$request->address,\n // ]\n // );\n\n $this->_validation($request);\n $data = $request->all();\n $supplier = Supplier::findOrFail($id);\n $supplier->update($data);\n return redirect()->route('supplier.index')->with('message','data berhasil di update');\n\n }", "public function update(Request $request, Supplier $supplier)\n {\n //\n }", "public function update(Request $request, Supplier $supplier)\n {\n //\n }", "function update_supplier_details($id,$sup_code,$sup_name,$sup_vatno,$sup_blacklist,$sup_remarks){\n $query = \"UPDATE tbl_suppliers SET supplier_name='$sup_name',supplier_vatno='$sup_vatno',supp_blacklist='$sup_blacklist', supp_remarks = '$sup_remarks' WHERE supplier_id='$id'\";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public function updateChittagongData(Request $request){\n \n $zoneInfo = Zone::find($request->zoneAlise);\n $orgInfo = NsdName::find($request->organization);\n $tbl = $request->tbl;\n\n //$zone = $request->zoneAlise; // 'nsd'\n //$organization = $request->organization; // 'nsd_chattagram'\n $zone = $zoneInfo->alise; // 'nsd'\n $organization = $orgInfo->alise; // 'nsd_chattagram'\n\n $ss = $request;\n\n// Supplier information ======================================================\n if($tbl==1){ \n \\Session::put('zoneAlise', strtolower($zone));\n\n $ifexist = Supplier::where('all_org_id','=',$organization.'_'.$ss->id)->first();\n\n if(empty($ifexist)){\n $supplier = new Supplier();\n }else{\n $supplier = Supplier::find($ifexist->id);\n }\n $supplier->all_org_id = $organization.'_'.$ss->id;\n $supplier->company_name = $ss->company_name;\n $supplier->company_regi_number_nsd = $ss->company_regi_number_nsd;\n $supplier->mobile_number = $ss->mobile_number;\n $supplier->fax = $ss->fax;\n $supplier->email = $ss->email;\n $supplier->head_office_address = $ss->head_office_address;\n $supplier->tin_number = $ss->tin_number;\n $supplier->bank_account_number = $ss->bank_account_number;\n $supplier->date_of_enrollment = $ss->date_of_enrollment;\n $supplier->bank_name_and_branch = $ss->bank_name_and_branch;\n $supplier->rltn_w_acc_holder = $ss->rltn_w_acc_holder;\n $supplier->branch_office_address = $ss->branch_office_address;\n $supplier->intr_name = $ss->intr_name;\n $supplier->intr_designation = $ss->intr_designation;\n $supplier->intr_address = $ss->intr_address;\n $supplier->cur_reg_supplier_name = $ss->cur_reg_supplier_name;\n $supplier->cur_reg_supplier_address = $ss->cur_reg_supplier_address;\n $supplier->defaulter_before = $ss->defaulter_before;\n $supplier->company_partnership_act = $ss->company_partnership_act;\n $supplier->registered_as = $ss->registered_as;\n $supplier->des_of_sole_prtship = $ss->des_of_sole_prtship;\n $supplier->partners_name = $ss->partners_name;\n $supplier->partners_address = $ss->partners_address;\n $supplier->auth_prsn_name = $ss->auth_prsn_name;\n $supplier->auth_prsn_designation = $ss->auth_prsn_designation;\n $supplier->vat_registration_number = $ss->vat_registration_number;\n $supplier->bsti_certification = $ss->bsti_certification;\n $supplier->nid_number = $ss->nid_number;\n $supplier->trade_license_number = $ss->trade_license_number;\n $supplier->trade_license_address = $ss->trade_license_address;\n $supplier->registered_nsd_id = $ss->registered_nsd_id;\n $supplier->iso_certification = $ss->iso_certification;\n $supplier->supply_cat_id = $ss->supply_cat_id;\n $supplier->status_id = $ss->status_id;\n $supplier->profile_pic = $ss->profile_pic;\n $supplier->tin_certificate = $ss->tin_certificate;\n $supplier->testimonial = $ss->testimonial;\n $supplier->bangla_signature = $ss->bangla_signature;\n $supplier->english_signature = $ss->english_signature;\n $supplier->attested_photo = $ss->attested_photo;\n $supplier->attested_trade_lic = $ss->attested_trade_lic;\n $supplier->attested_nid_photocopy = $ss->attested_nid_photocopy;\n $supplier->attested_char_cert = $ss->attested_char_cert;\n $supplier->att_vat_reg_cert = $ss->att_vat_reg_cert;\n $supplier->att_vat_return_last_cert = $ss->att_vat_return_last_cert;\n $supplier->att_edu_cert = $ss->att_edu_cert;\n $supplier->lst_six_mnth_bnk_sttmnt = $ss->lst_six_mnth_bnk_sttmnt;\n $supplier->bnk_solvency_certi = $ss->bnk_solvency_certi;\n $supplier->non_judicial_stamp = $ss->non_judicial_stamp;\n $supplier->non_judicial_stamp = $ss->non_judicial_stamp;\n $supplier->created_by = $ss->created_by;\n $supplier->updated_by = $ss->updated_by;\n $supplier->updated_at = $insertInLogTable->updated_at;\n\n $supplier->save();\n }// End if tbl == 1 =========================\n\n // Supplier basic information ======================================================\n if($tbl==5){\n \\Session::put('zoneAlise', strtolower($zone));\n\n $ifexist = SupplierBasicInfo::where('all_org_sup_bas_info_id','=',$organization.'_'.$ss->id)->first();\n\n if(empty($ifexist)){\n $supplier_bsc_info = new SupplierBasicInfo();\n }else{\n $supplier_bsc_info = SupplierBasicInfo::find($ifexist->id);\n }\n\n //$supplier_bsc_info = new SupplierBasicInfo();\n\n $supplier_bsc_info->all_org_sup_bas_info_id = $ss->organization.'_'.$ss->id;\n $supplier_bsc_info->supplier_id = $ss->organization.'_'.$ss->supplier_id;\n $supplier_bsc_info->full_name = $ss->full_name;\n $supplier_bsc_info->father_name = $ss->father_name;\n $supplier_bsc_info->father_nid = $ss->father_nid;\n $supplier_bsc_info->mother_name = $ss->mother_name;\n $supplier_bsc_info->mother_nid = $ss->mother_nid;\n $supplier_bsc_info->permanent_address = $ss->permanent_address;\n $supplier_bsc_info->present_address = $ss->present_address;\n $supplier_bsc_info->birth_place = $ss->birth_place;\n $supplier_bsc_info->birth_date = $ss->birth_date;\n $supplier_bsc_info->height = $ss->height;\n $supplier_bsc_info->weight = $ss->weight;\n $supplier_bsc_info->color = $ss->color;\n $supplier_bsc_info->eye_color = $ss->eye_color;\n $supplier_bsc_info->identification_mark = $ss->identification_mark;\n $supplier_bsc_info->religion = $ss->religion;\n $supplier_bsc_info->nationality = $ss->nationality;\n $supplier_bsc_info->organization = $ss->organization;\n $supplier_bsc_info->rank_in_organization = $ss->rank_in_organization;\n $supplier_bsc_info->business_start_date = $ss->business_start_date;\n $supplier_bsc_info->organization_name = $ss->organization_name;\n $supplier_bsc_info->organization_branch = $ss->organization_branch;\n $supplier_bsc_info->membership_number = $ss->membership_number;\n $supplier_bsc_info->membrsip_cont_date = $ss->membrsip_cont_date;\n $supplier_bsc_info->date_of_registry = $ss->date_of_registry;\n $supplier_bsc_info->jn_date_of_prsnt_ocuptn = $ss->jn_date_of_prsnt_ocuptn;\n $supplier_bsc_info->des_of_pre_occu = $ss->des_of_pre_occu;\n $supplier_bsc_info->offence = $ss->offence;\n $supplier_bsc_info->offence_date = $ss->offence_date;\n $supplier_bsc_info->offence_place = $ss->offence_place;\n $supplier_bsc_info->des_of_offence = $ss->des_of_offence;\n $supplier_bsc_info->spouse_full_name = $ss->spouse_full_name;\n $supplier_bsc_info->spouse_nid = $ss->spouse_nid;\n $supplier_bsc_info->spouse_father_name = $ss->spouse_father_name;\n $supplier_bsc_info->spouse_father_nid = $ss->spouse_father_nid;\n $supplier_bsc_info->spouse_mother_name = $ss->spouse_mother_name;\n $supplier_bsc_info->spouse_mother_nid = $ss->spouse_mother_nid;\n $supplier_bsc_info->spouse_per_address = $ss->spouse_per_address;\n $supplier_bsc_info->spouse_pre_address = $ss->spouse_pre_address;\n $supplier_bsc_info->spouse_birth_place = $ss->spouse_birth_place;\n $supplier_bsc_info->spouse_birth_date = $ss->spouse_birth_date;\n $supplier_bsc_info->spouse_nationality = $ss->spouse_nationality;\n $supplier_bsc_info->spouse_occupation = $ss->spouse_occupation;\n $supplier_bsc_info->applicant_signature = $ss->applicant_signature;\n $supplier_bsc_info->applicant_seal = $ss->applicant_seal;\n $supplier_bsc_info->signature_place = $ss->signature_place;\n $supplier_bsc_info->signature_date = $ss->signature_date;\n $supplier_bsc_info->created_by = $ss->created_by;\n $supplier_bsc_info->updated_by = $ss->updated_by;\n $supplier_bsc_info->updated_at = $insertInLogTable->updated_at;\n\n $supplier_bsc_info->save();\n }// End if tbl == 5 =========================\n\n // Item information ======================================================\n if($tbl==2){\n \\Session::put('zoneAlise', strtolower($zone));\n\n $ifexist = Item::where('all_org_item_id','=',$organization.'_'.$ss->id)->first();\n\n if(empty($ifexist)){\n $item = new Item();\n }else{\n $item = Item::find($ifexist->id);\n }\n\n //$item = new Item();\n\n $item->all_org_item_id = $ss->organization.'_'.$ss->id;\n $item->imc_number = $ss->imc_number;\n $item->item_name = $ss->item_name;\n $item->model_number = $ss->model_number;\n $item->item_cat_id = $ss->item_cat_id;\n $item->nsd_id = $ss->nsd_id;\n $item->unit_price = $ss->unit_price;\n $item->unit_price_in_bdt = $ss->unit_price_in_bdt;\n $item->currency_name = $ss->currency_name;\n $item->conversion = $ss->conversion;\n $item->discounted_price = $ss->discounted_price;\n $item->discounted_price_in_bdt = $ss->discounted_price_in_bdt;\n $item->item_deno = $ss->item_deno;\n $item->manufacturing_country = $ss->manufacturing_country;\n $item->source_of_supply = $ss->source_of_supply;\n $item->other_info_about_itme = $ss->other_info_about_itme;\n $item->budget_code = $ss->budget_code;\n $item->status_id = $ss->status_id;\n $item->created_by = $ss->created_by;\n $item->updated_by = $ss->updated_by;\n $item->updated_at = $insertInLogTable->updated_at;\n\n $item->save();\n }// End if tbl == 2 =========================\n\n // Tender information ======================================================\n if($tbl==3){\n \\Session::put('zoneAlise', strtolower($zone));\n\n $ifexist = Tender::where('all_org_tender_id','=',$organization.'_'.$ss->id)->first();\n\n if(empty($ifexist)){\n $tender = new Tender();\n }else{\n $tender = Tender::find($ifexist->id);\n }\n $tender->all_org_tender_id = $ss->organization.'_'.$ss->id;\n $tender->po_number = $ss->po_number;\n $tender->tender_title = $ss->tender_title;\n $tender->tender_number = $ss->tender_number;\n $tender->tender_description = $ss->tender_description;\n $tender->tender_opening_date = $ss->tender_opening_date;\n $tender->supplier_id = $ss->supplier_id;\n $tender->work_order_date = $ss->work_order_date;\n $tender->date_line = $ss->date_line;\n\n\n $tender->delivery_date = $ss->delivery_date;\n $tender->imc_number = $ss->imc_number;\n $tender->tender_cat_id = $ss->tender_cat_id;\n $tender->nsd_id = $ss->nsd_id;\n $tender->other_info_about_tender = $ss->other_info_about_tender;\n $tender->specification = $ss->specification;\n $tender->notice = $ss->notice;\n $tender->open_tender = $ss->open_tender;\n $tender->number_of_lot_item = $ss->number_of_lot_item;\n $tender->status_id = $ss->status_id;\n $tender->created_by = $ss->created_by;\n $tender->updated_by = $ss->updated_by;\n $tender->updated_at = $insertInLogTable->updated_at;\n\n $tender->save();\n }// End if tbl == 3 =========================\n\n // Item To Tender information ======================================================\n if($tbl==4){\n \\Session::put('zoneAlise', strtolower($zone));\n\n $ifexist = ItemToTender::where('all_org_itmtotender_id','=',$organization.'_'.$ss->id)->first();\n\n if(empty($ifexist)){\n $itemtotender = new ItemToTender();\n }else{\n $itemtotender = ItemToTender::find($ifexist->id);\n }\n\n $itemtotender->all_org_itmtotender_id = $ss->organization.'_'.$ss->id;\n $itemtotender->tender_id = $ss->organization.'_'.$ss->tender_id;\n $itemtotender->item_id = $ss->organization.'_'.$ss->item_id;\n $itemtotender->unit_price = $ss->unit_price;\n $itemtotender->unit_price_in_bdt = $ss->unit_price_in_bdt;\n $itemtotender->currency_name = $ss->currency_name;\n $itemtotender->conversion = $ss->conversion;\n $itemtotender->quantity = $ss->quantity;\n $itemtotender->discount_price = $ss->discount_price;\n $itemtotender->discount_price_in_bdt = $ss->discount_price_in_bdt;\n $itemtotender->total = $ss->total;\n $itemtotender->status_id = $ss->status_id;\n $itemtotender->created_by = $ss->created_by;\n $itemtotender->updated_by = $ss->updated_by;\n\n $itemtotender->save();\n }// End if tbl == 4 =========================\n \n \n }", "public function updateRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->update([$request->column_name=>$request->value]);\n if ($result) echo 'Data Updated';\n }", "public function update(Request $request, $supplier)\n {\n\n try {\n $supplier = Supplier::find($supplier);\n $supplier->update($request->all());\n $messageType = 1;\n $message = \"Supplier Updated successfully !\";\n\n } catch(\\Illuminate\\Database\\QueryException $ex){\n $messageType = 2;\n $message = \"Supplier Update failed !\";\n }\n return redirect(route('supplier.index'))->with('messageType',$messageType)->with('message',$message);\n }", "public function update_Hotel2($id){\n $data['suplier']=Supplier::join('sup_services','sup_services.sup_id','=','suppliers.s_no')\n ->join('services','services.ser_id','=','sup_services.service_id')\n ->where(['suppliers.is_active'=>1,'suppliers.is_deleted'=>0,'services.ser_id'=>2])->get();\n \n \n $data['emp']=Employee::join('users','users.id','=','employees.emp_id')\n ->where('users.is_active',1)->where('users.is_delete',0)\n ->where('employees.is_active',1)->where('employees.deleted',0)->get(); \n $data['data']=HotelService::join('currency','currency.cur_id','=','hotel_services.ses_cur_id')\n ->join('suppliers','suppliers.s_no','=','hotel_services.due_to_supp')\n ->join('employees','employees.emp_id','=','hotel_services.due_to_customer')\n ->join('logs','logs.service_id','=','hotel_services.hotel_id')\n ->where('hotel_services.hotel_id',$id)->get();\n foreach( $data['data'] as $aff){ \n $sup=$aff->due_to_supp;\n }\n $data['cur']=Supplier::join('sup_currency','sup_currency.sup_id','=','suppliers.s_no')\n ->join('currency','currency.cur_id','=','sup_currency.cur_id')\n ->where(['suppliers.is_active'=>1,'suppliers.is_deleted'=>0,'suppliers.s_no'=>$sup])->get();\n \n return view('up_err_hotel',$data)->with('seccess','Seccess Data Update');\n}", "public function update(Request $request, $id)\n {\n $supplier = Supplier::findOrFail($id);\n $data = $request->all();\n\n $validasi = Validator::make($data,[\n 'nama_supplier'=>'required|max:255',\n 'alamat_supplier'=>'required|max:255'\n ]);\n\n if($validasi->fails()){\n return redirect()->route('supplier.edit',[$id])->withErrors($validasi);\n }\n\n $supplier->update($data);\n return redirect()->route('supplier.index')->with('success','Supplier Berhasil diupdate');\n }", "public function update(Request $request, ss $ss)\n {\n App\\ss::where('active',1)\n ->where('prijs','500')\n ->update('rented');\n }", "public function updatedriver(Request $request)\n {\n $postdata=$request->input();\n\n driver::where('did',$postdata['driverid'])->Update(['name'=>$postdata['drivername'],'email'=>$postdata['Email'],['age'=>$postdata['age'],'phone'=>$postdata['phone'],['cnic'=>$postdata['cnic'],'duty_start'=>$postdata['duty_start'],'duty_end'=>$postdata['duty_end']]);\n die();\n\n // echo \"<pre>\";\n // print_r($postdata);\n // die();\n }", "public function update(Request $request, $supplier_id)\n {\n $supplier = Supplier::findorFail($supplier_id);\n \n $validator = validator()->make($request->all(), [\n 'product_id' =>'required',\n 'supplier_name' => 'required|max:100',\n 'supplier_category' => 'required',\n ]);\n \n if ($validator->fails()) {\n\n flash(trans('messages.parameters-fail-validation'),'danger');\n return back()->withErrors($validator)->withInput();\n }\n extract($request->all());\n $supplier->product_id = $product_id;\n $supplier->supplier_name = $supplier_name;\n $supplier->supplier_category = $supplier_category;\n $supplier->save();\n\n if($request->wantsJson()){\n return response([\n \"message\" =>trans('Supplier details updated successfully!!'),\n \"status_code\" =>201\n ],201);\n }\n flash(trans('Supplier details updated successfully!!'),'success');\n return back();\n\n }", "public function update(Request $request, $id)\n {\n $supplier = Supplier::find($id);\n $supplier->supplier_name = $request->supplier_name;\n $supplier->company_name = $request->company_name;\n $supplier->telephone = $request->telephone;\n $supplier->email = $request->email;\n $supplier->address = $request->address;\n $supplier->supplier_type = $request->supplier_type;\n $supplier->save(); \n \\Session::put('info','Supplier has been updated successfully!'); \n return redirect('supplier');\n }", "public function update(Request $request, Supplier $supplier)\n {\n // Validation\n $request->validate([\n 'name' => 'required',\n \"company_name\" => 'required',\n \"email\" => 'required',\n \"phone\" => 'required',\n \"address\" => 'required'\n ]);\n \n // Data update\n $supplier->name = $request->name;\n $supplier->company_name = $request->company_name;\n $supplier->email= $request->email;\n $supplier->phone= $request->phone;\n $supplier->address= $request->address;\n $supplier->save();\n \n //redirect\n return redirect()->route('suppliers.index');\n }", "public function update(Request $request)\n\t{\n\t\t$suppliersRequest = json_decode($request->input('suppliers'));\n\n\t\tforeach ($suppliersRequest as $key => $supplierRequest) {\n\t\t\ttry {\n\n\t\t\t\t$supplierObject = Supplier::findOrFail($supplierRequest->id);\n\n\t\t\t\t$supplierObject->company_name \t\t= $supplierRequest->company_name;\n\t\t\t\t$supplierObject->contact_name \t\t= $supplierRequest->contact_name;\n\t\t\t\t$supplierObject->contact_title \t\t= $supplierRequest->contact_title;\n\t\t\t\t$supplierObject->gender \t\t\t\t= \t$supplierRequest->gender;\n\t\t\t\t$supplierObject->supplier_type_id\t\t= $supplierRequest->supplier_type_id;\n\t\t\t\t$supplierObject->phone \t\t= $supplierRequest->phone;\n\t\t\t\t$supplierObject->email \t\t= $supplierRequest->email;\n\t\t\t\t$supplierObject->country_id \t\t= $supplierRequest->country_id;\n\t\t\t\t$supplierObject->city_id \t\t= $supplierRequest->city_id;\n\t\t\t\t$supplierObject->region \t\t= $supplierRequest->region;\n\t\t\t\t$supplierObject->postal_code \t\t= $supplierRequest->postal_code;\n\t\t\t\t$supplierObject->address \t\t= $supplierRequest->address;\n\t\t\t\t$supplierObject->detail \t\t= $supplierRequest->detail;\n\t\t\t\t$supplierObject->branch_id \t\t= $supplierRequest->branch_id;\n\t\t\t\t$supplierObject->status \t\t= $supplierRequest->status;\n\t\t\t\t$supplierObject->updated_by \t\t= auth::id();\n\n\t\t\t\t$supplierObject->save();\n\n\t\t\t\t$suppliersResponse[] = $supplierObject;\n\t\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn Response()->Json($suppliersResponse);\n\t}", "public function updateteacher(Request $req, $teacher_id){\n\n \n $data=array();\n\n $data['teacher_name']=$req->teacher_name ;\n $data['teacher_phone']=$req->teacher_phone ;\n $data['teacher_address']=$req->teacher_address ;\n $data['teacher_department']=$req->teacher_department ;\n\n\n\n DB::table('teachers_tbl')\n ->where('teacher_id', $teacher_id)\n ->update($data);\n \n \n Session::put('exception', 'teacher update successfully');\n return Redirect::to('/allteacher');\n\n \n\n\n\n\n}", "public function editSupplier() {\n $arrPageData['arrSessionData'] = $this->session->userdata;\n $supplier_id = $this->input->post('adminuser_id');\n if ($this->input->post('editcontract_start')) {\n $start_date = $this->input->post('editcontract_start');\n } else {\n $start_date = '';\n }\n if ($this->input->post('editcontract_end')) {\n $end_date = $this->input->post('editcontract_end');\n } else {\n $end_date = '';\n }\n if (isset($supplier_id)) {\n\n $data = array(\n 'supplier_name' => $this->input->post('editsupplier_name'),\n 'type' => $this->input->post('service_type'),\n 'account_id' => $arrPageData['arrSessionData']['objSystemUser']->accountid,\n 'ref_no' => $this->input->post('editref_code'),\n 'support_email' => $this->input->post('editsupport_email'),\n 'support_number' => $this->input->post('editsupport_number'),\n 'service_level' => $this->input->post('editservice_level'),\n 'response' => $this->input->post('edit_response'),\n 'contract_startdate' => $start_date,\n 'contract_enddate' => $end_date,\n 'contract_name' => $this->input->post('editcontract_name'),\n 'supplier_title' => $this->input->post('editcontract_title'),\n 'contract_no' => $this->input->post('editcontract_number'),\n 'contract_email' => $this->input->post('editcontract_email'),\n 'supplier_address' => $this->input->post('edit_address'),\n 'supplier_city' => $this->input->post('edit_city'),\n 'supplier_state' => $this->input->post('edit_state'),\n 'supplier_postcode' => $this->input->post('edit_postcode')\n );\n\n $this->db->where('supplier_id', $supplier_id);\n $this->db->update('suppliers', $data);\n return 1;\n } else {\n return False;\n }\n }", "function update_food_id1($id,$data){\n$this->db->where('SlNo', $SlNo);\n$this->db->update('food_items', $data);\n}", "public function savety2receipt(Request $request) {\n $receptDate = Carbon::now()->format('Y-m-d');\n $expDate = Carbon::now()->addDays(365)->format('Y-m-d');\n //echo $receptDate; echo \"<br>\"; echo $expDate; echo \"<br>\"; exit;\n DB::table('ty2queuepatients')->where('id', $_POST['ty2qid'])->update(['receipt_no' => $_POST['receptno'], 'receipt_date' => $receptDate, 'expiry_date' => $expDate, 'action' => 1, 'q_status' =>0]);\n return 1;\n \n }", "public function student_won_update(Request $request){\n $student_id = Session::get('student_id');\n $data =array();\n\n $data['student_fname'] = $request->student_fname;\n\n $data['student_surname'] = $request->student_surname;\n\n\n $data['student_password'] = md5($request->student_password);\n $data['student_phone'] = $request->student_phone;\n\n\n DB::table('student_tbl')\n ->where('student_id',$student_id)\n ->update($data);\n Session::put('exception','Student Update Successfully ');\n return Redirect::to('/student_setting');\n }", "public function update(Request $request, $id)\n {\n //\n \n $app_user_id = Auth::user()->id;\n \n $booking_id = $id;\n $approval = $request->input('approval');\n $approval_pickup_time = $request->input('approval_pickup_time');\n $approval_return_time = $request->input('approval_return_time');\n $driver_id = $request->input('driver_id');\n $plate_no = $request->input('plate_no');\n $approver_description = $request->input('approver_description');\n \n\n if($approval===false||$approval==false||$approval==\"false\"){\n try{\n DB::statement(DB::raw(\"update bookings set approval = $approval, approver_description =\n '$approver_description',approver_user_id=$app_user_id,updated_at=now() where booking_id = $id\"));\n if(App::getLocale()=='fa'){\n return \"رزرو را رد نمودید\"; \n }\n return \"you have rejected the booking\";\n\n } catch(QueryException $e){\n return $e->getMessage();\n }\n \n }else{\n \n if($approval == true || $approval ==\"true\"|| $approval === true){\n $rules = array(\n 'approval_pickup_time' => 'required|date',\n 'approval_return_time' => 'required|date|after:approval_pickup_time',\n 'driver_id' => 'required',\n 'plate_no' => 'required',\n );\n $validator = Validator::make($request->all(),$rules);\n if($validator->fails()){\n return $validator->errors()->toArray();\n }\n else{\n try{\n DB::statement(DB::raw(\"update bookings set plate_no=$plate_no, approval =$approval,approval_pickup_time='$approval_pickup_time'\n ,approval_return_time='$approval_return_time',driver_id=$driver_id,approver_description = '$approver_description',approver_user_id=$app_user_id,\n updated_at=now() where \n booking_id=$id\"));\n if(App::getLocale()=='fa'){\n return \"موفقانه تصویب گردید.\";\n }\n return \"successfully approved\";\n }\n catch(QueryException $e){\n return $ex->getMessage();\n }\n }\n }\n }\n }", "public function update(Request $request)\n {\n $this->validate($request, [\n\n 'supplier_id' => 'required',\n 'req_branch' => 'required',\n 'del_branch' => 'required',\n 'requested_by'=> 'required',\n \n ]);\n \n $po_number = $request->input('po_number');\n \n $order_quantity_old = $request->input('quantity_old');\n $order_product_id_array = $request->input('product_name');\n $order_quantity_array = $request->input('quantity');\n $order_price_min_array = $request->input('price_min');\n $order_price_max_array = $request->input('price_max');\n \n\n $form_data = array(\n 'supplier_id' => $request->supplier_id,\n 'req_branch' => $request->req_branch,\n 'del_branch' => $request->del_branch\n\n ); \n\n Purchase::whereId($po_number)->update($form_data);\n \n for($i = 0; $i < count($order_product_id_array); $i++){\n\n \n $form_order = array(\n 'product_id' => $order->product_id = $order_product_id_array[$i],\n 'quantity' => $order->quantity = $order_quantity_array[$i] \n );\n\n $order->quantity_old = $order_quantity_old[$i];\n $order->quantity = $order_quantity_array[$i];\n\n Order::where('po_number', $po_number)->where('product_id', $order_product_id_array[$i])->update($form_order);\n\n DB::table('products')->where('id', $order_product_id_array[$i])->increment('quantity', $order->quantity_old);\n DB::table('products')->where('id', $order_product_id_array[$i])->decrement('quantity', $order->quantity);\n }\n\n \n $data['suppliers'] = Supplier::all();\n $data['branches'] = Branch::all();\n $data['purchases'] = Purchase::orderBy('id', 'DESC')->get();\n return view('purchase.index', $data);\n }", "public function update(Request $request, $id)\n {\n $supplier = Supplier::findOrFail($request->id);\n $supplier->name = $request->name;\n $supplier->partner_number = $request->partner_number;\n $supplier->id_number = $request->id_number;\n $supplier->address_1 = $request->address_1;\n $supplier->address_2 = $request->address_2;\n $supplier->contact_number = $request->contact_number;\n $supplier->email = $request->email;\n if($supplier->save())\n {\n return \\response()->json(['status'=>'ok']); \n }\n }", "public function updateShop()\n {\n $array = [\n 'product_id' => request()->input('productId'),\n 'productName' => request()->input('productName'),\n 'productDesc' => request()->input('productDesc'),\n 'productPrice' => request()->input('productPrice')\n ];\n\n DB::table('tbl_products')->where('product_id',$array['product_id'])->update([\n 'product_name' => $array['productName'],\n 'product_desc' => $array['productDesc'],\n 'product_price' => $array['productPrice']\n ]);\n\n return redirect('cmsshop/'.$array['product_id']);\n }", "public function savety2groupreceipt(Request $request) {\n $receptDate = Carbon::now()->format('Y-m-d');\n $expDate = Carbon::now()->addDays(365)->format('Y-m-d');\n DB::table('ty2queuepatients')->where('tytq_id', $_POST['ty2qid'])->update(['receipt_no' => $_POST['receptno'], 'receipt_date' => $receptDate, 'expiry_date' => $expDate, 'action' => 1, 'q_status' =>0]);\n return 1;\n }", "public function update(Request $request)\n {\n $affect_id = $request->input('m_affect_id');\n $affectation = Affectation::find($affect_id);\n /* $affectation->id_emp = $request->input('id_emp');*/\n $affectation->inv_laptop = $request->input('m_invent_lap');\n $affectation->desc_laptop = $request->input('m_desc_lap');\n $affectation->serial_laptop = $request->input('m_serial_lap'); \n $affectation->nom_laptop = $request->input('m_nom_lap');\n $affectation->inv_radio = $request->input('m_invent_vhf');\n $affectation->desc_radio = $request->input('m_desc_vhf');\n $affectation->serial_radio = $request->input('m_serial_vhf');\n $affectation->call_radio = $request->input('m_callsign');\n $affectation->inv_thuraya = $request->input('m_invent_thuraya');\n $affectation->desc_thuraya = $request->input('m_desc_thuraya');\n $affectation->serial_thuraya = $request->input('m_serial_thuraya'); \n $affectation->sim_thuraya = $request->input('m_sim_thuraya');\n $affectation->numero_thuraya = $request->input('m_num_tel');\n $affectation->comment_affect = $request->input('m_affect_comment');\n\n //return $request->input();\n // Copy the raw into Histo_Affectation before update\n DB::insert(\"insert into Histo_Affectations (id_emp, inv_laptop, desc_laptop, serial_laptop, nom_laptop, inv_radio, desc_radio, \n serial_radio, call_radio, inv_thuraya, desc_thuraya, serial_thuraya, sim_thuraya, numero_thuraya, created_at) \n select id_emp, inv_laptop, desc_laptop, serial_laptop, nom_laptop, inv_radio, desc_radio, serial_radio, call_radio, inv_thuraya, \n desc_thuraya, serial_thuraya, sim_thuraya, numero_thuraya, ?\n From Affectations \n Where inv_laptop = ? OR inv_radio = ? OR inv_thuraya = ?\", [ date(\"Y-m-d\"), $request->input('m_invent_lap'), $request->input('m_invent_vhf'), $request->input('m_invent_thuraya')] );\n \n $affectation->save();\n \n // Update the value of CallSign if changed\n Employe::where('id_emp',$request->input('m_id_emp'))\n ->update(array('callsign'=>$request->input('m_callsign')));\n\n // Update Assets with Employee Id\n Asset::where('inventory_num',$request->input('m_invent_lap'))\n ->update([\n 'emp_id' => $request->input('m_id_emp'),\n 'affect_id' => $affectation->id_affect,\n 'affect_date' => date(\"Y-m-d\")\n ]); \n\n Asset::where('inventory_num',$request->input('m_invent_lap_old'))\n ->update([\n 'emp_id' => null,\n 'affect_id' => null,\n 'affect_date' => null\n ]); \n\n Asset::where('inventory_num',$request->input('m_invent_vhf'))\n ->update([\n 'emp_id' => $request->input('m_id_emp'),\n 'affect_id' => $affectation->id_affect,\n 'affect_date' => date(\"Y-m-d\")\n ]);\n\n Asset::where('inventory_num',$request->input('m_invent_vhf_old'))\n ->update([\n 'emp_id' => null,\n 'affect_id' => null,\n 'affect_date' => null\n ]); \n\n Asset::where('inventory_num',$request->input('m_invent_thuraya'))\n ->update([\n 'emp_id' => $request->input('m_id_emp'),\n 'affect_id' => $affectation->id_affect,\n 'affect_date' => date(\"Y-m-d\")\n ]); \n Asset::where('inventory_num',$request->input('m_invent_thuraya_old'))\n ->update([\n 'emp_id' => null,\n 'affect_id' => null,\n 'affect_date' => null\n ]);\n\n \n return redirect('affectation')->with('Ok_Message','ok');\n\n }", "public function update(Request $request,$id)\n {\n $postData = $request->all();\n dd($postdata);\n /*$data=User::find($id)->update($postData);*/\n /* $name = $request->input('name');\n $id = $request->input('id');\n $email = $request->input('email');\n // $today = date(\"y/m/d\");\n $phone = $request->input('phone');\n $password = $request->input('password');\n $role = $request->input('role');\n $location = $request->input('location');\n */\n /* $data= DB::update(\"UPDATE `tbl_webusers` SET `name`='$name',`email`='$email',`phone`='$phone',`password`='$password',`role`='$role',`location`='$location' WHERE `id`= $id\");\n dd($admin_update);*/\n \n }", "public function update(Request $request, $supplier)\n {\n $supplier = Crypt::decrypt($supplier);\n $a = Supplier::findorFail($supplier);\n $a->name = $request->name;\n $a->save();\n session()->flash('alert-warning', 'Supplier Updated');\n return redirect('/supplier');\n }", "public function update(Request $request,$id)\n {\n $data = $request->all();\n\n if(isset($data['supplier'])){\n $data['supplier'] = 1;\n }\n if(isset($data['customer'])){\n $data['customer'] = 1;\n }\n if(isset($data['status'])){\n $data['status'] = 1;\n }\n\n unset($data['_token']);\n unset($data['_method']);\n \n party::where('id',$id)->update($data);\n return redirect(route('party.index'))->with('success','Party Details Updated Successfully');\n }", "public function update(Request $req,$id)\n\t{\n\t\tif(Auth::user()->type=='admin'){\n\t\t\t$rules=[\n\t\t\t\t'project_id'=>'required|exists:projects,id',\n\t\t\t\t'supplier_id'=>'required|exists:suppliers,id',\n\t\t\t\t'type'=>'required|exists:store_types,name',\n\t\t\t\t'amount'=>'required|numeric',\n\t\t\t\t'value'=>'numeric',\n\t\t\t\t'amount_paid'=>'numeric'\n\t\t\t];\n\t\t\t$error_messages=[\n\t\t\t\t'project_id.required'=>'يجب أختيار مشروع',\n\t\t\t\t'project_id.exists'=>'المشروع يجب أن يكون موجود بقاعدة البيانات',\n\t\t\t\t'supplier_id.required'=>'يجب أختيار مقاول',\n\t\t\t\t'supplier_id.exists'=>'المقاول يجب أن يكون موجود بقاعدة البيانات',\n\t\t\t\t'type.required'=>'يجب أدخال نوع الخام',\n\t\t\t\t'type.exists'=>'نوع الخام يجب أن يكون موجود بقاعدة البيانات',\n\t\t\t\t'amount.required'=>'يجب أدخال الكمية',\n\t\t\t\t'amount.numeric'=>'الكمية يجب أن تتكون من أرقام فقط',\n\t\t\t\t'value.numeric'=>'القيمة يجب أن تتكون من أرقام فقط',\n\t\t\t\t'amount_paid.numeric'=>'المبلغ المدفوع يجب أن يتكون من أرقام فقط'\n\t\t\t];\n\t\t\t$validator=Validator::make($req->all(),$rules,$error_messages);\n\t\t\tif($validator->fails()){\n\t\t\t\treturn redirect()->back()->withErrors($validator)->withInput();\n\t\t\t}\n\t\t\t$store=Store::findOrFail($id);\n\t\t\t$store->type=$req->input('type');\n\t\t\t$store->value=$req->input('value');\n\t\t\t$store->amount=$req->input('amount');\n\t\t\t$store->amount_paid=$req->input('amount_paid');\n\t\t\t$store->project_id=$req->input('project_id');\n\t\t\t$store->supplier_id=$req->input('supplier_id');\n\t\t\t$saved=$store->save();\n\t\t\tif(!$saved){\n\t\t\t\treturn redirect()->back()->with('update_error','حدث عطل خلال أضافة هذه الكمية من الخامو يرجى المحاولة فى وقت لاحق');\n\t\t\t}\n\t\t\treturn redirect()->back()->with('success','تم شراء الخام بنجاح و تم التخزين');\n\t\t}\t\t\n\t\telse\n\t\t\tabort('404');\t\n\t}", "public function postUpdate(Request $request)\n {\n // dd($request->all());\n // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription=Subscription::findOrFail($request->id);\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data updated successfully'));\n \n \n \n\n }", "public function update($id, Request $request)\n {\n//\n// $name = $request->name;\n// $num = $request->final;\n// //$result = new Result();\n// $result = Result::firstOrNew(array('id'=>$id,'sub_id'=>$request->sub_id));\n// //$result->id = $id;\n// //$result->sub_id = $request->sub_id;\n// $result->e_id = 1;\n// $result->marks = 0;\n// $result->quiz =$request->quiz;\n// $result->classPerformance =$request->class_performance ;\n// $result->final = $request->final;\n// $result->save();\n// return compact('name','num','id') ;\nreturn $id;\n }", "public function update(Request $request, Supplier $supplier)\n {\n $supplier->update($request->all());\n flash('تمت العملية بنجاح')->success();\n return redirect()->route('suppliers.index');\n }", "public function update(Request $request, Location $location,$id)\n {\n $location = Ho_details::find($id);\n $validator = Validator::make($request->all(), [\n 'gst_number' => 'required',\n 'address_line_1' => 'required',\n 'name' => 'required',\n 'state_id' => 'required',\n 'postal_code' => 'required',\n 'name' => 'required|unique:ho_details,name,'.$id.',id,deleted_at,NULL,gst_number,'.$request->gst_number,\n ])->validate();\n\n \n $location->name = $request->name;\n $location->gst_number = $request->gst_number;\n $location->address_line_1 = $request->address_line_1;\n $location->address_line_2 = $request->address_line_2;\n $location->land_mark = $request->land_mark;\n $location->state_id = $request->state_id;\n $location->district_id = $request->district_id;\n $location->city_id = $request->city_id;\n $location->postal_code = $request->postal_code;\n $location->created_by = 0;\n $location->updated_by = 0;\n\n if ($location->save()) {\n return Redirect::back()->with('success', 'Successfully Updated');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }", "public function update(Request $request, OpdTreatmentModel $opdTreatmentModel,$id)\n {\n $formData=$request->all();\n //return $formData;\n $validator = \\Validator::make($formData,[\n 'patientId'=>'required',\n 'complaint'=>'required',\n 'treatment'=>'required',\n 'treatment_date'=>'required',\n 'medicine'=>'required',\n 'potency'=>'required',\n 'advice'=>'required',\n 'nod'=>'required',\n 'consultant'=>'required',\n 'remark'=>'required',\n 'refTo'=>'required',\n ]);\n if($validator->fails()) {\n return response()->json(['error'=>$validator->errors(),'status'=>false]);\n }\n $ipdUpdate=OpdTreatmentModel::where('id',$id)->update([\n 'patientId'=>$formData['patientId'],\n 'complaint'=>$formData['complaint'],\n 'treatment_date'=>$formData['treatment_date'],\n 'treatment'=>$formData['treatment'],\n 'medicine'=>$formData['medicine'],\n 'potency'=>$formData['potency'],\n 'advice'=>$formData['advice'],\n 'nod'=>$formData['nod'],\n 'consultant'=>$formData['consultant'],\n 'remark'=>$formData['remark'], \n 'refTo' =>implode(\",\",$formData['refTo']), \n\n ]);\n return response()->json(['status'=>true]);\n }", "public function updateServices()\n {\n $array = [\n 'service_id' => request()->input('serviceId'),\n 'serviceName' => request()->input('serviceName'),\n 'servicePrice' => request()->input('servicePrice'),\n 'serviceVisits' => request()->input('serviceVisits'),\n 'serviceDesc' => request()->input('serviceDesc'),\n 'serviceBenefit' => request()->input('serviceBenefit')\n ];\n\n DB::table('tbl_services')->where('service_id',$array['service_id'])->update([\n 'service_name'=>$array['serviceName'],\n 'service_price'=>$array['servicePrice'],\n 'service_visits'=>$array['serviceVisits'],\n 'service_desc'=>$array['serviceDesc'],\n 'service_benefit'=>$array['serviceBenefit']\n ]);\n // dd($dump);\n return redirect('cms/'.$array['service_id']);\n }", "public function update(Request $request, Consult $consult)\n {\n $request->validate([\n 'p_id' => 'required',\n 'Fname' => 'required',\n 'Lname' => 'required',\n 'birthday' => 'required',\n 'illns' => 'required',\n 'medecine' => 'required',\n 'doc_id' => 'required',\n]);\n$consult->update($request->all());\nreturn redirect()->route('consults.index')\n ->with('success','updated successfully');\n }", "public function update(Request $request, $id)\n {\n //\n $current = Carbon::now('Asia/Manila');\n\n //\n $Order_ID = $request->Order_ID;\n $decision = $request->Decision_text;\n $cust_ID = $request->Currentcust_ID;\n $currentFname = $request->Current_FName;\n $currentLname = $request->Current_LName;\n $nFname = $request->nf_namefield;\n $nLname = $request->nl_namefield;\n\n $amt_Paid = $request->payment_field;\n $amt_Paid2 = $request->payment;\n $amt_Used = $request->PartialField;\n $change = $request->changeField;\n\n $value = collect([\n $Order_ID ,\n $decision ,\n $cust_ID ,\n $currentFname ,\n $currentLname ,\n $nLname ,\n $nLname ,\n $amt_Paid ,\n $amt_Paid2 ,\n $amt_Used ,\n $change\n ]);\n // dd($value);\n\n $NewSalesOrder_details = Neworder_details::find($Order_ID);\n if($amt_Paid2 >= $NewSalesOrder_details->BALANCE){\n if($amt_Used > 0){\n $Derived_Change = $amt_Paid2 - $amt_Used;\n $Balance = 0.00;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,'P_FULL',$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,'PF',0.00));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Used;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Used,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }//if they used partial payment only\n else if($amt_Used == 0 OR $amt_Used < 1){\n $Derived_Change = $NewSalesOrder_details->BALANCE - $amt_Paid2;\n $Balance = 0;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,'P_FULL',$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,'PF',0.00));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Paid2;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Paid2,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }\n }//end of if\n else if($amt_Paid2 < $NewSalesOrder_details->BALANCE){\n if($NewSalesOrder_details->Status == 'BALANCED' OR $NewSalesOrder_details->Status == 'A_UNPIAD'){\n $Status = \"\";\n $Stat = \"\";\n if($NewSalesOrder_details->Status == 'BALANCED'){\n $Status = \"P_PARTIAL\";\n $Stat = \"PP\";\n }else if($NewSalesOrder_details->Status == 'A_UNPAID'){\n $Status = \"A_P_PARTIAL\";\n $Stat = \"APP\";\n }\n\n if($amt_Paid2 >= $NewSalesOrder_details->BALANCE*0.20){\n if($amt_Used > 0){\n $Derived_Change = $amt_Paid2 - $amt_Used;\n $Balance = $NewSalesOrder_details->BALANCE - $amt_Used;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,$Status,$Balance));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",\n array($id,$current,$Stat,$Derived_Change));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Used;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Used,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }//if they used partial payment only\n else if($amt_Used == 0 OR $amt_Used < 1){\n $Derived_Change = $NewSalesOrder_details->BALANCE - $amt_Paid2;\n $Balance = 0;//gets the balance even they paid greater but uses partial of the payment only\n $UpdateOrderDet = DB::select('CALL confirmOrder(?,?,?)',array($Order_ID,$Status, $Balance - $amt_Paid2));//updated the status of the order details as well sa the salesorder status\n\n $newInvoice = DB::select(\"CALL update_BalAndstat_ofInvoice(?,?,?,?);\",array($id,$current,$Stat,$Balance - $amt_Paid2));\n //update the invoice\n\n $customerPayment = new CustomerPayment;\n $customerPayment->Amount = $amt_Paid2;\n $customerPayment->Amount_Used = $amt_Paid2;\n $customerPayment->Date_Obtained = $current;\n if($decision == \"N\"){\n $customerPayment->From_Id = null;\n $customerPayment->From_FName = $nFname;\n $customerPayment->From_LName = $nLname;\n }else{\n $customerPayment->From_Id = $cust_ID;\n $customerPayment->From_FName = $currentFname;\n $customerPayment->From_LName = $currentLname;\n }\n $customerPayment->Type = \"CASH\";\n $customerPayment->BALANCE = $NewSalesOrder_details->BALANCE;\n $customerPayment->save();\n\n //make a record of customer payment settlement record\n $createPaymentSettlement = DB::select('CALL create_RecordPaymentSettlement(?,?,?,?,?)',\n array($id,$customerPayment->Payment_ID,$amt_Paid2,$amt_Paid2,$Derived_Change));\n Session::put('CashPayment_CompletionSession','Successful');\n }\n }else{\n Session::put('CashPayment_CompletionSession','Fail');\n return redirect()->back();\n }\n }else{\n //kapag hinid BALANCED or A_UNPAID\n }\n }\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $supplierorders = Orders::find($id);\n $supplierorders -> order_date = now();\n $supplierorders -> order_arrive = $request -> order_limit_date;\n $supplierorders -> status = $request -> order_status;\n $supplierorders -> supplier_id = $request -> supplier;\n $supplierorders -> matrix_house_id = $request -> matrix_house;\n $supplierorders -> save();\n return redirect()->route('supplierorder.index');\n }", "public function update(Request $request ,$id){\n $preparatrices = Preparatrice::findOrFail($id);\n $preparatrices->nom=$request->nom;\n $preparatrices->prenom=$request->prenom;\n $preparatrices->email=$request->email; \n $preparatrices->genre=$request->genre;\n $preparatrices->telephone=$request->telephone;\n $preparatrices->detail=$request->detail;\n $preparatrices->save();\n return redirect()->route('preparatrice.index')\n ->with('success','preparatrice update successfully');\n \n \n }", "public function update(Request $request)\n {\n $update_data=Master_Company::whereId($request->id)->first();//mengambil data berdasarkan id yg direquest\n $update_data->update([//execute update data\n 'nama_company' => $request->nama_company,\n 'alamat_company' => $request->alamat_company,\n 'telp_company' => $request->telp_company,\n 'email_company' => $request->email_company,\n 'map_company' => $request->map_company,\n ]);\n\n return redirect('/company/edit');//kembali ke link home\n }", "public function update(Request $request, $id)\n {\n $updateData = Supplier::find($id);\n $updateData->name = $request->name;\n $updateData->email = $request->email;\n $updateData->mobile = $request->mobile;\n $updateData->address = $request->address;\n $updateData->updated_by = Auth::user()->id;\n $updateData->update();\n return redirect()->route('view-supplier')->with('success','Supplier updated successfully!');\n }", "public function update()\n {\n try{\n\n $rules = array(\n 'reg_no' => 'required',\n 'name' => 'required',\n );\n\n $validator = Validator::make(Input::all(), $rules);\n\n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n return Redirect::back()\n ->withErrors($validator) // send back all errors to the login form\n ->withInput();\n\n $input = input::all();\n\n } else { \n\n //custom validation\n $data = Shipping_Company::where('id', '!=', Input::get('id'))->where('reg_no', '=', Input::get('reg_no'))->first();\n if(!empty($data)){\n $message = $validator->errors();\n $message->add('Registration Number', 'Registration Number '.Input::get('reg_no').' sudah ada.');\n return Redirect::back()\n ->withErrors($validator) // send back all errors to the login form\n ->withInput();\n }\n\n $id = Input::get('id');\n $reg_no = Input::get('reg_no');\n $name = Input::get('name');\n $phone1 = Input::get('phone1');\n $phone2 = Input::get('phone2');\n $phone3 = Input::get('phone3');\n $address01 = Input::get('address01');\n $address02 = Input::get('address02');\n $address03 = Input::get('address03');\n $city = Input::get('city');\n $zipcode = Input::get('zipcode');\n $email01 = Input::get('email01');\n $email02 = Input::get('email02');\n $grade \t\t= Input::get('grade');\n $location = Input::get('location');\n $branch = Input::get('branch');\n $upper_id = Input::get('upper_id');\n $description = Input::get('description');\n $status \t= Input::get('status');\n\n Shipping_Company::where('id',$id)->update(\n array( \n 'reg_no' => $reg_no,\n 'name' => $name,\n 'phone1' => $phone1, \n 'phone2' => $phone2, \n 'phone3' => $phone3, \n 'address01' => $address01, \n 'address02' => $address02, \n 'address03' => $address03, \n 'city' => $city, \n 'zipcode' => $zipcode, \n 'email01' => $email01, \n 'email02' => $email02, \n 'grade' => $grade, \n 'location' => $location, \n 'branch' => $branch, \n 'upper_id' => $upper_id, \n 'description' => $description, \n 'status' => $status,\n 'updated_date'=> date('Y-m-d H:i:s'),\n 'updated_by' => 'System' )\n );\n\n return Redirect::to('/shipping_company')->with('success', 'Data tersimpan.');\n }\n } catch(QueryException $e){\n Log::error('Found exception. '.$e);\n $message = new MessageBag;\n $message->add('Error', $e->getMessage());\n return Redirect::to('shipping_company')->withErrors($message);\n } \n\n return Redirect::to('/shipping_company');\n }", "public function update(Request $request, $id)\n {\n $Supplier= auth()->user()->supplier()->find($id);\n if (!$Supplier) {\n return response()->json([\n 'success' => false,\n 'message' => 'Supplier with id ' . $id . ' not found'\n ], 400);\n }\n\n $Supplier->update($request->all()); \n $Supplier->save();\n \n if ($Supplier)\n return response()->json([\n 'success' => true,\n 'data'=>$Supplier\n ]);\n else\n return response()->json([\n 'success' => false,\n 'message' => 'Supplier could not be updated'\n ], 500);\n \n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'status'=>\"required\",\n ]);\n\n $supplier=SupplierDetail::find($id);\n $supplier->status=$request->status;\n $supplier->save();\n return redirect()->back();\n }", "public function updateDisposition(Request $request){ \n $validatedData = Validator::make($request->all(),[\n 'dispo_name' => 'required',\n 'discription'=>'required',\n 'dispo_code'=>'required',\n 'call_back'=>'required',\n 'status'=>'required',\n 'user_id'=>'required'\n ],[ \n \"dispo_name.required\" => 'dispo_name is required',\n \"discription.required\" => 'discription is required',\n \"dispo_code.required\" => 'dispo_code is required',\n \"call_back.required\" => 'callback is required',\n \"status.required\" => 'status is required',\n \"user_id.required\" => 'User is required'\n ])->validate(); \t\n $updatedData = $request->all();\n unset($updatedData['_token']);\n unset($updatedData['id']);\n\n $updateList = Disposition::where('id',$request->id)\n ->update($updatedData);\n\n if($updateList){\n $request->session()->flash('message', 'Data Updated successfully.');\n $request->session()->flash('message-type', 'success');\n return redirect()->route('disposition'); \t \t\t\n }\n else{\n $request->session()->flash('message', 'Something went wrong.');\n $request->session()->flash('message-type', 'danger');\n return redirect()->route('disposition'); \t \t\t\n } \t\n }", "public function update(Request $request, $id)\n {\n $request->validate([ \n 'product'=>'required', \n 'email'=>'required',\n 'telephone'=>'required',\n 'date'=>'required',\n 'number_person'=>'required',\n 'address'=>'required', \n \n ]); \n \n $cmd = Comand::find($id); \n $cmd->product = $request->get('product'); \n $cmd->email = $request->get('email');\n $cmd->telephone = $request->get('telephone');\n $cmd->date = $request->get('date');\n $cmd->number_person = $request->get('number_person');\n $cmd->address = $request->get('address'); \n $cmd->save();\n }", "public function update(Request $request, $id)\n {\n $list = Supplier::findOrFail($id);\n\n $list->update([\n 'supplier_id' => $request->supplier_id,\n 'supplier_name' => $request->supplier_name,\n 'short_name' => $request->short_name,\n 'owner' => $request->owner,\n 'phone' => $request->phone,\n 'cell_phone' => $request->cell_phone,\n 'fax' => $request->fax,\n 'email' => $request->email,\n 'zip_code' => $request->zip_code,\n 'address' => $request->address,\n 'remark' => $request->remark,\n ]);\n return redirect('supplier/')->with('message', '更新成功 / Supplier updated!');\n }", "public function updateForm(Request $request, $id)\n { $Select_Contact_personID = client::all();\n $productID = Product::all();\n $enquiry_data_sources = EnquiryDataSource::where('is_active','1')->get();\n $referred_bies=ReferredBy::where('is_active','1')->get();\n $enquiry_types=EnquiryType::where('is_active','1')->get();\n $Assign_toID = Employee::all();\n $user = User::all();\n $data = comment::where('enquery_id', $id)->orderBy('created_at', 'desc')->get();\n $enquiry = enquiry::where('id', $id)->first();\n // $comment_date= Carbon::parse($data->created_at)->format('d/m/Y');\n return view('enquiry/createEnquiry',compact('enquiry','user','data','productID','Select_Contact_personID','enquiry_data_sources','referred_bies','enquiry_types','Assign_toID'))->with('id',$id);\n }", "public function update($data)\n {\n $hooq = [];\n if($this->hooq){\n $id = $data['id'];\n $date = date('Y-m-d H:i:s');\n $hooq = $this->hooq::where('id',$id)->first();\n if(!empty($hooq->martbox_id))\n if(!is_null($data['username'])) $hooq->username = $data['username'];\n if(!is_null($data['password'])) $hooq->password = $data['password'];\n if(!is_null($data['voucher_code'])) $hooq->voucher_code = $data['voucher_code'];\n if(!is_null($data['voucher_description'])) $hooq->voucher_code = $data['voucher_description'];\n if(!is_null($data['status'])) $hooq->status = $data['status'];\n else\n if(is_null($data['driver_id'])) $hooq->driver_id = $data['driver_id'];\n if(is_null($data['driver_uuid'])) $hooq->driver_uuid = $data['driver_uuid'];\n if(is_null($data['martbox_id'])) $hooq->martbox_id = $data['martbox_id'];\n if(is_null($data['martbox_display_id'])) $hooq->martbox_display_id = $data['martbox_display_id'];\n $hooq->updated_at = $date;\n $hooq->save();\n\n return $hooq;\n }\n return ['code' => 404 , 'msg' => 'hooq not found'];\n }", "public function update(Request $request, $id)\n {\n $data = $this->validate($request,[\n 'date'=>'required',\n 'type'=>'required|integer',\n 'name'=>'required|integer',\n 'value'=>'required',\n 'note'=>'string|nullable'\n ]);\n $receipt = Receipt::find($id);\n if ($data['type']==1){\n $employee = DB::table('employees')->where('id',$data['name'])->first();\n if (Receipt::create($data)){\n DB::table('employees')->where('id',$data['name'])->update([\n 'balance' => $employee->balance-$receipt->value+$data['value']\n ]);\n return back()->with('done','Receipt Updated successfully');\n }\n }else{\n $supplier = DB::table('suppliers')->where('id',$data['name'])->first();\n if (Receipt::create($data)){\n DB::table('suppliers')->where('id',$data['name'])->update([\n 'balance' => $supplier->balance-$receipt->value+$data['value']\n ]);\n return back()->with('done','Receipt Updated successfully');\n }\n }\n return back()->with('fail','something Wrong Try again!');\n\n }", "public function update(Request $data, $id)\n {\n if(!hasTask('admin/drivers/update'))\n {\n return view('errors.404');\n }\n $validation = Validator::make($data->all(), array(\n //'social_title'=> 'required',\n 'first_name' => 'required|regex:/(^[A-Za-z0-9 ]+$)+/|min:3|max:32',\n 'last_name' => 'required|regex:/(^[A-Za-z0-9 ]+$)+/|min:3|max:32',\n 'user_password' => 'min:5|max:32',\n 'gender' => 'required',\n 'address' => 'required',\n 'date_of_birth' => 'date',\n 'image' => 'mimes:png,jpeg,bmp,max:10000',\n 'mobile' => 'required|regex:/^([0-9\\s\\-\\+\\(\\)]*)$/|min:9',\n //'mobile' => 'regex:/\\(?([0-9]{3})\\)?([ .-]?)([0-9]{3})\\2([0-9]{4})/',\n ));\n // process the validation\n if ($validation->fails())\n {\n return Redirect::back()->withErrors($validation)->withInput();\n }\n else { \n $vendor = !empty($_POST['vendor'])?$_POST['vendor']:0;\n // echo\"<pre>\";print_r($vendor);exit;\n // store datas in to database\n $drivers = Drivers::find($id);\n $drivers->first_name = $_POST['first_name'];\n $drivers->last_name = $_POST['last_name'];\n $drivers->mobile_number = $_POST['mobile'];\n $drivers->date_of_birth = $_POST['date_of_birth'];\n $drivers->gender = $_POST['gender'];\n $drivers->address = $_POST['address'];\n $drivers->latitude = isset($_POST['latitude'])?$_POST['latitude']:0;\n $drivers->longitude = isset($_POST['longitude'])?$_POST['longitude']:0;\n if(isset($_POST['country']) && $_POST['country']!='')\n if(isset($_POST['country']) && $_POST['country']!='')\n {\n $drivers->country_id = $_POST['country'];\n }\n if(isset($_POST['city']) && $_POST['city']!='')\n {\n $drivers->city_id = $_POST['city'];\n }\n if(isset($_POST['user_password']) && $_POST['user_password']!='')\n {\n $drivers->hash_password = md5($_POST['user_password']);\n }\n $drivers->active_status = isset($_POST['active_status']);\n $drivers->is_verified = isset($_POST['is_verified']);\n //$drivers->ip_address = Request::ip();\n $drivers->modified_date = date(\"Y-m-d H:i:s\");\n $drivers->driver_created_by = 1;\n $drivers->vendor_driver = isset($vendor)?$vendor:0;\n\n $drivers->save();\n\n if(isset($_FILES['image']['name']) && $_FILES['image']['name']!='')\n {\n $destinationPath = base_path().'/public/assets/admin/base/images/drivers/'; // upload path\n $imageName = $drivers->id.'.'.$data->file('image')->getClientOriginalExtension();\n $data->file('image')->move($destinationPath, $imageName);\n $destinationPath1 = url('/assets/admin/base/images/drivers/'.$imageName);\n Image::make( $destinationPath1 )->fit(75, 75)->save(base_path().'/public/assets/admin/base/images/drivers/thumb/'.$imageName)->destroy();\n $drivers->profile_image = $imageName;\n $drivers->save();\n } \n // redirect\n Session::flash('message', trans('messages.Driver has been updated successfully'));\n return Redirect::to('admin/drivers');\n }\n }", "public function updateSuscripcion(){\n $data = array(\n\t'titulo_suscripcion' => $this->input->post('titulo_hist'),\n\t'descripcion_suscripcion' => $this->input->post('descripcion'),\n\t'estatus_suscripcion' => $this->input->post('estatus'),\n\t'tipo_suscripcion' => $this->input->post('tipo'),\n\t'precio_suscripcion' => $this->input->post('precio'),\n\t'num_historias_suscripcion' => $this->input->post('num_historias'),\n\t'id_duracion_suscr' => $this->input->post('duracion'), \n\t'orden_suscripcion' => $this->input->post('orden'), \n\t'usuario_modifica' => $this->session->userdata('user_id'),\n\t'fecha_modifica' => date('Y-m-d H:i:s')\n ); \n\n $this->db->where('id_suscripcion', $this->input->post('id_obj'));\n \t$this->db->update('ips_suscripciones', $data);\n\n return $id_comp;\n}", "public function update(Request $recuest,$codpais)\n {\n }", "public function update(Request $request, $id)\n {\n $rules = [\n 'supplierId' => 'required',\n 'product' => 'required',\n 'qty.*' => 'required|integer|between:0,10000',\n ];\n $messages = [\n 'unique' => ':attribute already exists.',\n 'required' => 'The :attribute field is required.',\n 'max' => 'The :attribute field must be no longer than :max characters.',\n ];\n $niceNames = [\n 'supplierId' => 'Supplier',\n 'product' => 'Product',\n 'qty.*' => 'Quantity'\n ];\n $validator = Validator::make($request->all(),$rules,$messages);\n $validator->setAttributeNames($niceNames); \n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n }\n else{\n try{\n DB::beginTransaction();\n $delivery = DeliveryHeader::findOrFail($id);\n $created = explode('/',$request->date); // MM[0] DD[1] YYYY[2] \n $finalCreated = \"$created[2]-$created[0]-$created[1]\";\n $delivery->update([\n 'supplierId' => $request->supplierId,\n 'dateMake' => $finalCreated\n ]);\n $products = $request->product;\n $qtys = $request->qty;\n $orders = $request->order;\n sort($orders);\n foreach($products as $key=>$product){\n $inventory = Inventory::where('productId',$product)->first();\n $detail = DeliveryDetail::where('deliveryId',$delivery->id)->where('productId',$product)->first();\n $inventory->decrement('quantity',$detail->quantity);\n $detail->update([\n 'deliveryId' => $delivery->id,\n 'productId' => $product,\n 'quantity' => $qtys[$key],\n ]);\n $inventory->increment('quantity', $qtys[$key]);\n if($inventory->quantity<0){\n $request->session()->flash('error', 'Insufficient inventory resources. Check your inventory status.');\n return Redirect::back()->withInput();\n }\n }\n foreach($orders as $order){\n foreach($products as $key=>$product){\n $detail = PurchaseDetail::where('purchaseId',''.$order)->where('productId',$product)->where('isActive',1)->first();\n $detail->update([\n 'delivered' => 0\n ]);\n if(!empty($detail)){\n $qty = $detail->quantity;\n $delivered = $detail->delivered;\n if($qty != $delivered){\n while($qty!=$delivered && $qtys[$key]!=0){\n $delivered++;\n $qtys[$key]--;\n }\n $detail->update([\n 'delivered' => $delivered\n ]);\n }\n }\n }\n $details = PurchaseDetail::where('purchaseId',''.$order)->where('isActive',1)->get();\n foreach($details as $detail){\n if($detail->quantity!=$detail->delivered){\n $delivery = false;\n }\n }\n if($delivery){\n PurchaseHeader::where('id',''.$order)->update(['isDelivered'=>1]);\n }\n }\n Audit::create([\n 'userId' => Auth::id(),\n 'name' => \"Update Delivery\",\n 'json' => json_encode($request->all())\n ]);\n DB::commit();\n }catch(\\Illuminate\\Database\\QueryException $e){\n DB::rollBack();\n $errMess = $e->getMessage();\n return Redirect::back()->withErrors($errMess);\n }\n $request->session()->flash('success', 'Successfully updated.');\n return Redirect('delivery');\n }\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'particulars'=>'required',\n 'quantity'=>'required',\n 'rateperunit'=>'required',\n 'amount'=>'required',\n 'piece'=>'required'\n ]);\n\n\n $particular = new particular([\n 'suplier_id' => $request->get('suplier_id'),\n 'particulars' => $request->get('particulars'),\n 'quantity' => $request->get('quantity'),\n 'rateperunit' => $request->get('rateperunit'),\n 'piece' => $request->get('piece'),\n 'amount' => $request->get('amount')\n\n \n ]);\n $particular->save();\n\n return redirect('/particulars')->with('success', ' updated!');\n }", "public function update(Request $request, $id)\n {\n // return $request->all();\n $validatedData = $request->validate([\n 'customer_mobile' => 'required|digits:11 ',\n 'customer_name' => 'required ',\n 'customer_address' => 'required ',\n 'city' => 'required',\n 'courier' => 'required',\n 'shipping_cost' => 'required',\n // 'commission' => 'required',\n ]);\n\n //first find find the customer\n $customer=Customer::where('phone',$request->customer_mobile)->first();\n $order=Order::findOrFail($id);\n\n if($order->status!=1 && $order->status!=2){\n \n return \\response()->json('Order New Or Pending not now');\n }\n //if not customer then save, as a new customer\n if(!$customer){\n $customer=new Customer();\n $customer->name=$request->customer_name;\n $customer->phone=$request->customer_mobile;\n $customer->address=$request->customer_address;\n $customer->city_id=$request->city;\n\n $customer->save();\n }else{\n $customer->name=$request->customer_name;\n $customer->address=$request->customer_address;\n $customer->city_id=$request->city;\n $customer->custome_type=$customertype;\n $customer->save();\n }\n\n \n // return $customer->name;\n \n $order->customer_id=$customer->id;\n $order->cutomer_phone=$request->customer_mobile;\n $order->city_id=$request->city;\n $order->courier_id=$request->courier;\n $order->shipping_cost=$request->shipping_cost ?? 0;\n $order->discount=$request->discount ?? 0;\n $order->paid=$request->paid??0;\n $order->total=$request->total;\n \n //if order save then save the order details\n if($order->save()){\n\n\n $order_items=OrderItem::where('order_id',$id)->get();\n\n //many of times when update order item, some item remove or some item add, so here we are delete previous item and insert new $rquest item\n foreach($order_items as $order_item){\n\n //update product stock befere delete items\n $product_stock=Product::where('id',$order_item->product_id)->first();\n $product_stock->stock=$product_stock->stock+$order_item->qty;\n $product_stock->save();\n $order_item->delete();\n }\n\n foreach($request->products as $product){\n\n \n // return $product['product_id'];\n //update product stock before insert item\n // $product_item=Product::where('id',$product['product_id'])->first();\n // $product_item->stock;\n // $product_item->stock=$product_item->stock-$product['quantity'];\n // $product_item->save();\n\n $details=new OrderItem();\n $details->order_id=$order->id;\n $details->product_id=$product['product_id'];\n $details->price=$product['price'];\n $details->quantity=$product['quantity'];\n $details->total=$product['quantity']*$product['price'];\n $details->attribute_id=$product['attribute_id'] ?? null;\n $details->variant_id=$product['variant_id'] ?? null;\n $details->save();\n }\n return \\response()->json([\n 'status'=>'SUCCESS',\n 'message'=>'Order was updated successfully'\n ]);\n\n }\n\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'editusername' => 'required|string|min:6|max:30',\n 'editimajl' => ['required', 'min:6', 'max:30', 'email', 'regex:/(.*)@(met|gmail)\\.com/i'],\n 'editpassword' => 'required|string|min:6|max:30',\n ]);\n $update_array=[\n 'person_username'=>$request->input('editusername'),\n 'person_email'=>$request->input('editimajl'),\n 'person_password'=>$request->input('editpassword')\n ];\n\n DB::table('persons')->where('person_id', $id)->update($update_array);\n\n return redirect('/person')->with('success','Person is updated');\n }", "public function updateCreateColdStorage(Request $request,$row_id){\n \n $getLotInfoId = LotInfo::find($row_id);\n if(!empty($getLotInfoId)){\n $validator = validator::make($request->all(), [\n \n 'lot_number' => 'required|string',\n 'production_date' => 'required|date_format:Y-m-d',\n 'coldStorage' => 'required|array'\n ]);\n if($validator->fails()){\n return response()->json(['error'=>$validator->errors()], 401);\n }\n $validator2 = validator::make($request->all(), [\n\n 'coldStorage.*.reading_date' => 'required|date_format:Y-m-d',\n 'coldStorage.*.cold_room_number' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.fish_temp' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.cold_room_temp' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.comment' => 'required|string|max:255',\n 'coldStorage.*.cold_temp_image' => 'required|numeric|min:1|max:999999',\n 'coldStorage.*.cold_temp_images' => 'required|numeric|min:1|max:999999'\n ]);\n if(!empty($validator2->fails())){\n return response()->json(['error'=>$validator2->errors()], 401);\n }\n $update = array(\n\n 'reading_date' => $request->reading_date,\n 'cold_room_number' => $request->cold_room_number,\n 'fish_temp' => $request->fish_temp,\n 'cold_room_temp' => $request->cold_room_temp,\n 'comment' => $request->comment,\n 'cold_temp_image' => $request->cold_temp_image,\n 'cold_temp_images' => $request->cold_temp_images,\n );\n if(($getLotInfoId->lot_number != $request->lot_number) || ($getLotInfoId->production_date != $request->production_date)){\n return response()->json(['error'=>'Lot number And Production date does not exits!'], 401);\n }\n if(count($request->coldStorage)){\n foreach($request->coldStorage as $coldStorage){\n $coldStorage['lot_number'] = $request->lot_number;\n $coldStorage['production_date'] = $request->production_date;\n OnlineQcColdStorage::updateOrCreate(['id'=>isset($coldStorage['id'])?$coldStorage['id']:null],$coldStorage);\n }\n }\n return response()->json($request->all(), 200);\n } \n else{\n return response()->json(['error'=>'Lot number not found!'], 401);\n }\n}", "public function updateRecord(){\n\t\tglobal $db;\n $data = array('email'=>$this->email);\n\t\t\t\t$response = $db->update($this->table,$data,\"id = $this->id\");\n\t\treturn $response;\n\t}", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n\t\t\t\t'name' => 'required|string',\n\t\t\t\t'company_name' => 'required|string',\n\t\t\t\t'phone_number' => 'required|numeric|min:0',\n\t\t\t\t'address' => 'required|string',\n\t\t\t\t'description' => 'nullable|string'\n\t\t\t]);\n\n\t\t\ttry {\n\t\t\t\t$supplier = Supplier::findOrFail($id);\n\t\t\t\tif ($request->email != $supplier->email) {\n\t\t\t\t\t$this->validate($request, [\n\t\t\t\t\t\t'email' => 'nullable|email|unique:suppliers,email',\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t\t$supplier->update($request->except('_token', '_method'));\n\t\t\t\tsession()->flash('success', 'Behasil Mengubah Data Supplier !');\n\t\t\t\treturn redirect(route('suppliers.index'));\n\t\t\t} catch (Exception $e) {\n\t\t\t\tsession()->flash('error', 'Terjadi Kesalahan !');\n\t\t\t\treturn redirect()->back();\n\t\t\t}\n }", "public function update(Request $request, $id)\n {\n\n $brands = Subscriptions::findOrFail($id);\n\n\n $brands->update($request->all());\n\n\n\n return redirect()->back();\n\n\n \n }", "public function update(BuslvRequest $request,$id)\n {\n /*$ue = DB::table('des')\n ->where('id',$de->id)\n ->update(['name' => $de->name,'email' => $de->email,'role' => $de->role ]\n\n );*/\n //$de->update($request->all());\n $candidate = Buslv3::findOrFail($id);\n $input = $request->all();\n $candidate->update($input);\n return redirect()->route('lv3.index')->with('message','item has been updated successfully');\n }", "public function update(Request $request, Supplier $supplier)\n {\n $dataSupplier = $request->only('name', 'phone', 'address');\n $supplier->update($dataSupplier);\n\n return redirect()->route('suppliers.index');\n }", "public function update(Request $request, $id)\n {\n //\n $update_product=Details::findOrFail($id);\n $this->validate($request,[\n 'name'=>'required',\n 'image'=>'max:1000',\n ]);\n $formInput=$request->all();\n $slider=array();\n if(empty($request->input('atelier'))){\n $slider['atelier']=\"null\";\n }\n else{\n \n \n $slider['atelier']=$request->input('atelier');\n }\n if(empty($request->input('domicile'))){\n $slider['domicile']=\"null\";\n }\n else{\n \n \n $slider['domicile']=$request->input('domicile');\n } \n $slider['name']=$request->name;\n $slider['description']=$request->description;\n $slider['type']=$request->type;\n if($update_product->image==''){\n $image=$request->file('image');\n if($image)\n { \n $image_name=str_random(20);\n $ext=strtolower($image->getClientOriginalExtension());\n $image_full_name=$image_name.'.'.$ext;\n $upload_path='images/';\n $image_url=$upload_path.$image_full_name;\n $success=$image->move($upload_path,$image_full_name);\n if($success)\n {\n \n \n $slider['image']=$image_url;\n DB::table('details')->where('id',$id)->update($slider);\n session()->flash('success','sous service modifier');\n return back(); \n \n }\n \n \n }\n }\n else\n {\n \n \n $slider['image']=$update_product->image;\n \n \n DB::table('details')->where('id',$id)->update($slider);\n session()->flash('success','sous service modifier');\n return back(); \n }\n }", "public function update(Request $request, $id)\n {\n $supplier = Supplier::find($id);\n $supplier->supplier_company_name = $request->supplier_company_name;\n $supplier->name_of_contact_person = $request->name_of_contact_person;\n $supplier->supplier_contact_number = $request->supplier_contact_number;\n $supplier->supplier_email = $request->supplier_email;\n $supplier->supplier_address = $request->supplier_address;\n $supplier->hired_date = $request->hired_date;\n $supplier->estimated_end_date = $request->estimated_end_date;\n $supplier->additional_remarks = $request->additional_remarks;\n\n $supplier->save();\n return redirect()->route('admin.suppliers.index');\n }", "public function update(Request $request,$id)\n { \n //print_r($request->category_id);die;\n $request->validate([\n 'category_id' => 'required',\n ]);\n\n\n \n // $email = $request->email;\n \n \n $inst = Institute::find($id);\n\n $staticid = $request->ip_address;\n if($staticid) {\n $stid = implode(',',$staticid); \n }\n\n\n Institute::where('user_id',$id)->delete();\n foreach($request->book as $val) {\n foreach($request->category_id as $key=>$value) { \n \n \n if($inst!='') {\n $institute = Institute::find($id);\n } else {\n $institute = new Institute; \n }\n $institute->category_id = $value;\n $institute->static_ipaddress = $stid;\n $institute->book_id = $val;\n \n $institute->user_id = $id;\n if ($request->has('isActive')) {\n $institute->isActive = true;\n } else {\n $institute->isActive = false;\n }\n $institute->save();\n }\n }\n $content = [\n 'name' =>$request->name,\n 'email' => $request->email,\n ];\n \n //Mail::to('himanshu.kumar@edtech.in')->send(new InstituteMail($content));\n Toastr::success('Record updated Successfully!','Success');\n return redirect()->route('assign-institute.index');\n \n }", "public function update(Request $request)\n {\n $data = array(\n 'id_pemasok' => request()->get('idpemasok'),\n 'nama_pemasok' => request()->get('namapemasok'),\n 'email' => request()->get('emailpemasok'),\n 'alamat' => request()->get('alamatpemasok'),\n );\n DB::table('pemasoks')->where('id_pemasok','=',request()->get('idpemasok'))->update($data);\n return redirect('/supplier');\n }", "public function updateData (Request $request){\n\n $arr = explode(\"-\",$request->input('signby'));\n $membid = (int)$arr[0];\n $type = (int)$arr[1];\n\n if ($type == 0 ){\n $signbyid = $membid;\n $signbytype = $this->settings('COMPANY_MEMBERS','key')->id;\n }\n else{\n $signbyid = $membid;\n $signbytype = $this->settings('COMPANY_MEMBER_FIRMS','key')->id;\n }\n\n CompanyChangeRequestItem::where('id', $request->reqid)->update(['signed_by' => $signbyid,'signed_by_table_type' => $signbytype]);\n\n $newadds = $request->input('addArr');\n \n \n foreach($newadds as $newadd){\n if(!empty($newadd)){\n \n OtherAddress::where('id', $newadd['id'])\n ->update(['records_kept_from' => $newadd['date']]);\n\n $otheraddress = OtherAddress::where('id', $newadd['id'])->first();\n\n if($newadd['type'] == 1){\n $country = 'Sri Lanka';\n }\n else{\n $country = $newadd['country'];\n }\n\n Address::where('id', $otheraddress->address_id)\n ->update(['address1' => $newadd['localAddress1'],\n 'address2' => $newadd['localAddress2'],\n 'province' => $newadd['province'],\n 'district' => $newadd['district'],\n 'city' => $newadd['city'],\n 'gn_division' => $newadd['gnDivision'],\n 'postcode' => $newadd['postcode'],\n 'country' => $country]);\n\n \n\n \n \n }\n \n }\n\n $update_compnay_updated_at = array(\n 'updated_at' => date('Y-m-d H:i:s', time())\n );\n Company::where('id', $request->id)\n ->update($update_compnay_updated_at);\n\n $penalty_value = $this->penaltyCal($request->id);\n\n\n \n\n\n return response()->json([\n 'message' => 'Sucess!!!',\n 'status' =>true,\n 'penalty_value' => $penalty_value,\n ], 200);\n\n\n\n}", "public function updateFirstTime() {\n //$faculty_id = 5;\n $faculty_id = intval(Auth::id());\n + \n + $employment = request('employee_type');\n $division_id = intval(request('division_id'));\n \n+ DB::table('faculty')->where('faculty_id', $faculty_id)->update(['division_id' => $division_id, 'employee_type' => $employment]);\n\n //debugging\n //dd(DB::table('faculty')->get()->where('faculty_id', $faculty_id));\n \n //redirects user to Tip Questionnaire\n return redirect()->action('TipsController@index');\n\n }", "public function EditSupplier($id){\n \n $edit=DB::table('suppliers')\n ->where('id',$id)\n ->first();\n return view('edit_supplier', compact('edit'));\n\n }", "public function update(Request $request, $id)\n {\n // dd($request->toArray());\n\n $this->validate($request,[\n\n 'name' => 'required',\n 'email' => 'required|email',\n 'ph_no' => 'required|',\n 'subscription' => 'required',\n ]);\n\n $user = User::find($id);\n\n if ($request->hasFile('file')) \n {\n $image = $request->file;\n\n $new_image = time().$image->getClientOriginalName();\n\n $image->move('uploads/user_images',$new_image);\n\n $user->image = 'uploads/user_images/'.$new_image;\n }\n\n $user->name = $request->name;\n $user->email = $request->email;\n $user->phone_number = $request->ph_no;\n $user->latitude = $request->lat;\n $user->longitude = $request->log;\n $user->address = $request->address;\n\n $user->save(); \n \n\n $subscription = Subscription::where('detailer_id', $id)->first();\n\n $subscription->detailer_subscriptions = $request->subscription;\n $subscription->remaining_subscriptions = $request->subscription - $request->used_subscription;\n\n DB::table('warranty_codes')\n ->where('car_details_id',$subscription->id)\n ->where('status',0)\n ->delete();\n\n for($i=1; $i<=$request->subscription; $i++)\n {\n DB::table('warranty_codes')->insert([\n\n 'car_details_id' => $subscription->id,\n 'status' => 0,\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n\n $subscription->save();\n\n\n\n Session::flash('success','Deatailer Updated Successfully');\n\n return redirect()->route('detailers');\n }", "public function update(Request $request, Supplier $supplier)\n {\n $this->validate($request, [\n 'designation' => 'required|min:3',\n 'store' => 'required'\n ]);\n\n $supplier->designation = ucfirst($request->designation);\n $supplier->store_id = $request->store;\n $supplier->contact = $request->contact;\n $supplier->email = $request->email;\n $supplier->save();\n\n session()->flash('success', 'Fornecedor actualizado com sucesso!');\n\n return redirect()->route('suppliers.index');\n }", "public function update($id) {\n\t\t$this->supplier = $this->supplier->find($id);\n\t\t$input = Input::all();\n\t\t$this->supplier->fill($input);\n\t\t$this->supplier->save();\n\t\treturn Redirect::route('suppliers.index');\n\t}", "public function update(Request $request)\n {\n //\n // echo $request->rid;\n $res = Reviews::where('id',$request->rid)->update(['status'=>1]);\n if($res) return 1;\n\n }", "public function update($id,Request $request)\n { $v = Validator::make($request->all(), [\n 'etudiant_nom'=> 'required|max:20', \n 'etudiant_prenom'=>'required|max:20',\n 'etudiant_cin'=>'required|unique:etudiant,etudiant_cin,'.$id.'|digits:8',\n 'etudiant_mat'=>'required|unique:etudiant,etudiant_mat,'.$id.'|digits:7', \n 'etudiant_sexe'=> 'required',\n 'etudiant_date_nissance'=>'required|date' , \n 'etudiant_lieu_naissance'=>'required|alpha|max:20',\n 'etudiant_adresse'=>'required|max:255', \n 'etudiant_tel'=>'required|digits:8',\n 'email' => 'required|email|unique:etudiant,email,'.$id,\n 'etudiant_filiere_id'=>'required',\n 'etudiant_group_code'=>'integer' ,\n \n ]);\n if ($v->fails())\n {\n return redirect()->back()->withErrors($v->errors())->withInput();\n }\n\n $etudiant = Etudiant::find($id); \n\n $etudiant->etudiant_cin= $request->get('etudiant_cin');\n $etudiant->etudiant_mat= $request->get('etudiant_mat') ;\n $etudiant->etudiant_prenom= $request->get('etudiant_prenom');\n $etudiant->etudiant_nom= $request->get('etudiant_nom');\n $etudiant->etudiant_sexe= $request->get('etudiant_sexe');\n $etudiant->etudiant_date_nissance= $request->get('etudiant_date_nissance');\n $etudiant->etudiant_lieu_naissance= $request->get('etudiant_lieu_naissance');\n $etudiant->etudiant_rue= '';\n $etudiant->etudiant_ville= '';\n $etudiant->etudiant_region= '';\n $etudiant->etudiant_adresse= $request->get('etudiant_adresse'); \n $etudiant->etudiant_tel= $request->get('etudiant_tel');\n $etudiant->email= $request->get('email'); \n $etudiant->etudiant_rebouble= $request->get('etudiant_rebouble'); \n $etudiant->etudiant_moda= ''; \n $etudiant->etudiant_filiere_id= $request->get('etudiant_filiere_id');\n $etudiant->etudiant_niveau= $request->get('etudiant_niveau');\n $etudiant->etudiant_group_code= $request->get('etudiant_group_code');\n $etudiant->etudiant_group_name= $request->get('etudiant_group_name');\n $etudiant->save();\n \n return Redirect:: to('etudiant');\n \n }", "public function update(Request $request, $id)\n {\n $id = $request->id;\n $currentStatus = $request->status;\n $supplyorder = Supplyorder::find($id);\n if($currentStatus == 1) {\n $supplyorder->status_id = 2;\n $supplyorder->supplier_id = $request->Supplier;\n }\n elseif ($currentStatus == 2) {\n $ingredients = $supplyorder->ingredient;\n\n // loop through each ingredient and add itself to the quantity\n foreach ($ingredients as $i) {\n $i->quantity = ($i->quantity + $i->pivot->quantity);\n $i->save();\n }\n $supplyorder->status_id = 3;\n }\n $supplyorder->save();\n\n if ($supplyorder->status_id = 2){\n $ingredients = $supplyorder->ingredient;\n // return view('email.supplyorder', ['supplyorder' => $supplyorder, 'ingredients' => $ingredients]);\n Mail::send('email.supplyorder', ['supplyorder' => $supplyorder, 'ingredients' => $ingredients], function ($m) use ($supplyorder) {\n $m->from('samuelyerkes@gmail.com', 'Sweet Sweet Chocolates');\n $m->to($supplyorder->supplier->email, $supplyorder->supplier->name)->subject('Sweet Sweet Chocolates would like to make a supply order');\n });\n\n Activity::log('Submitted a supply order to ' . $supplyorder->supplier->name);\n }\n return Redirect::action('SupplyOrderController@index');\n }", "public function update(Request $req){\n// insert the price to room prices table\n// insert the description in room bands table\n $rooms = Room::findOrFail($req->id);\n\n $roomDesc = RoomBand::findOrFail($req->roombandid);\n $roomType = RoomType::findOrFail($req->roomtypeid);\n $roomPrice = RoomPrice::findOrFail($req->roompriceid);\n\n // $facilityDesc = FacilityList::findOrFail($req->facilityid);\n // $facilityDetail = RoomFacility::findOrFail($req->roomfacilityid);\n \n // insert rooms\n $roomType->room_type = $req->roomtype;\n $roomPrice->room_price = $req->roomprice;\n $roomDesc->room_description = $req->roomdescription;\n\n // insert facilities\n // $facilityDesc->facility_description = $req->facilitydesc;\n // $facilityDetail->facility_details = $req->facilitydetail;\n\n $roomDesc->save();\n $roomType->save();\n $roomPrice->save();\n\n // $facilityDesc->save();\n // $facilityDetail->save();\n\n $rooms->save();\n\n return redirect('/')->with('mssg','Room has been updated successfully!');\n }", "public function update(Request $request, SaleProduct $saleProduct)\n {\n $viewData['pageTitle'] = 'Add Workshop'; \n $viewData['product'] = Product::pluck('product_name', 'id');\n $viewData['service'] = Service::pluck('service_name', 'id');\n $viewData['model_select'] = Modal::pluck('model_name', 'id');\n $viewData['brand_select'] = Brand::pluck('brand_name', 'id');\n $viewData['ServiceType'] = ServiceType::pluck('service_type_name', 'id');\n $viewData['registered_vehicle_select'] = VehicleDetail::pluck('vehicle_reg_number', 'vehicle_reg_number');\n $viewData['customerNameSelect'] = Customer::pluck('customer_name', 'id');\n $viewData['header_link'] = HeaderLink::where(\"menu_id\",'3')->select(\"link_title\",\"link_name\")->orderBy('id','desc')->get();\n // This if condition for fill detail for update otherwise for save and update \n \n if ($request->isMethod('post')){\n $getFormAutoFillup = array(); \n if(isset($request->id) && $request->id != null) \n {\n if ($request->isMethod('post')){\n $PartyManage= request()->except(['_token','service_id','product_id','service_quantity','product_quantity','service_type','service_price','product_price','workshop_product_brand','workshop_product_model','workshop_service_brand','workshop_service_model','service_type_id']);\n // $PartyManage['is_workshop']=0;\n // $PartyManage['is_complete']=1;\n \n if(Workshop::where([['id', '=', $request->id]])->update($PartyManage)){\n $workshopProductData= WorkshopProduct::where('workshop_id','=',$request->id)->get();\n foreach ($workshopProductData as $key => $value) {\n $stock_out=$value['product_quantity'];\n $product_id=$value['product_id'];\n $stock_available=$value['stock_available'];\n \n $productDetail=Product::whereId($product_id)->first()->toArray();\n $productStockOut=$productDetail['stock_out'];\n $productStockAvailable=$productDetail['stock_available'];\n $productManame['stock_out']=$productStockOut-$stock_out;\n $productManame['stock_available']=$productStockAvailable+ $stock_available;\n Product::where([['id', '=',$product_id]])->update($productManame);\n }\n\n WorkshopProduct::where('workshop_id',$request->id)->forceDelete();\n for($i=0; $i < count($request->product_id); $i++){\n\n $WorkshopProduct= new WorkshopProduct();\n $WorkshopProduct->workshop_id = $request->id;\n $WorkshopProduct->product_id = $request->product_id[$i];\n $WorkshopProduct->product_quantity = $request->product_quantity[$i];\n $WorkshopProduct->product_price = $request->product_price[$i];\n $WorkshopProduct->workshop_product_brand = $request->workshop_product_brand[$i];\n $WorkshopProduct->workshop_product_model = $request->workshop_product_model[$i]; \n $WorkshopProduct->save();\n\n $productDetail=Product::whereId($request->product_id[$i])->first()->toArray();\n $productStockOut=$productDetail['stock_out'];\n if($productStockOut==null)\n {\n $productStockOut=0;\n }\n $productStockAvailable=$productDetail['stock_available'];\n $productManame['stock_out']=$productStockOut+$request->product_quantity[$i];\n $productManame['stock_available']=$productStockAvailable-$request->product_quantity[$i];\n Product::where([['id', '=',$request->product_id[$i]]])->update($productManame);\n\n } \n if($request->is_complete==1)\n {\n // Mail::to($request->email)->send(new SendMailToCustomer($request->id));\n // SendEMailJob::dispatch($request->email,$request->id)\n // ->delay(now()->addSeconds(5));\n }\n \n $request->session()->flash('message.level', 'success');\n $request->session()->flash('message.content', ' updated Successfully!');\n }\n }\n $viewData['workshopId'] = $request->id;\n return redirect('/SaiAutoCare/sale/edit/'.$request->id);\n }\n }\n}", "public function update(Request $request, $id)\n {\n if(session::has('email')){\n $email=session::get('email');\n if( $request->chk_collage==\"on\")\n {\n $chk_collage=1;\n }else {\n $chk_collage=0;\n }\n\n if( $request->chk_school==\"on\")\n {\n $chk_school=1;\n }else {\n $chk_school=0;\n }\n\n if( $request->chk_university==\"on\")\n {\n $chk_university=1;\n }else {\n $chk_university=0;\n }\n\n if( $request->chk_it==\"on\")\n {\n $chk_it=1;\n }else {\n $chk_it=0;\n }\n\n $catagory_id=catagory::select('id')->where('email',$email)->first();\n $catagory=catagory::find($catagory_id->id);\n $catagory->school=$chk_school;\n $catagory->college=$chk_collage;\n $catagory->university=$chk_university;\n $catagory->it=$chk_it;\n $catagory->save();\n\n\n\n\n \n $userinfo=userinfo::find($id);\n\n $dateOfBirth=$request->dob_date.\".\".$request->dob_month.\".\".$request->dob_year;\n $userinfo->name=$request->name;\n $userinfo->aboutme=$request->about;\n $userinfo->address=$request->address;\n $userinfo->phone=$request->phone;\n $userinfo->facebook=$request->facebook;\n $userinfo->twitter=$request->twitter;\n $userinfo->google=$request->google;\n $userinfo->school=$request->school;\n\n $userinfo->collage=$request->collage;\n $userinfo->university=$request->university;\n $userinfo->district=$request->district;\n $userinfo->country=$request->country;\n $userinfo->dateofbirth=$request->dateofbirth;\n $userinfo->gender=$request->gander;\n $userinfo->dateofbirth=$dateOfBirth;\n $userinfo->save();\n return redirect('/userinfo');\n\n\n\n\n\n \n\n\n }else{\n return redirect()->route('home',session('nul'));\n }\n }", "public function update(array $data){\n //dynamically query generate\n $query = \"UPDATE \".$this->table[0].\" SET\";\n $comma = \" \";\n foreach ($data as $key => $value) {\n if( ! empty($value)) {\n $query .= $comma . $key . \" = '\" .trim($value) . \"'\";\n $comma = \", \";\n }\n }\n //finaly query generated as per your form fields name and value\n \n $sql= $query. \" WHERE sid = '\".$data[\"sid\"].\"'\";\n //run the query\n return mysqli_query($this->conn,$sql);\n }", "public function demanderCoAuteur($id_membre_demandeur , $id_1_auteur , $id_prod,Request $request){\n\n\n $id_coauteur = $id_membre_demandeur ;\n\n $id_auteur = $id_1_auteur ; \n\n $prods = DB::select('select * from production_scientifiques where id = ?', [$id_prod]);\n\n\n foreach($prods as $prod){\n\n $demande = $prod->demande ; \n\n }\n \n if($demande == ''){\n\n $demande = '0,'.$id_coauteur ;\n\n }else{\n\n $demande = $demande . \",\" .$id_coauteur ;\n }\n \n\n\n\n $count1 = DB::update('update production_scientifiques set demande = ? where id = ?', [$demande, $id_prod]);\n\n if($count1 > 0){\n\n return redirect('Membre/ConsulterProduction') ;\n \n }\n\n\n }", "public function update(Request $request, $id)\n {\n $purchases = Purchase::findOrFail($id);\n $this->validate($request, [\n 'supplier_name' => 'required',\n 'payment_status' => 'required',\n 'net_loading_in_litres' => 'required',\n 'total_cost' => 'required|numeric',\n 'amount_paid' => 'required|numeric',\n 'balance' => 'required|numeric',\n 'payment_mode' => 'required',\n 'transaction_code' => 'required',\n 'transaction_date' => 'required'\n ]);\n $input=$request->all();\n \n $supplierName = Inventory::where(\"supplier_number\", \"=\", $request->supplier_name_from_inventory)->get();\n\n $supplierName=\"\";\n $transRefNo = \"SupplierPayment-\" . $id;\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans= $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n $transRefNo = \"SupplierPayment-(\" . $id.\")\";\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans = $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-\" . $id;\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->amount_paid;\n $transaction->balance = $request->balance;\n $transaction->narration = \"Payment to supplier\";\n\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-(\" . $id . \")\";\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->total_shortage;\n $transaction->balance = 0;\n $transaction->narration = \"shortage\";\n $transaction->supplier_rate = $request->unit_price;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n \n $purchases->update($input);\n\n\n \n Session::flash('flash_message', 'Record successfully Updated!');\n\n return redirect()->back();\n }", "public function update(Request $request)\n {\n $lastnum=$request->lastnum;\n $lastname=$request->lastname;\n\n $newnum=$request->num;\n $newname=$request->name;\n $newtel=$request->tel;\n $newphone=$request->phone;\n $newemail=$request->email;\n\n enter_garage::where('gar_num', '=', $lastnum)\n ->where('gar_name','=',$lastname)\n ->update(array('gar_num' =>$newnum , 'gar_name'=>$newname ,'tel'=>$newtel , 'phone'=>$newphone , 'email'=>$newemail,'gar_hebrow_name'=>$request->hebrow));\n\n }", "public function update($request,$id) {\n \n\n }", "public function update(Request $request,$id)\n {\n $part=Part::findOrFail($id);\n \n $part->number=$request->input('number');\n $part->description=$request->input('description');\n $part->brand_name=$request->input('brand_name');\n $part->qty=$request->input('qty');\n $part->price=$request->input('price');\n $part->condition=$request->input('condition');\n $part->location=$request->input('location');\n \n if($part->save()){\n return new PartResource($part);\n } \n }", "public function update_category(Request $request){\n $data = array();\n $category_id=$request->category_id;\n $data['category_name']=$request->category_name;\n $data['category_description']=$request->category_description;\n\n//$data['publication_status']=$request->publication_status;\n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->update($data);\n\n Session::put('message','Category update Successfully!!');\n return Redirect::to('/edit-category/'.$category_id);\n }", "public function restaurant_update_detail_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $city = $this->input->post('city');\n $admin_id = $this->input->post('admin_id');\n $name=$this->input->post('name');\n $image=$this->input->post('image');\n $gst_no=$this->input->post('gst_no');\n $pan_no=$this->input->post('pan_no');\n $lat=$this->input->post('lat');\n $lng=$this->input->post('lng');\n $location=$this->input->post('location');\n $cuisines=$this->input->post('cuisines');\n $cost=$this->input->post('cost');\n $openingTime=$this->input->post('openingTime');\n $closingTime=$this->input->post('closingTime');\n $phone=$this->input->post('phone');\n $address=$this->input->post('address');\n $amenities=$this->input->post('amenities');\n $update_by=$this->input->post('update_by');\n \n $data->city = $city;\n $data->admin_id = $admin_id;\n $data->name = $name;\n $data->image = $image;\n $data->gst_no = $gst_no;\n $data->pan_no = $pan_no;\n $data->lat = $lat;\n $data->lng = $lng;\n $data->location = $location;\n $data->cuisines = $cuisines;\n $data->cost = $cost;\n $data->openingTime = $openingTime;\n $data->closingTime = $closingTime;\n $data->phone = $phone;\n $data->address = $address;\n $data->amenities = $amenities;\n $data->update_by = $update_by;\n $result1 = $this->Supervisor->update_restaurant_data($data);\n if(!empty($admin_id))\n {\n $data1->status ='1';\n $data1->message = 'restaurant data successfully update';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else\n {\n $data1->status ='0';\n $data1->message = 'failed';\n array_push($result,$data1);\n $response->data = $data1;\n }\n echo json_output($response);\n }", "public function update(Request $request, $sifPred)\n{\n $request->validate([\n 'sifPred'=>'required',\n 'nazPred'=> 'required'\n ]);\n\n $user = Pred::find($sifPred);\n $user->sifPred = $request->get('sifPred');\n $user->nazPred = $request->get('nazPred');\n $user->save();\n\n return redirect('/shares')->with('success', 'Stock has been updated');\n}", "public function usn(Request $request)\n {\n //\n $id=1;\n $setting = Setting::find($id);\n $setting->supplier_number = $request->supplier_number;\n $setting->save();\n echo 1;\n }", "public function update($id,Request $request)\n {\n $v = Validator::make($request->all(), [\n 'ent_nom'=> 'required|max:20', \n 'ent_statut_juridique'=>'required|max:20',\n 'ent_nbr'=>'integer',\n 'ent_adresse'=>'required|max:255', \n 'ent_pays'=>'required|max:20',\n 'ent_ville'=>'required|max:20',\n // 'ent_fax'=>'integer',\n // 'ent_tel'=>'integer',\n 'ent_web'=>'url',\n 'email' => 'required|email|unique:entreprise,email,'.$id, \n ]);\n\n if ($v->fails())\n {\n return redirect()->back()->withErrors($v->errors())->withInput();\n }\n $Entreprise = Entreprise::find($id); \n \n $Entreprise->ent_nom=$request->get('ent_nom');\n $Entreprise->ent_statut_juridique=$request->get('ent_statut_juridique');\n $Entreprise->secteur_id=$request->get('secteur_id');\n $Entreprise->ent_nbr=$request->get('ent_nbr');\n $Entreprise->ent_adresse=$request->get('ent_adresse');\n $Entreprise->ent_pays=$request->get('ent_pays');\n $Entreprise->ent_ville=$request->get('ent_ville');\n $Entreprise->ent_fax=$request->get('ent_fax');\n $Entreprise->ent_tel=$request->get('ent_tel');\n $Entreprise->ent_web=$request->get('ent_web');\n $Entreprise->email=$request->get('email');\n \n \n \n $Entreprise->save();\n return Redirect:: to('entreprise');\n }", "public function update(Request $request ,$id){\n $medecins = Medecin::findOrFail($id);\n $medecins->nom=$request->nom;\n $medecins->prenom=$request->prenom;\n $medecins->email=$request->email;\n $medecins->special=$request->special;\n $medecins->age=$request->age; \n $medecins->operation=$request->operation;\n $medecins->telephone=$request->telephone;\n $medecins->detail=$request->detail;\n $medecins->save();\n return redirect()->route('medecin.index')\n ->with('success','medecin update successfully');\n \n \n }", "public function update(Request $request, $id)\n {\n \n $vars = Product::on(Auth::user()->database_name)->find($id);\n \n $vars_status = $vars->status;\n $vars_exento = $vars->exento;\n $vars_islr = $vars->islr;\n \n $data = request()->validate([\n \n \n 'segment' =>'required',\n 'unit_of_measure_id' =>'required',\n 'description' =>'required',\n 'price' =>'required',\n 'price_buy' =>'required',\n 'cost_average' =>'required',\n 'money' =>'required',\n 'special_impuesto' =>'required',\n 'status' =>'required',\n \n ]);\n \n $var = Product::on(Auth::user()->database_name)->findOrFail($id);\n \n $var->segment_id = request('segment');\n $var->subsegment_id= request('Subsegment');\n if(request('twoSubsegment') == 'null'){\n $var->twosubsegment_id= null;\n }else{\n $var->twosubsegment_id= request('twoSubsegment');\n }\n \n if(request('threeSubsegment') == 'null'){\n $var->threesubsegment_id= null;\n }else{\n $var->threesubsegment_id= request('threeSubsegment');\n }\n \n \n $var->unit_of_measure_id = request('unit_of_measure_id');\n \n $var->code_comercial = request('code_comercial');\n $var->description = request('description');\n \n $valor_sin_formato_price = str_replace(',', '.', str_replace('.', '',request('price')));\n $valor_sin_formato_price_buy = str_replace(',', '.', str_replace('.', '',request('price_buy')));\n $valor_sin_formato_cost_average = str_replace(',', '.', str_replace('.', '',request('cost_average')));\n $valor_sin_formato_special_impuesto = str_replace(',', '.', str_replace('.', '',request('special_impuesto')));\n \n \n \n $var->price = $valor_sin_formato_price;\n $var->price_buy = $valor_sin_formato_price_buy;\n $var->cost_average = $valor_sin_formato_cost_average;\n \n $var->photo_product = request('photo_product');\n \n $var->money = request('money');\n \n \n $var->special_impuesto = $valor_sin_formato_special_impuesto;\n \n if(request('exento') == null){\n $var->exento = \"0\";\n }else{\n $var->exento = \"1\";\n }\n if(request('islr') == null){\n $var->islr = \"0\";\n }else{\n $var->islr = \"1\";\n }\n \n \n if(request('status') == null){\n $var->status = $vars_status;\n }else{\n $var->status = request('status');\n }\n \n $var->save();\n \n return redirect('/products')->withSuccess('Actualizacion Exitosa!');\n }", "function update($where) {\n}", "public function update(Request $request,$id)\n {\n// echo \"<pre>\"; print_r($request->all());\n\n// $this->validate($request, ['working_hours' => 'required|numeric',\n// 'email' => 'required|unique:employee|email',\n// 'no_of_holidays' => 'required|numeric',\n// 'phone' => 'required|numeric|unique:employee',\n// 'promo_code' => 'required',\n// 'emp_name' => 'required',\n// 'phone2' => 'numeric',\n// 'team_leader' => 'required',\n// 'hr' => 'required',\n// 'country' => 'required',\n// 'state' => 'required',\n// 'city' => 'required',\n// 'venue' => 'required',\n// 'basic_venue' => 'required',\n// 'bdm' => 'required',\n// 'free_app_target_venue' => 'required',\n// 'free_shop_target_bdm' => 'required',\n// 'paid_app_target_venue' => 'required',\n// 'paid_shop_target_bdm' => 'required',\n//\n// ]);\n\n Employee::find($id)->update([\n 'emp_type' => $request['emp_type'],\n 'working_hours' => $request['working_hours'],\n 'no_of_holidays' => $request['no_of_holidays'],\n 'promo_code' => $request['promo_code'],\n 'name' => $request['name'],\n 'phone' => $request['phone'],\n 'phone2' => $request['phone2'],\n 'email' => $request['email'],\n 'file_no' => $request['file_no'],\n 'is_team_lead' => $request['is_team_lead'],\n 'team_leader' => $request['team_leader'],\n 'retailer' => $request['retailer'],\n 'dealer' => $request['dealer'],\n 'hr' => $request['hr'],\n 'country' => $request['country'],\n 'state' => $request['state'],\n 'city' => $request['city'],\n 'venue' => $request['venue'],\n 'basic_venue' => $request['basic_venue'],\n 'bdm' => $request['bdm'],\n 'free_app_target_venue' => $request['free_app_target_venue'],\n 'free_shop_target_bdm' => $request['free_shop_target_bdm'],\n 'paid_app_target_venue' => $request['paid_app_target_venue'],\n 'paid_shop_target_bdm' => $request['paid_shop_target_bdm'],\n 'paid_app_target_venue_transaction' => $request['paid_app_target_venue_transaction'],\n 'paid_app_bdm_transaction' => $request['paid_app_bdm_transaction'],\n 'target_bonus_basic_venue_target' => $request['target_bonus_basic_venue_target'],\n 'target_bonus_basic_venue_bonus' => $request['target_bonus_basic_venue_bonus'],\n 'target_bonus_bdm_target' => $request['target_bonus_bdm_target'],\n 'target_bonus_bdm_bonus' => $request['target_bonus_bdm_bonus'],\n 'spot_bonus_basic_venue_target' => $request['spot_bonus_basic_venue_target'],\n 'spot_bonus_basic_venue_bonus' => $request['spot_bonus_basic_venue_bonus'],\n 'spot_bonus_bdm_target' => $request['spot_bonus_bdm_target'],\n 'spot_bonus_bdm_bonus' => $request['spot_bonus_bdm_bonus'],\n ]);\n\n return redirect('/list-employee');\n }" ]
[ "0.7483169", "0.7199893", "0.71049935", "0.69770557", "0.684445", "0.680279", "0.67778605", "0.67778605", "0.6774393", "0.67644715", "0.6747955", "0.67461276", "0.6731689", "0.6713473", "0.6693267", "0.6690801", "0.66513085", "0.6645068", "0.6643859", "0.66383994", "0.6592372", "0.6576602", "0.6563912", "0.6555564", "0.65513414", "0.654657", "0.6534211", "0.6526123", "0.6516041", "0.65093136", "0.64925236", "0.64923567", "0.6436405", "0.6425723", "0.6415188", "0.6410045", "0.64001715", "0.6382197", "0.6379818", "0.63794345", "0.6376529", "0.6373529", "0.63686746", "0.63648814", "0.6358107", "0.6349306", "0.6341903", "0.6331424", "0.6325548", "0.6324857", "0.63191104", "0.6311321", "0.63108724", "0.62826526", "0.62790114", "0.6275316", "0.6269652", "0.62695926", "0.62667763", "0.6250784", "0.6248599", "0.62469494", "0.6236666", "0.622466", "0.6214992", "0.6204705", "0.62043023", "0.6202482", "0.61991495", "0.6194931", "0.6192199", "0.61879736", "0.6182872", "0.6178778", "0.61671096", "0.61629456", "0.6159325", "0.61578417", "0.615621", "0.61549205", "0.6150878", "0.6150843", "0.6148375", "0.6147494", "0.614684", "0.61460924", "0.6141279", "0.6137732", "0.6134205", "0.6132001", "0.6129938", "0.6128872", "0.6128014", "0.6121961", "0.612172", "0.6114518", "0.61120516", "0.61097634", "0.6101134", "0.60985315" ]
0.7658345
0
public function serviceFun() Show the form for creating a new resource.
public function create() { // $services['services']=Service::where('is_active',1)->get(); // return view('addSupplier')->with('services', $services); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function new_form(){\n $this->vars['page_header'] = __('Create New Service', 'latepoint');\n $this->vars['breadcrumbs'][] = array('label' => __('Create New Service', 'latepoint'), 'link' => false );\n\n $this->vars['category'] = new OsServiceCategoryModel();\n\n if($this->get_return_format() == 'json'){\n $response_html = $this->render($this->views_folder.'new_form', 'none');\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n exit();\n }else{\n echo $this->render($this->views_folder . 'new_form', $this->get_layout());\n }\n }", "public function create()\n {\n return view(\"admin.services.create\");\n }", "public function create()\n {\n //\n\t\treturn view('services.create');\n }", "public function create()\n {\n return view('admin/services.service.create');\n }", "public function create(){\n return view('admin/service/service_create');\n }", "public function create()\n {\n return view(\"backoffice.service_detail.create\");\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function create()\n {\n return view('widegts::services.create');\n }", "public function create()\n {\n $this->data[\"form\"] = \"add\";\n return view(\"admin.pages.services\",$this->data);\n }", "public function create()\n {\n return view('admin.service.create');\n }", "public function create()\n\t{\n\t\treturn view('recinto_servicios.create');\n\t}", "public function create()\r\n\t{\r\n\t\treturn View::make('services.create');\r\n\t}", "public function create()\n\t{\n\t\treturn View::make('services.create');\n\t}", "public function create()\n {\n return view('admin.services.create');\n \n }", "public function create()\n {\n return view('backend.services.add');\n }", "public function create()\n {\n return view('adminlte.services.create');\n }", "public function create()\n {\n return \\Response::view('service.create');\n }", "public function create()\n {\n return view('admin.services.add');\n }", "public function create()\n {\n return view('admin.services.create');\n }", "public function create()\n {\n return view('admin.services.create');\n }", "public function create()\n {\n return view('admin.services.create');\n }", "public function create()\n {\n return view('patent__services.create');\n }", "public function create()\n {\n return view('service_type.create');\n }", "public function create()\n {\n $services = Service::all();\n return view('back.service.addService', compact('services'));\n }", "public function create()\n {\n return \"Formulário para cadastrar um novo cliente.\";\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function createForm();", "public function createForm();", "public function create()\n {\n return view('services.add');\n }", "public function newAction()\n {\n $entity = new Servicio();\n $entity->setActivo(1);\n\n //Se carga una provincia por defecto\n $provincia = $this->getDoctrine()\n ->getRepository('sisconeeAppBundle:Provincia')\n ->find(2);\n //Se le establece la provincia por defecto al servicio (necesario para el funcionamiento de la programacion asociada\n //a los eventos PRE_SET_DATA y PRE_SUBMIT)\n //var_dump($provincia);\n $entity->setProvincia($provincia);\n\n $form = $this->createCreateForm($entity);\n\n return $this->render('sisconeeAdministracionBundle:Servicio:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function createForm()\n {\n }", "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.globales.servicios.create');\n }", "public function create()\n {\n return view('services.create');\n }", "public function create()\n {\n return view('services.create');\n }", "public function create()\n {\n return view('dashboard.service.create');\n }", "public function create()\n {\n $subservices = $this->subservice->lists('title', 'id');\n return view('admin.service.create', compact('subservices'));\n }", "public function create()\r\n {\r\n $serviceCategory = ServiceCategory::all();\r\n return view('admin.service.services.form', compact('serviceCategory'));\r\n }", "public function create()\n {\n return view('dashboard.services.create');\n }", "public function create()\n {\n \n return view('originalservice.create');\n }", "public function CreateForm();", "public function create()\n {\n if (Gate::denies('service.create')) {\n session()->flash('warning', 'You do not have permission to create a service');\n return redirect()->back();\n }\n return view('pages.settings.services-type.create');\n }", "public function create()\n {\n return view(\"pages.service.create\");\n }", "public function create()\n {\n return view('back_end.pages_backend.services_backend.create');\n }", "public function create()\n {\n $title = 'Services';\n $module = $this->module;\n $route = route($this->module . '.store');\n $formulario = 'modules.'.$this->module.'.form';\n return view('create', compact('title', 'module', 'route', 'formulario'));\n }", "function createApprentice() {\n\t\t\t\t\t$addForm = new h2o('views/addApprentice.html');\n\t\t\t\t\techo $addForm->render();\n\t\t\t\t}", "public function actionCreate()\n\t{\n\t\t\n\t\t//$data['model'] = new ClientForm();\n\n\t\t//$data['action'] = 'add';\n\t\t\n\t\t//$model=new Client;\n\t\t//$DPmodel=new Driverparticular;\n\t\t$data['modelBroker'] = new Broker;\n\t\t$data['model'] = new ClientForm();\n\t \t$data['DPmodel'] = new DriverParticularForm();\n\t\t$data['action'] = 'add';\n\t\t$data['i'] = 0;\n\t\t\n\t\t$this->render('_form', $data);\n\n\t\t\n\n\t}", "public function addService()\n {\n $option = 'submitnewservice';\n return view('cmsServicesAdd', ['title'=>'Add Service','option'=>$option]);\n }", "public function create()\n {\n return view('pagesystem.Service.create');\n }", "public function create()\n {\n $services = Service::all();\n return view('backend.service-detail.create',compact('services'));\n }", "public function create()\n {\n return view('servicos.create');\n }", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('servicios.create');\n }", "public function actionCreate()\n {\n $model = new Service();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $cities = Yii::$app->getRequest()->post('cities');\n\n $model->attachCities($cities);\n\n $requestTypes = Yii::$app->getRequest()->post('request_types');\n\n $model->attachRequestTypes($requestTypes);\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('admin.childservices.create',['title'=>trans('admin.create')]);\n }", "public function create()\n\t{\n\t\t//\n\t\t\n\t\treturn View::make('client.addclient');\n\t}", "public function create()\n {\n return view('admin.video_service.add_new_video_service');\n }", "abstract public function createForm();", "abstract public function createForm();", "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('restful.add');\n }", "public function create()\n\t{\n\t $services = Services::pluck(\"name\", \"id\")->prepend('Please select', 0);\n\n\t \n\t return view('admin.photoservices.create', compact(\"services\"));\n\t}", "public function actionCreate()\n {\n $model = new Service();\n if($model->load(Yii::$app->request->post()) ){\n $model->created_by=Yii::$app->user->id;\n $model->created_at=time();\n if ( $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n return view('main.client.create');\n }", "public function createCreateSupplierForm()\n\t{\n\t\t$form = $this->createForm();\n\n\t\t$form->addSubmit(\"create\", \"Vytvoriť dodávateľa\")\n\t\t\t->setAttribute('class', 'btn-primary');\n\n\t\t$form->onSuccess[] = array($this, \"createSupplierSubmitted\");\n\n\t\treturn $form;\n\t}", "public function create()\n {\n // $services = Service::all();\n $services = Service::all();\n return view('admin.orders.form', compact('services'));\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n $services=\\App\\Models\\Service::all();\n return view('admin.service-projects.create', compact('services'));\n }", "public function show()\n {\n return view('addservice');\n }", "public function create()\n {\n //get view form\n return 'create Method';\n }", "public function create()\n {\n //return view('marca.create');\n return 'Mostrando Formulario para crear Fabricantes';\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n $title = 'Serviços';\n return view('servicos.create', compact('title'));\n }", "public function create()\n {\n return $this->form->render('mconsole::personal.form');\n }", "public function create()\n {\n return view('Back.Tables.main_services.addition');\n\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n\t{\n return view('backend.clienti.create');\n\t}", "public function create()\n {\n return view('admin.servicio.create');\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 $service = Service::pluck('libelle','direction')->all();\n return view('services.create',compact('service'));\n }", "public function create()\n {\n return response()\n ->view( 'pages.esp.esp-add' , ['formType' => 'add' ] );\n }", "protected function form() {\n $form = new Form(new Service);\n\n $form->display('id', 'ID');\n\n $form->number('order_id', trans('admin.service.order-id'))->rules('required|integer|max:32767');\n\n $form\n ->text('name', trans('admin.service.name'))\n ->rules('required|max:250');\n\n $form\n ->text('name_ru', trans('admin.service.name') . '-ru')\n ->rules('max:250');\n\n $form\n ->text('link', trans('admin.service.link'))\n ->rules(function ($form) {\n $rules = 'required|min:2|alpha_dash';\n\n // If it is not an edit state, add field unique verification\n if (!$id = $form->model()->id) {\n $rules .= '|unique:services,link';\n }\n\n return $rules;\n });\n\n $form->multipleSelect('portfolio')->options(\\App\\Models\\Portfolio::all()->pluck('name', 'id'));\n\n $form->textarea('description', trans('admin.service.description'))->rules('required|max:250');\n $form->textarea('description_ru', trans('admin.service.description') . '-ru')->rules('max:250');\n\n $form->ckeditor('details', trans('admin.service.details'));\n $form->ckeditor('details_ru', trans('admin.service.details') . '-ru');\n\n $form\n ->image('cover', trans('admin.service.cover'))\n ->rules('required')\n ->uniqueName();\n\n $form\n ->image('image', trans('admin.service.image'))\n ->rules('required')\n ->uniqueName();\n\n $form->display('created_at', trans('admin.created_time'));\n $form->display('updated_at', trans('admin.updated_time'));\n\n return $form;\n }", "public function create()\n {\n return view('AltaServices');\n }", "public function create()\n\t{\n\t\treturn View::make('apis.create');\n\t}", "public function create()\n\t{\n\t\t//\n\t\treturn view('clients.create');\n\t}", "public function create()\n {\n $services = Service::pluck('title', 'id')->all();\n\n return view('back.partner.create', ['services'=>$services]);\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function actionCreate() {}", "public function actionCreate() {}", "public function create()\n {\n return view ('forms.create');\n }", "public function create()\n {\n return view(\"admin.feature.create\");\n }", "public function actionCreate()\n {\n $model = new ClinicServices();\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->save()) {\n\n $model->upload();\n \n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $service = new Service;\n $service_code = self::generateServiceCode();\n $ships = Ship::all();\n \n return view('service.create', compact('service', 'service_code','ships'));\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 return view('admin.client.add');\n }", "public function create()\n\t{\n\t\t//\n\t\treturn view(ServiceProvider::SHORT_NAME . '::OrmForms.checkFrontAccount');\n\t}", "public function create()\n {\n return view('admin.home.client.create');\n }" ]
[ "0.7636244", "0.7393333", "0.7361841", "0.7347827", "0.73438406", "0.7333594", "0.73249143", "0.727085", "0.72589797", "0.724974", "0.7232137", "0.72200197", "0.72001857", "0.7185539", "0.7151138", "0.7137338", "0.7136903", "0.7122271", "0.7110901", "0.7110901", "0.7110901", "0.70744914", "0.7069781", "0.7065236", "0.70603037", "0.7058307", "0.7049099", "0.7049099", "0.7042969", "0.7040075", "0.70101684", "0.70037663", "0.70037663", "0.69719", "0.6968004", "0.6968004", "0.6957413", "0.695286", "0.69400734", "0.6931618", "0.6927288", "0.69092935", "0.690339", "0.68839854", "0.6865102", "0.6828941", "0.68197596", "0.6801136", "0.68010676", "0.6795205", "0.677236", "0.67639256", "0.67569727", "0.6749672", "0.67409694", "0.67138416", "0.67042154", "0.6697787", "0.66922694", "0.66922694", "0.6689866", "0.6688828", "0.6681552", "0.66655225", "0.6662622", "0.664608", "0.6631825", "0.6602254", "0.660099", "0.6598407", "0.6593279", "0.6587578", "0.6579881", "0.6576323", "0.65752864", "0.65738636", "0.6573577", "0.6572841", "0.6572841", "0.6568698", "0.6558775", "0.6554717", "0.6554312", "0.655296", "0.6549494", "0.6545226", "0.65386856", "0.6531916", "0.6523703", "0.65211034", "0.6500858", "0.6500858", "0.64986914", "0.6494755", "0.6492442", "0.6485699", "0.6482267", "0.6480144", "0.6476722", "0.64699644" ]
0.6542159
86
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.7285655", "0.71443397", "0.7133207", "0.6641532", "0.6621311", "0.65678823", "0.6525738", "0.65086055", "0.6448411", "0.6374508", "0.637246", "0.6364561", "0.6364561", "0.6364561", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function 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($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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78548634", "0.7693446", "0.72737956", "0.72415876", "0.71732706", "0.7064379", "0.70547634", "0.6985193", "0.6948865", "0.6946892", "0.69416964", "0.6929201", "0.69028485", "0.6899143", "0.6899143", "0.68794435", "0.6864862", "0.6860578", "0.68581015", "0.6845792", "0.6836835", "0.681191", "0.6808133", "0.6806856", "0.68035305", "0.6796193", "0.67936623", "0.67936623", "0.67895305", "0.6785768", "0.678106", "0.67773324", "0.67697626", "0.6762823", "0.6747543", "0.6747543", "0.67463523", "0.67444044", "0.6741766", "0.6737379", "0.6726827", "0.6714104", "0.66950524", "0.66935307", "0.6689272", "0.6689106", "0.66872644", "0.6686648", "0.6684393", "0.6670288", "0.6669616", "0.66668564", "0.66668564", "0.666409", "0.6662514", "0.66599286", "0.66590035", "0.6655965", "0.6653906", "0.6644097", "0.66327673", "0.66314846", "0.6629497", "0.6629497", "0.6620671", "0.66204685", "0.66168797", "0.66163945", "0.66112244", "0.6610172", "0.66072273", "0.65975267", "0.6596347", "0.6595878", "0.65914613", "0.65904135", "0.65880567", "0.658147", "0.6581434", "0.6581035", "0.65780395", "0.65776944", "0.6576013", "0.6570687", "0.6569499", "0.6568776", "0.6567722", "0.6562973", "0.6562973", "0.6561691", "0.655929", "0.6557889", "0.65571314", "0.65565974", "0.65564924", "0.65558827", "0.65556073", "0.6555524", "0.6549151", "0.6548339", "0.65460944" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "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 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 function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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(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($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public 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 $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 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.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
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
For all the places passed, ensure they are of the same dimensionality.
private function validateDimensionality(Vector ...$vectors): void { $spaceDimensions = $this->dimensions; array_walk( $vectors, function (Vector $vector) use ($spaceDimensions) { // Ensure the dimensions are the same if ($vector->getN() !== $spaceDimensions) { $errorMsg = sprintf( 'There is a position that has [%d] dimensions but space has [%d] dimensions', $vector->getN(), $spaceDimensions ); throw new PlaceDimensionsDoNotMatchSpaceException( $errorMsg ); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validate_regions(){\n\n for ($row = 0; $row < 9; $row += 3) {\n for ($col = 0; $col < 9; $col += 3) {\n\n // validate each 3x3 region\n if (!$this->validate_region($row, $col)) {\n return false;\n }\n }\n }\n return true;\n }", "public function isValid()\n {\n $usedInRow = range(0, 8);\n $usedInColumn = range(0, 8);\n $usedInBox = range(0, 2);\n\n foreach ($usedInRow as $index) {\n $usedInRow[$index] = range(0, 8);\n foreach ($usedInRow[$index] as $i) {\n $usedInRow[$index][$i] = false;\n }\n }\n\n foreach ($usedInColumn as $index) {\n $usedInColumn[$index] = range(0, 8);\n foreach ($usedInColumn[$index] as $i) {\n $usedInColumn[$index][$i] = false;\n }\n }\n\n foreach ($usedInBox as $indexA) {\n $usedInBox[$indexA] = range(0, 2);\n foreach ($usedInBox[$indexA] as $indexB) {\n $usedInBox[$indexA][$indexB] = range(0, 8);\n foreach ($usedInBox[$indexA][$indexB] as $i) {\n $usedInBox[$indexA][$indexB][$i] = false;\n }\n }\n }\n\n for ($y = 0; $y < 9; $y++) {\n for ($x = 0; $x < 9; $x++) {\n if ($this->sudoku[$y][$x] === 0) {\n continue;\n }\n\n $value = $this->sudoku[$y][$x] - 1;\n if ($usedInRow[$y][$value] || $usedInColumn[$x][$value] || $usedInBox[floor($y / 3)][floor($x / 3)][$value]) {\n return false;\n }\n\n $usedInRow[$y][$value] = true;\n $usedInColumn[$x][$value] = true;\n $usedInBox[floor($y / 3)][floor($x / 3)][$value] = true;\n }\n }\n\n return true;\n }", "public function checkCoordinates() : void\n {\n $this->checkLatitudes();\n $this->checkLongitudes();\n }", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "private function validDimensions(array $size): bool\n {\n return $size['height'] > 0 && $size['width'] > 0;\n }", "private function validate_columns(){\n\n for($i=0;$i<9;$i++){\n $col = array_column($this->sudoku_array, $i);\n\n if(count($col) !=9 || count(array_unique($col)) !=9){\n return false;\n }\n }\n return true;\n }", "private function isValidBox(): bool {\n $boxCoordinates = [\n [0,0], [0,1], [0,2],\n [1,0], [1,1], [1,2],\n [2,0], [2,1], [2,2]\n ];\n for($y=0; $y<9; $y+=3) {\n for($x=0; $x<9; $x+=3) {\n $curBox = [];\n for($i=0; $i<9; $i++) {\n $coordinates = $boxCoordinates[$i];\n $coordinates[0] += $y;\n $coordinates[1] += $x;\n if(in_array($this->board[$coordinates[0]][$coordinates[1]], $curBox)){\n return false;\n }\n array_push($curBox, $this->board[$coordinates[0]][$coordinates[1]]);\n }\n }\n }\n return true;\n }", "public function typeIsOfSameInternalSize() : bool\n {\n return true;\n }", "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 }", "private function valid_team_array() {\r\n if (!is_array($this->teams) || count($this->teams) < 2) {\r\n $this->error = 'Not enough teams in array shape passed';\r\n $this->reset_class_state();\r\n return false;\r\n }\r\n return true;\r\n }", "public function valid()\n {\n\n if ($this->container['height'] === null) {\n return false;\n }\n if ($this->container['width'] === null) {\n return false;\n }\n if ($this->container['bits_per_pixel'] === null) {\n return false;\n }\n if ($this->container['horizontal_resolution'] === null) {\n return false;\n }\n if ($this->container['vertical_resolution'] === null) {\n return false;\n }\n if ($this->container['is_cached'] === null) {\n return false;\n }\n return true;\n }", "public static function is_product_dimensions_valid($all_product_data)\n {\n if (empty($all_product_data)) {\n return true;\n }\n foreach ($all_product_data as $p) {\n $product = wc_get_product($p->ID);\n if (!$product->is_virtual()) {\n $w = $product->get_weight();\n $dimensions = $product->get_dimensions(false);\n if (empty($w) || !is_numeric($w)) {\n return false;\n }\n if (!is_numeric($dimensions['height'])) {\n return false;\n }\n if (!is_numeric($dimensions['width'])) {\n return false;\n }\n if (!is_numeric($dimensions['length'])) {\n return false;\n }\n }\n }\n return true;\n }", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "function _updateCoords()\n {\n if (is_array($this->_elements)) {\n $keys = array_keys($this->_elements);\n foreach ($keys as $key) {\n if (is_object($this->_elements[$key])) {\n $this->_elements[$key]->_updateCoords();\n }\n }\n unset($keys);\n }\n return true;\n }", "private static function assertAll() {\r\n\t\tforeach (self::$global as $type) {\r\n\t\t\t$type->assert();\r\n\t\t}\r\n\t}", "public function getDimensions() {}", "public function valid()\n {\n\n if ($this->container['metrics'] === null) {\n return false;\n }\n if ($this->container['dimensions'] === null) {\n return false;\n }\n return true;\n }", "public function getDimensions();", "public function getDimensions();", "function placeQueens($row, $cols, $gridSize, &$results) {\n if ($row == $gridSize) {\n $result[] = $cols;\n } else {\n for ($col=0; $col < $gridSize; $col++) { \n if (checkValid($cols, $row, $col)) {\n $cols[$row] = $col; // place queen\n placeQueens($row+1, $cols, $gridSize, $results);\n }\n }\n }\n}", "protected function failsBasicDimensionChecks($parameters, $width, $height)\n {\n return (isset($parameters['width']) && $parameters['width'] != $width) ||\n (isset($parameters['min_width']) && $parameters['min_width'] > $width) ||\n (isset($parameters['max_width']) && $parameters['max_width'] < $width) ||\n (isset($parameters['height']) && $parameters['height'] != $height) ||\n (isset($parameters['min_height']) && $parameters['min_height'] > $height) ||\n (isset($parameters['max_height']) && $parameters['max_height'] < $height);\n }", "function part2() {\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n $area = $this->charCounter($id, $this->fabric);\n echo \"$id: $area\\n\";\n if ($area == $w * $h) {\n die(\"$id fills $area cells and is not overlapped.\\n\");\n }\n }\n echo \"No region found.\\n\";\n }", "private function perfectCity() {\n $this->addCity($this->cityOne);\n $this->addCity($this->cityTwo);\n $this->addCity($this->cityThree);\n if ($this->perfectCity != '')\n $this->perfectCitySize = sizeof(array_unique($this->perfectCity)); \n }", "public function valid()\n {\n if ($this->container['area'] === null) {\n return false;\n }\n if ($this->container['axis_between_categories'] === null) {\n return false;\n }\n if ($this->container['axis_line'] === null) {\n return false;\n }\n if ($this->container['base_unit_scale'] === null) {\n return false;\n }\n if ($this->container['category_type'] === null) {\n return false;\n }\n if ($this->container['cross_at'] === null) {\n return false;\n }\n if ($this->container['cross_type'] === null) {\n return false;\n }\n if ($this->container['display_unit'] === null) {\n return false;\n }\n if ($this->container['display_unit_label'] === null) {\n return false;\n }\n if ($this->container['has_multi_level_labels'] === null) {\n return false;\n }\n if ($this->container['is_automatic_major_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_max_value'] === null) {\n return false;\n }\n if ($this->container['is_automatic_minor_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_min_value'] === null) {\n return false;\n }\n if ($this->container['is_display_unit_label_shown'] === null) {\n return false;\n }\n if ($this->container['is_logarithmic'] === null) {\n return false;\n }\n if ($this->container['is_plot_order_reversed'] === null) {\n return false;\n }\n if ($this->container['is_visible'] === null) {\n return false;\n }\n if ($this->container['log_base'] === null) {\n return false;\n }\n if ($this->container['major_grid_lines'] === null) {\n return false;\n }\n if ($this->container['major_tick_mark'] === null) {\n return false;\n }\n if ($this->container['major_unit'] === null) {\n return false;\n }\n if ($this->container['major_unit_scale'] === null) {\n return false;\n }\n if ($this->container['max_value'] === null) {\n return false;\n }\n if ($this->container['minor_grid_lines'] === null) {\n return false;\n }\n if ($this->container['minor_tick_mark'] === null) {\n return false;\n }\n if ($this->container['minor_unit'] === null) {\n return false;\n }\n if ($this->container['minor_unit_scale'] === null) {\n return false;\n }\n if ($this->container['min_value'] === null) {\n return false;\n }\n if ($this->container['tick_label_position'] === null) {\n return false;\n }\n if ($this->container['tick_labels'] === null) {\n return false;\n }\n if ($this->container['tick_label_spacing'] === null) {\n return false;\n }\n if ($this->container['tick_mark_spacing'] === null) {\n return false;\n }\n if ($this->container['title'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "private function validate_region($startRow, $startCol){\n\n $temp = array();\n\n for ($row = $startRow; $row < $startRow+3; $row++) {\n for ($col = $startCol; $col < $startCol+3; $col++) {\n $temp[] = $this->sudoku_array[$row][$col];\n }\n }\n\n // check if all digits in a 3x3 regions are unique\n if(count(array_unique($temp)) !=9){\n return false;\n }\n\n return true;\n }", "public function ensureConsistency()\n {\n if ($this->aShape !== null && $this->shape_id !== $this->aShape->getShapeId()) {\n $this->aShape = null;\n }\n if ($this->aCakeType !== null && $this->cake_type_id !== $this->aCakeType->getCakeTypeId()) {\n $this->aCakeType = null;\n }\n }", "function is3x3BlockValid(array $grid, Int2D $int2D, bool $verbose = false): bool;", "public function isResolved()\n\t{\n\t\t// If one section isn't resolved, matrice isn't resolved\n\t\tfor( $i=1; $i<=$this->height; $i++ )\n\t\t{\n\t\t\tfor( $j=1; $j<=$this->width; $j++ )\n\t\t\t{\n\t\t\t\tif( !$this->matrice[$i][$j]->isResolved() )\n\t\t\t\t\treturn false;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\treturn true\n\t}", "public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }", "function countArrangements(){\n if (is_array($this->arrArrangement)) {\n return count($this->arrArrangement);\n } else {\n return 0;\n }\n }", "public function differentSizesDataProvider() {}", "function get_dimesions($shapes) {\n foreach($shapes as $key=>$shape) {\n echo \"<strong>Shape $key</strong><br>\";\n\n echo \"Cordinates - x,y<br>\".\n \"bottom_left: \".$shape['bottom_left'][0].\",\".$shape['bottom_left'][1].\" - \".\n \"top_left: \".$shape['top_left'][0].\",\".$shape['top_left'][1].\" - \".\n \"bottom_right: \".$shape['bottom_right'][0].\",\".$shape['bottom_right'][1].\" - \".\n \"top_right: \".$shape['top_right'][0].\",\".$shape['top_right'][1].\"<br>\";\n\n // for simplicity we are considering all shapes square with equal co-ordinates for height and width\n $dimensions['width'] = ($shape['bottom_right'][0] - $shape['bottom_left'][0])+1;\t\n echo \"Width: \".$dimensions['width'].\"<br>\";\n $dimensions['height'] = ($shape['top_right'][1] - $shape['bottom_left'][1])+1;\n echo \"Height: \".$dimensions['height'].\"<br>\";\n\n }\n return $dimensions;\n}", "function checkArrays($x, $y) {\n $A = new Matrix($x);\n $B = new Matrix($y);\n return $this->checkMatrices($A,$B);\n }", "public function testDimensionsForceMesasures()\n {\n $dimensions = Dimensions::create(\n 400,\n 400,\n 200,\n 200,\n ElcodiMediaImageResizeTypes::FORCE_MEASURES\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(0, $dimensions->getSrcY());\n $this->assertEquals(400, $dimensions->getSrcWidth());\n $this->assertEquals(400, $dimensions->getSrcHeight());\n\n $this->assertEquals(0, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(200, $dimensions->getDstWidth());\n $this->assertEquals(200, $dimensions->getDstHeight());\n $this->assertEquals(200, $dimensions->getDstFrameX());\n $this->assertEquals(200, $dimensions->getDstFrameY());\n }", "function get_dimesions_3d($shapes) {\n foreach($shapes as $key=>$shape) {\n echo \"<strong>Shape $key</strong><br>\";\n\n echo \"Cordinates - x,y,z1 (front),z2 (back)<br>\".\n \"bottom_left: \".$shape['bottom_left'][0].\",\".$shape['bottom_left'][1].\",\".$shape['bottom_left'][2].\",\".$shape['bottom_left'][3].\" - \".\n \"top_left: \".$shape['top_left'][0].\",\".$shape['top_left'][1].\",\".$shape['bottom_left'][2].\",\".$shape['bottom_left'][3].\" - \".\n \"bottom_right: \".$shape['bottom_right'][0].\",\".$shape['bottom_right'][1].\",\".$shape['bottom_left'][2].\",\".$shape['bottom_left'][3].\" - \".\n \"top_right: \".$shape['top_right'][0].\",\".$shape['top_right'][1].\",\".$shape['bottom_left'][2].\",\".$shape['bottom_left'][3].\"<br>\";\n\n // for simplicity we are considering all shapes square with equal co-ordinates for height and width\n $dimensions['width'] = ($shape['bottom_right'][0] - $shape['bottom_left'][0])+1;\t\n echo \"Width: \".$dimensions['width'].\"<br>\";\n $dimensions['height'] = ($shape['top_right'][1] - $shape['bottom_left'][1])+1;\n echo \"Height: \".$dimensions['height'].\"<br>\";\n\n }\n return $dimensions;\n}", "protected function buildGrid()\n {\n\t$this->cases = array() ;\n\tfor($row = 1; $row<=$this->size; $row++) { // row \n\t for($col = 1 ; $col<= $this->size; $col++) { // col\n $region = $this->getRegion($row, $col) ;\n $this->cases[$row . '.' . $col] = new GridCase($region, $row, $col, $this->size) ;\n }\n\t}\n return $this->cases ;\n }", "function checkForBounds() {\n $res = true;\n foreach ($this->listFields() as $fieldName) {\n $fieldInfo = $this->getFieldInfo($fieldName);\n $res = $this->_checkForBounds($fieldName, $fieldInfo) && $res;\n }\n return $res;\n }", "public static function validateDimensions($element, FormStateInterface $form_state) {\n $values = $form_state->getValue($element['#parents']);\n\n if (!($values['width'] || $values['height'])) {\n $form_state\n ->setError($element['width'], t('Width or height must be set.'))\n ->setError($element['height'], t('Width or height must be set.'));\n }\n }", "protected function aggregate_multidimensional()\n {\n }", "private function _checkBoundary($newBoundary, $newBox) {}", "public function validateIsFullBoard(){\r\n //in case of a full Column\r\n for($index=0; $index < Board::COLUMNS; $index++){\r\n //if there is an empty cell\r\n if($this->board->gameBoard[0][$index] == Board::CELL){\r\n //board is not full\r\n return false;\r\n }\r\n }///board is full\r\n return true;\r\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}", "abstract public function grid();", "public function testBagIsMultiDimensional($expected, $bag): void\n {\n $this->assertEquals($expected, $this->utility($bag)->isMultiDimensional());\n }", "function logDimension()\r\n {\r\n \r\n }", "private function populateGrid() {\n for ($x = 0; $x < self::HEIGHT; $x++) {\n $this->grid[$x] = [];\n for ($y = 0; $y < self::HEIGHT; $y++) {\n $location = new Location();\n $location->setX($x);\n $location->setY($y);\n $this->grid[$x][$y] = $location;\n }\n }\n }", "function isValid(array $grid, int $rowIndex, int $columnIndex): bool {//lolo\n $c = $grid[$rowIndex][$columnIndex];\n $xIndex = $rowIndex;\n $yIndex = $columnIndex;\n $rowIndex = 0;\n while ($rowIndex < 9)\n {\n if ($rowIndex != $xIndex) //verif diff de la case pour éviter la boucle inf\n if ($grid[$rowIndex][$columnIndex] == $c)\n return (false);\n $rowIndex++;\n }\n $columnIndex = 0;\n while ($columnIndex < 9)\n {\n if ($columnIndex != $yIndex)// idem avec la colonne\n if ($grid[$xIndex][$columnIndex] == $c)\n return (false);\n $columnIndex++;\n }\n $posY = floor($yIndex / 3) * 3; //verif la carré\n for ($i = 0; $i < 3; $i++)\n {\n $posX = floor($xIndex / 3) * 3; \n for($j = 0; $j < 3; $j++)\n {\n if ($grid[$posX][$posY] == $c && $posX != $xIndex && $posY != $yIndex)\n return false;\n $posX++;\n }\n $posY++;\n }\n return (true);\n}", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }", "function package_fits($shipping,$packages,$method) {\n\t\t\t// Packages\n\t\t\tif(!$packages) return;\n\t\t\t\n\t\t\t// Boxes\n\t\t\tif(!isset($this->dimensions[$method])) return true;\n\t\t\t$boxes = $this->dimensions[$method];\n\t\t\t\n\t\t\t// Debug\n\t\t\tif($shipping->debug) print \"<b>\".$method.\"</b><br />\";\n\t\t\t\n\t\t\t// Loop through available box dimensions\n\t\t\t$return = false;\n\t\t\tforeach($boxes as $box_x => $box_dimensions) {\n\t\t\t\trsort($box_dimensions);\n\t\t\t\tif($shipping->debug) {\n\t\t\t\t\tprint \"testing box \".$box_x.\": \";\n\t\t\t\t\tprint_r($box_dimensions);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Loop through all packages, makes sure they all fit\n\t\t\t\t$fits = true;\n\t\t\t\t$dimensions = NULL;\n\t\t\t\tforeach($packages as $package_x => $package) {\n\t\t\t\t\t// Check if package fits box dimensions\n\t\t\t\t\t$package_fits = true;\n\t\t\t\t\t$package_dimensions = array(\n\t\t\t\t\t\t$package['dimensions_width'],\n\t\t\t\t\t\t$package['dimensions_length'],\n\t\t\t\t\t\t$package['dimensions_height']\n\t\t\t\t\t);\n\t\t\t\t\trsort($package_dimensions);\n\t\t\t\t\tif($shipping->debug) {\n\t\t\t\t\t\tprint \"trying to fit package \".$package_x.\": \";\n\t\t\t\t\t\tprint_r($package_dimensions);\n\t\t\t\t\t}\n\t\t\t\t\tforeach($package_dimensions as $package_x => $package_dimension) {\n\t\t\t\t\t\t// Check all box dimensions to see if package fits within\n\t\t\t\t\t\tforeach($box_dimensions as $box_dimension_x => $box_dimension) {\n\t\t\t\t\t\t\tif(isset($dimensions['box'][$box_dimension_x])) continue;\n\t\t\t\t\t\t\tif($box_dimension >= $package_dimension) {\n\t\t\t\t\t\t\t\t$dimensions['package'][$package_x] = $package_dimension;\n\t\t\t\t\t\t\t\t$dimensions['box'][$box_dimension_x] = $box_dimension;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Doesn't fit\n\t\t\t\t\t\tif(!$dimensions['package'][$package_x]) {\n\t\t\t\t\t\t\tif($shipping->debug) print \"package dimension: \".$package_dimension.\" doesn't fit box dimension: \".$box_dimension.\"<br />\";\n\t\t\t\t\t\t\t$package_fits = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!$package_fits) {\n\t\t\t\t\t\tif($shipping->debug) print \"package doesn't fit in box \".$box_x.\"<br />\";\n\t\t\t\t\t\t$fits = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($fits) {\n\t\t\t\t\tif($shipping->debug) print \"FITS!<br /><br />\";\n\t\t\t\t\t$return = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function valid()\n {\n\n if ($this->container['major_group_id'] === null) {\n return false;\n }\n if ($this->container['sub_group_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['item_description'] === null) {\n return false;\n }\n if ($this->container['backorder'] === null) {\n return false;\n }\n if ($this->container['charge_code'] === null) {\n return false;\n }\n if ($this->container['max_cycle'] === null) {\n return false;\n }\n if ($this->container['max_interim'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['seasonal_item'] === null) {\n return false;\n }\n if ($this->container['secure'] === null) {\n return false;\n }\n if ($this->container['unit_code'] === null) {\n return false;\n }\n if ($this->container['forward_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['forward_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['allocation_rule'] === null) {\n return false;\n }\n if ($this->container['receiving_criteria_scheme_id'] === null) {\n return false;\n }\n if ($this->container['hazmat'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['warehouse_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['quantity'] === null) {\n return false;\n }\n if ($this->container['weight_per_wrap'] === null) {\n return false;\n }\n return true;\n }", "public function ensureConsistency()\n {\n if ($this->aPublisher !== null && $this->publisher_id !== $this->aPublisher->getPublisherId()) {\n $this->aPublisher = null;\n }\n if ($this->aLanguage !== null && $this->language_id !== $this->aLanguage->getLanguageId()) {\n $this->aLanguage = null;\n }\n if ($this->aPlace !== null && $this->publish_place_id !== $this->aPlace->getPlaceId()) {\n $this->aPlace = null;\n }\n if ($this->aFrequency !== null && $this->frequency_id !== $this->aFrequency->getFrequencyId()) {\n $this->aFrequency = null;\n }\n if ($this->aUser !== null && $this->uid !== $this->aUser->getUserId()) {\n $this->aUser = null;\n }\n }", "public function testIssue52C()\n {\n $packer = new Packer();\n $packer->addBox(new TestBox('Box', 230, 300, 240, 160, 230, 300, 240, 15000));\n $packer->addItem(new TestItem('Item 1', 210, 297, 4, 213, true));\n $packer->addItem(new TestItem('Item 2', 80, 285, 70, 199, true));\n $packer->addItem(new TestItem('Item 3', 80, 285, 70, 199, true));\n\n /** @var PackedBox[] $packedBoxes */\n $packedBoxes = iterator_to_array($packer->pack(), false);\n\n self::assertEquals(2, count($packedBoxes));\n\n self::assertEquals(160, $packedBoxes[0]->getUsedWidth());\n self::assertEquals(285, $packedBoxes[0]->getUsedLength());\n self::assertEquals(70, $packedBoxes[0]->getUsedDepth());\n\n self::assertEquals(210, $packedBoxes[1]->getUsedWidth());\n self::assertEquals(297, $packedBoxes[1]->getUsedLength());\n self::assertEquals(4, $packedBoxes[1]->getUsedDepth());\n }", "public function isInputsHaveSameRatio(): bool\n {\n $this->consistencyCheck();\n \n $input_list = ProjectInputs::query()->where('project', $this->id)->get();\n if (count($input_list) > 1) {\n return $input_list->where('status', InputStatuses::WRONG_RATIO)->isNotEmpty();\n } else {\n return false;\n }\n }", "public function solve()\n {\n $this->usedInBox = range(0, 2);\n foreach ($this->usedInBox as $indexA) {\n $this->usedInBox[$indexA] = range(0, 2);\n\n foreach ($this->usedInBox[$indexA] as $indexB => $bogus) {\n $this->usedInBox[$indexA][$indexB] = range(0, 8);\n\n foreach ($this->usedInBox[$indexA][$indexB] as $indexC => $c) {\n $this->usedInBox[$indexA][$indexB][$indexC] = false;\n }\n }\n }\n\n $this->usedInRow = range(0, 8);\n foreach ($this->usedInRow as $indexA) {\n $this->usedInRow[$indexA] = range(0, 8);\n\n foreach ($this->usedInRow[$indexA] as $indexB) {\n $this->usedInRow[$indexA][$indexB] = false;\n }\n }\n\n $this->usedInColumn = range(0, 8);\n foreach ($this->usedInColumn as $indexA) {\n $this->usedInColumn[$indexA] = range(0, 8);\n\n foreach ($this->usedInColumn[$indexA] as $indexB) {\n $this->usedInColumn[$indexA][$indexB] = false;\n }\n }\n\n for ($y = 0; $y < 9; $y++) {\n for ($x = 0; $x < 9; $x++) {\n if ($this->sudoku[$y][$x] === 0) {\n continue;\n }\n\n $value = $this->sudoku[$y][$x] - 1;\n\n $this->usedInRow[$y][$value] = true;\n $this->usedInColumn[$x][$value] = true;\n $this->usedInBox[floor($y / 3)][floor($x / 3)][$value] = true;\n }\n }\n\n return $this->runSolve(0);\n }", "public function testBasicPreconditionFail2()\n {\n $this->typeSafetyTestClass->iNeedArrays('test', array());\n }", "function isMultiDimentionalArray(array $array):bool\n{\n if (count($array) == count($array, COUNT_RECURSIVE))\n {\n return false;\n }else{\n return true;\n }\n}", "function part1() {\n $this->fabric = array_fill($this->minY, $this->spanY,\n array_fill($this->minX, $this->spanX, 0)\n );\n // Fill fabric with smaller areas:\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n\n while ($w > 0) {\n while ($h > 0) {\n// echo \"($x,$y)\\n\";\n // Place area id in empty cell:\n if ($this->fabric[$y][$x] === 0) {\n $this->fabric[$y][$x] = $id;\n }\n // Place '@' where areas overlap:\n else if ($this->fabric[$y][$x] !== '@' && $this->fabric[$y][$x] !== 0) {\n $this->fabric[$y][$x] = '@';\n }\n $y++;\n $h--;\n }\n $y = $a['y'];\n $h = $a['h'];\n $x++;\n $w--;\n }\n }\n //$this->printGrid($fabric);\n $charCounts = $this->charCounter('@', $this->fabric);\n echo \"Overlap: $charCounts\\n\";\n }", "function checkSudokuBoard(array $board)\n{\n if (empty($board)) {\n throw new \\InvalidArgumentException('The $board cannot be empty');\n }\n\n // Check the rows\n for ($i = 0; $i < count($board); $i++) {\n if (hasDuplicate($board, $i, $i + 1, 0, count($board), count($board))) {\n return false;\n }\n }\n\n // Check the columns\n for ($j = 0; $j < count($board); $j++) {\n if (hasDuplicate($board, 0, count($board), $j, $j + 1, count($board))) {\n return false;\n }\n }\n\n // Check the sub-grids\n $regionSize = (int) sqrt(count($board));\n for ($k = 0; $k < $regionSize; $k++) {\n for ($l = 0; $l < $regionSize; $l++) {\n if (hasDuplicate($board, $regionSize * $k, $regionSize * ($k + 1), $regionSize * $l, $regionSize * ($l + 1), count($board))) {\n return false;\n }\n }\n }\n\n return true;\n}", "public function getDimensions(){\n\t\treturn array('width' => $this->_width, 'height' => $this->_height);\n\t}", "public function testIssue52A()\n {\n $packer = new Packer();\n $packer->addBox(new TestBox('Box', 100, 50, 50, 0, 100, 50, 50, 5000));\n $packer->addItem(new TestItem('Item', 15, 13, 8, 407, true), 2);\n $packedBoxes = $packer->pack();\n\n self::assertEquals(1, $packedBoxes->count());\n self::assertEquals(26, $packedBoxes->top()->getUsedWidth());\n self::assertEquals(15, $packedBoxes->top()->getUsedLength());\n self::assertEquals(8, $packedBoxes->top()->getUsedDepth());\n }", "public function getGridSize();", "function isSquare(){\r\n if($this->width == $this->height){\r\n return true; //Square\r\n } else {\r\n return false; //Not a square\r\n }\r\n }", "function checkVectors($x, $y) {\n $nx = count($x);\n $ny = count($y);\n if ($nx == $ny)\n for($i=0; $i < $nx; ++$i)\n $this->checkScalars($x[$i],$y[$i]);\n else\n die(\"Attempt to compare vectors of different lengths\");\n }", "public function validateDimension($key, $value, $params, $rule)\n\t{\n\t\tif (empty($this->width) && empty($this->height) && empty($this->watermark_id))\n\t\t{\n\t\t\t$rule->stop();\n\t\t\treturn lang('image_manip_dimension_required');\n\t\t}\n\n\t\treturn TRUE;\n\t}", "private function solved($cells){\n\n foreach($cells as $values){\n\n foreach($values as $value){\n if($value['schedule'] === null){\n return false;\n }\n }\n\n }\n\n return true;\n }", "function hasDuplicate($board, $startRow, $endRow, $startCol, $endCol, $numberOfElements)\n{\n $isPresent = array_fill(1, $numberOfElements + 1, false);\n\n for ($i = $startRow; $i < $endRow; $i++) {\n for ($j = $startCol; $j < $endCol; $j++) {\n if ($board[$i][$j] !== 0 && $isPresent[$board[$i][$j]]) {\n return true;\n }\n\n $isPresent[$board[$i][$j]] = true;\n }\n }\n\n return false;\n}", "function is3x3BlockSolved(array $grid, Int2D $int2D): bool;", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['business_unit_id'] === null) {\n return false;\n }\n return true;\n }", "protected function coordsValid($coords)\n {\n $image = $this->imageInstance;\n\n $coos = array('x','x2','y','y2','w','h');\n foreach ($coos as $coo)\n {\n if (!isset($coords[$coo]) || $coords[$coo] < 0)\n {\n return false;\n }\n }\n\n $instW = imagesx($image);\n $instH = imagesy($image);\n\n if ($coords['x']+$coords['w'] > $instW)\n {\n throw new Exception($this->thumbnailName. $coords['x']\n . \"+\". $coords['w']. \" > \". $instW , 000);\n return false;\n }\n if ($coords['y']+$coords['h'] > $instH)\n {\n throw new Exception($this->thumbnailName. $coords['y']\n . \"+\". $coords['h']. \" > \". $instH , 000);\n return false;\n }\n\n return true;\n }", "public function testDimensionsValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"avatar\", function (Field $field): void {\n $field->dimensions(function(Dimensions $dimensions): void {\n $dimensions->ratio(3/2)->width(100);\n });\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"dimensions:ratio=1.5,width=100\"], $rules[\"avatar\"]);\n }", "private function validatePoint(PointInterface $point)\n {\n if ($point->getDimensionsCount() !== $this->tree->getDimensionCount()) {\n throw new ValidationException(\n 'point dimensions count should be equal to ' . $this->tree->getDimensionCount()\n );\n }\n }", "public function dimensions(): int\n {\n return -1;\n }", "public function isValid(): bool {\n\t\treturn $this->getGlobeObj()->coordinatesAreValid( $this->lat, $this->lon );\n\t}", "public function isAllTableSameWidth()\n {\n return $this->sameWide;\n }", "private function pad_grid() \n\t{\n\t\t// If more rows than cols we add columns to all rows\n\t\t// TODO: Has to be a better way to do this\n\t\t$numRows = count($this->clonedGrid);\n\t\t$numCols = count($this->clonedGrid[0]);\n\t\t\n\t\tif ($numRows > $numCols) \n\t\t{ \n\t\t\tfor ($i = 0; $i < $numRows; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad($this->clonedGrid[$i], $numRows, 0);\n\t\t\t\t\n\t\t\t}\n\t\t} \n\t\telseif ($numCols > $numRows) { \n\t\t\t// If not check if COLS are > then rows, if so then add new rows.\n\t\t\tfor ($i = count($this->clonedGrid); $i < $numCols; $i++) \n\t\t\t{\n\t\t\t\t$this->clonedGrid[$i] = array_pad(array(), $numCols, 0);\n\t\t\t}\n\t\t}\n\t}", "protected function getDimensions(): array\n {\n $args = $this->fit;\n $res = [];\n\n if (empty($args) || sizeof($args) < 2) {\n return [];\n }\n\n foreach ($args as $arg) {\n $res[] = (int) $arg;\n }\n\n return $res;\n }", "public function testWideOriginPoint()\n {\n $point = $this->grid100x50->pointToGridIndex(1, 1);\n $this->assertEquals(0, $point);\n }", "public function fullRank() : bool\n {\n return $this->rank() === min($this->shape());\n }", "protected function checkParameters()\n\t{\n\t\t$this->dbResult['REQUEST'] = array(\n\t\t\t'GET' => $this->request->getQueryList()->toArray(),\n\t\t\t'POST' => $this->request->getPostList()->toArray(),\n\t\t);\n\n\t\t$this->arParams['PATH_TO_LOCATIONS_LIST'] = CrmCheckPath('PATH_TO_LOCATIONS_LIST', $this->arParams['PATH_TO_LOCATIONS_LIST'], '');\n\t\t$this->arParams['PATH_TO_LOCATIONS_EDIT'] = CrmCheckPath('PATH_TO_LOCATIONS_EDIT', $this->arParams['PATH_TO_LOCATIONS_EDIT'], '?loc_id=#loc_id#&edit');\n\t\t//$this->arParams['PATH_TO_LOCATIONS_ADD'] = CrmCheckPath('PATH_TO_LOCATIONS_ADD', $this->arParams['PATH_TO_LOCATIONS_ADD'], '?add');\n\t\t\n\t\t$this->componentData['LOCATION_ID'] = isset($this->arParams['LOC_ID']) ? intval($this->arParams['LOC_ID']) : 0;\n\n\t\tif($this->componentData['LOCATION_ID'] <= 0)\n\t\t{\n\t\t\t$locIDParName = isset($this->arParams['LOC_ID_PAR_NAME']) ? intval($this->arParams['LOC_ID_PAR_NAME']) : 0;\n\n\t\t\tif($locIDParName <= 0)\n\t\t\t\t$locIDParName = 'loc_id';\n\n\t\t\t$this->componentData['LOCATION_ID'] = isset($this->dbResult['REQUEST']['GET'][$locIDParName]) ? intval($this->dbResult['REQUEST']['GET'][$locIDParName]) : 0;\n\t\t}\n\n\t\treturn true;\n\t}", "public function validate()\n\t{\n\t\t$result = true;\n\t\tforeach ($this->slices as &$slice) {\n\t\t\t//debug($slice['name'] . ' ('.$slice['from'].'-'.$slice['till'].': '.sizeof($slice['desc']).')');\n\t\t\t$f2 = new HTMLFormTable($slice['desc']);\n\t\t\t$v = new HTMLFormValidate($f2);\n\t\t\t$result = $v->validate() && $result; // recursive inside // this order to force execution\n\t\t\t$slice['desc'] = $v->getDesc();\n\t\t}\n\t\t//debug($this->slices);\n\t\treturn $result;\n\t}", "public function testCreateWithPlace()\n {\n $options = Search::place('Chicago, IL');\n\n $this->assertInstanceOf(Search::class, $options);\n $this->assertCount(1, $options->parametrise());\n $this->assertArrayHasKey('near', $options->parametrise());\n }", "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 }", "function isColumnSolved(array $grid, int $x): bool;", "protected function calculateRowsAndColumns() {}", "function NumCols() {}", "function updatePossibleSquares($possibleSquares, $possibleSquares2){\n for($i=0;$i<count($possibleSquares);$i++){\n list($r1, $c1, $r2, $c2) = $possibleSquares[$i];\n for($j=0;$j<count($possibleSquares2);$j++){\n list($pr1, $pc1, $pr2, $pc2) = $possibleSquares2[$j];\n if((($c1 < $pc2 && $pc2 <= $c2) || ($c1 <= $pc1 && $pc1 < $c2) || ($pc1 <= $c1 && $c2 <= $pc2))\n && (($r1 <= $pr2 && $pr2 <= $r2 + 1) || ($r1 <= $pr1 && $pr1 <= $r2 + 1) || ($pr1 <= $r1 + 1 && $r2 <= $pr2 + 1))\n ){\n $column1 = $c1;\n $column2 = $c2;\n if($c2>$pc2){\n $column2 = $pc2;\n }\n if($c1<$pc1){\n $column1 = $pc1;\n }\n // l'area del quadrato nuovo > di quella vecchia\n if(($pr2-$r1+1)*($column2-$column1+1) > ($r2-$r1+1)*($c2-$c1+1)){\n // aggiornamento possibleSquares\n $possibleSquares[$i] = array($r1, $column1, $pr2, $column2);\n }\n }\n }\n }\n return $possibleSquares;\n}", "public function hasSize() {\n return $this->_has(3);\n }", "public function isSquare() {\r\n\t\tif ($this->length == $this->width){\r\n\t\t\treturn true;\t// Square\r\n\t\t} else {\r\n\t\t\treturn false;\t// Not a square\r\n\t\t}\r\n\t}", "public function is_correct_component() {\n\t\t$name = false;\n\t\t$at_least_one_element = false;\n\t\tforeach ( $this->component as $item ) {\n\t\t\tif ( is_array( $item ) AND isset( $item['name'] ) AND isset( $item['val'] ) ) {\n\t\t\t\tif ( ( $item['name'] == 'Name' ) AND $item['val'] ) {\n\t\t\t\t\t$name = true;\n\t\t\t\t} elseif (\n\t\t\t\t\t$item['val'] !== ''\n\t\t\t\t\tAND $item['name'] != 'Name'\n\t\t\t\t\t AND $item['name'] != 'Thumbnail'\n\t\t\t\t\t AND $item['name'] != 'Preview'\n\t\t\t\t\t AND $item['name'] != 'Global Component Rules'\n\t\t\t\t\tOR ( $item['name'] === 'Global Component Rules' AND $item['val'] != '0' )\n\t\t\t\t) {\n\t\t\t\t\t$at_least_one_element = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $name AND $at_least_one_element ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function allShapeKeysAlwaysDefined(): bool\n {\n foreach ($this->properties as $property) {\n if ($property->possibly_undefined) {\n return false;\n }\n }\n\n return true;\n }", "public function findAllAvailableDimensions()\n {\n $query = $this->getEntityManager()->createQuery('SELECT c.width, c.height FROM AppBundle\\Entity\\Contentunit c');\n\n return $query->getArrayResult();\n }", "protected function _getWidthArray() {}", "public function testDimensionsOutboundsCrop()\n {\n $dimensions = Dimensions::create(\n 450,\n 450,\n 300,\n 150,\n ElcodiMediaImageResizeTypes::OUTBOUND_CROP\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(112.5, $dimensions->getSrcY());\n $this->assertEquals(450, $dimensions->getSrcWidth());\n $this->assertEquals(225, $dimensions->getSrcHeight());\n\n $this->assertEquals(0, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(300, $dimensions->getDstWidth());\n $this->assertEquals(150, $dimensions->getDstHeight());\n $this->assertEquals(300, $dimensions->getDstFrameX());\n $this->assertEquals(150, $dimensions->getDstFrameY());\n }", "public function fixSpatial()\r\n \t{\r\n \t}", "protected function checkValidity(array $params)\n\t{\n $this->count($params, 1);\n $this->isDirect($params[0], 0);\n }", "abstract public function calculateCropBoxSize();", "function mustDrawAStarInO($i, $j, $nrLin, $nrCol) {\r\n if ($i == 1 && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($i == $nrLin && $j != 1 && $j != $nrCol) {\r\n return true;\r\n }\r\n\r\n if ($j == 1 && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n if ($j == $nrCol && $i != 1 && $i != $nrLin) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "function testValidRepeatedFieldToCallFunctions() {\n\t\t// arrange\n\t\tglobal $post;\n\t\t$factory = $this->getMockBuilder('TestRepeatedFields')\n\t\t\t\t\t\t->setMethods( array( 'validate_repeated_field', ) )\n\t\t\t\t\t\t->getMock();\n\t\t$factory->expects($this->once())\n\t\t\t\t->method('validate_repeated_field')\n\t\t\t\t->will($this->returnValue(true));\n\t\t$View = $this->getMockBuilder('\\CFPB\\Utils\\MetaBox\\View')\n\t\t\t\t\t\t->setMethods( array( 'process_repeated_field_params', ) )\n\t\t\t\t\t\t->getMock();\n\t\t$View->expects($this->once())\n\t\t\t\t->method('process_repeated_field_params')\n\t\t\t\t->will($this->returnValue(true));\n\t\t$factory->set_view($View);\n\t\t$validate = array();\n\n\t\t// act\n\t\t$factory->validate( $post->ID, $factory->fields['fields'], $validate );\n\n\t\t// assert\n\t\t// Test will fail if validate_fieldset isn't executed once and only once\n\t}" ]
[ "0.553331", "0.531163", "0.5285115", "0.5276729", "0.5174999", "0.5165216", "0.51279837", "0.51269716", "0.51228255", "0.5018543", "0.50054795", "0.49910977", "0.4971227", "0.4953918", "0.4941696", "0.49416775", "0.49263012", "0.49172282", "0.48985747", "0.48985747", "0.48781496", "0.4870385", "0.48669556", "0.48494497", "0.4843362", "0.481468", "0.47916615", "0.4791637", "0.47909874", "0.47789997", "0.47570902", "0.47227335", "0.47132605", "0.4704435", "0.4702678", "0.470084", "0.46739995", "0.46716332", "0.4658328", "0.4653116", "0.46502444", "0.4647011", "0.46259606", "0.46111858", "0.46039584", "0.45884532", "0.45864806", "0.45691916", "0.4567167", "0.45574147", "0.4556272", "0.45395553", "0.45390162", "0.452417", "0.45216128", "0.45185247", "0.45053476", "0.44966155", "0.44933796", "0.44892734", "0.44886982", "0.4486798", "0.44865596", "0.44818947", "0.4479362", "0.44748768", "0.44722024", "0.44700313", "0.4469768", "0.4468067", "0.4464603", "0.44640675", "0.44627872", "0.44622752", "0.44609398", "0.44594952", "0.44580588", "0.44521862", "0.44393572", "0.44309476", "0.4421854", "0.44215703", "0.44165736", "0.44144025", "0.44121838", "0.4410042", "0.44036517", "0.4394163", "0.43908018", "0.43896034", "0.43891782", "0.43889695", "0.43884358", "0.43842554", "0.438348", "0.4379454", "0.43777585", "0.4377506", "0.4370678", "0.43666446" ]
0.61705506
0
Let's make sure we don't have any trailing or useless path seperators
public static function cleanFolder($folder) { $folders = explode('/', $folder); if(count($folders) > 0) { return implode('/', $folders); } else { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_path_segment(string $path)\n{\n $trailingslashed = trailingslashit($path);\n\n // Don't want a leading slash.\n $frontchecked = ltrim($trailingslashed, '\\\\/');\n return $frontchecked;\n}", "private function ensure_trailing_slash( string $path ): string {\n\t\treturn \\rtrim( $path, '/' ) . '/';\n\t}", "public function validPathStrInvalidCharactersDataProvider() {}", "protected function parsePath() {\n\t}", "function trimPaths($str)\n\t{\n\t\t$steps = explode('/', $str);\n\t\t//$str == \"/home/qreon/music/Radiohead/../\"\n\t\t//$steps == array('', 'home', 'qreon', 'music', 'Radiohead', '..', '')\n\n\t\treset($steps);\n\t\twhile(next($steps) !== false)\n\t\t{\n\t\t\tif(current($steps) == '..')\n\t\t\t{\n\t\t\t\tprev($steps);\n\t\t\t\t//On retourne à l'étape précédente\n\t\t\t\tarray_splice($steps, key($steps), 2);\n\t\t\t\t//On vire les deux cases à l'endroit actuel\n\t\t\t\tnext($steps);\n\t\t\t\t//On reavance pour annuler l'effet du prev()\n\t\t\t}\n\t\t}\n\t\tend($steps);\n\t\tunset($steps[key($steps)]);\n\n\t\t$res = '';\n\t\tforeach ($steps as $key => $value) {\n\t\t\t$res .= $value . '/';\n\t\t}\n\n\t\treturn $res;\n\t}", "public function validPathStrDataProvider() {}", "function tidy(string $path, bool $ending = false, string $separator = \\DIRECTORY_SEPARATOR)\n{\n\treturn preg_replace('/[\\/\\\\\\\\]+/', $separator, $path . ($ending ? $separator : ''));\n}", "function cleanSlash($str){\n $str = implode(\"/\", explode(\"\\\\\", $str));\n while( count(explode(\"//\", $str)) > 1){\n $str = implode(\"/\", explode(\"//\", $str));\n }\n\n return $str;\n}", "public function testParsingWithTrailingPeriod(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "function path_clean($path){\n $path = trim($path);\n $path = str_replace(\"/\",\"\\\\\",$path); // this kills me\n while (strstr($path,\"\\\\\\\\\")) $path = str_replace(\"\\\\\\\\\",\"\\\\\",$path);\n return $path;\n}", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "function _trimendslashurl ($url)\r\r\n{\r\r\n while(substr($url, -1) == \"/\") {\r\r\n $url = substr($url, 0, -1);\r\r\n }\r\r\n return $url;\r\r\n}", "function trim_path($path = '')\n { \n return trim_url($path, DIRECTORY_SEPARATOR);\n }", "function sanitize_path($path) {\n\treturn rtrim(ltrim(stripslashes($path), '/'), '/');\n}", "public function test_FName__Smartpath_disabled(): void\n {\n $path = '/very//cluttered///path/uh';\n $f = (new FName('', FName::FLAG_DISABLE_SMARTPATH))->path($path);\n\n //Note that the ending slash is always added\n $this->assertEquals('/very//cluttered///path/uh/', (string)$f);\n }", "public function invalidPathProvider() {\n\t\treturn [\n\t\t\t[\"new\\nline\"],\n\t\t\t[\"\\rreturn\"],\n\t\t\t['null' . chr(0) . 'byte'],\n\t\t\t['foo?bar'],\n\t\t\t['foo<bar>'],\n\t\t\t['foo:bar'],\n\t\t\t['foo*bar'],\n\t\t\t['foo|bar'],\n\t\t\t['foo\"bar\"']\n\t\t];\n\t}", "function EraseDubleSlash($sInputPath)\n{\n\treturn preg_replace(\"/[\\/]{2,}/\", \"/\", $sInputPath);\n}", "abstract public function getDirectorySeparator() : string;", "function normalizePath($path) {\n\t $val=str_replace(array('///','//','\\\\','\\\\\\\\',\"\\n\",\"\\r\"),'/',$path);\n\t $val=str_replace(array(\"\\n\",\"\\r\"),'',$val);\n\t if (PHP_OS=='WINNT') {\n\t \t$val=preg_replace('/\\/+([a-zA-Z]{1}:)/','$1',$val);\n\t\t}\n\t return $val;\n\t //return $path = ereg_replace('(\\\\\\\\*)|(\\/*/)', '/', $path); //only forward-slash\n\t}", "function normalizePath($path) {\n\t $val=str_replace(array('///','//','\\\\','\\\\\\\\',\"\\n\",\"\\r\"),'/',$path);\n\t $val=str_replace(array(\"\\n\",\"\\r\"),'',$val);\n\t if (PHP_OS=='WINNT') {\n\t \t$val=preg_replace('/\\/+([a-zA-Z]{1}:)/','$1',$val);\n\t\t}\n\t return $val;\n\t //return $path = ereg_replace('(\\\\\\\\*)|(\\/*/)', '/', $path); //only forward-slash\n\t}", "function cleanPath($path) {\n // files////janko/mika\n\n while (strpos($path, \"//\") !== FALSE) {\n $path = str_replace(\"//\", \"/\", $path);\n }\n\n return $path;\n}", "function add_ending_slash($path)\n{\n if (substr($path, (0 - (int)strlen(DIRECTORY_SEPARATOR))) !== DIRECTORY_SEPARATOR) {\n $path .= DIRECTORY_SEPARATOR;\n }\n return $path;\n}", "function formatPath($f)\n{\n\t$f = preg_replace('/[\\\\\\\\\\/]+/', '/', $f);\n\t$f = preg_replace('`[^/]+/\\.\\./`', '', $f);\n\t$f = preg_replace('`(^|/)\\K\\./`', '', $f);\n\treturn $f;\n}", "private function _sanitize($path) {\n\t\t$path = str_replace('\\\\', '/', $path);\n\t\twhile (strpos($path, '//')) {\n\t\t\t$path = str_replace('//', '/', $path);\n\t\t}\n\t\t\n\t\treturn ($path);\n\t}", "function system_ensure_path_ending(&$path, $make_realpath=false)\n{\n\tif( $make_realpath )\n\t{\n\t\t$p = realpath($path);\n\t\tif( $p ) $path = $p;\n\t}\n if( !ends_with($path, '/') )\n $path .= '/';\n}", "function remove_trailing_slash($path)\n{\n\tif (substr($path, -1) == DS )\n\t\t\t$path = substr($path, 0, strlen($path) - 1);\n\treturn $path;\n}", "abstract public function isDirectorySeparator(string $char, bool $isVerbatim = false) : bool;", "function wp_normalize_path( $path ) {\n\t\t$path = str_replace( '\\\\', '/', $path );\n\t\t$path = preg_replace( '|/+|','/', $path );\n\t\treturn $path;\n\t}", "function clean_path($dirty_path) {\n $cleaner_path = preg_replace('/\\.[\\.]+/', '', $dirty_path);\n return preg_replace('/\\/\\./', '', $cleaner_path);\n}", "public function testLineSeparatorInLoaderPaths()\n {\n // they're configured to force the line separator\n $tester = $this->createCommandTester(array(\n 'Acme' => array('extractor', 'extractor'),\n '!Acme' => array('extractor', 'extractor'),\n FilesystemLoader::MAIN_NAMESPACE => array('extractor', 'extractor'),\n ));\n $ret = $tester->execute(array(), array('decorated' => false));\n $ds = \\DIRECTORY_SEPARATOR;\n $loaderPaths = <<<TXT\nLoader Paths\n------------\n\n ----------- ------------ \n Namespace Paths \n ----------- ------------ \n @Acme extractor$ds \n extractor$ds \n \n @!Acme extractor$ds \n extractor$ds \n \n (None) extractor$ds \n extractor$ds \n ----------- ------------\nTXT;\n\n $this->assertEquals(0, $ret, 'Returns 0 in case of success');\n $this->assertContains($loaderPaths, trim($tester->getDisplay(true)));\n }", "protected function validateRouteUrl(string $path): string\n {\n // If the last character is not a slash and the config is set to\n // ensure trailing slash\n if ($path[-1] !== '/' && $this->config['useTrailingSlash']) {\n // add a trailing slash\n $path .= '/';\n }\n\n return $path;\n }", "function delSlash($text)\t{\n\n $text = trim($text);\n if(substr($text, strlen($text) - 1, 1) == '/')\n return substr($text, 0, strlen($text) - 1);\n else\n return $text;\n }", "function checkAndCleanPath($path,$origPath) {\n\t\t//echo \"|\".$path.\"|\".$origPath.\"|\".strpos($path,$origPath).\"|\";\n\t\t$path = str_replace(\"..\",\"\",$path);\n\t\t$path = str_replace(\".\",\"\",$path);\n\t\t$path = str_replace(\"%2E\",\"\",$path);\n\t\t$path = str_replace(\"'\",\"\",$path);\n\t\t$path = str_replace('\"',\"\",$path);\n\t\t$path = str_replace(\"\\\\\",\"\",$path);\n\t\tif (strpos($path,$origPath) === 0) {\n\t\t\treturn $path;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function unslashify($str)\n{\n return preg_replace('/\\/$/', '', $str);\n}", "public function testParsingWithTrailingPeriodAndParseExtensions(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "public function testCreateUriPathWithMultipleSlashes()\n {\n $uri = new Uri(\n 'http',\n 'test.com',\n null,\n '///'\n );\n\n $this->assertEquals('/', $uri->getPath());\n }", "function path_escape($v) {\n\treturn preg_replace('/(\\/\\.\\/)|[\\/\\\\\\]|(\\.\\.)/', '', $v);\n}", "public function isLastPartOfStringReturnsInvalidArgumentDataProvider() {}", "function fixPath($path)\n {\n $len = strlen($this->_dirSep);\n \n if (! empty($path) &&\n substr($path, -1 * $len, $len) != $this->_dirSep) {\n return $path . $this->_dirSep;\n } else {\n return $path;\n }\n }", "protected function _hasTrailingSlash()\n\t{\n\t\t$url = Sh404sefFactory::getPageInfo()->currentSefUrl;\n\t\t$rawPath = explode('?', $url);\n\t\t$rawPath = $rawPath[0]; // query string removed, if any\n\t\t$rawPath = explode('#', $rawPath);\n\t\t$rawPath = $rawPath[0]; // fragment removed, if any\n\t\t$trailingSlash = JString::substr($rawPath, -1) == '/';\n\n\t\treturn $trailingSlash;\n\t}", "protected function assertMissingDelimitation()\n {\n }", "private function remove_end_slash($str)\n {\n if(strlen($str) > 1) {\n if(substr($str,-1)==\"/\")\n {\n $str=substr($str,0,strlen($str)-1);\n }\n }\n return $str;\n }", "public function isAutoTrailingSlash()\n {\n return $this->auto_trailing_slash;\n }", "public function getCanonicalPathCorrectlyCleansPathDataProvider() {}", "function remove_trailing_slash($string) {\n $string_length = strlen($string);\n if (strrpos($string, \"/\") === $string_length - 1) {\n $string = substr($string, 0, $string_length - 1);\n }\n\n return $string;\n }", "public function testParse_request_url__slash() {\n\t$result = $this->object->parse_request_url('/');\n $this->assertTrue($result==array(),\n\t '$result did not match:'.print_r($result,1)\n\t);\n }", "protected function _normalizePath($path) { \n $p= preg_replace('#//#', '/', $path);\n $p= preg_replace('#/\\./#', '/', $p);\n $p= preg_replace('#[^/]+/\\.\\./#', '', $p);\n $p= preg_replace('#//#', '/', $p);\n $p= preg_replace('#/$#', '', $p);\n return $p;\n }", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "private function assertValidPath() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->path,\n '#[Route.path] must contain a non-empty string.'\n );\n }", "private function _clean_paths()\n {\n $path_vars = array('dash_path', 'asset_path', 'css_path', 'js_path', 'dash_fldr', 'dash', 'img_path', 'file_path', 'oop_path');\n\n foreach ($path_vars as $var) {\n $this->$var = trim($this->$var);\n }\n }", "public function testRouteMatchesWithTrailingSlash()\n {\n $resource1 = '/foo/bar/';\n $resource2 = '/foo/bar';\n $route = new \\Slim\\Route('/foo/:one/', function () {});\n $this->assertTrue($route->matches($resource1));\n $this->assertTrue($route->matches($resource2));\n }", "public function endPath() {}", "public function sanitizeLocalUrlValidPathsDataProvider() {}", "private function slashPath(string $path) : string\n {\n return trim($path, '/');\n }", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "public function standardizePath()\n {\n $arrPath = func_get_args();\n\n if (count($arrPath) == 0 || $arrPath == null || $arrPath == \"\")\n {\n return \"\";\n }\n\n $strVar = \"\";\n\n foreach ($arrPath as $itPath)\n {\n $itPath = str_replace(array(TL_ROOT, \"\\\\\"), array(\"\", \"/\"), $itPath);\n $itPath = explode(\"/\", $itPath);\n\n foreach ($itPath as $itFolder)\n {\n if ($itFolder == \"\" || $itFolder == \".\" || $itFolder == \"..\")\n {\n continue;\n }\n\n $strVar .= \"/\" . $itFolder;\n }\n }\n\n return preg_replace(\"/^\\//i\", \"\", $strVar);\n }", "public static function getPathSeparator() { return PATH_SEPARATOR; }", "function lastSlash($s)\n {\n if (empty($s)) {\n $s = '';\n }\n if (substr($s, -1) !== '/') {\n $s .= '/';\n }\n\n return $s;\n }", "function getPathParser();", "public function testLiteralSlash()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /\\\\// \");\n $this->assertEquals(array(\"/\"), $grammar1->parse(\"/\"));\n }", "function cap_sanitize_path_list ($path_list)\n{\n $paths = explode (' ', $path_list);\n $result = array ();\n foreach ($paths as $path) {\n $result[] = cap_sanitize_path ($path);\n }\n return implode (' ', $result);\n}", "function remove_trailing_slash($path) {\n\treturn rtrim($path, '/');\n}", "function add_trailing_slash($path) {\n\treturn remove_trailing_slash($path) . '/';\n}", "protected function pathTrailing(string $path, string $trailing) {\n $trailing_with_slash = substr($trailing, 0, strlen('/')) === '/' ? $trailing : \"/$trailing\";\n if (\n trim($path, '/') !== trim($trailing_with_slash, '/') &&\n substr(trim($path, '/'), -strlen($trailing_with_slash)) !== $trailing_with_slash\n ) {\n $path = rtrim($path, '/') . $trailing_with_slash;\n }\n return $path;\n }", "function no_page_slash($string, $type) {\r\n global $wp_rewrite;\r\n\r\n if ( $wp_rewrite->using_permalinks() && $wp_rewrite->use_trailing_slashes == true && $type == 'page' ) {\r\n return untrailingslashit($string);\r\n } else {\r\n return $string;\r\n }\r\n }", "private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "public function testLiteralBackslash()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /\\\\\\\\/ \");\n $this->assertEquals(array(\"\\\\\"), $grammar1->parse(\"\\\\\"));\n\n }", "function wp_slash_strings_only($value)\n {\n }", "public function getIsAbsolutePath() {}", "public static function addTrailingSlash($path) {\n\t\tif (substr($path, -1) != '/') {\n\t\t\treturn $path.'/';\n\t\t}\n\t\telse {\n\t\t\treturn $path;\n\t\t}\t\n\t}", "function makeSafe($path) \n {\n $ds = (DS == '\\\\') ? '\\\\' . DS : DS;\n $regex = array('#[^A-Za-z0-9:\\_\\-' . $ds . ' ]#');\n return preg_replace($regex, '', $path);\n }", "protected function _normpath($path) {\r\n\t\t$tmp = preg_replace(\"/^\\//\", \"\", $path);\r\n\t\t$tmp = preg_replace(\"/\\/\\//\", \"/\", $tmp);\r\n\t\t$tmp = preg_replace(\"/\\/$/\", \"\", $tmp);\r\n\t\treturn $tmp;\r\n\t}", "function basename_safe($path) {\n\t\tif (mb_strrpos($path, '/') !== false) {\n\t\t\treturn mb_substr($path, mb_strrpos($path, '/')+1);\n\t\t} else {\n\t\t\treturn $path;\n\t\t}\n\t}", "function string_to_path($str)\n{\n\t$str = preg_replace('`(?:^\\.?/|/\\./|/$)`', '', trim($str));\n\tif(empty($str) || $str == '.') return '';\n\treturn $str;\n}", "function fn_normalize_path($path, $separator = '/')\n{\n $prefix = '';\n if (strpos($path, '://') !== false) { // url is passed\n list($prefix, $path) = explode('://', $path);\n $prefix .= '://';\n }\n\n $result = array();\n $path = preg_replace(\"/[\\\\\\\\\\/]+/S\", $separator, $path);\n $path_array = explode($separator, $path);\n if (!$path_array[0]) {\n $result[] = '';\n }\n\n foreach ($path_array as $key => $dir) {\n if ($dir == '..') {\n if (end($result) == '..') {\n $result[] = '..';\n } elseif (!array_pop($result)) {\n $result[] = '..';\n }\n } elseif ($dir != '' && $dir != '.') {\n $result[] = $dir;\n }\n }\n\n if (!end($path_array)) {\n $result[] = '';\n }\n\n return fn_is_empty($result) ? '' : $prefix . implode($separator, $result);\n}", "static function inPath () {\n return strrpos(\n self::instance()->current_uri, \n self::instance()->path, \n -strlen(self::instance()->current_uri)\n ) !== false;\n }", "public static function normalPaths() {\n\t\t$paths = implode(DS, func_get_args());\n\t\t// Retain a single leading slash; otherwise remove all leading, trailing\n\t\t// and duplicate slashes.\n\t\treturn ((substr($paths, 0, 1) === DS) ? DS : '') .\n\t\t\timplode(DS, array_filter(explode(DS, $paths)));\n\t}", "function isAbsPath($path) {\r\n if (preg_match('|^[\\\\\\/]|', $path)) { return true; } // leading slash or backslash (for windows)\r\n if (preg_match('|^[a-zA-Z]:[\\\\\\/]|', $path)) { return true; } // windows drive\r\n if (preg_match('|^\\\\\\\\[a-zA-Z]|', $path)) { return true; } // unc path\r\n return false;\r\n}", "public function testRogueBackslash()\n {\n $this->performSyntaxErrorTest(\n 'foo\\bar',\n [\n $this->createToken(Lexer::TOKEN_IDENTIFIER, 'foo', 1),\n $unexpected = $this->createToken(Lexer::TOKEN_BACKSLASH, '\\\\', 4),\n $this->createToken(Lexer::TOKEN_IDENTIFIER, 'bar', 5),\n ],\n $this->unexpectedTokenException('foo\\bar', $unexpected)\n );\n }", "private static function isValidFilePath(string $value): bool\n {\n return empty($value) || !preg_match('/\\/\\.{1,2}\\//iu', '/'.$value.'/');\n }", "function addslash($dir) {\n\treturn (($dir[ strlen($dir)-1 ] == '/') ? $dir : $dir.'/');\n}", "public function testWithPathInvalidArray()\n {\n $uri = $this->getUriForTest();\n $uri->withPath(['/foo/bar']);\n }", "public function testGetSetRulesSeparator()\n {\n $this->ruleParse->setRulesDelimiter('||');\n $this->assertEquals('||', $this->ruleParse->getRulesDelimiter());\n }", "public function testAcoResolve()\n {\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('foo/bar'));\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('foo/bar'));\n $this->assertEquals(['foo', 'bar', 'baz'], $this->Acl->Aco->resolve('foo/bar/baz'));\n $this->assertEquals(['foo', '*-bar', '?-baz'], $this->Acl->Aco->resolve('foo/*-bar/?-baz'));\n\n $this->assertEquals(['foo', 'bar', '[a-f0-9]{24}', '*_bla', 'bla'], $this->Acl->Aco->resolve('foo/bar/[a-f0-9]{24}/*_bla/bla'));\n\n // multiple slashes will be squashed to a single, trimmed and then exploded\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('foo//bar'));\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('//foo///bar/'));\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('/foo//bar//'));\n $this->assertEquals(['foo', 'bar'], $this->Acl->Aco->resolve('/foo // bar'));\n $this->assertEquals([], $this->Acl->Aco->resolve('/////'));\n }", "private function stripTrailingSlash($str)\n {\n while (substr($str, -1) === '/') {\n $str = substr($str, 0, -1);\n }\n\n return $str;\n }", "function remove_last_slash($url) {\n\tif (substr($url,-1) == '/') {\n\t\treturn substr($url, 0, strlen($url) - 1);\n\t}\n\telse return ($url);\t\n}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "function BDC_NormalizePath($p_Path) {\n $canonical = str_replace('\\\\', '/', $p_Path);\n // ensure ending slash\n $canonical = rtrim($canonical, '/');\n $canonical .= '/';\n return $canonical;\n}", "public function testSeparator() {\n $facet = new Facet([], 'facets_facet');\n $facet->setFieldIdentifier('test');\n $facet->setUrlAlias('test');\n $facet->setFacetSourceId('facet_source__dummy');\n\n $this->processor = new QueryString(['facet' => $facet, 'separator' => '__'], 'query_string', [], new Request(), $this->entityManager, $this->eventDispatcher, $this->urlGenerator);\n $results = $this->processor->buildUrls($facet, $this->originalResults);\n\n foreach ($results as $result) {\n $this->assertEquals('route:test?f%5B0%5D=test__' . $result->getRawValue(), $result->getUrl()->toUriString());\n }\n }", "public function testBackslashesAreRespected()\n {\n $request = $this->parser->parse('foo bar\\\\baz');\n $this->assertEquals(['bar\\\\baz'], $request->getArgumentValues());\n }", "function add_leading_slash( $string ) {\n\t$string = ltrim( $string, '\\/' );\n\n\treturn '/' . $string;\n}", "public function isValidPath($path)\n\t{\n\t\treturn $this->getPath() == rtrim($path,'/').'/';\n\t}", "protected function createPathIfNeeded() {}", "public function fix_dir_index($s) {\n\t\t$s = preg_replace(\"/[\\/]+/\", \"/\", $s);\n\t\t/* $s = preg_replace(\"/[\\/]+$/\", \"/\", $s); */\n\t\t$s = preg_replace(\"/^\\//\", \"\", $s);\n\t\treturn $s;\n\t}", "#[ReturnTypeWillChange]\n public function accept()\n {\n $current = $this->current()->getPathname();\n $current = $this->normalizeDirectorySeparator($current);\n\n if ('.' . DIRECTORY_SEPARATOR !== $current[0] . $current[1]) {\n $current = '.' . DIRECTORY_SEPARATOR . $current;\n }\n\n return !in_array($current, $this->excluded);\n }", "private function getPathsRegex() : string\n {\n return '~\n <path # opening <path>\n (?:\\sclass=\"(?P<class>[^\"]+)\")? # optional classes\n \\sd=\"(?P<d>[^\"]+)\" # the path definition \"d\" attribute\n .*? # ignore any un-needed information after \"d\" attribute\n (?:/>|></path>) # either self closing /> or closing </path>\n ~x';\n }", "public function testInvalidInputSyntaxException()\r\n\t{\r\n\t\tnew Delimiters(\"//[a\\n1a2\");\r\n\t}", "function reduce_double_slashes($str) {\n\treturn preg_replace(\"#([^:])//+#\", \"\\\\1/\", $str);\n}", "function untrailingslashit($value)\n {\n }", "function levelingDirSeperators($dir) {\n return str_replace('\\\\', '/', $dir);\n}", "private function path(string $path): string\n\t{\n\t\tif (empty($path)) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (is_null($this->url)) {\n\t\t\treturn $path;\n\t\t}\n\n\t\tif (!is_null(parse_url($path, PHP_URL_HOST))) {\n\t\t\treturn $path;\n\t\t}\n\n\t\treturn rtrim($this->url, '/').'/'.ltrim($path, '/');\n\t}" ]
[ "0.6623491", "0.6266777", "0.625198", "0.61637455", "0.60611176", "0.5983993", "0.5966779", "0.5925508", "0.59251636", "0.5922401", "0.5911063", "0.5902794", "0.58390975", "0.58215946", "0.5813935", "0.57992864", "0.5767918", "0.57425743", "0.57408464", "0.57408464", "0.5736619", "0.5733256", "0.571415", "0.5703465", "0.5665876", "0.5661623", "0.565943", "0.56298697", "0.56279284", "0.5590471", "0.5550679", "0.5546229", "0.5536429", "0.5528989", "0.55175227", "0.55054194", "0.54642546", "0.545913", "0.5444271", "0.54427093", "0.5436876", "0.54303527", "0.5427627", "0.5422822", "0.54162526", "0.5415543", "0.5414327", "0.5407557", "0.54003817", "0.5396643", "0.5377848", "0.5377821", "0.53752846", "0.5374146", "0.5371276", "0.5370549", "0.5362263", "0.53558743", "0.53517693", "0.53304756", "0.53232795", "0.53174484", "0.5316447", "0.5303694", "0.5272802", "0.52717376", "0.5267852", "0.52618176", "0.5261768", "0.5250508", "0.5243273", "0.5241956", "0.52408236", "0.52358997", "0.52173316", "0.521107", "0.5204536", "0.52030903", "0.5201327", "0.51982886", "0.5184095", "0.5174944", "0.5174534", "0.5171904", "0.5170194", "0.5169451", "0.51691294", "0.5158136", "0.51528996", "0.5152569", "0.5149738", "0.51364803", "0.51353985", "0.51245797", "0.51196194", "0.51185125", "0.5118313", "0.5116621", "0.5112223", "0.51103586", "0.5107173" ]
0.0
-1
Returns a tree of the users folder.
public static function tree($user, $folder = '') { $all = array(); // get all of our folders $folders = Folder::where('user_id', $user->id)->get(); foreach($folders as $folder) { $files = $folder->files()->get(); $all[$folder->name] = array(); foreach($files as $file) { $name = $file->name; unset($file->name); $all[$folder->name][$name] = $file; } } return $all; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userFolders($args)\n {\n $userDao = $this->_getUser($args);\n if($userDao == false)\n {\n return array();\n }\n\n $userRootFolder = $userDao->getFolder();\n return $this->Folder->getChildrenFoldersFiltered($userRootFolder, $userDao, MIDAS_POLICY_READ);\n }", "public function getFolders()\n {\n $userId = Auth::user()->id;\n\n try {\n\n $folders = DB::table('user_directory as ud')\n ->leftJoin('user_parent_directory as usd','ud.id','=','usd.user_directory_id')\n ->select('ud.id', 'ud.name', 'ud.created_at', 'ud.updated_at')\n ->where('ud.user_id', $userId)\n ->whereNull('usd.user_directory_id')\n ->whereNull('ud.deleted_at')->get();\n\n $documents = $this->getDocuments($userId, 0);\n $signatures = $this->getUserSignatures('true');\n\n $response = array($this->common->success => true);\n $response['data']['folders'] = $folders;\n $response['data']['documents'] = $documents;\n $response['data']['signatures'] = $signatures;\n\n } catch (\\Exception $e) {\n $response = $this->common->getErrorMessage($e->getMessage());\n }\n\n return Response::json($response);\n }", "function folderTree($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $folder = $this->Folder->load($id);\n\n $userDao = $this->_getUser($args);\n $folders = $this->Folder->getAllChildren($folder, $userDao);\n\n $tree = array();\n $folderTree = array();\n\n foreach($folders as $folder)\n {\n $mainnode = $folder->toArray();\n\n if($folder->getParentId() != -1)\n {\n if(isset($folderTree[$folder->getParentId()]))\n {\n $mainnode['depth'] = $folderTree[$folder->getParentId()]['depth'] + 1;\n }\n else\n {\n $mainnode['depth'] = 1;\n }\n }\n // Cut the name to fit in the tree\n $maxsize = 24 - ($mainnode['depth'] * 2.5);\n if(strlen($mainnode['name']) > $maxsize)\n {\n $mainnode['name'] = substr($mainnode['name'], 0, $maxsize).'...';\n }\n $folderTree[$folder->getKey()] = $mainnode;\n if($folder->getParentId() == -1)\n {\n $tree[] = &$folderTree[$folder->getKey()];\n }\n else\n {\n $tree[$folder->getParentId()][] = &$folderTree[$folder->getKey()];\n }\n }\n return $tree;\n }", "public function usersDirectory(): Response\n {\n $userProfileRepo = $this->getDoctrine()->getRepository(UserProfile::class);\n $usersDirectory = $userProfileRepo->findAll();\n\n return $this->render('user/usersDirectory.html.twig', [\n 'usersDirectory' => $usersDirectory\n ]);\n }", "public function getDirectoryTreeList();", "function getRootLevelFolder() ;", "function user_folders($userid,$conn){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t//$dhandle = opendir('./cloud/'.$_SESSION['SESS_USER_ID'].'/');\r\n\t\t\t\t// define an array to hold the folders in the user's directory\r\n\t\t\t\t\t$folders = array();\r\n\t\t\t\t\t$files = array();\r\n\t\t\t\t\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\t\t\t\tforeach (new DirectoryIterator($path) as $file) {\r\n\t\t\t\t\tif (($file != '.') && ($file != '..') &&\r\n\t\t\t\t\t ($file != basename($_SERVER['PHP_SELF']))) {\r\n\t\t\t\t\t if ($file->isDir()) {\r\n\t\t\t\t\t $folders[] = $file->getFilename();\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Now loop through the folders, echoing out a new select option for each one\r\n\t\t\t\t\tforeach( $folders as $fname )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t printf('\r\n\t\t\t \t<div class=\"col-lg-3 col-md-3 col-sm-3\">\r\n\t\t\t\t\t\t\t\t<a id=\"uf\" href=\"dir.php?folder='.$fname.'\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"card btn-sm waves-attach\">\r\n\t\t\t\t\t\t\t\t\t\t<aside class=\"pull-left\">\r\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"icon icon-5x text-center\">folder_open</i>\r\n\t\t\t\t\t\t\t\t\t\t</aside>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"card-main\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-inner\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"\">'.$fname.'</p>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t}", "public function getFlatFolders()\n {\n $society_id = OauthToken::find(\\Input::get('access_token'))->society_id;\n $user_id = OauthToken::find(\\Input::get('access_token'))->user_id;\n\t\t\n\t\t$search = \\Input::get('search',null);\n $type = \\Input::get('type',1);\n//\t\tprint_r($type);exit;\n\t\t$binds = ['offset'=>\\Input::get('offset',0),'limit'=>\\Input::get('limit',10)];\n \n $where = ' where f.society_id = \"'.$society_id.'\" and f.deleted_at IS NULL';\n\t\tif ($search) {\n\t\t\t$where .= ' and f.name like :search and f.type= :type';\n\t\t\t$binds['search'] = '%'.$search.'%';\n $binds['type'] =$type;\n\t\t}else{\n $where .= ' and f.type = :type';\n $binds['type'] = $type;\n }\n \n $results = \\DB::select(\"select f.*,users.first_name,users.last_name,f.name as folder_name,date_format(f.created_at,'%d-%m-%Y') as created_at from admin_folder as f INNER JOIN users on f.user_id=users.id $where order by f.id desc limit :limit offset :offset\",$binds);\n \n \n\t\t$count = \\DB::selectOne(\n\t\t\t\t\t\"select count(*) as total from admin_folder as f $where\",\n\t\t\t\t\t$search ? array('search'=>'%'.$search.'%','type'=>$type) : array('type'=>$type)\n\t\t\t\t);\n\n\t\treturn ['total'=>$count->total,'data'=>$results];\n }", "function email_get_folders($userid, $sort='id') {\n\n\treturn get_records('email_folder', 'userid', $userid, $sort);\n}", "function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}", "public function getRootLevelFolder() {}", "function getCollectionTree(){\n\t\t\n\t\t/* Fetch collection tree from Flickr */\n\t\t$collectionTree = $this->askFlickr('collections.getTree','user_id='.$this->user);\n\t\t\n\t\t/* Ask Flickr For User Collections */\n\t\treturn $collectionTree;\n\t}", "public function tree() {\n return $this->children()->with(['user', 'children.user', 'children.children.user', 'children.children.children.user', 'children.children.children.children.user'])->get();\n }", "function getSubfolders() ;", "public function show_users_tree($user_code=null){\n\n $all_users = User::\n select(\"users.*\",'attachments.path')->\n leftJoin(\"attachments\",\"attachments.id\",\"=\",\"users.logo_id\")->\n where([\n \"user_type\" => \"user\"\n ])->get();\n\n $this->current_user_data->user_code=\"first_code\";\n\n $all_users_group_by_user_code=$all_users->groupBy(\"user_code\");\n $all_users_group_by_parent_id=$all_users->groupBy(\"parent_id\");\n\n $current_user_node=User::get_users(\" and u.user_code = '\".$this->current_user_data->user_code.\"' \");\n $current_user_node = $current_user_node[0];\n if(!is_object($current_user_node)){\n return abort(404);\n }\n\n $current_user_node->active=$this->get_user_status($current_user_node);\n //get his childs\n $nodes[$this->current_user_data->user_code][\"data\"]=$current_user_node;\n $nodes[$this->current_user_data->user_code][\"childs\"]=$this->get_node_childs($current_user_node,$this->current_user_data->user_code,$all_users_group_by_user_code,$all_users_group_by_parent_id);\n\n\n if($user_code==null||$user_code==\"first_code\"){\n $user_code=\"first_code\";\n }\n else{\n //check if this $user_code is exist in $this->current_user_data tree\n\n\n $is_exist=collect($nodes)->flatten()->search(function ($item, $key) use ($user_code) {\n return $item->user_code == $user_code;\n });\n\n\n if($is_exist>=0&&$is_exist!=false){\n $current_user_node=User::get_users(\" and u.user_code = '\".$user_code.\"' \");\n $current_user_node = $current_user_node[0];\n if(!is_object($current_user_node)){\n return Redirect::to(\"/user/chat\")->send();\n }\n\n $current_user_node=$current_user_node;\n $current_user_node->active=$this->get_user_status($current_user_node);\n //get his childs\n $nodes[$user_code][\"data\"]=$current_user_node;\n $nodes[$user_code][\"childs\"]=$this->get_node_childs($current_user_node,$user_code,$all_users_group_by_user_code,$all_users_group_by_parent_id);\n }\n else{\n return Redirect::to(\"/user/dashboard\")->send()->with([\"msg\"=>\"<div class='alert alert-danger'>You can not see this tree</div>\"]);\n }\n\n }\n\n\n\n $total_side_nodes = [];\n $active_side_nodes = [];\n foreach($nodes[$user_code][\"childs\"] as $key => $node)\n {\n if (!isset($node[\"data\"]->user_position))\n {\n continue;\n }\n $total_side_nodes[$node[\"data\"]->user_position] = collect($nodes[\"$user_code\"][\"childs\"][\"$key\"])->flatten()->groupBy(\"user_code\");\n\n unset($total_side_nodes[$node[\"data\"]->user_position][\"\"]);\n }\n\n foreach ($total_side_nodes as $key =>$side)\n {\n $active_side_nodes[$key] = $side->flatten()->groupBy(\"active\");\n }\n\n\n\n $this->data[\"nodes\"]=$nodes;\n $this->data[\"current_user_node\"]=$current_user_node;\n $this->data[\"total_side_nodes\"]=$total_side_nodes;\n $this->data[\"active_side_nodes\"]=$active_side_nodes;\n\n return view(\"admin.subviews.users.tree.users_tree\",$this->data);\n }", "public function index()\n {\n $user = Auth::user();\n\n //$folders = $user->folders;\n\n $folders = Folder::where('user_id', $user->id)\n ->orderBy('name', 'desc')\n ->get();\n\n return response()->json($folders, 200);\n }", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "function user_dir_list($user_dir){\r\n\t\t\t\tif($resource = @opendir(\"../cloud/\".$_SESSION['SESS_USER_ID'].\"/\".$user_dir)){\r\n\t\t\t\t\t$list=array();\r\n\t\t\t\t\twhile (($entry = readdir($resource)) !==FALSE) {\r\n\t\t\t\t\t\tif($entry != '.' && $entry != '..'){\r\n\t\t\t\t\t\t\t$list[]= \"\".$entry.\"\".\"%0A\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\t\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\treturn $list;\r\n\t\t\t}", "public function network_explorer_tree(Request $request){\n\t\t//get all network data\n\t\t\treturn \\App\\Users::with('children')->get()->where('parent', null);\n\t}", "public static function render(Collection $users): string\n {\n $tree = '<ul id=\"user-tree\" style=\"font-size: 20px\">';\n\n // we could have multiple users in a single line\n foreach ($users as $user) {\n\n /**\n * @var $user User\n */\n\n $tree .= '<li class=\"tree-view closed\"><a href=\"#\">' . strtoupper($user->email) . \" (\" . $user->name . ') </a>';\n\n if (count($user->children)) {\n $tree .= self::buildRecursiveTree($user);\n }\n }\n\n $tree .= '<ul>';\n\n return $tree;\n }", "function email_get_root_folders($userid, $draft=true, $trash=true, $sendbox=true, $inbox=true) {\n\n\temail_create_parents_folders($userid);\n\n\t$folders = array();\n\n\t// Include inbox folder\n\tif ( $inbox ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_INBOX);\n\t}\n\n\t// Include return draft folder\n\tif ( $draft ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_DRAFT);\n\t}\n\n\t// Include sendbox folder\n\tif( $sendbox ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_SENDBOX);\n\t}\n\n\tif ( $trash ) {\n\t\t$folders[] = email_get_root_folder( $userid, EMAIL_TRASH);\n\t}\n\n\treturn $folders;\n\n}", "public function getFolders(string $username, int $folderId);", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "public function getRootLevelFolderObject();", "public function getPageFolders();", "public function getFolder();", "public function getTreeStructure()\n {\n $result = array();\n $search = function($folder, $prefix) use (&$result, &$search)\n {\n foreach (new \\DirectoryIterator($folder) as $node)\n {\n if ($node->isDir() && !$node->isDot())\n {\n $result[] = $prefix.$node->getFilename();\n $search($node->getPathname(), $prefix.$node->getFilename().'/');\n }\n }\n };\n\n $search($this->path, \"\");\n sort($result);\n return $result;\n }", "public function getFoldersList()\r\n\t{\r\n\t\t$olist = new CAntObjectList($this->dbh, \"folder\", $this->user);\r\n\t\t$olist->addCondition(\"and\", \"parent_id\", \"is_equal\", $this->id);\r\n\t\treturn $olist;\r\n\t}", "public function genealogy_tree(Request $request){\n\t if(!empty($request->session()->has('id') && $request->session()->get('role') == 0)){\n \t\t//all users\n if(!empty($request->input('id'))){\n $users = \\App\\Models\\Left_Users\\Users::with('children')->with('child')->withCount('left_count')->withCount('right_count')->where('id', '=', $request->input('id'))->get();\n }else{\n $users = \\App\\Models\\Left_Users\\Users::with('children')->with('child')->withCount('left_count')->withCount('right_count')->where('id', '=', $request->session()->get('id'))->get();\n }\n \t\t//$users = \\App\\Models\\Left_Users\\Users::with('children')->get();\n //return ['users' => $users,'lev3' => $last_level];\n return view('admin/members/tree',compact('users'));\n\t }\n\t else{\n\t return redirect()->route('admin_login');\n\t }\n\t}", "function email_print_tree_myfolders($userid, $courseid) {\n\n\tglobal $CFG;\n\n\t$strfolders = get_string('folders', 'block_email_list');\n\t$stredit \t= get_string('editfolders', 'block_email_list');\n\t$strcourse = get_string('course');\n\t$strfolderopened = s(get_string('folderopened'));\n $strfolderclosed = s(get_string('folderclosed'));\n\n $spancounter = 1;\n\n\t// For title blocks\n\t$startdivtitle\t= '<div class=\"title\">';\n\t$enddivtitle = '</div>';\n\n\tprint_side_block_start($startdivtitle.$strfolders.$enddivtitle);\n\n\t// Get my folders\n\tif ( $folders = email_get_root_folders($userid) ) {\n\n $numbermails = 0;\n $unreaded = '';\n\t\t$row = 0;\n\n\t\techo '<ul class=\"c_menu\">';\n\n\t\t// Clean trash\n\t\t$clean = '';\n\n\t\t// Get courses\n\t\tforeach ($folders as $folder) {\n\n\t\t\tunset($numbermails);\n\t\t\tunset($unreaded);\n\t\t\t// Get number of unreaded mails\n\t\t\tif ( $numbermails = email_count_unreaded_mails($userid, $courseid, $folder->id) ) {\n\t\t\t\t$unreaded = ' ('.$numbermails.')';\n\t\t\t} else {\n\t\t\t\t$unreaded = '';\n\t\t\t}\n\n\t\t\tif ( email_isfolder_type($folder, EMAIL_TRASH) ) {\n\t\t\t\t$clean .= '&#160;&#160;<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;folderid='.$folder->id.'&amp;action=cleantrash\">'.get_string('cleantrash', 'block_email_list').'</a>';\n\t\t\t}\n\n\t\t\t// Now, print all subfolders it\n\t\t\t$subfolders = email_get_subfolders($folder->id, $courseid);\n\n\t\t\t// LI\n\t\t\techo '<li class=\"r'. $row .'\">';\n\t echo '<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/index.php?id='.$courseid.'&amp;folderid='.$folder->id.'\">'.$folder->name.$unreaded.'</a>';\n\n\t\t\t// If subfolders\n\t\t\tif ( $subfolders ) {\n\t\t\t\temail_print_subfolders( $subfolders, $userid, $courseid );\n\t\t\t}\n\t\t\techo '</li>';\n\t\t\t$row = $row ? 0:1;\n\t\t}\n\n\n\t\techo '</ul>';\n\n\t\techo '<div class=\"footer\">'.$clean.'</div>';\n\t\t// For admin folders\n\t\techo '<div class=\"footer\"><a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/folder.php?course='.$courseid.'&amp;action='.md5('admin').'\"><b>'.$stredit.'</b></a></div>';\n\n\t\tprint_side_block_end();\n\n\t}\n\n}", "private static function buildRecursiveTree(User $user): string\n {\n $html = '<ul>';\n\n foreach ($user->children as $arr) {\n if (count($arr->children)) {\n $html .= '<li>' . Str::limit($arr->email, 10) . \" (\" . $arr->name . \")\";\n $html .= self::buildRecursiveTree($arr);\n } else {\n $html .= '<li>' . str_limit($arr->email, 10) . \" (\" . $arr->name . \")\";\n $html .= \"</li>\";\n }\n\n }\n\n $html .= \"</ul>\";\n\n return $html;\n }", "public function loadTree($par = 1){\r\n\t\t$user = new Table_Users();\r\n\t\t// load the user data\r\n\t\t$userData = $user->getDataById($_SESSION['userId']);\r\n\t\t//get the role id\r\n\t\t$role_id = $userData->role_id;\r\n\t\t// load the tree\r\n\t\techo $this->getChildrens($par, $role_id);\r\n\t}", "public function treeview($root,$ids='')\n {\n # Fetch all files\n $dir=opendir($root);\n $folders=[];\n while($file=readdir($dir)) {\n # Don't show folders starting with .\n if ($file[0]=='.') continue;\n # Hide c and s folders (from imageresize)\n if ($file=='c' || $file=='s') continue;\n # Check if it's actualy a folder\n if (is_dir($root.'/'.$file)) $folders[]=$file;\n }\n natcasesort($folders);\n\n # Return if no rows found to prevent empty <ul></ul> but only if not root\n if (!count($folders) && $ids) return;\n \n $nav='';\n if (!$ids) {\n $nav='<ul>';\n $nav.='<li data-id=\"0\">'.$this->treeviewRow('Media');\n }\n\n # Create the html list\n $nav.='<ul>';\n $i=0;\n foreach($folders as $folder) {\n $i++;\n $nav.='<li data-id=\"'.$ids.$i.'\" data-folder=\"'.htmlspecialchars($folder).'\">';\n $nav.=$this->treeviewRow($folder);\n # Check if this row has children and add them\n $nav.=$this->treeview($root.'/'.$folder,$ids.$i.'-');\n $nav.='</li>';\n }\n\n # Finalize the html list and return it\n if (!$ids) \n $nav.='</li><ul>';\n $nav.='</ul>';\n return $nav;\n }", "public function renderDirectories() {\r\n\t\t$treeData = array();\r\n\t\tlist($name, $id) = $this->resolveNameID();\r\n\t\t$htmlOptions = array(\r\n\t\t\t\"class\" => \"filetree\",\r\n\t\t\t\"id\" => $id.\"-directories\"\r\n\t\t);\r\n\t\t\r\n\t\tforeach((is_array($this->basePath) ? $this->basePath : array($this->basePath)) as $path) {\r\n\t\t\t$item = array(\r\n\t\t\t\t\"text\" => \"<span class='folder'>\".basename($path).\"</span>\",\r\n\t\t\t\t\"id\" => md5($path),\r\n\t\t\t\t\"children\" => $this->directoryTreeviewData($path),\r\n\t\t\t\t\"expanded\" => false,\r\n\t\t\t);\r\n\t\t\t$checkboxId = $this->getId().\"_\".$item['id'];\r\n\t\t\t$item['text'] = CHtml::tag(\r\n\t\t\t\t\t\t\"span\",\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\"class\" => \"folder\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t($this->multiple ? \r\n\t\t\t\t\t\t\tCHtml::activeCheckbox($this->model,$this->attribute.\"[\".$item['id'].\"]\",array(\"id\" => $checkboxId))\r\n\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\tCHtml::activeRadioButton($this->model,$this->attribute,array(\"id\" => $checkboxId, \"value\" => $item['id']))\r\n\t\t\t\t\t\t).\r\n\t\t\t\t\t\tCHtml::label(basename($path),$checkboxId)\r\n\t\t\t\t\t);\r\n\t\t\t$treeData[] = $item;\r\n\t\t\t\r\n\t\t}\r\n\t\tob_start();\r\n\t\t$this->widget(\"CTreeView\",array(\r\n\t\t\t\"htmlOptions\" => $htmlOptions,\r\n\t\t\t\"data\" => $treeData\r\n\t\t));\r\n\t\t$html = ob_get_clean();\r\n\t\treturn $html;\r\n\t}", "public function subDirectories(){\n return $this->hasMany(UserDirectoryDetail::class, 'parent_directory_id', 'id');\n }", "function GetUser($folderId)\n {\n $html = \"<div id='dvFolderUserShared'>\";\n\n $users = FolderHelper::GetUser($this->Core, $folderId);\n\n if(count($users) > 0)\n {\n $eprofil = DashBoardManager::GetApp(\"Profil\", $this->Core);\n\n foreach($users as $user)\n {\n $html .= \"<span>\" .$eprofil->GetProfil($user->User->Value);\n\n //Bouton de suppression\n $html .= \"<i class='icon-remove' id='\".$user->IdEntite.\"' title='\".$this->Core->GetCode(\"File.RemoveUser\").\"' onclick='FileAction.RemoveUser(this)' >&nbsp</i>\";\n $html .= \"</span>\";\n }\n }\n else\n {\n $html .= $this->Core->GetCode(\"File.NoPartage\");\n }\n\n $html .= \"</div>\";\n\n return $html;\n }", "public static function ADMIN_ARCHIVE_GET_FOLDERS(){\n\t $SQL_String = \"SELECT ufno,owner,user_folder.name,files,count(*) AS queue,_share,createtime FROM user_folder LEFT JOIN task_upload ON ufno=folder WHERE owner=:owner AND ftype='folder' AND _keep=1 AND (_upload !='' || _upload IS NULL) GROUP BY ufno ORDER BY createtime DESC;\";\n\t return $SQL_String;\n\t}", "function email_get_my_folders($userid, $courseid, $excludetrash, $excludedraft, $excludesendbox=false, $excludeinbox=false) {\n\n\t// Save my folders in this variable\n\t$myfolders = array();\n\n\t// Get especific root folders\n\t$folders = email_get_root_folders($userid, !$excludedraft, !$excludetrash, !$excludesendbox, !$excludeinbox);\n\n\t// for every root folder\n\tforeach ( $folders as $folder ) {\n\n\t\t$myfolders[$folder->id] = $folder->name;\n\t\t$myfolders = email_my_folders($folder->id, $courseid, $myfolders, '&#160;&#160;&#160;');\n\t}\n\n\treturn $myfolders;\n}", "protected function getTreeUser()\n {\n return $this->getReportingUser();\n }", "public function create_user()\n {\n $root = 0;\n foreach ($this->sysfolders as $path => $data) {\n $dispname = ($this->_PM_['core']['language'] == 'de') ? $data['de'] : $data['en'];\n if ($data['root']) {\n $root = $this->STOR->create_mailbox($dispname, 0, $data['icon'], true, true);\n if (!$root) {\n \t$this->errortext = $this->STOR->get_errors('<br />');\n \treturn false;\n }\n } else {\n $state = $this->STOR->create_folder($dispname, $root, 0, $data['icon'], true, true, $path);\n if (!$state) {\n \t$this->errortext = $this->STOR->get_errors('<br> /');\n \treturn false;\n }\n }\n }\n return true;\n }", "function get_folders($option = NULL, $id_folder = NULL, $id_user = NULL)\n\t{\n\t\t$this->db->from('user_folders');\n\n\t\tswitch ($option)\n\t\t{\n\t\t\tcase 'all':\n\t\t\t\t$this->db->where('id_folder >', '10');\n\t\t\t\t$this->db->where('id_user', $this->session->userdata('id_user'));\n\t\t\t\tbreak;\n\n\t\t\tcase 'exclude':\n\t\t\t\t$this->db->where('id_folder >', '10');\n\t\t\t\t$this->db->where('id_folder !=', $id_folder);\n\t\t\t\t$this->db->where('id_user', $this->session->userdata('id_user'));\n\t\t\t\tbreak;\n\n\t\t\tcase 'name':\n\t\t\t\t$this->db->where('id_folder', $id_folder);\n\t\t\t\tif ($id_folder !== '5' && $id_folder !== '6')\n\t\t\t\t{\n\t\t\t\t\t$this->db->where('id_user', $this->session->userdata('id_user'));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->db->order_by('name');\n\t\treturn $this->db->get();\n\t}", "function getRoleSelectTree()\n {\n //find all roles below users current role\n $roles = $this->all();\n if (\\Config::get('user')->isAdmin())\n {\n return [[\n 'name' => $this->name,\n 'value' => $this->id,\n 'children' => $this->findChildren($roles, $this->id, 1)\n ]];\n\n }\n\n return $this->findChildren($roles, $this->id, 1);\n\n\n }", "private function get_existed_directory_tree()\r\n {\r\n $node_abs_length = 0;\r\n \r\n for ($dic_depth = 1; $dic_depth < 6; $dic_depth++)\r\n {\r\n $node_abs_length = $dic_depth * TL_NODE_ABS_LENGTH;\r\n \r\n $sql = \"select id, name, parent_id from \" .\r\n $this->db_handler->get_table('nodes_hierarchy') . \" n where n.node_type_id = 2 \" .\r\n \" and LENGTH(n.node_depth_abs) = \" . $node_abs_length;\r\n $result = $this->db_handler->fetchRowsIntoMap($sql, 'id');\r\n \r\n if (count($result, COUNT_NORMAL) > 0)\r\n {\r\n $this->existed_directory_array[$dic_depth] = $result;\r\n }\r\n }\r\n }", "public function index()\n {\n return $this->responseFactory->view(\"user.index\", [\n \"users\" => User::query()\n ->orderBy(\"id\")\n ->with([\n \"parent_ref.ancestor\",\n \"children_refs.descendant\",\n ])\n ->addSelect([\n \"left_child\" => Path::query()\n ->select(\"paths.descendant_id\")\n ->whereColumn(\"paths.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n ->orderBy(\"id\")\n ->limit(1),\n\n \"right_child\" => Path::query()->from(DB::raw(\"paths paths_rc\"))\n // Anak di sisi kanan hanya ada jika orang tuanya memiliki > 1 anak\n ->where(\n Path::query()->from(DB::raw(\"paths paths_sub\"))\n ->selectRaw(\"COUNT(*)\")\n ->whereColumn(\"paths_sub.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n , \">\", 1)\n\n ->select(\"paths_rc.descendant_id\")\n ->whereColumn(\"paths_rc.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n\n // Anak di sisi kiri adalah anak yang id nya lebih besar daripada anak lain\n ->orderByDesc(\"id\")\n ->limit(1),\n\n \"left_descendant_count\" =>\n Path::query()\n ->selectRaw(\"COUNT(*)\")\n ->whereIn(\n \"ancestor_id\",\n Path::query()\n ->selectRaw(\"MIN(paths.descendant_id)\")\n ->whereColumn(\"paths.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n ),\n\n \"right_descendant_count\" =>\n Path::query()\n ->selectRaw(\"COUNT(*)\")\n ->whereIn(\n \"ancestor_id\",\n Path::query()->from(DB::raw(\"paths paths_rdc\"))\n ->selectRaw(\"MAX(paths_rdc.descendant_id)\")\n\n // Anak di sisi kanan hanya ada jika orang tuanya memiliki > 1 anak\n ->where(\n Path::query()->from(DB::raw(\"paths paths_sub\"))\n ->selectRaw(\"COUNT(*)\")\n ->whereColumn(\"paths_sub.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n , \">\", 1)\n\n ->whereColumn(\"paths_rdc.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n ),\n\n \"left_deposit_total\" => User::query()->from(DB::raw(\"users users_lds\"))\n ->selectRaw(\"SUM(users_lds.deposit_amount)\")\n ->whereIn(\n \"id\",\n Path::query()\n ->select(\"paths.descendant_id\")\n ->whereIn(\n \"ancestor_id\",\n Path::query()\n ->selectRaw(\"MIN(paths.descendant_id)\")\n ->whereColumn(\"paths.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n )\n ),\n\n \"right_deposit_total\" => User::query()->from(DB::raw(\"users users_rds\"))\n ->selectRaw(\"SUM(users_rds.deposit_amount)\")\n ->whereIn(\n \"id\",\n Path::query()\n ->selectRaw(\"paths.descendant_id\")\n ->whereIn(\n \"ancestor_id\",\n Path::query()->from(DB::raw(\"paths paths_rdc\"))\n ->selectRaw(\"MAX(paths_rdc.descendant_id)\")\n\n // Anak di sisi kanan hanya ada jika orang tuanya memiliki > 1 anak\n ->where(\n Path::query()->from(DB::raw(\"paths paths_sub\"))\n ->selectRaw(\"COUNT(*)\")\n ->whereColumn(\"paths_sub.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n , \">\", 1)\n\n ->whereColumn(\"paths_rdc.ancestor_id\", \"=\", \"users.id\")\n ->where(\"tree_depth\", 1)\n )\n ),\n ])\n ->paginate(30),\n\n \"graph_nodes\" => User::query()\n ->has(\"descendant_refs\")\n ->has(\"ancestor_refs\")\n ->select([\n \"id\",\n DB::raw(\"CONCAT(name, ' (', id, ')', 'DEP: ', COALESCE(deposit_amount, '')) AS label\"),\n DB::raw(\"IF(deposited_at IS NOT NULL, '#A2FFF7', '#FFAFA3') AS color\"),\n ])->get(),\n\n \"graph_edges\" => Path::query()\n ->select([\n \"ancestor_id AS to\",\n \"descendant_id AS from\",\n ])\n ->where(\"tree_depth\", 1)\n ->get()\n ]);\n }", "public function myHierarchy_get(){\n\t\t$userId = $this->token_payload[\"user_id\"];\n\t\tresponse($this,true,200,$this->getAllAccessibleProfiles($userId));\n\t}", "function get_folder_view_tree($folder_id, $include_pages, $include_files, $excluded_page_id)\r\n{\r\n $output = '';\r\n\r\n // If this folder is not archived, then continue to get folder contents.\r\n if (db_value(\"SELECT folder_archived FROM folder WHERE folder_id = '$folder_id'\") == 0) {\r\n // Get folders in this folder.\r\n $folders = db_items(\r\n \"SELECT\r\n folder_id AS id,\r\n folder_name AS name\r\n FROM folder\r\n WHERE folder_parent = '$folder_id'\r\n ORDER BY\r\n folder_order ASC,\r\n folder_name ASC\");\r\n\r\n // Loop through folders in order to get their contents.\r\n foreach ($folders as $folder) {\r\n $folder_output = get_folder_view_tree($folder['id'], $include_pages, $include_files, $current_page_id);\r\n\r\n // If this folder has content to display, then output folder name and contents.\r\n // We output a folder even if a visitor does not have view access to it, assuming it has content,\r\n // because the visitor has view access to something inside of it and we need to preserve\r\n // the heirarchy/indentation.\r\n if ($folder_output != '') {\r\n $output .=\r\n '<li class=\"folder ' . get_access_control_type($folder['id']) . '\">\r\n <div class=\"name\">' . h($folder['name']) . '</div>\r\n ' . $folder_output . '\r\n </li>';\r\n }\r\n }\r\n\r\n // If the visitor has view access to this folder, then continue to get pages and files.\r\n if (check_view_access($folder_id, $always_grant_access_for_registration_and_guest = true) == true) {\r\n // If pages are selected to be included, then get them.\r\n if ($include_pages == 1) {\r\n $pages = db_items(\r\n \"SELECT\r\n page_id AS id,\r\n page_name AS name,\r\n page_title AS title,\r\n page_meta_description AS meta_description\r\n FROM page\r\n WHERE\r\n (page_folder = '$folder_id')\r\n AND (page_search = '1')\r\n AND (page_type != 'registration confirmation')\r\n AND (page_type != 'membership confirmation')\r\n AND (page_type != 'view order')\r\n AND (page_type != 'custom form confirmation')\r\n AND (page_type != 'form item view')\r\n AND (page_type != 'calendar event view')\r\n AND (page_type != 'catalog detail')\r\n AND (page_type != 'shipping address and arrival')\r\n AND (page_type != 'shipping method')\r\n AND (page_type != 'billing information')\r\n AND (page_type != 'order preview')\r\n AND (page_type != 'order receipt')\r\n AND (page_type != 'affiliate sign up confirmation')\r\n AND (page_type != 'affiliate welcome')\r\n ORDER BY name ASC\");\r\n\r\n // Loop through pages in order to output them.\r\n foreach ($pages as $page) {\r\n // If this is not the excluded page, then output it.\r\n if ($page['id'] != $excluded_page_id) {\r\n // If there is a title, then prepare link with title.\r\n if ($page['title'] != '') {\r\n $output_name = '<div class=\"name\"><a href=\"' . OUTPUT_PATH . h(encode_url_path($page['name'])) . '\">' . h($page['title']) . '</a></div>';\r\n \r\n // Otherwise there is not a title, so prepare link with page name.\r\n } else {\r\n $output_name = '<div class=\"name\"><a href=\"' . OUTPUT_PATH . h(encode_url_path($page['name'])) . '\">' . h($page['name']) . '</a></div>';\r\n }\r\n\r\n $output_description = '';\r\n \r\n // If there is a meta description for this page, then output it.\r\n if ($page['meta_description'] != '') {\r\n $output_description = '<div class=\"description\">' . h($page['meta_description']) . '</div>';\r\n }\r\n\r\n $output .=\r\n '<li class=\"page\">\r\n ' . $output_name . '\r\n ' . $output_description . '\r\n </li>';\r\n }\r\n }\r\n }\r\n\r\n // If files are selected to be included, then get them.\r\n if ($include_files == 1) {\r\n $files = db_items(\r\n \"SELECT\r\n name,\r\n description,\r\n design\r\n FROM files\r\n WHERE folder = '$folder_id'\r\n ORDER BY name ASC\");\r\n\r\n // Loop through files in order to output them.\r\n foreach ($files as $file) {\r\n $output_design_class = '';\r\n\r\n // If this file is a design file, then output design class.\r\n if ($file['design'] == 1) {\r\n $output_design_class = ' design';\r\n }\r\n\r\n $output_description = '';\r\n \r\n // If there is a description for this file, then output it.\r\n if ($file['description'] != '') {\r\n $output_description = '<div class=\"description\">' . h($file['description']) . '</div>';\r\n }\r\n\r\n $output .=\r\n '<li class=\"file' . $output_design_class . '\">\r\n <div class=\"name\"><a href=\"' . OUTPUT_PATH . h(encode_url_path($file['name'])) . '\">' . h($file['name']) . '</a></div>\r\n ' . $output_description . '\r\n </li>';\r\n }\r\n }\r\n }\r\n\r\n // If content was found for this folder, then wrap content in ul tags.\r\n if ($output != '') {\r\n $output = '<ul>' . $output . '</ul>';\r\n }\r\n }\r\n\r\n return $output;\r\n}", "public function index() {\n\n if (Input::get('all') === 'true' && (Auth::user()->isAdmin || IS_DEMO)) {\n //return $this->paginator->paginate(Folder::withTrashed()->where('name', '!=', 'root')->orderBy('updated_at', 'desc'), Input::all(), 'folders');\n //return $this->paginator->paginate(Folder::where('name', '!=', 'root')->orderBy('updated_at', 'desc'), Input::all(), 'folders');\n \n /*$res = DB::table('folders')\n ->join('folders_users', 'folders.id', '=', 'folders_users.folder_id')\n ->wherenull('folders.deleted_at')\n ->get();\n\n return $res;*/\n\n /*$res = Folder::join('folders_users', 'folders.id', '=', 'folders_users.folder_id')\n ->select('folders.id','folders.name', 'folders.description', 'folders.path','folders.folder_id', 'folders.share_id', 'folders.password', 'folders.created_at','folders.updated_at','folders.deleted_at', 'folders_users.user_id');\n return $res->get();*/\n\n $res = Auth::user()->folders()->with('labels', 'users');\n return $res->get();\n } \n else {\n //$user_id = Auth::user()->first()->getAttributes()['id'];\n //Auth::user()->folders()->with('labels', 'users')->toSql().\"<br/>\";\n //print_r(Auth::user()->folders()->with('labels', 'users')->get());\n $res = Auth::user()->folders()->with('labels', 'users');\n return $res->get();\n }\n }", "function getPhotosOfUser($idUser){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$tab = new Data();\r\n\t\t$r = mysql_query(\"select login from Utilisateur where id_user = \" . $idUser);\r\n\r\n\t\tif(mysql_num_rows($r) == 0){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\t\t$name = mysql_result($r,0,0);\r\n\t\t$connectService->close();\r\n\t\tif(!is_dir(\"../v2.0/espace/\" . $name . \"/photos/sd\")){\r\n\t\t\treturn $tab;\r\n\t\t}\r\n\r\n\t\t$tab->addInfo(\"root\",\"../v2.0/espace/\" . $name . \"/photos\");\r\n\t\t$tab->addInfo(\"photos\",$this->getPhotosOfDir($tab->getInfo(\"root\")));\r\n\t\t$tab->addInfo(\"type\",\"scan\");\r\n\r\n\t\treturn $tab;\r\n\t}", "public function view(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n\n $data = [];\n \n $user_id = $user['id'];\n $tree = false; \n $entity = $this->Users->get($user_id); \n if($this->Users->childCount($entity) > 0){\n $tree = true;\n } \n \n //Fields\n\t\t$fields = $this->{$this->main_model}->schema()->columns();\n \n if(isset($this->request->query['realm_id'])){\n $q_r = $this->{$this->main_model}->find()\n ->where([$this->main_model.'.id' => $this->request->query['realm_id']])\n ->contain(['Users'=> ['fields' => ['Users.username']]])\n ->first();\n if($q_r){ \n $owner_tree = $this->Users->find_parents($q_r->user_id);\n $data['owner'] = $owner_tree; \n foreach($fields as $field){\n\t $data[\"$field\"]= $q_r->{\"$field\"};\n\t\t } \n }\n \n if($q_r->user !== null){\n $data['username'] = \"<div class=\\\"fieldBlue\\\"> <b>\".$q_r->user->username.\"</b></div>\";\n }else{\n $data['username'] = \"<div class=\\\"fieldRed\\\"><i class='fa fa-exclamation'></i> <b>(ORPHANED)</b></div>\";\n }\n $data['show_owner'] = $tree;\n } \n $this->set(array(\n 'data' => $data,\n 'success' => true,\n '_serialize'=> array('success', 'data')\n ));\n }", "function email_get_root_folder($userid, $folder) {\n\n\tglobal $USER;\n\n\tif ( empty($userid) ) {\n\t\t$userid = $USER->id;\n\t}\n\n\temail_create_parents_folders($userid);\n\n\t$rootfolder = new object();\n\n\tif ( $userid > 0 and !empty($userid) ) {\n\t\tif ( $folder == EMAIL_INBOX ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_INBOX);\n\t\t\t$rootfolder->name = get_string('inbox', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_SENDBOX ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_SENDBOX);\n\t\t\t$rootfolder->name = get_string('sendbox', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_TRASH ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_TRASH);\n\t\t\t$rootfolder->name = get_string('trash', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\n\t\tif ( $folder == EMAIL_DRAFT ) {\n\t\t\t$rootfolder = get_record('email_folder', 'userid', $userid, 'isparenttype', EMAIL_DRAFT);\n\t\t\t$rootfolder->name = get_string('draft', 'block_email_list');\n\t\t\treturn $rootfolder;\n\t\t}\n\t}\n\n\treturn $rootfolder;\n\n}", "function minorite_menu_tree__user_menu(array $variables) {\n $links = '';\n $options = '';\n global $user;\n\n if ($user->uid) {\n // TODO: add this as a menu link.\n $text = t('Welcome !first_name', array('!first_name' => $user->name));\n $options .= '<option>' . l($text, 'user', array('html' => TRUE)) . '</option>';\n }\n\n foreach (explode(\"\\n\", $variables['tree']) as $leaf) {\n substr($leaf, 0, 2) === '<l' ? $links .= $leaf . \"\\n\" : $options .= $leaf;\n }\n\n if (!empty($options)) {\n // TODO: Refactor this with theme_select()!\n $change = 'onchange=\"location = this.options[this.selectedIndex].value;\"';\n $select = '<select name=\"user-menu\" id=\"user-menu\" tabindex=\"0\" class=\"custom-select-user\" ' . $change . '>' . $options . '</select>';\n $select_span = '<span class=\"custom-select-user-wrapper\">' . $select . '</span>';\n $label = '<label for=\"user-menu\" class=\"visuallyhidden\">' . t('User menu') . \"</label>\\n\";\n $legend = '<legend class=\"visuallyhidden\">' . 'Menu utilisateur (naviguer avec les flêches hauts et bas)' . \"</legend>\\n\";\n $links .= '<li><fieldset>' . $legend . $label . $select_span . '</fieldset></li>';\n }\n\n return '<ul class=\"nav user-access-menu\">' . $links . \"</ul>\\n\";\n}", "public function directoryTreeviewData($basePath) {\r\n\t\t$items = array();\r\n\t\tlist($name, $id) = $this->resolveNameID();\r\n\t\tforeach(AFileHelper::findDirectories($basePath,array(\r\n\t\t\t\"level\" => 0,\r\n\t\t\t\"exclude\" => $this->exclude,\r\n\t\t)) as $dir) {\r\n\t\t\t$item = array();\r\n\t\t\t$item['id'] = md5($dir);\r\n\t\t\t$checkboxId = $id.\"_\".$item['id'];\r\n\t\t\tif ($this->hasModel()) {\r\n\t\t\t\t$item['text'] = CHtml::tag(\r\n\t\t\t\t\t\t\"span\",\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\"class\" => \"folder\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t($this->multiple ? \r\n\t\t\t\t\t\t\tCHtml::activeCheckbox($this->model,$this->attribute.\"[\".$item['id'].\"]\",array(\"id\" => $checkboxId))\r\n\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\tCHtml::activeRadioButton($this->model,$this->attribute,array(\"id\" => $checkboxId, \"value\" => $item['id']))\r\n\t\t\t\t\t\t).\r\n\t\t\t\t\t\tCHtml::label(basename($dir),$checkboxId)\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$item['children'] = $this->directoryTreeViewData($dir);\r\n\t\t\t$item['expanded'] = false;\r\n\t\t\t$items[] = $item;\r\n\t\t}\r\n\t\treturn $items;\r\n\t}", "public function getRootFolder() : string;", "public function index()\n {\n $userId = 1;\n $rows = $this->treeRepo->binaryChildren($userId,100)->joinUsers()->get();\n list($parent, $jsonNodes) = TreeBinary::generateJson($rows, $userId);\n\n // dump($jsonNodes);\n return view('tree.binary.indexBinary',compact('jsonNodes','parent'));\n\n }", "public function listFolders()\n {\n $this->_init();\n return $this->_list_cache->getFolders();\n }", "public function getMyFoldersList($userId, $limit = 3)\n\t{\n\t\t$sql = '';\n\n\t\tif($limit == -1) {\n\t\t\t$sql =\n\t\t\t'\n\t\t\t\tSELECT \n\t\t\t\t\t`folder`.`id`,\n\t\t\t\t\t`folder`.`name`,\n\t\t\t\t\t`folder`.`keyword`,\n\t\t\t\t\t`user_folder`.`user_id`,\n\t\t\t\t\t`user_folder`.`expiration_date`,\n\t\t\t\t\t`user_folder`.`status`\n\t\t\t\tFROM\n\t\t\t\t\t`user_folder`\n\t\t\t\tINNER JOIN `folder` ON `folder`.`id` = `user_folder`.`folder_id`\n\t\t\t\tWHERE\n\t\t\t\t\t`user_folder`.`user_id` = ' . $userId . '\n\t\t\t\t\t\tAND\n\t\t\t\t\t(\n\t\t\t\t\t\t`user_folder`.`status` = \\'active\\'\n\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t`user_folder`.`status` = \\'expired\\'\n\t\t\t\t\t)\n\t\t\t\tGROUP BY `folder`.`id`\n\t\t\t\tORDER BY `user_folder`.`id` DESC\n\t\t\t';\n\t\t} else {\n\t\t\t$limit = $limit + 1;\n\n\t\t\t$sql =\n\t\t\t'\n\t\t\t\tSELECT \n\t\t\t\t\t`folder`.`id`,\n\t\t\t\t\t`folder`.`name`,\n\t\t\t\t\t`folder`.`keyword`,\n\t\t\t\t\t`user_folder`.`user_id`,\n\t\t\t\t\t`user_folder`.`expiration_date`,\n\t\t\t\t\t`user_folder`.`status`\n\t\t\t\tFROM\n\t\t\t\t\t`user_folder`\n\t\t\t\tINNER JOIN `folder` ON `folder`.`id` = `user_folder`.`folder_id`\n\t\t\t\tWHERE\n\t\t\t\t\t`user_folder`.`user_id` = ' . $userId . '\n\t\t\t\t\t\tAND\n\t\t\t\t\t(\n\t\t\t\t\t\t`user_folder`.`status` = \\'active\\'\n\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t`user_folder`.`status` = \\'expired\\'\n\t\t\t\t\t)\n\t\t\t\tGROUP BY `folder`.`id`\n\t\t\t\tORDER BY `user_folder`.`id` DESC\n\t\t\t\tLIMIT 0, ' . $limit;\n\t\t}\n\n\t\t$response = self::findBySql($sql)->all();\n\t\tif(isset($response) && $response != null) {\n\t\t\treturn $response;\n\t\t}\n\n\t\treturn NULL;\n\t}", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public function getFolders($id = null) {\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->alias = 'r';\n\t\t$criteria->order = 'parent_category_id ASC';\n\t\t$criteria->condition = '`type` = \"folder\"';\n\t\t$data = $this->findAll($criteria);\n\t\t$tree = $this->bindTree($data);\n\t\treturn $this->getHtmlTree($tree,$id);\n\t}", "public function getDirectory();", "public function getDirectory();", "function get_menu_tree($parent_id) \n\t\t{\n\t\t\tinclude_once('connection.php');\n \t$obj=new connection();\n \t$obj->connect();\n\t\t\t$menu='';\n\t\t\t$obj->sql=\"SELECT * FROM register where referral_code='\".$parent_id.\"'\";\n\t\t\t$obj->select($obj->sql);\n\t\t\t//$no1=mysqli_num_rows($obj->res);\n\t\t\twhile($rows1=mysqli_fetch_array($obj->res))\n\t\t\t{\n\t\t\t\t//$rows1=mysqli_fetch_array($obj->res);\n\t\t\t\t$menu.=\"<li>\". $rows1['name'];\n\t\t\t\t$menu.=\"<ul>\".get_menu_tree($rows1['rid']).\"</ul>\";\n\t\t\t\t$menu.=\"</li>\";\n\t\t\t}\n\t\t\treturn $menu;\n\t\t}", "public function getFolderInfo() {}", "public function subfolders()\n {\n return $this->hasMany('App\\Model\\Folder', 'parent_id');\n }", "public function ajax_get_folder_contents() {\n\n\t\t$path = '#' === rgget( 'path' ) ? '/' : rgget( 'path' );\n\n\t\techo wp_json_encode( $this->get_folder_tree( $path, rgget( 'first_load' ) ) );\n\t\tdie();\n\n\t}", "public function getDir();", "public function getFileList()\r\n {\r\n $gid = $this->input->get_post('gid');\r\n if ($gid === FALSE)\r\n {\r\n // list all groups (by permission)\r\n $permission = $this->input->get_post('permission');\r\n $file_list = $this->_get_group_list($permission);\r\n $access_full_path = '';\r\n }\r\n else\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n $access_full_path = $this->_get_access_full_path();\r\n $sortby = $this->input->get_post('sortby') ?: '+name';\r\n $file_list = $this->files_model->get_file_list($access_full_path, $sortby);\r\n }\r\n\r\n $format = $this->input->get_post('format');\r\n if ($format === 'jstree')\r\n {\r\n //$path = '/' . trim($this->input->get_post('path') ?: '', '/');\r\n $path = $this->input->get_post('path');\r\n $path = $path ? $path : '';\r\n $dironly = $this->input->get_post('dironly');\r\n $tree = array();\r\n foreach ($file_list as $file)\r\n {\r\n if ($dironly && $file['type'] === Files_model::FILE_TYPE_FILE)\r\n {\r\n continue;\r\n }\r\n // Give different directory icons based directories.\r\n $is_my_workspace = 0;\r\n if ($gid)\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($gid);\r\n }\r\n else\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($file['gid']);\r\n }\r\n $access_full_subpath = $access_full_path .'/'. $file['name'];\r\n\r\n $data_path = $file['type'] === Files_model::FILE_TYPE_FOLDER ? $path . '/' . $file['name'] : $path;\r\n if ($gid !== FALSE && $path === '' && $file['type'] === Files_model::FILE_TYPE_FOLDER)\r\n {\r\n $file['show_name'] = $this->files_model->get_system_folder_name($file['name']);\r\n }\r\n $tree[] = array(\r\n 'data' => array(\r\n 'title' => isset($file['show_name']) ? $file['show_name'] : $file['name'],\r\n 'attr' => array(\r\n 'href' => '#',\r\n ),\r\n ),\r\n 'attr' => array(\r\n 'data-name' => $file['name'],\r\n 'data-gid' => $gid === FALSE ? $file['gid'] : $gid,\r\n 'data-path' => $gid === FALSE ? '' : $data_path,\r\n 'data-size' => $file['size'],\r\n 'data-crumb'=> $file['type'] == Files_model::FILE_TYPE_FOLDER ? $this->login->get_crumb($access_full_subpath) : '',\r\n 'class' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'folder' : 'file',\r\n 'rel' => $is_my_workspace ? 'user-folder' : 'folder',\r\n ),\r\n 'state' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'closed' : '',\r\n );\r\n }\r\n $this->_outputJSON($tree);\r\n }\r\n\r\n $resp['status'] = 'ok';\r\n $resp['errno'] = $resp['errmsg'] = '';\r\n $resp['list'] = $file_list;\r\n $this->_outputJSON($resp);\r\n }", "function getFoldersListXML() {\n $this->loadFolders();\n if (isset($this->folders) && is_array($this->folders) && count($this->folders) > 0) {\n return $this->getFoldersSubTreeXML(0, 1);\n }\n return FALSE;\n }", "public function rechercherCreatedFolder() \n {\n $auth = AuthenticationManager::getInstance();\n $username = $auth->getMatricule();\n //sécurité\n $action = 'listCreatedFolder';\n $error = AccessControll::checkRight($action);\n if ( empty($error) ){ //ok\n $search = $this->request->getPostAttribute('search');\n $dossier = DossierManager::rechercherIdOrNameCreatedFolder($search, $username);\n $prez = DossierHtml::listCreatedFolderHtml($dossier);\n } else{ //pas ok\n $prez = HomeHtml::toHtml($error);\n }\n $this->response->setPart('contenu', $prez);\n }", "public function subDirectories()\n {\n $this->files();\n\n return $this->directories->get();\n }", "public static function is_user_folder($user_id){\n\n\t}", "public function tree()\n {\n// try {\n $root = $this->model->root();\n if ($root) {\n $items = $root->getDescendants();\n }\n\n $items = $this->recursiveNestable($items->toArray(), $root->id);\n\n return view('admin.menus.tree', compact('items', 'root'))->with('parentId', $root->id);\n// } catch (Exception $e) {\n// return $this->returnWithError($e->getMessage());\n// }\n }", "public function getFolderPath(){}", "private function listMyFolder($dir = APPPATH) {\n $ffs = scandir($dir);\n\n unset($ffs[array_search('.', $ffs, true)]);\n unset($ffs[array_search('..', $ffs, true)]);\n unset($ffs[array_search('.DS_Store', $ffs, true)]);\n unset($ffs[array_search('', $ffs, true)]);\n\n if (count($ffs) < 1) {\n return;\n }\n\n $ul = '<ul>';\n foreach ($ffs as $ff) {\n if (is_dir($dir . '/' . $ff)) {\n $ul .= '<li>';\n $ul .= $ff;\n $ul .= $this->listMyFolder($dir . '/' . $ff . \"/\");\n $ul .= '</li>';\n } else {\n // Search for color class\n switch ($ff) {\n case '.htaccess' :\n $class = 'text-default';\n break;\n case 'Buildigniter.php' :\n $class = 'text-danger';\n break;\n default :\n $class = 'text-info';\n break;\n }\n // Folder search\n if (strpos($dir . $ff, '_buildigniter')) {\n $class = 'text-danger';\n }\n $ul .= '<li class=\"' . $class . '\" data-jstree=\\'{\"icon\":\"fa fa-file\"}\\'>' . $ff . '</li>';\n }\n }\n $ul .= '</ul>';\n\n return $ul;\n }", "function fs_get_tree($dir_path) {\n #echo \"top of fs_get_tree, dir_path=$dir_path\\n\";\n { $old_cwd = getcwd();\n chdir($dir_path);\n #echo \" did chdir to '$dir_path'\\n\";\n\n {\n $fh = opendir('.');\n #echo \" opendir\\n\";\n\n $results = array();\n $n = 0;\n $dirs_to_crawl = array();\n while (true) {\n #echo \" loop\\n\";\n if ($n > 500) {\n #echo \"--- n > LIMIT (n=$n), break\\n\";\n break;\n }\n $n++;\n $file = readdir($fh);\n #echo \" file = '$file'\\n\";\n if (!$file) {\n break;\n }\n if ($file == '.'\n || $file == '..'\n || $file == '.git' #todo #fixme don't assume\n ) {\n #echo \"--- . or .., continuing\\n\";\n continue;\n }\n if (is_dir($file)) {\n #echo \"--- adding $file to dirs, n=$n\\n\";\n $dirs_to_crawl[] = $file;\n }\n $results[$file] = null;\n }\n closedir($fh);\n }\n\n #echo \"\\nnow looping thru dirs_to_crawl\\n\";\n foreach ($dirs_to_crawl as $dir) {\n #echo \" dir = $dir\\n\";\n $results[$dir] = fs_get_tree($dir);\n }\n\n chdir($old_cwd);\n }\n\n return $results;\n }", "public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }", "public function getTree($id, $showFiles=true, &$results = array()) {\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=browse&fileid=\".$id.\"&showdirs=true\";\n\t\tif ($showFiles) $url.=\"&showfiles=true\";\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=browse&fileid=\".$id;\n\t\t$files_info = json_decode($this->curlObj->fetch_url($url),true);\n//\t\tprint_r($files_info[\"FILES_INFO\"]);\n//\t\tdie();\n//\t\tforeach($files_info[\"FILES_INFO\"] as $f) {\n//\t\t\tprint $f[\"FILE_ID\"] . \"<br />\";\n//\t\t}\n\t\tforeach($files_info[\"FILES_INFO\"] as $f) {\n\t\t\tif($f[\"FILE_ISADIR\"] == 1) {\n//\t\t\t\tprint \"DO ANOTHER GETTREE\";\n//\t\t\t\tdie();\n\t\t\t\t$this->getTree($f[\"FILE_ID\"], $showFiles, $results);\n\t\t\t\t$results[\"dirs\"][] = $f[\"FILE_PATH\"];\n\t\t\t} else {\n\t\t\t\t$results[\"files\"][$f[\"FILE_ID\"]] = $f[\"FILE_PATH\"];\n\t\t\t}\n\t\t}\n\t\treturn $results;\n\t}", "public function getUsersForHierarchyRanking() {\n // create hierarchy ranking query\n $hierarchy_ranking_query = Doctrine_Query::create()\n ->from('sfGuardUserProfile sgup')\n ->leftJoin('sgup.User sgu')\n ->where('sgup.accumulated_points > 0')\n ->andWhere('sgup.id=sgu.id')\n ->andWhere('sgu.is_disabled <> 1')\n ->andWhere('sgu.is_active = 1')\n ->groupBy('sgu.username')\n ->orderBy('sgup.accumulated_points DESC, sgu.username ASC');\n \n return $hierarchy_ranking_query;\n }", "function folderChildren($args)\n {\n if(!array_key_exists('id', $args))\n {\n throw new Exception('Parameter id is not defined', MIDAS_INVALID_PARAMETER);\n }\n\n $id = $args['id'];\n $folder = $this->Folder->load($id);\n\n $userDao = $this->_getUser($args);\n $folders = $this->Folder->getChildrenFoldersFiltered($folder, $userDao);\n $items = $this->Folder->getItemsFiltered($folder, $userDao);\n\n return array('folders' => $folders, 'items' => $items);\n }", "protected function action_getUserMainDir() {}", "function listFolderTree($path, $filter, $maxLevel = 3, $level = 0, $parent = 0) \n {\n $dirs = array ();\n if ($level == 0) {\t\t\t\n self::$_folder_tree_index = 0;\n }\n if ($level < $maxLevel) {\n $folders = $this->folders($path, $filter);\n if (VWP::isWarning($folders)) {\n return $folders;\n }\n \n $vpath =& $this->_fs->path();\n \n // first path, index foldernames\n foreach ($folders as $name) {\n $id = ++self::$_folder_tree_index;\n $fullName = $vpath->clean($path . DS . $name);\n $dirs[] = array(\n\t\t 'id' => $id,\n\t\t 'parent' => $parent,\n\t\t 'name' => $name,\n\t\t 'fullname' => $fullName,\n\t\t 'relname' => str_replace(VPATH_BASE, '', $fullName)\n\t\t );\n $dirs2 = $this->listFolderTree($fullName, $filter, $maxLevel, $level + 1, $id);\n if (VWP::isWarning($dirs2)) {\n return $dirs2;\n } \n $dirs = array_merge($dirs, $dirs2);\n }\n }\n return $dirs;\n }", "private function _prep_folders() \n\t{\n\t\t \n\t\t// Prep folders for Image selection\n\t\t// Load Files Module\n\t\t$this->load->library('files/files');\n\t\t$this->load->model('files/file_folders_m');\n\t\t \n\t\t// Set up the Dropdown Array for edit and create\n\t\t$folders = array(0 => lang('global:select-pick'));\n\t\t \n\t\t// Get All folders\n\t\t$tree = $this->file_folders_m->order_by('parent_id', 'ASC')->order_by('id', 'ASC')->get_all();\n\t\t \n\t\t// Build the Folder Tree\n\t\tforeach ($tree as $folder) \n\t\t{\n\t\t\t$id = $folder->id;\n\t\t\tif ($folder->parent_id != 0) \n\t\t\t{\n\t\t\t\t$folders[$id] = $folders[$folder->parent_id] . ' &raquo; ' . $folder->name;\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$folders[$id] = $folder->name;\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $folders;\n\t\t \n\t}", "public function getFolders()\n {\n \n $folders = array();\n $fList = $this->getNodes( 'folder' );\n \n foreach( $fList as $lNode )\n {\n $folders[] = $lNode->getAttribute('name');\n }\n \n return $folders;\n \n }", "function displayDirectories($dir)\r\n{\r\n\t// $bcI is the iterator from getBreadcrumbs()\r\n\tglobal $group, $bcI, $debug;\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"displayDirectories(\".$dir.\")\\n----------\\n\";\r\n\t}\r\n\tif ( $group==true && $bcI==2 )\r\n\t{\r\n\t\t$getDirectories = getGroupedDirectories($dir);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"getDirectories = getGroupedDirectories(\".$dir.\")\\n\\n\";\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$getDirectories = getDirectories($dir);\r\n\t\tif ( !empty($debug) )\r\n\t\t{\r\n\t\t\t$log .= \"getDirectories = getDirectories(\".$dir.\")\\n\\n\";\r\n\t\t}\r\n\t}\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $getDirectories;\r\n}", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public function listUserPaths(): array\n {\n $path = storage_path('keys');\n if (\\is_dir($path)) {\n $directory = glob($path.'/*', GLOB_ONLYDIR);\n $usersPaths = [];\n foreach ($directory as $userPath) {\n $pathSlices = explode('/', $userPath);\n $usersPaths[] = end($pathSlices);\n }\n }\n\n return $usersPaths;\n }", "function getDirectories($dir)\r\n{\r\n\tglobal $debug;\r\n\t$directories = getFolderList($dir);\r\n\t// Only bother with it if there are any subdirectories here\r\n\tif (count($directories)>0)\r\n\t{\r\n\t\t$getDirectories = '<div class=\"list-group\">';\r\n\t\tforeach($directories as $directory)\r\n\t\t{\r\n\t\t\t// Only bother with it if there are playable tracks or subdirectories\r\n\t\t\tif ( getTracksCount($directory)>0 || getFoldersCount($directory)>0 )\r\n\t\t\t{\r\n\t\t\t\t$getDirectories .= '<a href=\"?dir='.rawurlencode($directory);\r\n\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$getDirectories .= '&debug=log';\r\n\t\t\t\t}\r\n\t\t\t\t$getDirectories .= '\" class=\"list-group-item\" title=\"Open this directory\">'.substr($directory,strrpos($directory,\"/\")+1).'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\t\tunset($directories);\r\n\t\t$getDirectories .= '</div>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$getDirectories = '';\r\n\t}\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"getDirectories(\".$dir.\")\\n----------\\n\";\r\n\t\t$log .= \"getDirectories = \".$getDirectories.\"\\n\\n\";\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $getDirectories;\r\n}", "public static function jqueryFileTree_get_list() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n\t\t//setup wp_filesystem api\r\n\t\tglobal $wp_filesystem;\r\n $url = wp_nonce_url('admin.php?page=wpide','plugin-name-action_wpidenonce');\r\n $form_fields = null; // for now, but at some point the login info should be passed in here\r\n if (false === ($creds = request_filesystem_credentials($url, FS_METHOD, false, false, $form_fields) ) ) {\r\n // no credentials yet, just produced a form for the user to fill in\r\n return true; // stop the normal page form from displaying\r\n }\r\n \r\n\t\tif ( ! WP_Filesystem($creds) ) \r\n\t\t return false;\r\n \r\n\t\t$_POST['dir'] = urldecode($_POST['dir']);\r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ); \r\n\t\t\r\n\t\tif( $wp_filesystem->exists($root . $_POST['dir']) ) {\r\n\t\t\t//$files = scandir($root . $_POST['dir']);\r\n\t\t\t//print_r($files);\r\n\t\t\t$files = $wp_filesystem->dirlist($root . $_POST['dir']);\r\n\t\t\t//print_r($files);\r\n \r\n\t\t\techo \"<ul class=\\\"jqueryFileTree\\\" style=\\\"display: none;\\\">\";\r\n\t\t\tif( count($files) > 0 ) { \r\n\t\t\t\t\r\n\t\t\t\t// All dirs\r\n\t\t\t\tasort($files); // Sort Files and folders by php case-sensitive Alpha\r\n\t\t\t\tforeach( $files as $file => $file_info ) {\r\n\t\t\t\t\tif( $file != '.' && $file != '..' && $file_info['type']=='d' ) {\r\n\t\t\t\t\t\techo \"<li class=\\\"directory collapsed\\\"><a href=\\\"#\\\" rel=\\\"\" . htmlentities($_POST['dir'] . $file) . \"/\\\">\" . htmlentities($file) . \"</a></li>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// All files\r\n\t\t\t\tforeach( $files as $file => $file_info ) {\r\n\t\t\t\t\tif( $file != '.' && $file != '..' && $file_info['type']!='d') {\r\n\t\t\t\t\t\t$ext = preg_replace('/^.*\\./', '', $file);\r\n\t\t\t\t\t\techo \"<li class=\\\"file ext_$ext\\\"><a href=\\\"#\\\" rel=\\\"\" . htmlentities($_POST['dir'] . $file) . \"\\\">\" . htmlentities($file) . \"</a></li>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//output toolbar for creating new file, folder etc\r\n\t\t\techo \"<li class=\\\"create_new\\\"><a class='new_directory' title='Create a new directory here.' href=\\\"#\\\" rel=\\\"{type: 'directory', path: '\" . htmlentities($_POST['dir']) . \"'}\\\"></a> <a class='new_file' title='Create a new file here.' href=\\\"#\\\" rel=\\\"{type: 'file', path: '\" . htmlentities($_POST['dir']) . \"'}\\\"></a><br style='clear:both;' /></li>\";\r\n\t\t\techo \"</ul>\";\t\r\n\t\t}\r\n\t\r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "function email_create_parents_folders($userid) {\n\n\t$folders = new stdClass();\n\t$folder = new stdClass();\n\n\t$folder->timecreated = time();\n\t$folder->userid\t = $userid;\n\t$folder->name\t\t = addslashes(get_string('inbox', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_INBOX; // Be careful if you change this field\n\n\t/// $folders is an object who contain id's of created folders\n\n\t// Insert inbox if no exist\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_INBOX) == 0 ) {\n\t\tif (! $folders->inboxid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert draft if no exist\n\t$folder->name\t\t = addslashes(get_string('draft', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_DRAFT; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_DRAFT) == 0 ) {\n\t\tif (! $folders->trashid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert sendbox if no exits\n\t$folder->name\t\t = addslashes(get_string('sendbox', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_SENDBOX; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_SENDBOX) == 0 ) {\n\t\tif (! $folders->sendboxid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Insert trash if no exits\n\t$folder->name\t\t = addslashes(get_string('trash', 'block_email_list'));\n\t$folder->isparenttype = EMAIL_TRASH; // Be careful if you change this field\n\n\tif ( count_records('email_folder', 'userid', $userid, 'isparenttype', EMAIL_TRASH) == 0) {\n\t\tif (! $folders->trashid = insert_record('email_folder', $folder)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn $folders;\n}", "public abstract function getDirectory();", "public function getAllFolders($locale = null);", "function getFolderTree($base = null)\r\n\t{\r\n\t\tif (empty($base)) {\r\n\t\t\t$base = Tienda::getPath('images');\r\n\t\t}\r\n\t\t$mediaBase = str_replace(DS, '/', Tienda::getPath('images').'/');\r\n\r\n\t\t// Get the list of folders\r\n\t\tjimport('joomla.filesystem.folder');\r\n\t\t$folders = JFolder::folders($base, '.', true, true);\r\n\r\n\t\t$tree = array();\r\n\t\tforeach ($folders as $folder)\r\n\t\t{\r\n\t\t\t$folder\t\t= str_replace(DS, '/', $folder);\r\n\t\t\t$name\t\t= substr($folder, strrpos($folder, '/') + 1);\r\n\t\t\t$relative\t= str_replace($mediaBase, '', $folder);\r\n\t\t\t$absolute\t= $folder;\r\n\t\t\t$path\t\t= explode('/', $relative);\r\n\t\t\t$node\t\t= (object) array('name' => $name, 'relative' => $relative, 'absolute' => $absolute);\r\n\r\n\t\t\t$tmp = &$tree;\r\n\t\t\tfor ($i=0,$n=count($path); $i<$n; $i++)\r\n\t\t\t{\r\n\t\t\t\tif (!isset($tmp['children'])) {\r\n\t\t\t\t\t$tmp['children'] = array();\r\n\t\t\t\t}\r\n\t\t\t\tif ($i == $n-1) {\r\n\t\t\t\t\t// We need to place the node\r\n\t\t\t\t\t$tmp['children'][$relative] = array('data' =>$node, 'children' => array());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (array_key_exists($key = implode('/', array_slice($path, 0, $i+1)), $tmp['children'])) {\r\n\t\t\t\t\t$tmp = &$tmp['children'][$key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$tree['data'] = (object) array('name' => JText::_('COM_TIENDA_MEDIA'), 'relative' => '', 'absolute' => $base);\r\n\t\treturn $tree;\r\n\t}", "function cot_selectbox_folders($user, $skip, $check, $name = 'folderid')\n{\n\tglobal $db, $db_pfs_folders, $R;\n\n\t$user = (int) $user;\n\t$sql = $db->query(\"SELECT pff_id, pff_title, pff_isgallery, pff_ispublic FROM $db_pfs_folders WHERE pff_userid=$user ORDER BY pff_title ASC\");\n\n\t$check = (empty($check) || $check == '/') ? '0' : $check;\n\n\t$result_arr = array();\n\n\tif ($skip != '/' && $skip != '0')\n\t{\n\t\t$result_arr[0] = '/';\n\t}\n\n\twhile ($row = $sql->fetch())\n\t{\n\t\tif ($skip != $row['pff_id'])\n\t\t{\n\t\t\t$result_arr[$row['pff_id']] = htmlspecialchars($row['pff_title']);\n\t\t}\n\t}\n\t$sql->closeCursor();\n\n\t$result = cot_selectbox($check, $name, array_keys($result_arr), array_values($result_arr), false);\n\n\treturn ($result);\n}", "public function getGlazedElementsFolders();", "public function show($name)\n\t{\n $user_id = Auth::user()->id;\n $folder = Auth::user()->folders()->with(['files' => function($q) {\n /*$q->leftJoin('files_users', function($leftJoin) {\n $leftJoin->on('files_users.file_id', '=', 'files.id');\n })\n //$q->with([\"users\" => function($query){\n //$query->where(\"files_users.user_id\", Auth::user()->id);*/\n /*->with('labels')->where('files_users.user_id', Auth::user()->id)->select($this->fileColumns)->limit(70);*/\n $q->with('labels')->select($this->fileColumns)->limit(70);\n }])->with('labels')->where('name', $name)->firstOrFail();\n\n\n return $folder;\n\t}", "public function list() {\n $users = User::orderBy('name')->paginate(10);\n $repository = new Repository(compact('users'));\n \n $layout = Layout::blank([\n Layout::view('vendor.platform.users.list')\n ]);\n \n return $layout->build($repository);\n }", "function drawFolder ($item, $isExpanded, $tree, $indentLevel)\n\t{\n\t\t$resultString = '';\n\t\n\t\tif ($item->owner == $_SESSION['brimUsername'])\n \t{\n\t\t\t$resultString .= '<div id=\"item_'.$item->itemId.'\" class=\"dndFolder\">';\t\n\t\t\t$resultString .= '<a href=\"';\n\t\t\t$resultString .= $this->configuration['callback'];\n\t $resultString .= '&amp;action=modify&amp;itemId='.$item->itemId;\n\t $resultString .= '&amp;parentId='.$item->parentId.'\">';\n\t\t\t$resultString .= $this->configuration['icons'] ['folder_closed'];\n\t\t\t$resultString .= '</a>';\n \t}\n \telse \n \t{\n\t\t\t$resultString .= $this->configuration['icons'] ['folder_closed'];\n \t}\n\t\t$resultString .= '<a href=\"';\n\t\t$resultString .= $this->configuration['callback'];\n\t\t$resultString .= '&amp;action=show&amp;parentId=';\n\t\t$resultString .= $item->itemId . '\">';\n\t\t$resultString .= $item->name;\n\t\t$resultString .= '</a>';\n\t\tif ($item->owner == $_SESSION['brimUsername'])\n \t{\n\t\t\t$resultString .= '</div>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultString .= '<br />';\n\t\t}\n\t\treturn $resultString;\n\t}", "public function theme_menu_tree($variables)\n {\n return theme_menu_tree($variables);\n }", "public function getMyFolder($projectId = false) {\n echo json_encode($this->listMyFolder($this->pathCreator . '/' . $projectId));\n }", "static function tree($params = false)\n {\n $params = parse_params($params);\n @extract($params);\n\n if (!isset($dir_name)) {\n return 'Error: You must set $dir_name for the function ' . __FUNCTION__;\n }\n if (!empty($params)) {\n ksort($params);\n }\n\n $function_cache_id = __FUNCTION__ . crc32(serialize($params));\n $cache_content = false;\n //$cache_content = $this->app->cache->get($function_cache_id, 'content/static');\n\n if (($cache_content) != false) {\n\n $tree = $cache_content;\n } else {\n\n //$this->app->cache->save($tree, $function_cache_id, $cache_group = 'content/static');\n }\n if (!isset($url)) {\n $url = $this->app->url->current(true, true);\n }\n $params['url'] = $url;\n $params['url_param'] = 'page';\n\n\n mw('Microweber\\Utils\\Files')->dir_tree($dir_name, $params);\n\n\n }", "public function getPageTree () {\r\n $query = \"SELECT * FROM \" . DBP . \"vw_pageTree AS pageTree WHERE languageId = :lang\";\r\n $queryParams = array (\r\n ':lang' => Config::read ('defaultLang')\r\n );\r\n $result = $this->_preparedQuery ($query, $queryParams, __FILE__, __LINE__);\r\n return $this->buildPageTree ($result);\r\n }" ]
[ "0.6829168", "0.65895766", "0.6574571", "0.64547616", "0.641667", "0.6386231", "0.6343512", "0.6332912", "0.62860227", "0.6276909", "0.6159174", "0.61521554", "0.6131201", "0.60542613", "0.6050161", "0.60429525", "0.6022192", "0.60169953", "0.6012387", "0.6008993", "0.59939057", "0.59839153", "0.59634995", "0.5952503", "0.5933233", "0.5932767", "0.59051204", "0.59008634", "0.5893461", "0.5870975", "0.58373344", "0.583192", "0.58020097", "0.57925546", "0.57380205", "0.5736425", "0.5736345", "0.5731729", "0.5721873", "0.5719629", "0.5719519", "0.5683708", "0.5671231", "0.56492096", "0.56401956", "0.5637028", "0.5598173", "0.55390507", "0.55335385", "0.55251753", "0.55239713", "0.55134284", "0.55073047", "0.5506961", "0.5506046", "0.55024683", "0.5501144", "0.5489925", "0.54604", "0.54604", "0.54538155", "0.5450456", "0.54449236", "0.54425704", "0.5439042", "0.543747", "0.53946704", "0.5388143", "0.53831226", "0.53733444", "0.53658986", "0.53643215", "0.53519124", "0.5351192", "0.5350639", "0.5347429", "0.53347856", "0.5317327", "0.53169686", "0.5311476", "0.530798", "0.5306981", "0.5302959", "0.5300828", "0.5299812", "0.52907753", "0.52830654", "0.5278576", "0.5278411", "0.5271825", "0.5263235", "0.52577573", "0.5251077", "0.52469414", "0.524174", "0.52342486", "0.52260286", "0.52102536", "0.5209092", "0.52073765" ]
0.64455813
4
Attach a event listener
public function on($event, \Closure $listener) { foreach ((array)$event as $e) { $this->listeners[strtolower($e)][] = $listener; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attachEvents();", "public function attachEvents();", "public function attach(string $event, callable $listener, int $priority = 0): void;", "function eventRegister($eventName, EventListener $listener);", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function attachListener(callable $listener): void\n {\n if (in_array($listener, $this->listeners, true)) {\n return;\n }\n\n $this->listeners[] = $listener;\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function addEventListener($event, $callback, $weight = null);", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public function listen($event, $listener);", "public function onEvent();", "public function addListener($eventName, $listener, $priority = 0);", "public function addListener($event, $listener, $priority = 0);", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function attach(string $event, callable $callback, int $priority = self::PRIORITY_MIN): void;", "public function attachListener(\n $listener,\n /*# string */ $eventName = '',\n /*# int */ $priority = 50\n )/*# : EventManagerInterface */;", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "public function on($eventName, $callable);", "public function on($eventName, $callable);", "public function listen($listener);", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function listen() {\n $this->source->listen($this->id);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function listener(Listener $listener);", "public function addListener($name, $listener, $priority = 0);", "public function on($event, $callback){ }", "protected function registerListeners()\n {\n }", "public function attach($event, Event_ObserverInterface $observer) {\r\n\t\t$this->_eventObservers[$event][] = $observer;\r\n\t}", "public function attach(EventManagerInterface $eventManager, $priority = 1)\n {\n $this->listeners[] = $eventManager->attach(Event::EVENT_DETECT, [$this, 'detect'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_FOUND, [$this, 'found'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_ASSEMBLE, [$this, 'assemble'], $priority);\n }", "public function addListener($event, tx_auxo_observer $listener) {\r\n\t\t$this->eventListener[$event][spl_object_hash($listener)] = $listener;\r\n\t}", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function attach(EventManagerInterface $events, $priority = 400)\n {\n $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);\n $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);\n }", "public function attach(EventManagerInterface $eventManager, $priority = 100)\n {\n $shared = $eventManager->getSharedManager();\n $this->listeners[] = '???';\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('received.node.void', [$this, 'onReceivedNodeVoid']);\n $this->listeners[] = $events->attach('received.node.receipt', [$this, 'onReceivedNodeReceipt']);\n }", "public function attachEventListeners( Observable $observable )\n\t{\n\t\tforeach ( array( 'update', 'open', 'delete', 'after_delete', 'after_update', 'dispense' ) as $eventID ) {\n\t\t\t$observable->addEventListener( $eventID, $this );\n\t\t}\n\t}", "function onEvent($element_id)\r\n\t{\r\n\t\t\r\n\t}", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function listeners($eventName);", "public function listeners($event);", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MessageDispatch::ROUTE, [$this, 'onRoute'], 100);\n }", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('get.pre', array($this, 'load'), 100);\n $this->listeners[] = $events->attach('get.post', array($this, 'save'), -100);\n }", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "function addEvent($event) {\n Event::addEvent($event);\n }", "public function attach(EventManagerInterface $events) {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, __CLASS__ . '::onDispatch', 1000);\n }", "public function attach( $observer )\r\n {\r\n $this->observers []= $observer;\r\n }", "public function register(): void\n {\n $eventManager = EventManager::getInstance();\n\n $this->discoverEvents();\n\n foreach ($this->getListeners() as $moduleName => $moduleEvents) {\n foreach ($moduleEvents as $eventName => $eventListeners) {\n foreach (array_unique($eventListeners) as $listener) {\n $eventManager->addEventHandler(\n $moduleName,\n $eventName,\n [$listener, 'handle']\n );\n }\n }\n }\n }", "public function addRequestCreateListener($listener);", "public function attach(string $eventClass, callable $handler)\n {\n $this->listeners[$eventClass][] = $handler;\n }", "public static function events();", "public function addNetDriverChangeListener($listener);", "public function attach(EventManagerInterface $e, $priority = 100)\n {\n $shared = $e->getSharedManager();\n\t\t$this->listeners[] = $shared->attach('*', Event::EVENT_SOMETHING, [$this, 'logMessage']);\n \t\t//*** DATABASE EVENTS LAB: complete an \"attach()\" for INSERT and SELECT table operations\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_INSERT, [$this, 'logInsert'], $priority);\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_SELECT, [$this, 'logSelect'], $priority);\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "abstract function HookEvents();", "public function listen($events, $listener = null): void;", "protected function setupListeners()\n {\n //\n }", "public function attach(EventManagerInterface $events, $priority = 1)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute'], -40);\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "static public function addEventListener($eventName, $listener) {\n if (!isset(self::$listeners[$eventName])) self::$listeners[$eventName] = array();\n array_unshift(self::$listeners[$eventName], $listener);\n }", "public function attach(EventManagerInterface $events, $priority = 1)\n {\n $this->listeners[] = $events->attach(PageEvent::EVENT_ROUTE, [$this, 'onRoute']);\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch'], 2);\n }", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "public function attach(EventManagerInterface $events)\n {\n foreach ($this->hooks as $name => $spec) {\n $listeners[] = $events->attach($spec['event'], array($this, \"do$name\"));\n }\n }", "public function setListener($listener)\n {\n $this->_listener = $listener;\n }", "public function postEventadd();", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function registerEvents()\n {\n if (!empty($this->clientEvents)) {\n $js = [];\n foreach ($this->clientEvents as $event => $handle) {\n $handle = new JsExpression($handle);\n $js[] = \"$({$this->var}).on('{$event}', {$handle});\";\n }\n $this->getView()->registerJs(implode(PHP_EOL, $js));\n }\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('blog.model.post.save', array($this, 'onPostSave'));\n $this->listeners[] = $events->attach('blog.model.post.create', array($this, 'onPostSave'));\n }", "public function addEventSubscriber(IEventSubscriber $subscriber);", "function attach(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }", "public function attach(EventEmitter $emitter): void;", "protected function _subscribeToEngineEvents()\n {\n $controller = $this->getController();\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array(\n 'callback' => array( $this, 'onEndOfFax' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function testAttach()\n {\n $event = new EventManager();\n\n /** @var \\Closure $closure */\n $closure = function () {\n return $this->listeners;\n };\n\n $this->mvcKeeper->attach($event);\n\n $getListeners = $closure->bindTo($this->mvcKeeper, get_class($this->mvcKeeper));\n $listeners = $getListeners();\n\n foreach ($listeners as $listener) {\n $this->assertInstanceOf('Zend\\Stdlib\\CallbackHandler', $listener);\n }\n }", "function attach(AbstractObserver $observer)\n {\n $this->observers[] = $observer;\n\n }", "public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}", "function attach(&$observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::setStaticObserver($nameHash, array('obs' => &$observer, 'eventID' => $eventID));\n }\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'selectCsvRenderer'));\n }", "public function addEvent($event){\n $this->events[]=$event;\n }", "public static function listen($event, callable $listener, $priority = 0)\n {\n static::getDispatcher()->addListener($event, $listener, $priority);\n }", "public function setEventName(String $eventName) : EventListenerInterface;", "protected function withListener(string $event, string $listener): void\n {\n $this->callAfterResolving('events', static function (Dispatcher $dispatcher) use ($event, $listener): void {\n $dispatcher->listen($event, $listener);\n });\n }", "public function on($events, $callback, $options = array()) {\n\t\tforeach ((array)$events as $event) {\n\t\t\tif (!strpos($event, '.')) {\n\t\t\t\t$event = 'Visualisation' . '.' . $event;\n\t\t\t}\n\n\t\t\t$this->_eventManager->attach($callback, $event, $options);\n\t\t}\n\t}", "public function attach(Observer $observer) {\n $this->observers[] = $observer;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerEvents(): void\n {\n Event::listen(MessageLogged::class, function (MessageLogged $e) {\n if( app()->bound('current-context') )\n app('current-context')->log((array)$e);\n });\n }", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "public function addListener($event, $listener, $priority = 0)\n {\n if (empty($this->listeners[$event])) {\n\n if ($event === 'onAfterCleanModuleList') {\n\n $handler = function (&$modules) use ($event) {\n return $this->dispatch($event, new Event($event, [&$modules]));\n };\n\n } else {\n\n $handler = function (...$arguments) use ($event) {\n return $this->dispatch($event, new Event($event, $arguments));\n };\n\n }\n\n $this->app->registerEvent($event, $handler);\n }\n\n parent::addListener($event, $listener, $priority);\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }" ]
[ "0.76603466", "0.76603466", "0.6893791", "0.6790374", "0.6662127", "0.6611006", "0.6582604", "0.64965296", "0.6476519", "0.647423", "0.6446873", "0.6412187", "0.63948095", "0.6370083", "0.6331031", "0.62409884", "0.62265575", "0.62258947", "0.61502695", "0.60950166", "0.60950166", "0.6068168", "0.60393846", "0.6029826", "0.6007031", "0.59893084", "0.59841204", "0.59776264", "0.5974596", "0.59504426", "0.59456825", "0.5911821", "0.5880547", "0.5872513", "0.58660406", "0.58549875", "0.5849507", "0.58330244", "0.58327574", "0.5824219", "0.57939655", "0.57935333", "0.5783975", "0.5743133", "0.5739941", "0.57371235", "0.57326645", "0.5727366", "0.57271105", "0.57271105", "0.57271105", "0.57266206", "0.57266206", "0.57266206", "0.5718984", "0.57164836", "0.56948555", "0.568356", "0.5672136", "0.5666856", "0.5666203", "0.5646703", "0.5641709", "0.56415176", "0.5631034", "0.5621124", "0.5619052", "0.5599639", "0.5598067", "0.5596686", "0.55888486", "0.5576664", "0.5575895", "0.55758494", "0.5575202", "0.55709755", "0.5570633", "0.55704695", "0.55646664", "0.55569255", "0.5549944", "0.5548703", "0.5532307", "0.5530541", "0.5530284", "0.5522059", "0.55042857", "0.54993045", "0.54964775", "0.5480959", "0.54642475", "0.5461845", "0.5446367", "0.544519", "0.54433036", "0.5442656", "0.5435335", "0.54318786", "0.5419586", "0.5417006", "0.54165536" ]
0.0
-1
Attach a listener to emit once
public function once($event, \Closure $listener) { foreach ((array)$event as $e) { $this->listeners[strtolower($e)][] = array($listener, array('times' => 1)); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function once($name, $callback, $arguments = array())\n {\n return $this->on($name, $callback, $arguments, true);\n }", "public function once($eventName, callable $callBack, $callbackObject = true);", "function once(callable $callback, $delay);", "public function listen() {\n $this->source->listen($this->id);\n }", "function triggerOnce($event, $data=null) {\n return Event::triggerOnce($event, $data);\n }", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public final function once( $eventName, $eventCallback ) {\n\n\t\t\tif ( !is_string( $eventName ) ) {\n\t\t\t\n\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: string expected');\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\tif ( !strlen( $eventName ) ) {\n\t\t\t\n\t\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: expected non-empty string');\n\t\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\tif ( !is_callable( $eventCallback ) ) {\n\t\t\t\n\t\t\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventCallback: callable expected' );\n\t\t\t\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t$this->events[ $eventName ] = isset( $this->events[ $eventName ] ) ? $this->events[ $eventName ] : [];\n\n\t\t\t\t\t\t$this->events[ $eventName ][] = [\n\t\t\t\t\t\t\t'once' => true,\n\t\t\t\t\t\t\t'callback' => $eventCallback,\n\t\t\t\t\t\t\t'fireId' => 0\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}", "public function attachListener(callable $listener): void\n {\n if (in_array($listener, $this->listeners, true)) {\n return;\n }\n\n $this->listeners[] = $listener;\n }", "public function once(Timer $timer);", "public function register($event, $listener, $params = array(), $first = false);", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function on($event, callable $callback, $once = false)\n {\n if (! is_string($event)) {\n throw new InvalidArgumentException('Event name must be in a string.');\n }\n $cb = empty($once) ? 'on' : 'once';\n foil('events')->$cb($event, $callback);\n }", "public function listen($listener);", "function addListener(EventListener $listener): void;", "public function listener(Listener $listener);", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "public function listen(callable $callback);", "public function startListening();", "public function registerOnce($property, $value) {\n $this->_events->registerOnce($property, $value);\n }", "public function bindSignalOnce(\n string $id,\n iterable $signals,\n callable $callback\n ): static {\n return $this->addSignalBinding(new SignalBinding(\n $this,\n $id,\n false,\n $signals,\n $callback\n ), false);\n }", "public function broadcastOn();", "public function broadcastOn();", "public function bindStreamWriteOnce(\n Stream $stream,\n callable $callback,\n ?float $timeout = null,\n ?callable $timeoutHandler = null\n ): static {\n return $this->addStreamBinding(new StreamBinding(\n $this,\n false,\n $stream,\n 'w',\n $callback,\n $timeout,\n $timeoutHandler\n ), false);\n }", "public function makeListener($listener, $wildcard = false): Closure;", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "function once(callable $func, $msDelay) {\n return getReactor()->once($func, $msDelay);\n}", "public function listen();", "public function attach(EventEmitter $emitter): void;", "public function bindFrozenStreamWriteOnce(\n Stream $stream,\n callable $callback,\n ?float $timeout = null,\n ?callable $timeoutHandler = null\n ): static {\n return $this->addStreamBinding(new StreamBinding(\n $this,\n false,\n $stream,\n 'w',\n $callback,\n $timeout,\n $timeoutHandler\n ), true);\n }", "private function assertOnce() {\n if ($this->onceAndOnlyOnce) {\n throw new exception\\MutationException();\n }\n $this->onceAndOnlyOnce = true;\n }", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function on($signo, callable $listener)\n {\n pcntl_signal($signo, array($this, 'emit'));\n parent::on($signo, $listener);\n }", "public function addListener($listener)\n {\n $refl = new \\ReflectionClass($listener);\n foreach ($refl->getMethods(\\ReflectionMethod::IS_PUBLIC) as $meth) {\n $methName = $meth->getName();\n if (!$meth->isStatic() &&\n !preg_match('#^__.+#', $methName) &&\n $meth->getNumberOfParameters() == 1) {\n // get type-hint\n $classParam = $meth->getParameters()[0]->getClass();\n // check type-hint\n if (!is_null($classParam) &&\n $classParam->implementsInterface(__NAMESPACE__ . '\\Event')) {\n // subscribes\n $this->listener[$methName][] = $listener;\n }\n }\n }\n }", "public function subscribe(): void;", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }", "function onWritable($stream, callable $callback, $enableNow = TRUE);", "public function addNeedsBeginFramesChangedListener(callable $listener): SubscriptionInterface;", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public static function listen(Closure $callback)\n {\n }", "public function onListen(callable $callback) : SystemBroadcast {\n\n\t\t\t$this->onListenHandlers[] = $callback;\n\n\t\t\treturn $this;\n\t\t}", "private function processAny($listener,$e) {\n if($e->name == $listener[0] && $this->isWithin()) {\n $this->emit($listener[1],$e);\n }\n }", "public function bindFrozenSignalOnce(\n string $id,\n iterable $signals,\n callable $callback\n ): static {\n return $this->addSignalBinding(new SignalBinding(\n $this,\n $id,\n false,\n $signals,\n $callback\n ), true);\n }", "public function onEvent();", "public function setCatchAll(Bool $flag) : EventListenerInterface;", "public function setListener($listener)\n {\n $this->_listener = $listener;\n }", "public function silence(Listener $listener);", "public function on($name, $callback = null, $arguments = array(), $once = false)\n {\n if (is_array($name)) {\n foreach ($name as $event) {\n extract(array_merge(array(\n 'on' => null,\n 'callback' => null,\n 'arguments' => array(),\n 'once' => false\n ), $event));\n if ($on && is_callable($callback)) {\n $this->on($on, $callback, $arguments, $once);\n }\n }\n }\n elseif (is_callable($callback)) {\n if (!isset($this->events[$name])) {\n $this->events[$name] = array();\n }\n $this->events[$name][] = array(\n 'callback' => $callback,\n 'arguments' => $arguments,\n 'once' => $once\n );\n }\n else {\n throw new Exception(\"Invalid callback $callback.\");\n }\n }", "public function registerAllOnce($props_and_vals = array()) {\n $this->_events->registerAllOnce($props_and_vals);\n }", "public function addListener(BLW_PSP_StateChangeListener $listener) {\n\t\t$this->listeners->append($listener);\n\t}", "public function bindTimerOnce(\n string $id,\n float $duration,\n callable $callback\n ): static {\n return $this->addTimerBinding(new TimerBinding(\n $this,\n $id,\n false,\n $duration,\n $callback\n ), false);\n }", "public function on($event, $callback){ }", "public function on($eventName, $callable);", "public function on($eventName, $callable);", "public function listen($event, $listener);", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function listen(): bool;", "public function subscribe();", "public function attach(IObservable_1 $model)\n\t{\n\t\t$model->attachObserver($this->delegate);\n\t}", "abstract protected function inscriretruetrue($event, $membre);", "public function addWriteStream($stream, callable $listener);", "public function notifyOne() : bool{}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "public function bindFrozenTimerOnce(\n string $id,\n float $duration,\n callable $callback\n ): static {\n return $this->addTimerBinding(new TimerBinding(\n $this,\n $id,\n false,\n $duration,\n $callback\n ), true);\n }", "public function futureTick(\\Closure $listener): void;", "public function subscription();", "public function runOnce($method, $param, $id = 0)\n {\n if (!is_array($param)) throw new \\Exception('Expected array for $param');\n if ($id === 0) $id = (int)microtime(1) * 1000;\n Yii::$app->redis->setex('rpc_con_lock_#' . $id, 600, 1);\n $param['__once'] = 1;\n return !!Yii::$app->redis->publish('rpc', $this->buildRpc($method, $param, $id));\n }", "public function testOnce() {\n\t\t$function = function() {\n\t\t\tstatic $n = null;\n\t\t\tif (is_null($n)) {\n\t\t\t\t$n = 1;\n\t\t\t} else {\n\t\t\t\t++$n;\n\t\t\t}\n\t\t\treturn $n;\n\t\t};\n\t\t$onceFunction = _::once($function);\n\t\t$result1 = $function();\n\t\t$this->assertEquals(1, $result1);\n\t\t$result2 = $function();\n\t\t$this->assertEquals(2, $result2);\n\t\t$result3 = $onceFunction();\n\t\t$this->assertEquals(3, $result3);\n\t\t$result4 = $onceFunction();\n\t\t$this->assertEquals(3, $result4);\n\t}", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function addIssueAddedListener(callable $listener): SubscriptionInterface;", "public function visitIncludeOnceAstNode( ezcTemplateIncludeOnceAstNode $include )\n {\n $this->generateUnaryControl( $include, \"include_once\" );\n }", "public function visitRequireOnceAstNode( ezcTemplateRequireOnceAstNode $require )\n {\n $this->generateUnaryControl( $require, \"require_once\" );\n }", "public function onSpeakersAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function subscription(): EventSubscription;", "public function on($name, array $callback, $unique = FALSE)\r\n\t{\r\n\t\tif ( ! isset($this->observer_events[$name]))\r\n\t\t{\r\n\t\t\t// Create an empty event for undefined events\r\n\t\t\t$this->observer_events[$name] = array();\r\n\t\t}\r\n\t\telseif ($unique and in_array($callback, $this->observer_events[$name], TRUE))\r\n\t\t{\r\n\t\t\t// Event already exists\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\t// Add the event\r\n\t\t$this->observer_events[$name][] = $callback;\r\n\r\n\t\treturn TRUE;\r\n\t}", "function attach(&$observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::setStaticObserver($nameHash, array('obs' => &$observer, 'eventID' => $eventID));\n }\n }", "public function createSubscriber();", "public function subscribe(callable $callback)\n {\n $this->callbacks[] = $callback;\n }", "function onWritable($stream, callable $func, $enableNow = true) {\n return getReactor()->onWritable($stream, $func, $enableNow);\n}", "function attach(ftpClientObserver $observer) {\r\n\t\t$this->_listeners[$observer->getId()] = $observer;\r\n\t\treturn true;\r\n\t}", "public function listen($events, $listener = null): void;", "static function once()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_TestCase::once', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function subscribes();", "public function bindSocketWriteOnce(\n Socket $socket,\n callable $callback,\n ?float $timeout = null,\n ?callable $timeoutHandler = null\n ): static {\n return $this->addSocketBinding(new SocketBinding(\n $this,\n false,\n $socket,\n 'w',\n $callback,\n $timeout,\n $timeoutHandler\n ), false);\n }", "private function once()\n {\n $alreadyRan = [];\n\n $docker = (new Docker())->mustRun(false);\n\n $temp = tempnam(sys_get_temp_dir(), 'dchelper');\n $docker->run(\"cp {$this->container}:{$this->lockFile} {$temp}\");\n if ($docker->exit === 0) {\n $alreadyRan = array_map('trim', file($temp));\n }\n\n $once = !\\is_array($this->once) ? [$this->once] : $this->once;\n\n $executed = 0;\n foreach ($once as $script) {\n\n $script = ($this->doEnvSubst)($script);\n\n if (!\\in_array($script, $alreadyRan)) {\n\n $this->runScript($script);\n\n $alreadyRan[] = $script;\n $executed ++;\n\n if (!$this->isLocal) {\n file_put_contents($temp, implode(PHP_EOL, $alreadyRan));\n $docker->mustRun()->run(\"cp $temp {$this->container}:{$this->lockFile}\");\n }\n }\n }\n\n debug($executed . ' script(s) executed.');\n\n @unlink($temp);\n }", "function eventRegister($eventName, EventListener $listener);", "public function addVirtualTimeBudgetExpiredListener(callable $listener): SubscriptionInterface;", "public function init_listeners( $callable ) {\n\t}", "public function addListener($event, tx_auxo_observer $listener) {\r\n\t\t$this->eventListener[$event][spl_object_hash($listener)] = $listener;\r\n\t}", "public function onceUsingId($id)\n {\n return false;\n }", "public function subscribe(string $event, callable $listener): void\n {\n $this->listeners[$event][] = $listener;\n\n if (!$this->readingFuture) {\n $this->readingFuture = async($this->read(...));\n }\n }", "abstract public function onRegister(): void;", "public function register( \\Aimeos\\MW\\Observer\\Publisher\\Iface $p )\n\t{\n\t\t$p->addListener( $this->getObject(), 'check.after' );\n\t}", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}" ]
[ "0.58758664", "0.5793837", "0.5633321", "0.5482252", "0.5425996", "0.5420638", "0.5420287", "0.5399389", "0.5360765", "0.527887", "0.5243947", "0.52055943", "0.5187627", "0.5173275", "0.5172744", "0.50088155", "0.49466482", "0.49436453", "0.493857", "0.49337125", "0.49223295", "0.49223295", "0.4900738", "0.4892499", "0.48922804", "0.48822185", "0.4854452", "0.48382628", "0.48042583", "0.4756428", "0.47465", "0.47454435", "0.47447443", "0.4722715", "0.47172698", "0.47157896", "0.4711336", "0.47023964", "0.46988556", "0.4688409", "0.46733913", "0.46154797", "0.4594742", "0.45910382", "0.45909578", "0.4577152", "0.45665252", "0.4564489", "0.4551547", "0.454591", "0.45242214", "0.45161405", "0.45151934", "0.45151934", "0.45082554", "0.44970357", "0.44970357", "0.44970357", "0.44967377", "0.44967377", "0.44967377", "0.44950488", "0.44728452", "0.4471801", "0.44557756", "0.44508576", "0.4433968", "0.44336778", "0.4433296", "0.4433139", "0.44321677", "0.44282803", "0.4426876", "0.44231448", "0.44214886", "0.44155672", "0.44119415", "0.4408079", "0.4408017", "0.4407214", "0.44039568", "0.43992266", "0.43990812", "0.43921736", "0.43920344", "0.43796077", "0.43792766", "0.43791097", "0.43764645", "0.43738383", "0.43729883", "0.4371113", "0.43688107", "0.43637738", "0.43555313", "0.43553674", "0.43445763", "0.43427086", "0.432998", "0.43237543" ]
0.5925425
0
Attach a listener to emit many times
public function many($event, $times = 1, \Closure $listener) { foreach ((array)$event as $e) { $this->listeners[strtolower($e)][] = array($listener, array('times' => $times)); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listen() {\n $this->source->listen($this->id);\n }", "public function subscribe(): void\n {\n foreach (static::$eventHandlerMap as $eventName => $handler) {\n $this->events->listen($eventName, [$this, $handler]);\n }\n }", "public function attachListener(callable $listener): void\n {\n if (in_array($listener, $this->listeners, true)) {\n return;\n }\n\n $this->listeners[] = $listener;\n }", "private function processAny($listener,$e) {\n if($e->name == $listener[0] && $this->isWithin()) {\n $this->emit($listener[1],$e);\n }\n }", "protected function setListeners()\n\t{\n\t\t$this->templates->listenEmitBasic('foreach', array($this, 'tpl_foreach'));\n\t\t$this->templates->listenEmitBasic('not-last', array($this, 'tpl_not_last'));\n\t}", "public function listen($listener);", "public function listen();", "public function on($signo, callable $listener)\n {\n pcntl_signal($signo, array($this, 'emit'));\n parent::on($signo, $listener);\n }", "public function attach(EventEmitter $emitter): void;", "public function onSpeakersAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public static function listen($callback){\n\t\t\\Illuminate\\Log\\Writer::listen($callback);\n\t}", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function listen($name,$data) {\n if(is_array($name)) {\n foreach($name as $n) {\n $this->listen($n,$data);\n }\n \n return $this;\n }\n \n if($name instanceof observr\\Stream) {\n $name = $name->name;\n }\n \n if(!array_key_exists($name, $this->listeners)) {\n $this->listeners[$name] = [];\n }\n \n $this->listeners[$name][] = $data;\n \n return $this;\n }", "private function processEvery($listener,$e) {\n if($this->start_elapse instanceof \\DateTime) {\n $this->elapsed = new \\DateTime;\n $diff = $this->start_elapse->diff($this->elapsed);\n if($diff->s >= $listener[0] && $this->isWithin()) {\n $this->emit($listener[1]);\n $this->start_elapse = new \\DateTime;\n }\n } else {\n $this->start_elapse = new \\DateTime;\n }\n }", "public function subscribesCounter();", "public function __invoke()\n {\n foreach ($this->identityMap as $eventSourcedAggregateRoot) {\n $pendingStreamEvents = $this->aggregateTranslator->extractPendingStreamEvents($eventSourcedAggregateRoot);\n\n if (count($pendingStreamEvents)) {\n $this->streamStrategy->appendEvents(\n $this->aggregateType,\n $this->aggregateTranslator->extractAggregateId($eventSourcedAggregateRoot),\n $pendingStreamEvents,\n $eventSourcedAggregateRoot\n );\n }\n }\n }", "protected function registerListeners()\n {\n }", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "function addListener(EventListener $listener): void;", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "function attach(&$observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::setStaticObserver($nameHash, array('obs' => &$observer, 'eventID' => $eventID));\n }\n }", "public function listen(callable $callback);", "public function createSubscriber();", "public function broadcastOn();", "public function broadcastOn();", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "public function startListening();", "public function attachAllHitStatObservers()\n\t{\n\t\t$event_log = new Stats_OLP_Observe_Eventlog();\n\t\t$event_log->observeHitStat($this);\n\t}", "public function listener(Listener $listener);", "public static function listen(Closure $callback)\n {\n }", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "public function listen(): void\n {\n $receive = function () {\n each($this->receiveMessages(), $this->parseAndConsumeMessage());\n };\n\n $this->settings->beforeReceive($receive);\n }", "public function futureTick(\\Closure $listener): void;", "public function subscribe();", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function subscribe(): void;", "public function process(ContainerBuilder $container)\n {\n if (!$container->hasDefinition('synd_metrics.metric_listener')) {\n return;\n }\n \n $definition = $container->getDefinition('synd_metrics.metric_listener');\n \n foreach ($this->getEvents($container) as $eventName) {\n $definition->addMethodCall('addListenedEvent', array($eventName));\n }\n }", "public function addEventListener($event, $callback, $weight = null);", "public function addWriteStream($stream, callable $listener);", "public function register($event, $listener, $params = array(), $first = false);", "public function onEvent();", "public function listen()\n {\n $this->openWorker();\n while (!Signal::isExit()) {\n if (($payload = $this->pop(3)) !== null) {\n list($id, $message) = explode(':', $payload, 2);\n $this->handleMessage($message);\n }\n }\n $this->closeWorker();\n }", "public function setCatchAll(Bool $flag) : EventListenerInterface;", "public function subscribes();", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function collectSubscribers();", "public function attachEvents();", "public function attachEvents();", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "public function enableSocketEvents()\n\t{\n foreach ($this->socketEvents as $ev)\n\t\t{\n event_base_set($ev, Daemon::$process->eventBase);\n event_add($ev, $this->config->ev_timeout->value); // With specified timeout\n }\n }", "protected function attachHandlers()\n { \n foreach ($this->dataCollectors as $dataCollector) {\n $this->eventsManager->attach($dataCollector->getListenerType(), $dataCollector);\n }\n \n $this->eventsManager->attach('view:beforeRender', function($event, $view){\n $this->di->get('assets')\n ->addCss('assets/css/profiler.css')\n ->addJs('assets/js/profiler.js')\n ;\n $view->setVar('profilerRequestId', $this->storage->getRequestId());\n });\n \n // Profiled request details writer\n $this->eventsManager->attach('view:afterRender', function() {\n if (static::$profilerModuleName === $this->di->getShared('dispatcher')->getModuleName()) {\n return;\n }\n $this->storage->store($this);\n });\n }", "function event_buffer_set_callback($event, $readcb, $writecb, $errorcb, $arg = NULL)\n{\n}", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function subscribe(callable $callback)\n {\n $this->callbacks[] = $callback;\n }", "public function listen(\\ReflectionClass $class): void;", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "public function makeListener($listener, $wildcard = false): Closure;", "public function subscribe(string $event, callable $listener): void\n {\n $this->listeners[$event][] = $listener;\n\n if (!$this->readingFuture) {\n $this->readingFuture = async($this->read(...));\n }\n }", "public static function callableCallback()\n {\n BaseTest::$shared++;\n }", "protected function registerEvents()\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "public function addSubscribers(\n EventManager $manager,\n EntityManagerInterface $entityManager,\n ?Reader $reader = null\n ): void {\n $subscriber = new LoggableEventSubscriber(function (): string {\n return 'username';\n });\n\n $this->addSubscriber($subscriber, $manager, $reader);\n }", "public function listen(): static\n {\n $this->breakLoop = false;\n $this->listening = true;\n\n $baseTime = microtime(true);\n $times = [];\n $lastCycle = $baseTime;\n $this->generateMaps = false;\n $this->generateMaps();\n\n $this->startSignalHandlers();\n $this->breakLoop = false;\n\n while (!$this->breakLoop) {\n $socketCount = count($this->sockets);\n $streamCount = count($this->streams);\n $signalCount = count($this->signals);\n $timerCount = count($this->timers);\n\n if ($this->generateMaps) {\n $this->generateMaps();\n }\n\n $hasHandler = false;\n\n\n // Timers\n if (!empty($this->timers)) {\n $hasHandler = true;\n $time = microtime(true);\n\n foreach ($this->timers as $id => $binding) {\n if ($binding->frozen) {\n continue;\n }\n\n $dTime = $times[$id] ?? $baseTime;\n $diff = $time - $dTime;\n\n if ($diff > $binding->duration) {\n $times[$id] = $time;\n $binding->trigger(null);\n }\n }\n }\n\n\n\n // Signals\n if (!empty($this->signals) && $this->hasPcntl) {\n $hasHandler = true;\n pcntl_signal_dispatch();\n }\n\n // Sockets\n if (!empty($this->socketMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource|Socket> $read */\n $read = $this->socketMap[self::RESOURCE][self::READ];\n /** @var array<int, resource|Socket> $write */\n $write = $this->socketMap[self::RESOURCE][self::WRITE];\n\n try {\n /* @phpstan-ignore-next-line */\n $res = socket_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n\n foreach ($write as $resourceId => $socket) {\n foreach (Coercion::toArray(\n $this->socketMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($socket);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n // Streams\n if (!empty($this->streamMap)) {\n $hasHandler = true;\n $e = null;\n\n /** @var array<int, resource> $read */\n $read = $this->streamMap[self::RESOURCE][self::READ];\n /** @var array<int, resource> $write */\n $write = $this->streamMap[self::RESOURCE][self::WRITE];\n\n try {\n $res = stream_select($read, $write, $e, 0, 10000);\n } catch (Throwable $e) {\n $res = false;\n }\n\n\n if ($res === false) {\n // TODO: deal with error\n } elseif ($res > 0) {\n foreach ($read as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::READ][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n\n foreach ($write as $resourceId => $stream) {\n foreach (Coercion::toArray(\n $this->streamMap[self::HANDLER][self::WRITE][$resourceId]\n ) as $id => $binding) {\n /** @var Binding $binding */\n $binding->trigger($stream);\n }\n }\n }\n\n // TODO: add timeout handler\n }\n\n\n // Tick\n if (\n !$this->breakLoop &&\n $this->tickHandler\n ) {\n if (false === ($this->tickHandler)($this)) {\n $this->breakLoop = true;\n }\n }\n\n // Cycle\n if (\n !$this->breakLoop &&\n $this->cycleHandler\n ) {\n $time = microtime(true);\n\n if ($time - $lastCycle > 1) {\n $lastCycle = $time;\n\n if (false === ($this->cycleHandler)(++$this->cycles, $this)) {\n $this->breakLoop = true;\n }\n }\n }\n\n\n if (!$hasHandler) {\n $this->breakLoop = true;\n } elseif (\n $socketCount !== count($this->sockets) ||\n $streamCount !== count($this->streams) ||\n $signalCount !== count($this->signals) ||\n $timerCount !== count($this->timers)\n ) {\n $this->generateMaps = true;\n }\n\n usleep(30000);\n }\n\n $this->breakLoop = false;\n $this->listening = false;\n\n $this->stopSignalHandlers();\n\n return $this;\n }", "public function getSubscribedEvents();", "private function processAfter($listener,$e) {\n if($e->name == $listener[1] && $this->amounts[$e->name] == $listener[0] && $this->isWithin()) {\n $this->amounts[$e->name] = 0;\n $this->emit($listener[2],$e);\n }\n }", "public function listen(Closure $callback)\n\t{\n\t\t$this->neoeloquent->listen($callback);\n\t}", "public function once($event, \\Closure $listener)\n {\n foreach ((array)$event as $e) {\n $this->listeners[strtolower($e)][] = array($listener, array('times' => 1));\n }\n return $this;\n }", "public function listen($events, $listener = null): void;", "function testShouldCheckIfListenersExist()\n {\n $this->assertFalse($this->emitter->hasListeners());\n $this->assertFalse($this->emitter->hasListeners('foo'));\n\n // check with \"foo\" listener\n $this->emitter->on('foo', $this->createTestCallback('foo'));\n\n $this->assertTrue($this->emitter->hasListeners());\n $this->assertTrue($this->emitter->hasListeners('foo'));\n\n // check event without any listeners\n $this->assertFalse($this->emitter->hasListeners('bar'));\n\n // check event with a global listener\n $this->emitter->on(EventEmitterInterface::ANY_EVENT, $this->createTestCallback('global'));\n\n $this->assertTrue($this->emitter->hasListeners('bar'));\n }", "public function listen(Closure $callback)\n {\n if ( isset ( $this->events ) ) {\n $this->events->listen ( 'leaps.query', $callback );\n }\n }", "public function addListener($listener)\n {\n $refl = new \\ReflectionClass($listener);\n foreach ($refl->getMethods(\\ReflectionMethod::IS_PUBLIC) as $meth) {\n $methName = $meth->getName();\n if (!$meth->isStatic() &&\n !preg_match('#^__.+#', $methName) &&\n $meth->getNumberOfParameters() == 1) {\n // get type-hint\n $classParam = $meth->getParameters()[0]->getClass();\n // check type-hint\n if (!is_null($classParam) &&\n $classParam->implementsInterface(__NAMESPACE__ . '\\Event')) {\n // subscribes\n $this->listener[$methName][] = $listener;\n }\n }\n }\n }", "public static function getSubscribedEvents()\n {\n echo 'Test';\n }", "public function on($event, $callback){ }", "public function register($app)\n {\n $this->startTime = microtime(true);\n\n return $app->events->listen('*', function ($eventName, $payload) {\n $this->collect($eventName, $payload);\n });\n }", "function eventRegister($eventName, EventListener $listener);", "protected function setupListeners()\n {\n //\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = 'on' . ucfirst($event);\n\n if (method_exists($this, $listener)) {\n $this->server->on($event, [$this, $listener]);\n } else {\n $this->server->on($event, function () use ($event) {\n $event = sprintf('swoole.%s', $event);\n\n $this->container['events']->fire($event, func_get_args());\n });\n }\n }\n }", "public function appendFrom(EventBuffer $buf, int $len): int {}", "public static function eventSubscriptions() : iterable;", "function onWritable($stream, callable $callback, $enableNow = TRUE);", "protected function setSwooleServerListeners()\n {\n foreach ($this->events as $event) {\n $listener = Str::camel(\"on_$event\");\n $callback = method_exists($this, $listener) ? [$this, $listener] : function () use ($event) {\n $this->triggerEvent($event, func_get_args());\n };\n\n $this->getServer()->on($event, $callback);\n }\n }", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function listener()\n {\n /** @var \\Illuminate\\Redis\\Connections\\PhpRedisConnection|\\Illuminate\\Redis\\Connections\\PredisConnection $connection */\n $connection = Redis::connection($this->connection());\n\n register_shutdown_function(function () use ($connection) {\n $connection->disconnect();\n abort(200);\n });\n\n return response()->stream(function () use ($connection) {\n\n // Send the message with a retry timer\n $this->message()->retry($this->timeRetry())->send();\n\n // If the Last-Event-Id header is set, restore the connection with the last message id.\n if (request()->hasHeader('Last-Event-Id')) {\n $this->restore(request()->header('Last-Event-Id'));\n }\n\n // Listen for new messages\n $connection->subscribe([$this->channel()], fn (string $message) => $this->handler($message));\n\n }, Response::HTTP_OK, $this->headers());\n }", "public function on($eventName, $callable);", "public function on($eventName, $callable);", "public function listen($event, $listener);", "public function init_listeners( $callable ) {\n\t}", "public static function subscriptionIncremented($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionIncremented', $callback);\n }" ]
[ "0.55981463", "0.54396296", "0.5297393", "0.5155785", "0.5146792", "0.5131319", "0.5126397", "0.5101177", "0.5077927", "0.5024831", "0.50234735", "0.5001083", "0.4988463", "0.49856436", "0.49828434", "0.49658418", "0.49604285", "0.49393263", "0.49352613", "0.49280652", "0.49237737", "0.49006885", "0.48999265", "0.48984236", "0.487163", "0.48688847", "0.48688847", "0.4862047", "0.4849551", "0.4848206", "0.48096806", "0.4805791", "0.4784695", "0.47838527", "0.4762954", "0.4761671", "0.47555918", "0.4731026", "0.47153038", "0.4707818", "0.4706597", "0.47002307", "0.46735865", "0.4664771", "0.46617028", "0.4652389", "0.4646249", "0.46453512", "0.46344048", "0.4627548", "0.46254843", "0.46253106", "0.46203768", "0.46203768", "0.4619081", "0.46071383", "0.45898765", "0.45831594", "0.45821097", "0.45820907", "0.45745426", "0.45701405", "0.45674604", "0.45407256", "0.45389137", "0.45302945", "0.4530256", "0.45295858", "0.45249283", "0.45183587", "0.45154235", "0.45151737", "0.45148265", "0.45094216", "0.45072716", "0.45067856", "0.45027345", "0.4495868", "0.4494539", "0.44865653", "0.4485287", "0.44734788", "0.4468136", "0.44673052", "0.44593292", "0.4452326", "0.4445892", "0.44390005", "0.44368923", "0.44368923", "0.44368923", "0.44367144", "0.44367144", "0.44367144", "0.44358277", "0.44279152", "0.44279152", "0.4426896", "0.44226012", "0.44221044" ]
0.52878815
3
Get listeners of given event
public function listeners($event) { if (!empty($this->listeners[$event])) { return $this->listeners[$event]; } return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getListeners($event): array;", "public function getListenersForEvent($event): iterable;", "public function getListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events))\n\t\t\treturn static::$events[$event];\n\t\treturn static::$events;\n\t}", "public function getListeners($eventName): array;", "public function listeners($event);", "public function getListeners($event)\n {\n if ( ! isset($this->sorted[$event])) {\n $this->sortListeners($event);\n }\n return $this->sorted[$event];\n }", "public static function getListeners() : array\n {\n return Event::$listeners;\n }", "public function getEvents()\n {\n return $this->eventListeners;\n }", "public static function listeners($event) {\n return isset(static::$events[$event]);\n }", "public function getEventListeners()\n {\n return $this->eventListeners;\n }", "public function getListeners(): array;", "public function listeners($eventName);", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "abstract protected function getReceivers($event);", "public function getEvents();", "public function getEvents();", "public function getAdditionalListeners($event)\n {\n return array(\n new Enlight_Event_Handler_Default($event, array($this, 'onEvent'), -1000),\n new Enlight_Event_Handler_Default($event, array($this, 'onEvent'), 1000)\n );\n }", "public function getListenersForEvent($eventClassName)\n {\n if (FALSE === array_key_exists($eventClassName, $this->eventMap))\n {\n return [];\n }\n return $this->eventMap[$eventClassName];\n }", "public static function getSubscribedEvents();", "public static function getSubscribedEvents();", "public function getListeners()\n {\n return $this->listeners;\n }", "public function getListeners()\n {\n return $this->listeners;\n }", "public function getListeners(Request $request);", "function getEvents() {\n return [];\n }", "public function getListeners($name = null);", "public static function getEventListenersClasses($event_abstract)\n {\n $result = [];\n\n foreach (\\Illuminate\\Support\\Facades\\Event::getListeners($event_abstract) as $listener_closure) {\n $reflection = new ReflectionFunction($listener_closure);\n $uses = $reflection->getStaticVariables();\n\n if (isset($uses['listener'])) {\n $result[] = $uses['listener'];\n }\n }\n\n return $result;\n }", "public function getSubscribedEvents();", "public static function getEvents()\n {\n $events = parent::getEvents();\n $events[] = self::ON_FIRST_LOGIN;\n $events[] = self::ON_LOGIN;\n $events[] = self::ON_LOGOUT;\n $events[] = self::ON_PASSWORD_CHANGE;\n\n return $events;\n }", "public static function getSubscribedEvents() {\n return [];\n }", "protected function getEventListenersClasses($event_abstract): array\n {\n $result = [];\n\n foreach (\\Illuminate\\Support\\Facades\\Event::getListeners($event_abstract) as $listener_closure) {\n $reflection = new ReflectionFunction($listener_closure);\n $uses = $reflection->getStaticVariables();\n\n if (isset($uses['listener'])) {\n $result[] = $uses['listener'];\n }\n }\n\n return $result;\n }", "public static function getApplicableListener(): array;", "protected function getHandlers($event){\n\t\tif(!$this->countHandlers($event)){\n\t\t\treturn [];\n\t\t}\n\n\t\tif(!is_array($this->events[$event])){\n\t\t\treturn [];\n\t\t}\n\n\t\treturn $this->events[$event];\n\t}", "public function getOtherEvents();", "public function getEvents()\n\t{\n\t\treturn $this->events;\n\t}", "public function getAll()\n {\n $listeners = [];\n\n // Get a clone of the queue.\n $queue = $this->getIterator();\n\n foreach ($queue as $listener) {\n $listeners[] = $listener;\n }\n\n unset($queue);\n return $listeners;\n }", "protected function getRegisteredEvents() {\n// $events = [];\n// foreach ($this->loadMultiple() as $rules_config) {\n// $event = $rules_config->getEvent();\n// if ($event && !isset($events[$event])) {\n// $events[$event] = $event;\n// }\n// }\n// return $events;\n }", "public function getTriggeringEvents();", "public static function getSubscribedEvents()\n {\n return array(\n DefaultEvents::default_pre_index => 'onCustomListener',\n DefaultEvents::default_pre_index => 'onCustomListener',\n OtherEvents::other_pre_index => 'onCustomListener',\n OtherEvents::other_pox_index => 'onCustomListener'\n );\n }", "protected function getRegisteredEvents() {\n $events = [];\n foreach ($this->loadMultiple() as $rules_config) {\n foreach ($rules_config->getEventNames() as $event_name) {\n $event_name = $this->eventManager->getEventBaseName($event_name);\n if (!isset($events[$event_name])) {\n $events[$event_name] = $event_name;\n }\n }\n }\n return $events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "public function getEvents()\n {\n return $this->events;\n }", "protected function getAttributeEvents()\n {\n $events = [];\n foreach($this->dispatchesEvents as $event => $class) {\n if(strpos($event, ':') !== false) {\n $events[$event] = $class;\n }\n }\n return $events;\n }", "public function getImplementedListeners(): iterable;", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => array('onKernelRequest', 10), // 10 is before Firewall listener.\n );\n }", "public function getEvents()\n {\n return $this->_events;\n }", "public static function getEvents(): array\n {\n return is_array(static::$events) ? static::$events : [static::$events];\n }", "public function getSubscribedEvents()\n {\n $events = array();\n $self = $this;\n foreach ($this->plugins as $plugin) {\n foreach (array_keys($plugin->getSubscribedEvents()) as $event) {\n if (isset($events[$event])) {\n continue;\n }\n $events[$event] = function() use ($event, $self) {\n $self->handleEvent($event, func_get_args());\n };\n }\n }\n return $events;\n }", "public function getEvents() {\n return $this->_events;\n }", "public function events()\n {\n return $this->events;\n }", "public function events()\n {\n return $this->events;\n }", "public function getSubEvents()\n {\n return $this->subEvents;\n }", "protected function getEventHandlers($event)\n {\n $logger = $this->getLogger();\n $handlers = array();\n\n foreach ($this->plugins as $plugin) {\n $callbacks = $plugin->getSubscribedEvents();\n if (!is_array($callbacks)) {\n $logger->warning('Plugin returns non-array value for event callbacks', array(\n 'plugin' => get_class($plugin),\n 'callbacks' => $callbacks,\n ));\n continue;\n }\n if (!isset($callbacks[$event])) {\n $logger->debug('Plugin does not handle event', array(\n 'plugin' => get_class($plugin),\n 'event' => $event,\n ));\n continue;\n }\n $callback = $callbacks[$event];\n $pluginCallback = array($plugin, $callback);\n if (is_callable($pluginCallback)) {\n $handlers[] = $pluginCallback;\n } elseif (is_callable($callback)) {\n $handlers[] = $callback;\n } else {\n $logger->warning('Plugin returns invalid event callback', array(\n 'plugin' => get_class($plugin),\n 'event' => $event,\n 'callback' => $callback,\n ));\n }\n }\n\n return $handlers;\n }", "public static function getSubscribedEvents(): array\n {\n return [\n KernelEvents::REQUEST => ['onKernelRequest', 110],\n KernelEvents::RESPONSE => ['onKernelResponse', 10],\n ];\n }", "public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}", "public static function getSubscribedEvents(): array\n {\n return [\n LoginActionEvent::NAME => [\n ['flashLoginEvent', self::FLASH_MESSAGE_PRIORITY],\n ['afterLogin'],\n ]\n ];\n }", "public static function eventSubscriptions() : iterable;", "public static function getSubscribedEvents()\n {\n return [\n //Step 4:Classname::ConstantName or event name 'kernel.request' => 'functionameyouliketocall' - onKernelRequest()\n KernelEvents::REQUEST => 'onKernelRequest',\n ];\n }", "public function getCallbacks($eventName)\n {\n $eventMap = $this->getEventMap();\n\n if (isset($eventMap[$eventName])) {\n return $eventMap[$eventName];\n }\n\n return array();\n }", "public static function getSubscribedEvents()\n {\n return array(\n GetFormDataControllerEvent::NAME => array(\n array('getFormDataNewsController')\n )\n );\n }", "public function getEvents() { return $this->_events; }", "public function getListener($event, $key)\n\t{\n\t\tif (isset(static::$events[$event]) && isset(static::$events[$event][$key]))\n\t\t\treturn static::$events[$event][$key];\n\t\t\n\t\treturn NULL;\n\t}", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => array('onKernelRequest', 9999),\n KernelEvents::RESPONSE => array('onKernelResponse', 9999),\n //KernelEvents::EXCEPTION => 'onKernelException'\n );\n }", "public function getAllEventCallback()\n {\n $response = $this->get(Resources::$Eventcallbackurl);\n if (!$response->success()) {\n $this->throwError('MailjetService:getAllEventCallback() failed', $response);\n }\n return $response->getData();\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => 'onMatchRequest'\n );\n }", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "public static function list_event_handlers($module_name, $event_name)\n\t{\n\t\treturn CmsCache::get_instance()->call('CmsDatabaseEventManager::list_event_handlers_impl', $module_name, $event_name);\n\t\t//return CmsDatabaseEventManager::list_event_handlers_impl($module_name, $event_name);\n\t}", "protected static function getListenerEvents($listeners, $basePath)\n {\n $listenerEvents = [];\n\n foreach ($listeners as $listener) {\n try {\n $listener = new ReflectionClass(\n static::classFromFile($listener, $basePath)\n );\n } catch (ReflectionException $e) {\n continue;\n }\n\n if (! $listener->isInstantiable()) {\n continue;\n }\n\n foreach ($listener->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {\n if (! Str::is('handle*', $method->name) ||\n ! isset($method->getParameters()[0])) {\n continue;\n }\n\n $listenerEvents[$listener->name.'@'.$method->name] =\n Reflector::getParameterClassNames($method->getParameters()[0]);\n }\n }\n\n return array_filter($listenerEvents);\n }", "static public function getSubscribedEvents()\n {\n return array(\n JobEventsMap::STATE_START => array('logJobEvent'),\n JobEventsMap::STATE_FAIL => array('logJobEvent'),\n JobEventsMap::STATE_ERROR => array('logJobEvent'),\n JobEventsMap::STATE_ADD => array('logJobEvent'),\n JobEventsMap::STATE_FINISH => array('logJobEvent'),\n \n WorkerEventsMap::WORKER_START => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_FINISH => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_ERROR => array('logWorkerEvent'),\n \n QueueEventsMap::QUEUE_LIST => array('logQueueListEvent'),\n QueueEventsMap::QUEUE_LOCK => array('logQueueLockEvent'),\n QueueEventsMap::QUEUE_UNLOCK => array('logQueueUnlockEvent'),\n \n QueueEventsMap::QUEUE_LOOKUP => array('logQueueLookupEvent'),\n QueueEventsMap::QUEUE_PURGE => array('logQueuePurgeEvent'),\n QueueEventsMap::QUEUE_PURGE_ACTIVITY => array('logQueuePurgeActivityEvent'),\n QueueEventsMap::QUEUE_QUERY_ACTIVITY => array('logQueueQueryActivityEvent'),\n \n QueueEventsMap::QUEUE_REC => array('logQueueReceiveEvent'),\n QueueEventsMap::QUEUE_REMOVE => array('logQueueRemoveEvent'),\n QueueEventsMap::QUEUE_SENT => array('logQueueSendEvent'),\n \n \n MonitoringEventsMap::MONITOR_COMMIT => array('logMonitorCommitEvent'),\n MonitoringEventsMap::MONITOR_LOCK => array('logMonitorLockEvent'),\n MonitoringEventsMap::MONITOR_QUERY => array('logMonitorQueryEvent'),\n MonitoringEventsMap::MONITOR_RUN => array('logMonitorRunEvent')\n );\n }", "protected function getCacheIdentityListeners(): array\n {\n if (null === $this->cacheIdentityListeners) {\n $this->cacheIdentityListeners = [];\n $listeners = $this->dispatcher->getListeners(AddSecurityIdentityEvent::class);\n\n foreach ($listeners as $listener) {\n $listener = \\is_array($listener) && \\count($listener) > 1 ? $listener[0] : $listener;\n\n if ($listener instanceof CacheSecurityIdentityListenerInterface) {\n $this->cacheIdentityListeners[] = $listener;\n }\n }\n }\n\n return $this->cacheIdentityListeners;\n }", "public static function getSubscribedEvents()\n {\n return [NotificationEvent::NAME => ['handleNotificationEvent', self::getPriority()]];\n }", "static function getSubscribedEvents() {\n $events[KernelEvents::VIEW][] = array('onHtmlFragment', 100);\n $events[KernelEvents::VIEW][] = array('onHtmlPage', 50);\n\n return $events;\n }", "public static function getSubscribedEvents()\n\t{\n\t\treturn array(\n\t\t\tBrowserTestCase::TEST_ENDED_EVENT => array('onTestEnd', 0),\n\t\t);\n\t}", "public static function getSubscribedEvents(): array\n\t{\n\t\t// Only subscribe events if the component is installed and enabled\n\t\tif (!ComponentHelper::isEnabled('com_ars'))\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t'onContentPrepare' => 'onContentPrepare',\n\t\t];\n\t}", "public function getListeners($eventName)\n {\n $wildcards = $this->getWildcardListeners($eventName);\n\n if (! isset($this->sorted[$eventName])) {\n $this->sortListeners($eventName);\n }\n\n return array_merge($this->sorted[$eventName], $wildcards);\n }", "public function getEventHandlers($name)\r\n\t{\r\n\t\tif($this->hasEvent($name))\r\n\t\t{\r\n\t\t\t$name=strtolower($name);\r\n\t\t\tif(!isset($this->_e[$name]))\r\n\t\t\t\t$this->_e[$name]=new CList();\r\n\t\t\treturn $this->_e[$name];\r\n\t\t}\r\n\t}", "protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}", "public static function getSubscribedEvents()\n {\n return array(\n AvisotaMessageEvents::POST_RENDER_MESSAGE_CONTENT => array(\n array('injectGA', -500),\n ),\n\n GetOperationButtonEvent::NAME => array(\n array('prepareButton'),\n ),\n\n BuildDataDefinitionEvent::NAME => array(\n array('injectGALegend'),\n ),\n );\n }", "public function getSubscribedEvents(): array\n {\n return [\n Events::postLoad,\n Events::onFlush,\n Events::postFlush,\n ];\n }", "public static function getSubscribedEvents(): array\n {\n return [KernelEvents::EXCEPTION => ['onException', 20]];\n }", "public static function getSubscribedEvents()\n {\n return [\n KernelEvents::VIEW => ['onKernelView', 30],\n KernelEvents::RESPONSE => ['onKernelResponse', 30],\n ];\n }", "protected function getEvents(ContainerBuilder $container)\r\n {\n $events = array();\n \n foreach ($container->get('synd_metrics.finder')->getConfig() as $groupName => $groupConfig) {\n foreach ($groupConfig['funnel'] as $event) {\r\n $events[] = $event;\r\n }\n }\n\n return $events;\r\n }", "public function getEventDescriptors(): array\n {\n //Get the room descriptors from the database\n $eventDescriptors = $this->entityManager\n ->getRepository(EventDescriptor::class)\n ->findAll();\n\n return $eventDescriptors;\n }", "public static function getSubscribedEvents(): array\n {\n return [\n Events::FIGURE_CREATED => 'onFigureCreated',\n ];\n }", "public static function getSubscribedEvents(): array\n {\n return [\n WsServerEvent::HANDSHAKE_SUCCESS => 'handshakeOk',\n WsServerEvent::MESSAGE_RECEIVE => 'messageReceive',\n WsServerEvent::CLOSE_BEFORE => 'messageReceive',\n ];\n }", "public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}", "public function getAttachObserver(string $event_name):array{\r\n return $this->storage[$event_name]??[];\r\n }", "public static function getSubscribedEvents()\n {\n return [\n KernelEvents::CONTROLLER => \"onKernelController\",\n KernelEvents::EXCEPTION => \"onKernelException\"\n ];\n }", "public function getListeners($hook)\n {\n if (! isset($this->sorted[$hook])) {\n $this->sortListeners($hook);\n }\n\n return $this->sorted[$hook];\n }", "function getAllEvents() {\n\n $this->events = $this->getEvents();\n //If plugin adds new events for an already defined type\n Plugin::doHook('item_get_events', $this);\n\n return $this->events;\n }", "public static function getSubscribedEvents()\n {\n return [\n FOSUserEvents::REGISTRATION_INITIALIZE => [\n ['disableUser', 0],\n ],\n FOSUserEvents::REGISTRATION_SUCCESS => [\n ['registrationFlashMessage', 0],\n ],\n ];\n }", "public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }", "private function getEventData( array $event ): array {\n return [\n 'token' => env( 'VERIFICATION_TOKEN' ),\n 'team_id' => 'T061EG9R6',\n 'api_app_id' => 'A0MDYCDME',\n 'event' => $event,\n 'type' => 'event_callback',\n 'event_id' => 'Ev0MDYHUEL',\n 'event_time' => 1515449483000108,\n 'authed_users' => [\n 0 => 'U0LAN0Z89',\n ],\n ];\n }", "public function listen($event, $listener);", "public static function getSubscribedEvents()\n {\n // event can be dispatch with dispatcher in a controller ...\n return [\n 'user.update' => 'updateUser'\n ];\n }" ]
[ "0.8527602", "0.8165313", "0.79345465", "0.7794574", "0.7664116", "0.7337114", "0.7279026", "0.72776026", "0.72156066", "0.71325475", "0.7112888", "0.71092516", "0.70718455", "0.68172866", "0.6788475", "0.6788475", "0.6776465", "0.6769203", "0.6609631", "0.6609631", "0.65787816", "0.65787816", "0.6529483", "0.6520612", "0.64824116", "0.64711577", "0.6469307", "0.6461419", "0.6407275", "0.6382998", "0.63762176", "0.6366414", "0.6362973", "0.6326379", "0.630427", "0.630017", "0.62914133", "0.6264345", "0.6225525", "0.62087035", "0.62087035", "0.62087035", "0.62087035", "0.62087035", "0.62087035", "0.62087035", "0.62087035", "0.62006384", "0.61921716", "0.6188705", "0.6188021", "0.6182119", "0.61632663", "0.615048", "0.61380583", "0.61380583", "0.61345834", "0.61099523", "0.60997576", "0.6069577", "0.6054634", "0.60533327", "0.6045806", "0.60220325", "0.60089433", "0.600643", "0.60025615", "0.59970564", "0.59783393", "0.59631264", "0.5962395", "0.59536755", "0.5953339", "0.59322613", "0.5923981", "0.5915544", "0.5908932", "0.5903697", "0.5902345", "0.5878673", "0.58646035", "0.58507204", "0.58504677", "0.58494836", "0.5847456", "0.58470446", "0.5846489", "0.5841669", "0.5840246", "0.5840048", "0.5835724", "0.5831017", "0.58264893", "0.5825709", "0.58250284", "0.5824503", "0.5813009", "0.5803959", "0.57962286", "0.5794071" ]
0.8186738
1
Attach a event listener
public function addListener($event, \Closure $listener) { return $this->on($event, $listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function attachEvents();", "public function attachEvents();", "public function attach(string $event, callable $listener, int $priority = 0): void;", "function eventRegister($eventName, EventListener $listener);", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function attachListener(callable $listener): void\n {\n if (in_array($listener, $this->listeners, true)) {\n return;\n }\n\n $this->listeners[] = $listener;\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function addEventListener($event, $callback, $weight = null);", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public function listen($event, $listener);", "public function onEvent();", "public function addListener($eventName, $listener, $priority = 0);", "public function addListener($event, $listener, $priority = 0);", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function attach(string $event, callable $callback, int $priority = self::PRIORITY_MIN): void;", "public function attachListener(\n $listener,\n /*# string */ $eventName = '',\n /*# int */ $priority = 50\n )/*# : EventManagerInterface */;", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "public function on($eventName, $callable);", "public function on($eventName, $callable);", "public function listen($listener);", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function listen() {\n $this->source->listen($this->id);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function listener(Listener $listener);", "public function addListener($name, $listener, $priority = 0);", "public function on($event, $callback){ }", "protected function registerListeners()\n {\n }", "public function attach($event, Event_ObserverInterface $observer) {\r\n\t\t$this->_eventObservers[$event][] = $observer;\r\n\t}", "public function attach(EventManagerInterface $eventManager, $priority = 1)\n {\n $this->listeners[] = $eventManager->attach(Event::EVENT_DETECT, [$this, 'detect'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_FOUND, [$this, 'found'], $priority);\n $this->listeners[] = $eventManager->attach(Event::EVENT_ASSEMBLE, [$this, 'assemble'], $priority);\n }", "public function addListener($event, tx_auxo_observer $listener) {\r\n\t\t$this->eventListener[$event][spl_object_hash($listener)] = $listener;\r\n\t}", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function attach(EventManagerInterface $events, $priority = 400)\n {\n $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, [$this, 'selectRenderer'], $priority);\n $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, [$this, 'injectResponse'], $priority);\n }", "public function attach(EventManagerInterface $eventManager, $priority = 100)\n {\n $shared = $eventManager->getSharedManager();\n $this->listeners[] = '???';\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('received.node.void', [$this, 'onReceivedNodeVoid']);\n $this->listeners[] = $events->attach('received.node.receipt', [$this, 'onReceivedNodeReceipt']);\n }", "public function attachEventListeners( Observable $observable )\n\t{\n\t\tforeach ( array( 'update', 'open', 'delete', 'after_delete', 'after_update', 'dispense' ) as $eventID ) {\n\t\t\t$observable->addEventListener( $eventID, $this );\n\t\t}\n\t}", "function onEvent($element_id)\r\n\t{\r\n\t\t\r\n\t}", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function listeners($eventName);", "public function listeners($event);", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MessageDispatch::ROUTE, [$this, 'onRoute'], 100);\n }", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('get.pre', array($this, 'load'), 100);\n $this->listeners[] = $events->attach('get.post', array($this, 'save'), -100);\n }", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "function addEvent($event) {\n Event::addEvent($event);\n }", "public function attach(EventManagerInterface $events) {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, __CLASS__ . '::onDispatch', 1000);\n }", "public function attach( $observer )\r\n {\r\n $this->observers []= $observer;\r\n }", "public function register(): void\n {\n $eventManager = EventManager::getInstance();\n\n $this->discoverEvents();\n\n foreach ($this->getListeners() as $moduleName => $moduleEvents) {\n foreach ($moduleEvents as $eventName => $eventListeners) {\n foreach (array_unique($eventListeners) as $listener) {\n $eventManager->addEventHandler(\n $moduleName,\n $eventName,\n [$listener, 'handle']\n );\n }\n }\n }\n }", "public function addRequestCreateListener($listener);", "public function attach(string $eventClass, callable $handler)\n {\n $this->listeners[$eventClass][] = $handler;\n }", "public static function events();", "public function addNetDriverChangeListener($listener);", "public function attach(EventManagerInterface $e, $priority = 100)\n {\n $shared = $e->getSharedManager();\n\t\t$this->listeners[] = $shared->attach('*', Event::EVENT_SOMETHING, [$this, 'logMessage']);\n \t\t//*** DATABASE EVENTS LAB: complete an \"attach()\" for INSERT and SELECT table operations\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_INSERT, [$this, 'logInsert'], $priority);\n $this->listeners[] = $shared->attach('listings-table', EventFeatureEventsInterface::EVENT_PRE_SELECT, [$this, 'logSelect'], $priority);\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "abstract function HookEvents();", "public function listen($events, $listener = null): void;", "protected function setupListeners()\n {\n //\n }", "public function attach(EventManagerInterface $events, $priority = 1)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute'], -40);\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "static public function addEventListener($eventName, $listener) {\n if (!isset(self::$listeners[$eventName])) self::$listeners[$eventName] = array();\n array_unshift(self::$listeners[$eventName], $listener);\n }", "public function attach(EventManagerInterface $events, $priority = 1)\n {\n $this->listeners[] = $events->attach(PageEvent::EVENT_ROUTE, [$this, 'onRoute']);\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, [$this, 'onDispatch'], 2);\n }", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "public function attach(EventManagerInterface $events)\n {\n foreach ($this->hooks as $name => $spec) {\n $listeners[] = $events->attach($spec['event'], array($this, \"do$name\"));\n }\n }", "public function setListener($listener)\n {\n $this->_listener = $listener;\n }", "public function postEventadd();", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function registerEvents()\n {\n if (!empty($this->clientEvents)) {\n $js = [];\n foreach ($this->clientEvents as $event => $handle) {\n $handle = new JsExpression($handle);\n $js[] = \"$({$this->var}).on('{$event}', {$handle});\";\n }\n $this->getView()->registerJs(implode(PHP_EOL, $js));\n }\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach('blog.model.post.save', array($this, 'onPostSave'));\n $this->listeners[] = $events->attach('blog.model.post.create', array($this, 'onPostSave'));\n }", "public function addEventSubscriber(IEventSubscriber $subscriber);", "function attach(Observer $observer_in) {\n $this->observers[] = $observer_in;\n }", "public function attach(EventEmitter $emitter): void;", "protected function _subscribeToEngineEvents()\n {\n $controller = $this->getController();\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array(\n 'callback' => array( $this, 'onEndOfFax' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $controller->addEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function testAttach()\n {\n $event = new EventManager();\n\n /** @var \\Closure $closure */\n $closure = function () {\n return $this->listeners;\n };\n\n $this->mvcKeeper->attach($event);\n\n $getListeners = $closure->bindTo($this->mvcKeeper, get_class($this->mvcKeeper));\n $listeners = $getListeners();\n\n foreach ($listeners as $listener) {\n $this->assertInstanceOf('Zend\\Stdlib\\CallbackHandler', $listener);\n }\n }", "function attach(AbstractObserver $observer)\n {\n $this->observers[] = $observer;\n\n }", "public function HookEvents() {\n\t\tadd_action( 'add_attachment', array( $this, 'EventFileUploaded' ) );\n\t\tadd_action( 'delete_attachment', array( $this, 'EventFileUploadedDeleted' ) );\n\t\tadd_action( 'admin_init', array( $this, 'EventAdminInit' ) );\n\t}", "function attach(&$observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::setStaticObserver($nameHash, array('obs' => &$observer, 'eventID' => $eventID));\n }\n }", "public function attach(EventManagerInterface $events)\n {\n $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'selectCsvRenderer'));\n }", "public function addEvent($event){\n $this->events[]=$event;\n }", "public static function listen($event, callable $listener, $priority = 0)\n {\n static::getDispatcher()->addListener($event, $listener, $priority);\n }", "public function setEventName(String $eventName) : EventListenerInterface;", "protected function withListener(string $event, string $listener): void\n {\n $this->callAfterResolving('events', static function (Dispatcher $dispatcher) use ($event, $listener): void {\n $dispatcher->listen($event, $listener);\n });\n }", "public function on($events, $callback, $options = array()) {\n\t\tforeach ((array)$events as $event) {\n\t\t\tif (!strpos($event, '.')) {\n\t\t\t\t$event = 'Visualisation' . '.' . $event;\n\t\t\t}\n\n\t\t\t$this->_eventManager->attach($callback, $event, $options);\n\t\t}\n\t}", "public function attach(Observer $observer) {\n $this->observers[] = $observer;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerEvents(): void\n {\n Event::listen(MessageLogged::class, function (MessageLogged $e) {\n if( app()->bound('current-context') )\n app('current-context')->log((array)$e);\n });\n }", "protected function registerEvents(): void\n {\n $events = $this->app->make(Dispatcher::class);\n\n foreach ($this->events as $event => $listeners) {\n foreach ($listeners as $listener) {\n $events->listen($event, $listener);\n }\n }\n }", "public function addListener($event, $listener, $priority = 0)\n {\n if (empty($this->listeners[$event])) {\n\n if ($event === 'onAfterCleanModuleList') {\n\n $handler = function (&$modules) use ($event) {\n return $this->dispatch($event, new Event($event, [&$modules]));\n };\n\n } else {\n\n $handler = function (...$arguments) use ($event) {\n return $this->dispatch($event, new Event($event, $arguments));\n };\n\n }\n\n $this->app->registerEvent($event, $handler);\n }\n\n parent::addListener($event, $listener, $priority);\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }" ]
[ "0.76603466", "0.76603466", "0.6893791", "0.6790374", "0.6662127", "0.6611006", "0.6582604", "0.64965296", "0.6476519", "0.647423", "0.6446873", "0.6412187", "0.63948095", "0.6370083", "0.6331031", "0.62409884", "0.62265575", "0.62258947", "0.61502695", "0.60950166", "0.60950166", "0.6068168", "0.60393846", "0.6029826", "0.6007031", "0.59893084", "0.59841204", "0.59776264", "0.5974596", "0.59504426", "0.59456825", "0.5911821", "0.5880547", "0.5872513", "0.58660406", "0.58549875", "0.5849507", "0.58330244", "0.58327574", "0.5824219", "0.57939655", "0.57935333", "0.5783975", "0.5743133", "0.5739941", "0.57371235", "0.57326645", "0.5727366", "0.57271105", "0.57271105", "0.57271105", "0.57266206", "0.57266206", "0.57266206", "0.5718984", "0.57164836", "0.56948555", "0.568356", "0.5672136", "0.5666856", "0.5666203", "0.5646703", "0.5641709", "0.56415176", "0.5631034", "0.5621124", "0.5619052", "0.5599639", "0.5598067", "0.5596686", "0.55888486", "0.5576664", "0.5575895", "0.55758494", "0.5575202", "0.55709755", "0.5570633", "0.55704695", "0.55646664", "0.55569255", "0.5549944", "0.5548703", "0.5532307", "0.5530541", "0.5530284", "0.5522059", "0.55042857", "0.54993045", "0.54964775", "0.5480959", "0.54642475", "0.5461845", "0.5446367", "0.544519", "0.54433036", "0.5442656", "0.5435335", "0.54318786", "0.5419586", "0.5417006", "0.54165536" ]
0.0
-1
Detach a event listener
public function removeListener($event, \Closure $listener) { return $this->off($event, $listener); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}", "public function detachListener(\n $listener,\n /*# string */ $eventName = ''\n )/*# : EventManagerInterface */;", "public function detach(EventManagerInterface $events)\r\n {\r\n foreach ($this->listeners as $index => $listener) {\r\n if ($events->detach($listener)) {\r\n unset($this->listeners[$index]);\r\n }\r\n }\r\n }", "public function detach(EventManagerInterface $eventManager)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($eventManager->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n array_walk($this->listeners, array($events,'detach'));\n $this->listeners = array();\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($listener[$index]);\n }\n }\n }", "public function detach(\\SplObserver $observer) {}", "public function detach(string $event, callable $callback): bool;", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach($event, Event_ObserverInterface $observer) {\r\n\t\tif (isset($this->_eventObservers[$event])) {\r\n\t\t\t$key = array_search($observer, $this->_eventObservers[$event], true);\r\n\t\t\tif ($key !== false) {\r\n\t\t\t\tarray_splice($this->_eventObservers[$event], $key, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function detachShared(SharedEventManagerInterface $events)\n\t\t{\n\t\t\tforeach ($this->listeners as $index => $listener) {\n\t\t\t if ($events->detach($index, $listener)) {\n\t\t\t\t unset($this->listeners[$index]);\n\t\t\t }\n\t\t }\n\t\t}", "public function removeListener($eventName, $listener);", "public function removeListener($eventName, $listener);", "public function remove($event, $listener);", "public function detach(EventManagerInterface $em)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($em->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->getSharedManager()->detach(MainProcessor::EVENT_MANAGER_ID, $listener)) {\n unset($this->listeners[$i]);\n }\n }\n }", "public function detach() {}", "public function detach() {}", "public function detach();", "public function remove($listener);", "public function detachShared(SharedEventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $callback) {\n if ($events->detach('', $callback)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach($observer)\n\t{\n // Not implemented here\n }", "public function detach(SplObserver $observer){\n $id = spl_object_hash($observer);\n unset($this->observers[$id]);\n }", "public function detach()\n {\n // TODO\n }", "public function detach(Observer $observer)\n\t{\n\t\tunset($this->_observers[array_search($observer, $this->_observers)]);\n\t}", "public function detach(EventCollection $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach($observer)\n {\n $observerKey = spl_object_hash($observer);\n unset($this->observers[$observerKey]);\n }", "public function unsubscribe(): void;", "public function detach()\n {\n // dummy implementation\n }", "function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function off($event);", "public function removeAllListeners($eventName);", "public function detach(Observer $observer)\n {\n if (($key = array_search($observer, $this->observers, true)) !== false) {\n unset($this->observers[$key]);\n }\n }", "public function detachObserver(Delegate_1 $d)\n\t{\n\t\t// detach this observer\n\t\t$hash = spl_object_hash($d);\n\t\tunset($this->observers[$hash]);\n\t}", "function detach();", "public function detach(EventManagerInterface $events)\n {\n $sharedManager = $events->getSharedManager();\n\n foreach ($this->listeners as $index => $listeners) {\n if ($listeners === $this) {\n continue;\n }\n\n if ($listeners instanceof ListenerAggregateInterface) {\n $listeners->detach($events);\n }\n\n $events->detach($listeners);\n }\n\n /** @var array $sharedListeners */\n foreach ($this->sharedListeners as $id => $sharedListeners) {\n foreach ($sharedListeners as $index => $listener) {\n if ($listener === $this) {\n continue;\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->detach($events);\n }\n\n $sharedManager->detach($listener, $id);\n }\n }\n }", "public function unsetEventDispatcher()\n {\n $this->events = null;\n }", "public function detach(\\SplObserver $observer)\n {\n $this->storage->detach($observer);\n }", "public function detach(Observer $observer) {\n foreach ($this->observers as $key => $obs) {\n if ($observer == $obs) {\n unset($this->observers[$key]);\n break;\n }\n }\n }", "function detach(AbstractObserver $observer)\n {\n foreach($this->observers as $okey => $oval) {\n if ($oval == $observer) {\n unset($this->observers[$okey]);\n }\n }\n }", "public function clearListeners(string $event): void;", "public function detach( $observer )\r\n {\r\n $this->observers []= $observer; // an an observer to the observer subject.\r\n }", "public function detach( \\SplObserver $observer )\n {\n $this->_storage->detach( $observer );\n }", "public function detach(SplObserver $observer)\n {\n $this->_observers->detach($observer);\n }", "public function removeEventSubscriber(IEventSubscriber $subscriber);", "public function detach($component);", "public function detach()\r\n {\r\n $this->_parentNode->removeChild($this);\r\n }", "public function forget($event)\n {\n unset($this->listeners[$event]);\n }", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "public function removeEvent($event);", "public function __destruct() {\n\t\tif($this->_listeningenabled)\n\t\t\t$this->unlisten();\n\t}", "function detach(Observer $observer_in) {\n //or\n //$this->observers = array_diff($this->observers, array($observer_in));\n //or\n foreach($this->observers as $okey => $oval) {\n if ($oval == $observer_in) {\n unset($this->observers[$okey]);\n }\n }\n }", "public function removeListener($name, $listener);", "public function detach(ObserverInterface $observer)\n {\n $observers = $this->getObservers();\n\n foreach ($observer->getEvents() as $event) {\n $count = count($observers[$event]);\n\n for ($i = 0; $i < $count; $i++) {\n if ($observers[$event][$i] == $observer) {\n unset($observers[$event][$i]);\n }\n }\n }\n\n $this->setObservers($observers);\n }", "public function detach()\n\t{\n\t\tif (null !== $this->shmId) {\n\t\t\tshmop_close($this->shmId);\n\t\t\t$this->shmId = null;\n\t\t}\n\t}", "public function detach(ObservesProxyLoading $observer) : void;", "public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }", "function removeListener(EventListener $listener): bool;", "function eventUnRegister($eventName, $id);", "public function detach(EventObserver $observer):bool{\r\n $name=$observer->eventName();\r\n if (is_string($name))$name=[$name];\r\n $deatch=0;\r\n foreach ($name as $v){\r\n foreach ($this->storage[$v]??[] as $k=>$ob){\r\n if($ob[0]===$observer){\r\n unset($this->storage[$v][$k]);\r\n $deatch++;\r\n }\r\n }\r\n }\r\n return $deatch;\r\n }", "public function clearListeners()\n {\n $this->listeners = array();\n }", "public function detach(SplObserver $obj)\n\t{\n\t\t// Remove the listener\n\t\tunset($this->listeners[spl_object_hash($obj)]);\n\n\t\treturn $this;\n\t}", "function detach(ftpClientObserver $observer) {\r\n\t\tif ( !isset($this->_listeners[$observer->getId()]) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->_listeners[$observer->getId()]);\r\n\t\treturn true;\r\n\t}", "public function detach()\n {\n return null;\n }", "public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}", "public function removeListener($event, tx_auxo_observer $listener) {\r\n\t\tif (! isset($this->eventListener[$event][spl_object_hash($listener)])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->eventListener[$event][spl_object_hash($listener)]);\r\n\t\treturn true;\r\n\t}", "protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }", "public function releaseEvents();", "public function releaseEvents();", "public function removeListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events)) {\n\t\t\tstatic::$events[$event] = [];\n\t\t} else {\n\t\t\tforeach (static::$events as $evt => $events)\n\t\t\t\tstatic::$events[$evt] = [];\n\t\t}\n\t}", "public function forget($event)\n {\n unset($this->listeners[$event], $this->sorted[$event]);\n }", "public function detach($component)\n\t{\n\t}", "public static function removeAllListeners(string $event) : void\n {\n if (Event::hasListeners($event)) {\n unset(Event::$listeners[$event]);\n }\n }", "public function detachFromBattle($battle) {\n $battle->detachEventHandler(\"onAfterRound\", array($this, 'reactToOnAfterRound'));\n if($this->blocks) {\n $battle->detachEventHandler(\"onBeforeAction\", array($this, 'reactToOnBeforeAction'));\n }\n }", "public function detach(\\SplObserver $observer) {\n\t\treturn $this->storage->delete($observer);\n\t}", "public function removeParseListener(ParseTreeListener $listener): void\n {\n $index = \\array_search($listener, $this->parseListeners, true);\n\n if ($index !== false) {\n unset($this->parseListeners[$index]);\n }\n }", "public static function unsetEventDispatcher()\n {\n static::$dispatcher = null;\n }", "public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }", "public function destroy()\n {\n $this->stop();\n $this->setupListeners();\n }", "public function postEventDel();", "public function detach($document);", "public static function detaching ($callback, $priority = 0) {\n static::registerModelEvent('detaching', $callback, $priority);\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$i]);\n }\n }\n\n return empty($this->listeners);\n }", "function unregister($event, $callback) {\n Event::unregister($event, $callback);\n }", "public function detach()\n {\n if ($this->getBack()) {\n $this->getBack()->setNext($this->getNext());\n }\n\n if ($this->getNext()) {\n $this->getNext()->setBack($this->getBack());\n }\n }", "public function detach($key): Event\n\t{\n\t\tif (is_object($key) || is_string($key)) {\n\t\t\tif (is_string($key)) {\n\t\t\t\t$class = $key;\n\t\t\t} else {\n\t\t\t\t$class = get_class($key);\n\t\t\t}\n\n\t\t\tforeach ($this as $pos => $item) {\n\t\t\t\t$this->cliOut($item['className']);\n\t\t\t\tif ($item['className'] === $class) {\n\t\t\t\t\t$this->cliOut(sprintf('Detach %s at position %s', $item['className'], $pos));\n\t\t\t\t\tunset($this[$pos]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tunset($this[$key]);\n\t\t}\n\n\t\treturn $this;\n\t}", "public final function off( $eventName, $eventCallback = null ) {\n\n\t\t\tif ( is_string( $eventName ) ) {\n\n\t\t\t\tif ( strlen( $eventName ) > 0 ) {\n\n\t\t\t\t\tif ( isset( $this->events[ $eventName ] ) ) {\n\n\t\t\t\t\t\tif ( $eventCallback === null ) {\n\n\t\t\t\t\t\t\tunset( $this->events[ $eventName ] );\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( $i = count( $this->events[ $eventName ] ) - 1; $i>=0; $i-- ) {\n\n\t\t\t\t\t\t\t\tif ( self::callbackEquals( $eventCallback, $this->events[ $eventName ][ $i ]['callback'] ) ) {\n\n\t\t\t\t\t\t\t\t\t// remove event\n\t\t\t\t\t\t\t\t\tarray_splice( $this->events[ $eventName ], $i, 1 );\n\n\t\t\t\t\t\t\t\t\tif ( count( $this->events[ $eventName ] ) == 0 ) {\n\t\t\t\t\t\t\t\t\t\tunset( $this->events[ $eventName ] );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: non-empty string expected!');\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthrow new \\browserfs\\Exception('Invalid argument $eventName: string expected!' );\n\n\t\t\t}\n\n\t\t}", "public function removeListener($event, $callback)\n {\n if (false === isset($this->listeners[$event])) {\n\n return;\n }\n\n $key = array_search($callback, $this->listeners[$event]);\n if ($key !== false) {\n unset($this->listeners[$event][$key]);\n\n if (0 === count($this->listeners[$event])) {\n unset($this->listeners[$event]);\n }\n }\n }", "function unregister_elgg_event_handler($event, $object_type, $function) {\n\tglobal $CONFIG;\n\tforeach($CONFIG->events[$event][$object_type] as $key => $event_function) {\n\t\tif ($event_function == $function) {\n\t\t\tunset($CONFIG->events[$event][$object_type][$key]);\n\t\t}\n\t}\n}", "public function stop(): void\n {\n $this->entityManager->getEventManager()->removeEventListener($this->initializeEvents, $this);\n }", "public function onRemove();", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function __destruct()\n\t{\n\t\t$this->detach();\n\t}", "static public function removeEventListener($eventName, $listener) {\n if (TRUE !== $eventName) {\n foreach(self::$listeners[$eventName] as $key=>$item) {\n if ($item == $listener) {\n unset(self::$listeners[$eventName][$key]);\n return true;\n }\n }\n return false;\n }\n foreach(self::$listeners as $il=>$list) {\n foreach($list as $ii=>$item) {\n if ($item == $listener) {\n unset(self::$listeners[$il][$ii]);\n return true;\n }\n }\n }\n return false;\n }", "public function detach($callback)\n {\n $this->callbacks = array_filter($this->callbacks, function($handler) use($callback) {\n return $handler['callback'] != $callback;\n });\n\n return $this;\n }", "public function detach() {\n\t\t$handle = $this->handle;\n\t\t$this->handle = null;\n\t\treturn $handle;\n\t}" ]
[ "0.767265", "0.711938", "0.6978497", "0.6769045", "0.6746242", "0.66893476", "0.6689133", "0.666327", "0.6645427", "0.6645427", "0.6645427", "0.6645427", "0.6628564", "0.6619655", "0.6570294", "0.6570294", "0.65026605", "0.64992607", "0.64581037", "0.6412531", "0.6412531", "0.63933504", "0.6331033", "0.63214886", "0.6315205", "0.6287898", "0.62742454", "0.62708324", "0.62669665", "0.6257721", "0.6245264", "0.6240369", "0.61600447", "0.6146738", "0.61338997", "0.6116681", "0.61030257", "0.6078013", "0.6060744", "0.60448986", "0.6027568", "0.59843314", "0.5971026", "0.59636235", "0.59634405", "0.5940921", "0.5920372", "0.591924", "0.5888287", "0.58340746", "0.5824557", "0.5812423", "0.58062357", "0.57846624", "0.5781391", "0.57759684", "0.5772427", "0.57521176", "0.5726955", "0.5686627", "0.56844914", "0.56800336", "0.5666461", "0.55871546", "0.5550164", "0.5549705", "0.55433226", "0.55427074", "0.5492759", "0.54907227", "0.5488374", "0.54869384", "0.54869384", "0.54861313", "0.546499", "0.5457193", "0.5448097", "0.54240376", "0.5411992", "0.5402589", "0.53947437", "0.5389199", "0.5365593", "0.5359559", "0.5327896", "0.5326403", "0.5315078", "0.53050774", "0.52953714", "0.5290692", "0.5273576", "0.5258297", "0.524299", "0.5190439", "0.5185835", "0.5162939", "0.5140292", "0.5136808", "0.5112142", "0.51097065" ]
0.567525
62
Remove all listeners of given event
public function removeAllListeners($event = null) { if ($event === null) { $this->listeners = array(); } else if (($event = strtolower($event)) && !empty($this->listeners[$event])) { $this->listeners[$event] = array(); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearListeners(string $event): void;", "public static function removeAllListeners(string $event) : void\n {\n if (Event::hasListeners($event)) {\n unset(Event::$listeners[$event]);\n }\n }", "public function removeAllListeners($eventName);", "public function removeListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events)) {\n\t\t\tstatic::$events[$event] = [];\n\t\t} else {\n\t\t\tforeach (static::$events as $evt => $events)\n\t\t\t\tstatic::$events[$evt] = [];\n\t\t}\n\t}", "public function remove($event, $listener);", "public function forget($event)\n {\n unset($this->listeners[$event]);\n }", "public function removeEvent($event);", "public function truncateEventClosures(): void\n {\n $this->listeners = [];\n }", "public function clearListeners()\n {\n $this->listeners = array();\n }", "public function forget($event)\n {\n unset($this->listeners[$event], $this->sorted[$event]);\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $events = array(\n Streamwide_Engine_Events_Event::SDP,\n Streamwide_Engine_Events_Event::CHILD,\n Streamwide_Engine_Events_Event::OKMOVED,\n Streamwide_Engine_Events_Event::MOVED,\n Streamwide_Engine_Events_Event::FAILMOVED\n );\n \n $controller = $this->getController();\n foreach ( $events as $event ) {\n $controller->removeEventListener( $event, array( 'callback' => array( $this, 'onSignalReceived' ) ) );\n }\n }", "public static function clear($event) {\n unset(static::$events[$event]);\n }", "protected function _unsubscribeFromEngineEvents()\n {\n $controller = $this->getController();\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::ENDOFFAX,\n array( 'callback' => array( $this, 'onEndOfFax' ) )\n );\n $controller->removeEventListener(\n Streamwide_Engine_Events_Event::FAXPAGE,\n array( 'callback' => array( $this, 'onFaxPage' ) )\n );\n }", "public function remove($listener);", "function unregister_elgg_event_handler($event, $object_type, $function) {\n\tglobal $CONFIG;\n\tforeach($CONFIG->events[$event][$object_type] as $key => $event_function) {\n\t\tif ($event_function == $function) {\n\t\t\tunset($CONFIG->events[$event][$object_type][$key]);\n\t\t}\n\t}\n}", "public function clearListeners($id, $event = null)\n {\n return true;\n }", "public static function remove_all_event_handlers( $modulename, $eventname )\n\t{\n\t\t$handlers = self::list_event_handlers($modulename, $eventname);\n\n\t\tif ($handlers != null)\n\t\t{\n\t\t\tforeach ($handlers as $handler)\n\t\t\t{\n\t\t\t\t$handler->delete();\n\t\t\t}\n\t\t}\n\t}", "public function removeListener($eventName, $listener);", "public function removeListener($eventName, $listener);", "public function removeObserver() {\n //$this->__observers = array();\n foreach($this->__observers as $obj) {\n unset($obj);\n }\n }", "public function removeListener($event, \\Closure $listener)\n {\n return $this->off($event, $listener);\n }", "public function unsetEventDispatcher()\n {\n $this->events = null;\n }", "public function off($event);", "public function removeListener($event, tx_auxo_observer $listener) {\r\n\t\tif (! isset($this->eventListener[$event][spl_object_hash($listener)])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tunset($this->eventListener[$event][spl_object_hash($listener)]);\r\n\t\treturn true;\r\n\t}", "public function clear($event);", "public function detach(EventManagerInterface $events)\r\n {\r\n foreach ($this->listeners as $index => $listener) {\r\n if ($events->detach($listener)) {\r\n unset($this->listeners[$index]);\r\n }\r\n }\r\n }", "function eventUnRegister($eventName, $id);", "public function clearEvents()\n {\n $this->recorded = [];\n }", "public function releaseEvents();", "public function releaseEvents();", "function UnInstallEvents()\n\t{\n\t}", "public function removeEventSubscriber(IEventSubscriber $subscriber);", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($listener[$index]);\n }\n }\n }", "function destroy($event) {\n $timers =& Timer::timers();\n unset($timers[$event]);\n }", "public function clear(): void\n {\n $this->eventRegistry->dequeueEvents();\n }", "private function uninstallEvents()\n {\n $this->load->model('setting/event');\n $this->model_setting_event->deleteEvent('payment_mundipagg');\n }", "public static function offAll()\n {\n self::$_events = [];\n self::$_eventWildcards = [];\n }", "public function clearEvents()\n\t{\n\t\t$this->collEvents = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function detach(EventManagerInterface $events)\n {\n array_walk($this->listeners, array($events,'detach'));\n $this->listeners = array();\n }", "public function remove_all_hook() {\n\t\tremove_action( 'all', [ $this, 'wrap_hook_callbacks' ] );\n\t}", "public static function flushEventListeners()\n {\n if (!isset(static::$dispatcher)) {\n return;\n }\n\n $instance = new static;\n\n foreach ($instance->getObservableEvents() as $event) {\n static::$dispatcher->forget(\"halcyon.{$event}: \".get_called_class());\n }\n\n static::$eventsBooted = [];\n }", "public function remove()\n {\n foreach ($this->filters as $filter) {\n $filterWithoutAcceptedArguments = array_slice($filter, 0, 3);\n call_user_func_array($this->removeCallback, $filterWithoutAcceptedArguments);\n }\n }", "public static function deregister_event() {\n\t\twp_clear_scheduled_hook( 'learn_press_schedule_cleanup_temp_users' );\n\t}", "static public function removeListeners($eventName) {\n if (!self::hasListeners($eventName)) return false;\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach($event, Event_ObserverInterface $observer) {\r\n\t\tif (isset($this->_eventObservers[$event])) {\r\n\t\t\t$key = array_search($observer, $this->_eventObservers[$event], true);\r\n\t\t\tif ($key !== false) {\r\n\t\t\t\tarray_splice($this->_eventObservers[$event], $key, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function unsubscribe(): void;", "function detach($observer, $eventIDArray)\n {\n foreach ($eventIDArray as $eventID) {\n $nameHash = md5(get_class($observer) . $eventID);\n base::unsetStaticObserver($nameHash);\n }\n }", "public function removeListener($event, $callback)\n {\n if (false === isset($this->listeners[$event])) {\n\n return;\n }\n\n $key = array_search($callback, $this->listeners[$event]);\n if ($key !== false) {\n unset($this->listeners[$event][$key]);\n\n if (0 === count($this->listeners[$event])) {\n unset($this->listeners[$event]);\n }\n }\n }", "public function removeSubscribes();", "public function listeners($event);", "function unregister($event, $callback) {\n Event::unregister($event, $callback);\n }", "public function detach(EventCollection $events)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($events->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $eventManager)\n {\n foreach ($this->listeners as $index => $listener) {\n if ($eventManager->detach($listener)) {\n unset($this->listeners[$index]);\n }\n }\n }", "public function detach(EventManagerInterface $events)\n {\n foreach ($this->listeners as $i => $listener) {\n if ($events->getSharedManager()->detach(MainProcessor::EVENT_MANAGER_ID, $listener)) {\n unset($this->listeners[$i]);\n }\n }\n }", "public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }", "public static function clearCache()\n {\n static::$eventMap = [];\n \\Cache::forget(static::EVENT_CACHE_KEY);\n }", "public function removeParseListeners(): void\n {\n $this->parseListeners = [];\n }", "public function unsetEventTypes(): void\n {\n $this->eventTypes = [];\n }", "function removeListener(EventListener $listener): bool;", "public function onRemove();", "public function removeListener($name, $listener);", "public function forgetPushed()\n {\n foreach ($this->listeners as $key => $value) {\n if (Str::endsWith($key, '_pushed')) {\n $this->forget($key);\n }\n }\n }", "public function erase_history()\n {\n $this->_event_history = [];\n }", "public function removeListener($event, $hash)\n\t{\n\t\tif (isset(static::$events[$event][$hash])) {\n\t\t\tunset(static::$events[$event][$hash]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function off($name)\n {\n foreach ($this->events as $key => $events) {\n if (preg_match(\"/^$name$|$name\\.)/\", $key)) {\n unset($this->events[$key]);\n }\n }\n }", "public function getListeners($event): array;", "public function getListenersForEvent($event): iterable;", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function removeAll() {}", "public function unregister()\n {\n $previousHandlers = $this->previousHandlers;\n\n foreach ($previousHandlers as $signal => $handler) {\n if (is_null($handler)) {\n pcntl_signal($signal, SIG_DFL);\n\n unset($previousHandlers[$signal]);\n }\n }\n\n $this->setHandlers($previousHandlers);\n }", "public function detachShared(SharedEventManagerInterface $events)\n\t\t{\n\t\t\tforeach ($this->listeners as $index => $listener) {\n\t\t\t if ($events->detach($index, $listener)) {\n\t\t\t\t unset($this->listeners[$index]);\n\t\t\t }\n\t\t }\n\t\t}", "public function postEventDel();", "public function stopListeningForEvents()\n\t\t{\n\n\t\t\t// Initialize the crontab manager if this has not been done before\n\t\t\tif(is_null($this->CronManager)) $this->CronManager = new ssh2_crontab_manager();\n\n\t\t\t// Stop cronjob to call $this-->captureSongHistory()\n\t\t\t$this->CronManager->remove_cronjob(\"checkTimeEventExecutionNeeds\");\n\n\t\t\t// Write status to the config\n\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] = \"disabled\";\n\t\t\t$this->writeConfFile($this->data['config'], true);\n\n\t\t}", "public function testRemoveListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n $callback = function () use (&$listenerCalled) {\n $listenerCalled = true;\n };\n\n // Act\n $communicator->addListener($callback);\n $communicator->removeListener($callback);\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertFalse($listenerCalled);\n }", "public function getListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events))\n\t\t\treturn static::$events[$event];\n\t\treturn static::$events;\n\t}", "public function clearRecordedEvents()\n {\n $this->events = [];\n }", "public function detach(EventManagerInterface $events)\n {\n $sharedManager = $events->getSharedManager();\n\n foreach ($this->listeners as $index => $listeners) {\n if ($listeners === $this) {\n continue;\n }\n\n if ($listeners instanceof ListenerAggregateInterface) {\n $listeners->detach($events);\n }\n\n $events->detach($listeners);\n }\n\n /** @var array $sharedListeners */\n foreach ($this->sharedListeners as $id => $sharedListeners) {\n foreach ($sharedListeners as $index => $listener) {\n if ($listener === $this) {\n continue;\n }\n\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->detach($events);\n }\n\n $sharedManager->detach($listener, $id);\n }\n }\n }", "public function deleteEvent($event)\n {\n $this->entityManager->remove($event);\n $this->entityManager->flush();\n }", "public function __destruct()\n\t{\n\t\tif (static::$instance != NULL)\n\t\t\tstatic::$instance = NULL;\n\t\tforeach (static::$events as $event => $events)\n\t\t\tstatic::$events[$event] = [];\n\t}", "public function removeParseListener(ParseTreeListener $listener): void\n {\n $index = \\array_search($listener, $this->parseListeners, true);\n\n if ($index !== false) {\n unset($this->parseListeners[$index]);\n }\n }", "public function remSubscriber(IEventSubscriber $Subscriber)\n {\n // Loop through each subscriver event\n foreach ($Subscriber->getSubscribedEvents() as $EventName => $Params) {\n\n // Params is array[]|Traversable[]\n if (is_array($Params) && is_array($Params[0]) ?: $Params[0] instanceof Traversable) {\n\n // Deregister each method\n foreach ($Params as $NewParams) {\n $this->deregister(\n $EventName,\n array(\n $Subscriber,\n $NewParams[0]\n )\n );\n }\n\n // Otherwise, Deregester method\n } else {\n $this->deregister(\n $EventName,\n array(\n $Subscriber,\n is_string($Params) ? $Params : $Params[0]\n )\n );\n }\n }\n }", "public function removeAll(): void;", "public function remove_event_handler($modulename, $eventname)\n\t{\n\t\tCmsEvents::remove_event_handler($modulename, $eventname, false, $this->get_name());\n\t}", "static public function removeEventListener($eventName, $listener) {\n if (TRUE !== $eventName) {\n foreach(self::$listeners[$eventName] as $key=>$item) {\n if ($item == $listener) {\n unset(self::$listeners[$eventName][$key]);\n return true;\n }\n }\n return false;\n }\n foreach(self::$listeners as $il=>$list) {\n foreach($list as $ii=>$item) {\n if ($item == $listener) {\n unset(self::$listeners[$il][$ii]);\n return true;\n }\n }\n }\n return false;\n }", "public function detachAll(string $event_name):bool{\r\n $this->storage[$event_name]=[];\r\n return true;\r\n }", "public function removeAll();", "public function removeAll();", "public function detach(): void\n\t{\n\t\t$this->events->detach($this->type, $this->hook);\n\t}", "public function unregister($event=null)\n {\n if(!empty($event) && $event != '*')\n $this->_handlers[$event] = array();\n else\n $this->_handlers = array();\n\n return $this;\n }", "protected function removeListenerPattern(string $eventPattern, $listener)\n {\n if (! isset($this->patterns[$eventPattern])) {\n return;\n }\n\n foreach ($this->patterns[$eventPattern] as $key => $pattern) {\n if ($listener == $pattern->getListener()) {\n $pattern->unbind($this);\n unset($this->patterns[$eventPattern][$key]);\n }\n }\n }", "function ibase_free_event_handler($event): void\n{\n error_clear_last();\n $safeResult = \\ibase_free_event_handler($event);\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "public function detachShared(SharedEventManagerInterface $events)\n {\n foreach ($this->listeners as $index => $callback) {\n if ($events->detach('', $callback)) {\n unset($this->listeners[$index]);\n }\n }\n }" ]
[ "0.82597315", "0.78852576", "0.7719297", "0.76829684", "0.69750047", "0.6855162", "0.68347436", "0.67883277", "0.6773675", "0.6676002", "0.66236216", "0.6580093", "0.6551063", "0.6530608", "0.63629335", "0.6351797", "0.62478554", "0.62150097", "0.62150097", "0.618218", "0.61738455", "0.61544615", "0.613695", "0.61160046", "0.6076512", "0.6061477", "0.60445976", "0.6041111", "0.6040529", "0.6040529", "0.6031959", "0.59687865", "0.5954241", "0.59372044", "0.5935217", "0.58835655", "0.5877174", "0.5849841", "0.5842965", "0.583183", "0.5830437", "0.578935", "0.5779085", "0.5772035", "0.57696575", "0.57696575", "0.57696575", "0.57696575", "0.5734566", "0.572181", "0.57215476", "0.5696405", "0.5692915", "0.5690673", "0.5678798", "0.5677977", "0.5668408", "0.5659832", "0.565132", "0.565132", "0.5636559", "0.562249", "0.5597131", "0.5590781", "0.558211", "0.5536855", "0.5528951", "0.5528211", "0.5525371", "0.5520134", "0.5498088", "0.54971445", "0.54971445", "0.54971445", "0.54971445", "0.54964197", "0.54964197", "0.54857665", "0.5483026", "0.5452942", "0.5451565", "0.5438655", "0.5436868", "0.5425494", "0.5419762", "0.5415265", "0.5401759", "0.53936064", "0.5384251", "0.5377242", "0.53612226", "0.5360154", "0.5351962", "0.53492415", "0.53492415", "0.53492177", "0.5348148", "0.5340141", "0.533028", "0.5320362" ]
0.661895
11
Restrict Omniva Shipping methods if cart products has restricted categories
public static function restrict_shipping_methods_by_cats($rates) { global $woocommerce; $configs = OmnivaLt_Core::get_configs(); $settings = get_option($configs['plugin']['settings_key']); $cart_categories_ids = array(); foreach( $woocommerce->cart->get_cart() as $cart_item ) { $cats = get_the_terms($cart_item['product_id'], 'product_cat'); if ( empty($cats) ) { continue; } foreach ( $cats as $cat ) { $cart_categories_ids[] = $cat->term_id; if ( $cat->parent != 0 ) { $cart_categories_ids[] = $cat->parent; } } } $cart_categories_ids = array_unique($cart_categories_ids); $restricted_categories = $settings['restricted_categories']; if ( ! is_array($restricted_categories) ) { $restricted_categories = array($restricted_categories); } foreach ( $cart_categories_ids as $cart_product_categories_id ) { if ( in_array($cart_product_categories_id, $restricted_categories) ) { foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) { if ( ! $ship_method_values['is_shipping_method'] ) continue; unset($rates['omnivalt_' . $ship_method_values['key']]); } break; } } return $rates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validate_product_categories() {\n\t\tif ( sizeof( $this->product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\t// If we find an item with a cat in our allowed cat list, the coupon is valid\n\t\t\t\t\tif ( sizeof( array_intersect( $product_cats, $this->product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('catalog/categories');\n }", "private function validate_excluded_product_categories() {\n\t\tif ( sizeof( $this->exclude_product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = false;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\t// If we find an item with a cat NOT in our disallowed cat list, the coupon is valid\n\t\t\t\t\tif ( empty( $product_cats ) || sizeof( array_diff( $product_cats, $this->exclude_product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_APPLICABLE );\n\t\t\t}\n\t\t}\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "private function validate_cart_excluded_product_categories() {\n\t\tif ( sizeof( $this->exclude_product_categories ) > 0 ) {\n\t\t\t$valid_for_cart = true;\n\t\t\tif ( ! WC()->cart->is_empty() ) {\n\t\t\t\tforeach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\n\t\t\t\t\t$product_cats = wc_get_product_cat_ids( $cart_item['product_id'] );\n\n\t\t\t\t\tif ( sizeof( array_intersect( $product_cats, $this->exclude_product_categories ) ) > 0 ) {\n\t\t\t\t\t\t$valid_for_cart = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! $valid_for_cart ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_EXCLUDED_CATEGORIES );\n\t\t\t}\n\t\t}\n\t}", "protected function restrict() {\n $this->restrict_to_permission('manage_products');\n }", "public function getActiveCartProducts();", "public function getProductCategoriesForASIN($request);", "protected function _applyProductLimitations()\n {\n Mage::dispatchEvent('catalog_product_collection_apply_limitations_before', array(\n 'collection' => $this,\n 'category_id' => isset($this->_productLimitationFilters['category_id']) ?\n $this->_productLimitationFilters['category_id'] : null,\n ));\n $this->_prepareProductLimitationFilters();\n $this->_productLimitationJoinWebsite();\n $this->_productLimitationJoinPrice();\n $filters = $this->_productLimitationFilters;\n\n if (!isset($filters['category_id']) && !isset($filters['visibility'])) {\n return $this;\n }\n\n $conditions = array(\n 'cat_index.product_id=e.entity_id',\n $this->getConnection()->quoteInto('cat_index.store_id=?', $filters['store_id'])\n );\n if (isset($filters['visibility']) && !isset($filters['store_table'])) {\n $conditions[] = $this->getConnection()\n ->quoteInto('cat_index.visibility IN(?)', $filters['visibility']);\n }\n\n if (!$this->getFlag('disable_root_category_filter')) {\n if (is_array($filters['category_id'])) {\n $categoryIdConditions = array();\n foreach ($filters['category_id'] as $categoryId) {\n $categoryIdConditions[] = $this->getConnection()->quoteInto('cat_index.category_id = ?',\n $categoryId);\n }\n $conditions[] = '(' . join(' OR ', $categoryIdConditions) . ')';\n } else {\n $conditions[] = $this->getConnection()->quoteInto('cat_index.category_id = ?', $filters['category_id']);\n }\n }\n\n if (isset($filters['category_is_anchor'])) {\n $conditions[] = $this->getConnection()\n ->quoteInto('cat_index.is_parent=?', $filters['category_is_anchor']);\n }\n\n $joinCond = join(' AND ', $conditions);\n $fromPart = $this->getSelect()->getPart(Zend_Db_Select::FROM);\n if (isset($fromPart['cat_index'])) {\n $fromPart['cat_index']['joinCondition'] = $joinCond;\n $this->getSelect()->setPart(Zend_Db_Select::FROM, $fromPart);\n } else {\n $this->getSelect()->join(\n array('cat_index' => $this->getTable('catalog/category_product_index')),\n $joinCond,\n array('cat_index_position' => 'position')\n );\n }\n\n $this->_productLimitationJoinStore();\n\n Mage::dispatchEvent('catalog_product_collection_apply_limitations_after', array(\n 'collection' => $this\n ));\n\n return $this;\n }", "function other_product_catalog($cid, $cpath, $COLLAPSABLE) {\n global $categories_string3, $languages_id, $level, $categories;\n\n $selectedPath = array();\n // Get all of the categories on this level\n\n\n /* Added for Discount pharmacy hide and show on 2nd feb 2012 */\n $category_query_raw = \"\";\n\n if(isset($_SESSION['customer_id']) && !empty($_SESSION['customer_id'])) {\t\n \n\t\t$customer_group_id = tep_get_customers_access_group($_SESSION['customer_id']);\t\n\t \n\t //$customer_group_id = array(\"G\",\"0\");\n\t\t\n } else {\n \n\t\t$customer_group_id = array(\"G\",\"0\");\n\t\t\n }\n \n $category_query_raw .= tep_get_access_sql('c.products_group_access', $customer_group_id);\n\n/* Added for Discount pharmacy hide and show on 2nd feb 2012 /end */\n\n \n \n /* Default Modified for Discount pharmacy hide and show on 2nd feb 2012 */\n\n /*if(!$_SESSION['sppc_customer_group_id']) {\n $customer_group_id = 'G';\n } else {\n $customer_group_id = $sppc_customer_group_id;\n }*/\n \n /* Default Modified for Discount pharmacy hide and show on 2nd feb 2012 */\n\n \n \n $categories_query = tep_db_query(\"SELECT c.categories_id, cd.categories_name, c.parent_id \n from \" . TABLE_CATEGORIES . \" c,\n \" . TABLE_CATEGORIES_DESCRIPTION . \" cd \n WHERE c.parent_id = '25' \n and c.categories_id = cd.categories_id \n and cd.language_id='\" . $languages_id .\"' \n $category_query_raw order by sort_order, cd.categories_name\");\n \n while ($categories = tep_db_fetch_array($categories_query)) {\n if ($categories[$level]['parent_id'] == \"\") { $categories[$level]['parent_id'] = 0; }\n $categories[$level]['categories_id'] = $categories[$level]['parent_id'] + 1;\n // Add category link to $categories_string3\n for ($a=1; $a < $level[$categories]['categories_id']; $a++) {\n $categories_string3 .= \"&nbsp;&nbsp;\";\n }\n\t\n $categories_string3 .= '<li><a href=\"';\n $cPath_new = $cpath;\n if ($categories[$level]['parent_id'] > 0) {\n $cPath_new .= \"_\";\n }\n $cPath_new .= $categories['categories_id'];\n // added for CDS CDpath support\n $CDpath = (isset($_SESSION['CDpath'])) ? '&CDpath=' . $_SESSION['CDpath'] : ''; \n $cPath_new_text = \"cPath=\" . $cPath_new . $CDpath;\n $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);\n $categories_string3 .= '\">';\n if ($_GET['cPath']) {\n $selectedPath = split(\"_\", $_GET['cPath']);\n }\n if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '<b>'; }\n //if ($categories[$level]['categories_id'] == 1) { $categories_string3 .= '<u>'; }\n $categories_string3 .= tep_db_output($categories['categories_name']);\n if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) { $categories_string3 .= ' ->'; }\n //if ($categories[$level]['categories_id'] == 1) { $categories_string3 .= '</u>'; }\n if (in_array($categories['categories_id'], $selectedPath)) { $categories_string3 .= '</b>'; }\n $categories_string3 .= '</a></li>';\n \n \n // If I have subcategories, get them and show them\n if (tep_has_category_subcategories($categories['categories_id'])) {\n if ($COLLAPSABLE) {\n if (in_array($categories['categories_id'], $selectedPath)) {\n other_product_catalog($categories['categories_id'], $cPath_new, $COLLAPSABLE);\n }\n } else { \n other_product_catalog($categories['categories_id'], $cPath_new, $COLLAPSABLE); \n }\n }\n\t\n }\n \n}", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function getProductCategoriesForSKU($request);", "public function validateCatalogProductReview()\n {\n $reviewStores = $this->_objectManager->create(\n \\Magento\\Review\\Model\\Review::class\n )->load(\n $this->_request->getParam('id')\n )->getStores();\n\n $storeIds = $this->_role->getStoreIds();\n\n $allowedIds = array_intersect($reviewStores, $storeIds);\n if (empty($allowedIds)) {\n $this->_redirect();\n }\n }", "public static function restrict_shipping_methods_by_shipclass($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_classes_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class');\n if ( empty($shipping_classes) ) {\n continue;\n }\n foreach ( $shipping_classes as $class ) {\n $cart_classes_ids[] = $class->term_id;\n }\n }\n $cart_classes_ids = array_unique($cart_classes_ids);\n\n $restricted_shipclass = $settings['restricted_shipclass'] ?? array();\n if ( ! is_array($restricted_shipclass) ) {\n $restricted_shipclass = array($restricted_shipclass);\n }\n\n foreach ( $cart_classes_ids as $cart_product_class_id ) {\n if ( in_array($cart_product_class_id, $restricted_shipclass) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "function droit_gestion_categories()\r\n{\r\n\tif($_SESSION[\"espace\"][\"droit_acces\"]==2 || ($_SESSION[\"user\"][\"id_utilisateur\"]>0 && option_module(\"ajout_categorie_admin\")!=true))\r\n\t\treturn true;\r\n}", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "function similarProducts() {\n $filter = Yii::$app->session->get('filterOption');\n }", "public function categories(Request $request)\n {\n $idsCategories = [];\n if (isset($request['categories'])) {\n foreach ($request['categories'] as $idCategory) {\n if ((int) $idCategory != 0) {\n $idsCategories[] = (int) $idCategory;\n }\n }\n }\n $marketId = '0';\n if (isset($request['marketid'])) {\n $marketId = $request['marketid'];\n }\n $promo = '0';\n if (isset($request['promo'])) {\n $promo = $request['promo'];\n }\n try {\n if (count($idsCategories) != 0) {\n $request['categories'] = ['0'];\n }\n $this->productRepository->pushCriteria(new RequestCriteria($request));\n $this->productRepository->pushCriteria(new LimitOffsetCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfFieldsCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfCategoriesCriteria($request));\n\n $products = $this->productRepository->all();\n } catch (RepositoryException $e) {\n return $this->sendError($e->getMessage());\n }\n\n // return $this->sendResponse($products->toArray(), 'Products retrieved successfully');\n $productsFinal = [];\n\n $productsArray = $products->toArray();\n if (!isset($request['no_filter'])) {\n if ($promo) {\n return $this->sendResponse($productsArray, 'Promos enviados');\n } else {\n\n if (count($idsCategories) > 0) {\n $idMarket = $marketId;\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->whereIn('category_id', $idsCategories)->pluck('active', 'category_id');\n $idsProducts = DB::table('products')->where('market_id', '=', $idMarket)->get(['featured', 'id'])->toArray();\n $algo = [];\n foreach ($idsProducts as $idP) {\n if ($idP->featured) {\n $algo[] = $idP->id;\n }\n }\n $datosProductosRaw = DB::table('product_categories')->whereIn('category_id', $idsCategories)->whereIn('product_id', $algo)->where('active', '1')->get();\n $idsProducts = [];\n foreach ($datosProductosRaw as $idPR) {\n if ($idPR->active) {\n $idsProducts[] = $idPR->product_id;\n }\n }\n $productsFilter = $this->productRepository->whereIn('id', $idsProducts)->get();\n $productsFinal = $productsFilter;\n } else if (count($productsArray) != 0) {\n\n $idMarket = $productsArray[0]['market_id'];\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->pluck('active', 'category_id');\n $idsCategory = [];\n foreach ($valueActiveCategory as $categoryID => $id) {\n $idsCategory[] = $categoryID;\n }\n $productsTmp = [];\n foreach ($productsArray as $product) {\n $valueActiveProduct = DB::table('product_categories')->whereIn('category_id', $idsCategory)->where('product_id', '=', $product['id'])->pluck('active');\n foreach ($valueActiveProduct as $value) {\n if ($value) {\n $productsTmp[] = $product;\n }\n }\n }\n\n $productsFinal = $productsTmp;\n }\n }\n } else {\n $productsFinal = $productsArray;\n }\n\n return $this->sendResponse($productsFinal, 'Productos filtrados enviados');\n }", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->set('group', 'compounds');\n //$this->Auth->deny('addCompound', 'editCompound'); //deny access from addCompound and editCompound by default\n }", "public function isAllowInCart() {\n return !$this->isEnabled();\n }", "public function getCartable();", "public function addRemoveProducts() {\n\n //date calculation \n $email_content = array();\n $current_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time()));\n $yesterday_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time() - 60 * 60 * 24));\n\n\n //case 1 \n if (Mage::getStoreConfig('sale_category/general/t_shirt_of_day_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/t_shirt_of_day');\n $attr_name = 'special_to_date';\n $email_content['shirt']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'special_from_date';\n $email_content['shirt']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 2 \n if (Mage::getStoreConfig('sale_category/general/after_hour_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/after_hour');\n $attr_name = 'afterhours_to_date';\n $email_content['after_hour']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'afterhours_from_date';\n $email_content['after_hour']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 3 \n if (Mage::getStoreConfig('sale_category/general/gallery_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/gallery');\n $attr_name = 'gallery_to_date';\n $email_content['gallery']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'gallery_from_date';\n $email_content['gallery']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n if (Mage::getStoreConfig('sale_category/general/offer_mail')) {\n $newContent = \"Hi,<br/> These are the products Added or Removed through Auto Sale Extension\";\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n $headers .= 'From: <' . Mage::getStoreConfig('general/store_information/name') . '@magento.com>';\n \n $newContent .='<br/><br/><b><u>T-Shirt of the day </u></b><br/>Added Products';\n foreach ($email_content['shirt']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['shirt']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>After Hour </u></b><br/>Added Products';\n foreach ($email_content['after_hour']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['after_hour']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>Gallery </u></b><br/>Added Products';\n foreach ($email_content['gallery']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['gallery']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n\n $newContent .='<br/><br/> Thanks....<br/>';\n mail(Mage::getStoreConfig('trans_email/ident_general/email'), \"Product Added/Removed By Auto Sale Extension\", $newContent, $headers);\n }\n\n //mage::log($email_content);\n }", "public function hasActiveCart();", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function validateCatalogProductAttributeActions()\n {\n if (!$this->_role->getIsAll()) {\n $this->_forward();\n return false;\n }\n return true;\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "private function product() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "public function index(Request $request)\n {\n $products = $this->cartRepo->getCartItems();\n\n // if(!auth()->check())\n // {\n // return redirect()->route('login')->with(['error' => 'Login / Register in order to checkout']);\n // }\n\n $customer = $request->user();\n\n $courier = $this->courierRepo->findCourierById(request()->session()->get('courierId', 1));\n $shippingFee = $this->cartRepo->getShippingFee($courier);\n\n\n $countries = Country::get();\n //Check the if impression kit is in cart then show medical form as checkout page otherwise show simple checkout page\n $impressionKit = false;\n $aligners = false;\n\n foreach($this->cartRepo->getCartItems() as $item)\n {\n $product = Product::with(['categories'])->find($item->id);\n foreach($product->categories as $category)\n {\n if($category->label == \"IK\")\n $impressionKit = true;\n\n if($category->label == \"Aligners\")\n $aligners = true;\n }\n }\n\n $statesList = array(\"AL\"=>\"Alabama\", \"AK\"=>\"Alaska\", \"AZ\"=>\"Arizona\", \"AR\"=>\"Arkansas\", \"CA\"=>\"California\", \"CO\"=>\"Colorado\", \"CT\"=>\"Connecticut\", \"DE\"=>\"Delaware\", \"DC\"=>\"District of Columbia\", \"FL\"=>\"Florida\", \"GA\"=>\"Georgia\", \"HI\"=>\"Hawaii\", \"ID\"=>\"Idaho\", \"IL\"=>\"Illinois\", \"IN\"=>\"Indiana\", \"IA\"=>\"Iowa\", \"KS\"=>\"Kansas\", \"KY\"=>\"Kentucky\", \"LA\"=>\"Louisiana\", \"ME\"=>\"Maine\", \"MD\"=>\"Maryland\", \"MA\"=>\"Massachusetts\", \"MI\"=>\"Michigan\", \"MN\"=>\"Minnesota\", \"MS\"=>\"Mississippi\", \"MO\"=>\"Missouri\", \"MT\"=>\"Montana\", \"NE\"=>\"Nebraska\", \"NV\"=>\"Nevada\", \"NH\"=>\"New Hampshire\", \"NJ\"=>\"New Jersey\", \"NM\"=>\"New Mexico\", \"NY\"=>\"New York\", \"NC\"=>\"North Carolina\", \"ND\"=>\"North Dakota\", \"OH\"=>\"Ohio\", \"OK\"=>\"Oklahoma\", \"OR\"=>\"Oregon\", \"PA\"=>\"Pennsylvania\", \"RI\"=>\"Rhode Island\", \"SC\"=>\"South Carolina\", \"SD\"=>\"South Dakota\", \"TN\"=>\"Tennessee\", \"TX\"=>\"Texas\", \"UT\"=>\"Utah\", \"VT\"=>\"Vermont\", \"VA\"=>\"Virginia\", \"WA\"=>\"Washington\", \"WV\"=>\"West Virginia\", \"WI\"=>\"Wisconsin\",\"WY\"=>\"Wyoming\");\n\n\n // if($impressionKit)\n // $view = 'front.checkout';\n // else\n $view = 'front.checkout.checkout2-update';\n\n return view($view, [\n 'customer' => $customer ?: null,\n 'billingAddress' => '',\n 'address' => $customer ? $customer->addresses()->first() : null,\n 'products' => $this->cartRepo->getCartItems(),\n 'subtotal' => $this->cartRepo->getSubTotal(),\n 'tax' => $this->cartRepo->getTax(),\n 'total' => $this->cartRepo->getSubTotal(),\n 'cartItems' => $this->cartRepo->getCartItemsTransformed(),\n 'shippingFee' => $shippingFee,\n 'countries' => $countries,\n 'aligners' => $aligners,\n 'statesList' => $statesList,\n ]);\n }", "public function validateCatalogProduct()\n {\n if (!$this->validateNoWebsiteGeneric([self::ACTION_NEW, self::ACTION_DELETE, self::ACTION_DUPLICATE])) {\n return;\n }\n }", "public function hiding_restricted_products() {\n\n\t\tif ( null === $this->hiding_restricted_products ) {\n\n\t\t\t$this->hiding_restricted_products = 'yes' === get_option( $this->hide_restricted_products_option );\n\t\t}\n\n\t\treturn $this->hiding_restricted_products;\n\t}", "public function getShippingCategoryId();", "public function validateCatalogProductMassActions()\n {\n if ($this->_role->getIsAll()) {\n return;\n }\n\n $store = $this->_storeManager->getStore(\n $this->_request->getParam('store', \\Magento\\Store\\Model\\Store::DEFAULT_STORE_ID)\n );\n if (!$this->_role->hasStoreAccess($store->getId())) {\n $this->_forward();\n }\n }", "private function validate_cart_excluded_items() {\n\t\tif ( ! $this->is_type( wc_get_product_coupon_types() ) ) {\n\t\t\t$this->validate_cart_excluded_product_ids();\n\t\t\t$this->validate_cart_excluded_product_categories();\n\t\t\t$this->validate_cart_excluded_sale_items();\n\t\t}\n\t}", "protected function _isAllowed()\n\t{\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');\n\t}", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\t$this->Auth->allow('view', 'shopfront', 'frontpage');\n\t\n\t\tif ($this->request->action == 'admin_toggle' ||\n\t\t $this->request->action == 'admin_menu_action') {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t\t\n\t}", "function thrive_dashboard_get_no_license_products()\n{\n\n $products = array();\n\n $products = apply_filters('thrive_dashboard_no_license_products', $products);\n\n return $products;\n}", "function VariationOrProductIsInCart() {\r\n\t\treturn ($this->owner->IsInCart() || $this->VariationIsInCart());\r\n\t}", "function limitOrders($vars) {\n if ($_SESSION['uid']) {\n $otherServicesCount = Capsule::table('tblhosting')\n ->join('tblproducts', 'tblhosting.packageid', '=', 'tblproducts.id')\n ->where('tblproducts.servertype', '=', 'fleio')\n ->where('tblhosting.userid', '=', $_SESSION['uid'])\n ->count();\n if ($otherServicesCount > 0) {\n global $errormessage;\n $errormessage = \"<li>Cloud products are limited to one per customer. Contact support if you need help.</li>\";\n }\n }\n}", "function fn_wishlist_get_carts(&$type_restrictions)\n{\n if (is_array($type_restrictions)) {\n $type_restrictions[] = 'W';\n }\n}", "public function filterProducts(Request $request)\n {\n $AddedProdsArr = array();\n if (Auth::guest()) {\n $ParentProdsArr = $this->getParentHireProduct();\n $AllAvailProdsArr = array();\n session()->put('defaultFilterArr', $request->filterArr);\n $defaultFilterArr = session()->get('defaultFilterArr');\n $servicingDays = Config::get('constants.stateServicingDays');\n $extendedDays = $servicingDays[session()->get('states')];\n if(isset($_COOKIE['order_reference_id'])){\n $AddedProdsArr = $this->preOrderProdMapDetails($_COOKIE['order_reference_id']);\n }\n if (!empty($ParentProdsArr)) {\n foreach ($ParentProdsArr as $Parentprod) {\n $AvailProdArr = $this->getAvailChildProds($Parentprod->id, $request->fromDate, $request->toDate, $extendedDays, $defaultFilterArr,$AddedProdsArr,$request->attribOptId);\n\n if (!empty($AvailProdArr)) {\n $ParentProdDetailArr['parent-prod-id'] = $Parentprod->id;\n $ParentProdDetailArr['parent-prod-name'] = $Parentprod->name;\n $ParentProdDetailArr['parent-prod-description'] = $Parentprod->description;\n $ParentProdDetailArr['parent-prod-feat_img'] = $Parentprod->feat_img;\n $ParentProdDetailArr['parent-prod-sku'] = $Parentprod->sku;\n $ParentProdDetailArr['parent-prod-quantity'] = count($AvailProdArr);\n $ParentProdDetailArr['parent-prod-price'] = $Parentprod->price;\n $ParentProdDetailArr['parent-prod-category'] = $Parentprod->category;\n $ParentProdDetailArr['parent-prod-product_type'] = $Parentprod->product_type;\n $ParentProdDetailArr['parent-prod-is_upsell_product'] = $Parentprod->is_upsell_product;\n $ParentProdDetailArr['parent-prod-sale'] = $Parentprod->sale;\n $ParentProdDetailArr['parent-prod-sale_price '] = $Parentprod->sale_price;\n $ParentProdDetailArr['parent-prod-rent'] = $Parentprod->rent;\n $ParentProdDetailArr['parent-prod-rent_price'] = $Parentprod->rent_price;\n $ParentProdDetailArr['parent-prod-prod_video'] = $Parentprod->prod_video;\n $ParentProdDetailArr['parent-prod-attrib-handicap'] = $AvailProdArr[0]->handicap;\n array_push($AvailProdArr, $ParentProdDetailArr);\n array_push($AllAvailProdsArr, $AvailProdArr);\n }\n\n }\n }\n\n return $AllAvailProdsArr;\n } else {\n return redirect('/dashboard');\n }\n }", "function beforeFilter() {\n\t\tparent::beforeFilter(); //Use the beforeFilter in the app_controller\n\t\t$restrictedActions = array(\"view\", \"book\", \"purchase\", \"confirmation\", \"deal_details\");\n\t\tif(in_array($this->action, $restrictedActions)) {\n\t\t\tif(!$this->Session->read('Auth.User') || $this->Session->read('Auth.User.role_id') == Configure::Read('Role.Traveler_ID')) { \n\t\t\t\t//User is either not logged in or a traveler\n\t\t\t\t$dealId = $this->params['pass'][0];\n\t\t\t\t$dealToAccess = $this->Deal->read(null, $dealId);\n\t\t\t\t//If deal is not live, don't allow access\n\t\t\t\tif(($dealToAccess['Deal']['deal_status_id'] == Configure::Read('Deal.Status_Listed')) || ($dealToAccess['Deal']['deal_status_id'] == Configure::Read('Deal.Status_Closed'))) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->Session->setFlash(__('Sorry, that page is unavailable.', true),'error_flash');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($this->Session->read('Auth.User.role_id') == Configure::Read('Role.Merchant_ID')) {\n\t\t\t\t//User is a merchant\n\t\t\t\t$dealId = $this->params['pass'][0];\n\t\t\t\t$dealToAccess = $this->Deal->read(null, $dealId);\n\t\t\t\t$dealOwner = $this->Deal->getDealsMerchant($dealId);\n\t\t\t\t//If deal is not live and merchant does not own or if deal status is initiated, don't allow access.\n\t\t\t\tif(($dealToAccess['Deal']['deal_status_id'] != Configure::Read('Deal.Status_Listed') \n\t\t\t\t\t&& $dealOwner['Merchant']['id'] != $this->Session->read('Merchant.id')) \n\t\t\t\t\t|| $dealToAccess['Deal']['deal_status_id'] == Configure::Read('Deal.Status_Initiated')){\n\t\t\t\t\t\n\t\t\t\t\t$this->Session->setFlash(__('Sorry, that page is unavailable.', true),'error_flash');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\t}", "public function manageOrderProducts()\n {\n }", "function is_carton() {\n\treturn ( is_shop() || is_product_category() || is_product_tag() || is_product() ) ? true : false;\n}", "protected abstract function isSingleProduct();", "public function fixVisibleButWithoutCategoryAndInConfigurable()\n {\n $visibilityAttribute = $this->eavConfig->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'visibility');\n $select = $this->_getWriteAdapter()->select();\n $select->join(['data_index' => $this->getMainTable()], 'data_index.entity_id = attribute.entity_id', []);\n $select->where('attribute.attribute_id = ?', $visibilityAttribute->getId());\n $select->where('data_index.is_in_configurable = ?', 1);\n $select->where('data_index.is_in_category = ?', 0);\n $select->where('data_index.visibility <> ?', Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);\n $select->columns([\n 'value' => new Zend_Db_Expr(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)\n ]);\n $this->_getWriteAdapter()->query($select->crossUpdateFromSelect(\n ['attribute' => $visibilityAttribute->getBackendTable()]\n ));\n\n Mage::getSingleton('index/indexer')\n ->getProcessByCode('catalog_category_product')\n ->reindexAll();\n \n Mage::getSingleton('index/indexer')\n ->getProcessByCode('catalog_product_flat')\n ->reindexAll();\n }", "public function isAssignedToCategory()\n {\n $_currentProduct = $this->getProduct();\n $_categoryIds = $_currentProduct->getCategoryIds();\n if($_categoryIds) {\n return true;\n } else {\n return false;\n }\n }", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function checkavailAction() {\r\n\r\n /**\r\n * Retrives the @param string $url This param contains product URL\r\n */\r\n $url = $this->getRequest()->getParam('product_url');\r\n if ($url) {\r\n $ex_url = explode(\"/\", $url);\r\n $count = count($ex_url) - 4;\r\n $id = $ex_url[$count];\r\n\r\n /**\r\n * Product Quantity as customer needs\r\n */\r\n if ($id) {\r\n $coun = count($ex_url) - 5;\r\n $id = $ex_url[$coun];\r\n }\r\n }\r\n\r\n /**\r\n * Retrive the @param integer $product product id from the cart URL\r\n */\r\n $produtId = $this->getRequest()->getParam('product');\r\n if ($produtId) {\r\n $id = $produtId;\r\n }\r\n\r\n /**\r\n * Product Quantity as customer needs\r\n */\r\n $qtyid = $this->getRequest()->getParam('qty');\r\n if ($qtyid) {\r\n $qty = $qtyid;\r\n }\r\n\r\n /**\r\n * When i clicks the add to cart button in whishlist page\r\n * \r\n * @param string $whishlisturl Description\r\n */\r\n $wishlistUrl = $this->getRequest()->getParam('wishlist_url');\r\n if ($wishlistUrl) {\r\n $ex_url = explode(\"/\", $wishlistUrl);\r\n $count = count($ex_url) - 4;\r\n $id = $ex_url[$count];\r\n $wishlist = Mage::getModel('wishlist/item')->load($id);\r\n $wishlitProdId = $wishlist->product_id;\r\n\r\n /**\r\n * Product Quantity as customer needs in whishlist section\r\n */\r\n $coun = count($ex_url) - 1;\r\n $q_ex = explode(\"=\", $ex_url[$coun]);\r\n $qty = $q_ex[1];\r\n }\r\n\r\n $_product = Mage::getModel('catalog/product')->load($wishlitProdId);\r\n $stocklevel = (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();\r\n\r\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\r\n\r\n foreach ($items as $item) {\r\n if ($wishlitProdId == $item->getProductId()) {\r\n $quantity += $item->getQty();\r\n }\r\n $totalQty += $item->getQty();\r\n }\r\n $totat_used = $stocklevel - $quantity;\r\n\r\n /**\r\n * Check if the quanity level is reached to stcklevel\r\n */\r\n if ($_product->getId()) {\r\n if (empty($totat_used)) {\r\n $message = 'The requested quantity for \"' . $_product->getName() . '\" is not available';\r\n $success = false;\r\n }\r\n\r\n if ($qty > $totat_used) {\r\n $message = 'The requested quantity for \"' . $_product->getName() . '\" is not available';\r\n $success = false;\r\n }\r\n }\r\n $max_sale_qty = Mage::getStoreConfig('cataloginventory/item_options/max_sale_qty');\r\n $max_sale = $qty + $totalQty;\r\n if ($max_sale > $max_sale_qty) {\r\n $message = 'The maximum quantity allowed for purchase is ' . $max_sale_qty;\r\n $success = false;\r\n }\r\n\r\n /**\r\n * choose the whishlist Product custom options\r\n */\r\n if ($wishlistUrl) {\r\n $prductOpt = $_product->getHasOptions();\r\n if ($prductOpt) {\r\n $option = '1';\r\n $message = 'Please specify the product required option(s).';\r\n $success = false;\r\n $wish = $wishlistUrl;\r\n $prourl = $_product->getProductUrl() . \"?options=cart\";\r\n }\r\n }\r\n $result = array(\"success\" => $success, 'message' => $message, 'op' => $option, 'wish' => $wish, 'prourl' => $prourl);\r\n\r\n Mage::app()->getFrontController()->getResponse()->setBody(Zend_Json::encode($result));\r\n }", "public function canAddToCart($product)\n {\n return (!$product->getData('personalization_allowed') || !$product->getData('personalization_required'));\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/mfb_myflyingbox/offer');\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order');\n }", "private function checkIfExistsProducts()\n {\n if (isset($_COOKIE['cart-data'])) {\n $productCookie = htmlspecialchars($_COOKIE['cart-data']);\n $products = trim($productCookie, '|');\n $products = explode('|', $products);\n foreach ($products as $product) {\n if (!Product::find($product)) {\n $productCookie = str_replace('|' . $product . '|', '|', $productCookie);\n }\n }\n setcookie('cart-data', $productCookie, time() + (86400 * 365), \"/\");\n }\n }", "public static function checkForNearProducts() {\n $cartDeliveryPostcodeSessionKey = \\Config::get('appConstants.user_delivery_postcode_session_key');\n $landingPagePostcodeSessionKey = \\Config::get('appConstants.user_landing_postcode_session_key');\n $landingPostcode = session()->get($landingPagePostcodeSessionKey, '');\n $cartPostcode = session()->get($cartDeliveryPostcodeSessionKey, '');\n if (!empty($landingPostcode)\n || !empty($cartPostcode)\n ) {\n return true;\n }\n return false;\n }", "public function manageProducts()\r\n {\r\n $multi_submit = $this->getRequest()->getPost('multi_submit');\r\n $entityIds = $this->getRequest()->getParam('id');\r\n $delete = $this->getRequest()->getPost('multi');\r\n /**\r\n * Check if submit buttom submitted.\r\n */\r\n if ($multi_submit) {\r\n if (count($entityIds) > 0 && $delete == 'delete') {\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->deleteProduct($entityIdData);\r\n $this->getRequest()->setPost('id', null);\r\n Mage::unregister('isSecureArea');\r\n }\r\n Mage::getSingleton('core/session')->addSuccess($this->__(\"selected Products are Deleted Successfully\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n\r\n\r\n }\r\n\r\n /*----------------Disable ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'disable') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::getModel('catalog/product_status')->updateProductStatus($entityIdData, Mage::app()->getStore()->getStoreId() , Mage_Catalog_Model_Product_Status::STATUS_DISABLED);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products has been disabled Successfully.\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'disable') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n /*----------------Disable End----------------*/\r\n\r\n /*----------------Sold Out ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'soldout') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->outOfStock($entityIdData);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products status has been sold Out Successfully and Un Publish\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'soldout') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n /*--------------------- END -------------------------*/\r\n /*----------------paused ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'paused') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->pausedStock($entityIdData);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products status has been sold Out Successfully and Un Publish\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'paused') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n /*--------------------- END -------------------------*/\r\n }\r\n $filterPrice = $this->getRequest()->getParam('filter_price');\r\n $filterStatus = $this->getRequest()->getParam('filter_status');\r\n $ProductStatus = $this->getRequest()->getParam('product_status');\r\n $filterId = $this->getRequest()->getParam('filter_id');\r\n $filterName = $this->getRequest()->getParam('filter_name');\r\n $filterQuantity = $this->getRequest()->getParam('filter_quantity');\r\n $filterProductType = $this->getRequest()->getParam('filter_product_type');\r\n $cusId = Mage::getSingleton('customer/session')->getCustomer()->getId();\r\n $products = Mage::getModel('catalog/product')->getCollection();\r\n $products->addAttributeToSelect('*');\r\n $products->addAttributeToFilter('seller_id', array(\r\n 'eq' => $cusId,\r\n ));\r\n\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('name', $filterName, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('entity_id', $filterId, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('price', $filterPrice, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('status', $filterStatus, $products);\r\n $products = Mage::helper('marketplace/product')\r\n ->productFilterByAttribute('seller_product_status', $ProductStatus, $products);\r\n\r\n /**\r\n * confirming filter product type is not empty\r\n */\r\n if (!empty ($filterProductType)) {\r\n $products->addAttributeToFilter('type_id', array(\r\n 'eq' => $filterProductType,\r\n ));\r\n }\r\n /**\r\n * Check filter quantity is not equal to empty\r\n */\r\n if ($filterQuantity != '') {\r\n $products->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id',\r\n '{{table}}.stock_id=1', 'left')->addAttributeToFilter('qty', array(\r\n 'eq' => $filterQuantity,\r\n ));\r\n }\r\n\r\n $products->addAttributeToFilter('visibility', array(\r\n 'eq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,\r\n ));\r\n $products->addAttributeToSort('entity_id', 'DESC');\r\n\r\n return $products;\r\n }", "public function isProduct()\n {\n return $this -> name == config('constant.categorytype.product_id');\n }", "public function authorize()\n\t{\n\t\treturn current_user()->hasValidCoffeeShop();\n\t}", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "protected function _shouldRenderCartPage()\n {\n return !(!$this->getIsOnCatalogProductPage() && !$this->_getConfigFlag(self::VISIBLE_CART));\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "abstract function has_purchased_before();", "function bs_disable_right( $args = array() ){\n global $flag_disable_right, $current_page_base, $cPath_array;\n \n if ( in_array( $current_page_base, $args['page'] ) ) {\n $flag_disable_right = true;\n }\n\n if ( !$flag_disable_right && zen_not_null( $args['categories'] ) ){\n foreach ( $cPath_array as $category_id ) {\n if ( in_array( $category_id, $args['categories'] ) ) {\n $flag_disable_right = true;\n }\n }\n }\n\n if ( !$flag_disable_right && isset( $_GET['products_id'] ) && zen_not_null( $args['products'] ) ) {\n if ( in_array( (int) $_GET['products_id'], $args['products'] ) ) {\n $flag_disable_right = true;\n }\n }\n\n}", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "function shophead_index()\n {\n $this->layout = 'admin_layout'; \n $this->set('title','Product Items Management');\n App::Import(\"Model\",\"ProductCategory\");\n $this->ProductCategory=new ProductCategory();\n $categories_list = $this->ProductCategory->find('list', array('conditions' => array('ProductCategory.is_deleted' => 0), 'fields' => array('ProductCategory.id', 'ProductCategory.name')));\n $this->set('categories_list', $categories_list);\n\t\t$Category_join = array('table' => 'product_sub_categories', 'alias' => 'ProductSubCategory', 'type' => 'inner', 'conditions' => array('ProductItem.product_sub_category_id =ProductSubCategory.id'));\t\t\n $conditions = array('ProductItem.is_deleted' => 0);\n if (!empty($this->request->data)) {\n \n if ($this->request->data['ProductItem']['product_sub_category_id'] != \"\") {\n $conditions['ProductItem.product_sub_category_id'] = $this->request->data['ProductItem']['product_sub_category_id'];\n $this->request->params['named']['ProductItem.product_sub_category_id'] = $this->request->data['ProductItem']['product_sub_category_id'];\n }\n if ($this->request->data['ProductItem']['product_category_id'] != \"\") {\n $conditions['ProductItem.product_category_id'] = $this->request->data['ProductItem']['product_category_id'];\n $this->request->params['named']['ProductItem.product_category_id'] = $this->request->data['ProductItem']['product_category_id'];\n }\n } else {\n if (isset($this->request->params['named']['ProductItem.product_category_id']) && $this->request->params['named']['ProductItem.product_category_id'] != \"\") {\n $conditions['ProductItem.product_category_id'] = $this->request->params['named']['ProductItem.product_category_id'];\n $this->request->data['ProductItem']['product_category_id'] = $this->request->params['named']['ProductItem.product_category_id'];\n }\n if (isset($this->request->params['named']['ProductItem.product_sub_category_id']) && $this->request->params['named']['ProductItem.product_sub_category_id'] != \"\") {\n $conditions['ProductItem.product_sub_category_id'] = $this->request->params['named']['ProductItem.product_sub_category_id'];\n $this->request->data['ProductItem']['product_sub_category_id'] = $this->request->params['named']['ProductItem.product_sub_category_id'];\n }\n }\n \n $this->paginate = array(\n 'recursive' => 0,\n 'limit' => LIMIT,\n 'fields'=> array('ProductSubCategory.name as catname,ProductItem.id,ProductItem.name,ProductItem.sort_order,ProductItem.created,ProductItem.status,ProductItem.updated,ProductItem.product_sub_category_id'),\n 'conditions' => $conditions,\n 'order' => array(\n 'ProductItem.sort_order' => 'Asc'\n ),\n 'joins'=>array($Category_join)\n );\n\t\t\n\t\t\n $result = $this->paginate('ProductItem');\n\t\t//pr($result);\n $this->set('result', $result);\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_Vendors::vendors_sellers');\n }", "abstract function is_only_premium();", "protected function _beforeLoad()\n {\n if (isset($this->_productLimitationFilters['category_id']) &&\n is_array($this->_productLimitationFilters['category_id'])\n ) {\n $this->getSelect()->group('e.entity_id');\n }\n\n return parent::_beforeLoad();\n }", "public function availableCheckout()\n {\n //and disables method if it is not\n\n $country = $this->_website->getConfig('payment/mercadopago/country');\n\n if (!in_array($country, $this->available_transparent_credit_cart)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_custom/active', 0, 'websites', $this->_website->getId());\n }\n\n if (!in_array($country, $this->available_transparent_ticket)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_customticket/active', 0, 'websites', $this->_website->getId());\n }\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('drugento_countryorder/country');\n }", "public function authorize()\n { \n $this->shop = Auth::user()->shop;\n\n if($this->method() == 'PUT' || $this->method() == 'PATCH') {\n $product = Product::findorFail($this->route('product'));\n\n return $product->shop_id == $this->shop->id;\n }\n\n return true;\n }", "function ShowCatalogo(){\n $productos = $this->model->GetInventario(); \n if($this->controller->isLogged() && $_SESSION[\"ADMIN\"]==0){ \n $this->view->ShowCatalogo($productos);\n }else{\n $this->view->ShowCatalogoNoUsuario($productos);\n }\n }", "public static function may_restrict_by_site()\n {\n return 3 == lib::create( 'business\\session' )->get_role()->tier;\n }", "public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }", "public function setNoMultiShipping(){\n $emptyCache = false;\n $db = JFactory::getDBO();\n if (JeproshopSettingModelSetting::getValue('allow_multi_shipping')){\n // Upgrading quantities\n $query = \"SELECT sum(\" . $db->quoteName('quantity') . \") AS quantity, product_id, product_attribute_id, count(*) as count FROM \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" WHERE \" . $db->quoteName('cart_id') . \" = \" . (int)$this->cart_id . \" AND \" ;\n $query .= $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \" GROUP BY product_id, product_attribute_id HAVING count > 1\";\n\n $db->setQuery($query);\n $products = $db->loadObjectList();\n\n foreach ($products as $product){\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('quantity') . \" = \" . $product->quantity;\n $query .= \"\tWHERE \" . $db->quoteName('cart_id') . \" = \".(int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id ;\n $query .= \" AND product_id = \" . $product->product_id . \" AND product_attribute_id = \" . $product->product_attribute_id;\n $db->setQuery($query);\n if ($db->query())\n $emptyCache = true;\n }\n\n // Merging multiple lines\n $query = \"DELETE cart_product_1 FROM \" . $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_1 INNER JOIN \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_2 ON ((cart_product_1.cart_id = cart_product_2.\";\n $query .= \"cart_id) AND (cart_product_1.product_id = cart_product_2.product_id) AND (cart_product_1.product_attribute_id = \";\n $query .= \"cart_product_2.product_attribute_id) AND (cart_product_1.address_delivery_id <> cart_product_2.address_delivery_id) \";\n $query .= \" AND (cart_product_1.date_add > cart_product_2.date_add) )\";\n $db->setQuery($query);\n $db->query();\n }\n\n // Update delivery address for each product line\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \") WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . (JeproshopSettingModelSetting::getValue('allow_multi_shipping') ? \" AND \" . $db->quoteName('shop_id') . \" = \" .(int)$this->shop_id : \"\");\n\n $db->setQuery($query);\n\n $cache_id = 'jeproshop_cart_set_no_multi_shipping'.(int)$this->cart_id.'_'.(int)$this->shop_id .((isset($this->address_delivery_id) && $this->address_delivery_id) ? '-'.(int)$this->address_delivery_id : '');\n if (!JeproshopCache::isStored($cache_id)){\n $db->setQuery($query);\n if ($result = (bool)$db->query())\n $emptyCache = true;\n JeproshopCache::store($cache_id, $result);\n }\n\n if (JeproshopCustomization::isFeaturePublished()){\n //Db::getInstance()->execute(\n\t\t\t$query = \" UPDATE \" . $db->quoteName('#__jeproshop_customization') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" ) WHERE \" . $db->quoteName('cart_id') . \" = \" .(int)$this->cart_id;\n\n $db->setQuery($query);\n $db->query();\n }\n if ($emptyCache){\n $this->_products = null;\n }\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->request->action == 'admin_toggle' || \n\t\t\t$this->request->action == 'admin_add_smart' ||\n\t\t\t$this->request->action == 'admin_save_condition' ) {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t}", "protected function export_categoryless_products()\n {\n $table = $this->getTableName(\"catalog_product_entity\");\n $categoryProductsTable = $this->getTableName(\"catalog_category_product\");\n $catalogProductWebsite = $this->getTableName(\"catalog_product_website\");\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $sql = \"SELECT DISTINCT(entity_id), type_id, sku FROM {$table}\n LEFT JOIN (`{$categoryProductsTable}`) ON ({$table}.`entity_id` = `{$categoryProductsTable}`.`product_id`)\n LEFT JOIN (`{$catalogProductWebsite}`) ON ({$table}.`entity_id` = `{$catalogProductWebsite}`.`product_id`)\n WHERE (`{$categoryProductsTable}`.`product_id` IS NULL OR `{$categoryProductsTable}`.`category_id` NOT IN ({$this->_getCategoriesForStore()}))\n AND {$table}.entity_type_id = {$this->_product_entity_type_id}\n AND `{$catalogProductWebsite}`.`website_id` = \" . $this->getWebsiteId($this->_fStore_id); \n \n return $this->export_products($sql, 'categoryless_products');\n }", "public function catalogProductLoadAfter(Varien_Event_Observer $observer)\n{\n // set the additional options on the product\n if(Mage::getStoreConfigFlag('mycustom_section/mycustom_group2/field1')){\n $action = Mage::app()->getFrontController()->getAction();\n if ($action->getFullActionName() == 'checkout_cart_add')\n {\n\n \n $product = $observer->getProduct();\n // Mage::log($product);\n \n$totalCredits = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCreditsOfProduct($product->getId());\n\n if($totalCredits > 0) {\n\n // if ($options = $action->getRequest()->getParam('extra_option'))\n //{\n //$product = $observer->getProduct();\n // Mage::log($product);\n\n // add to the additional options array\n $additionalOptions = array();\n if ($additionalOption = $product->getCustomOption('additional_options'))\n {\n $additionalOptions = (array) unserialize($additionalOption->getValue());\n }\n\n \n $additionalOptions[] = array(\n 'label' => \"Credits\",\n 'value' => $totalCredits,\n );\n\n \n // add the additional options array with the option code additional_options\n $observer->getProduct()\n ->addCustomOption('additional_options', serialize($additionalOptions));\n //}\n }\n }\n }\n}", "private function isProductInNotifiyList($productId) {\r\n\r\n $this->bcc = array();\r\n $mailStaus = 'NO';\r\n\r\n $collection = Mage::getModel('outofstocknotification/outofstocknotification')->getCollection()\r\n ->addFieldToFilter('product_id', $productId)\r\n ->addFieldToFilter('status', '1')\r\n ->addFieldToFilter('mailsend_status', $mailStaus);\r\n $collection->getSelect()->group(array(\"email_id\"));\r\n $isArray = $collection->getSize();\r\n if ($isArray) {\r\n foreach ($collection as $productlist) {\r\n $this->bcc[] = $productlist->getEmailId();\r\n }\r\n $this->productUrl = base64_decode($productlist['product_url']);\r\n $this->productName = $productlist['product_name'];\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n }", "public function getActiveCart();", "function check_access_to_production($current_prod) {\n \n if ((int)$_SESSION['admin_superadmin'] != 0) {\n return;\n }\n\n\n if(isset($_SESSION['admin_prodlist'])) {\n $can_access = false;\n\n /* go through each production they can access and stop\n * when the current production is found\n */\n foreach ($_SESSION['admin_prodlist'] as $prod) {\n if ($prod == $current_prod) {\n /* found it! */\n $can_access = true;\n break;\n }\n }\n\n if (!$can_access) {\n /* they don't have permission to access this show */\n die(\"This hack is no longer supported. Talk to webmin to get admin access to the current production.\");\n }\n\n }\n}", "protected function allowAdd($data=array()){\n return parent::allowAdd($data=array());\n /*\n $user=JFactory::getUser();\n $filter=$this->input->getInt('filter_category_id');\n $categoryId=JArrayHelper::getValue($data,'catid',$filter,'int');\n $allow=null;\n\n if($categoryId){\n // If the category has been passed in the URL check it.\n $allow=$user->authorise('core.create',$this->option.'.category.'.$categoryId);\n }\n\n if($allow === null){\n // In the absence of better information, revert to the component permissions.\n return parent::allowAdd($data);\n }else{\n return $allow;\n }\n */\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/save');\n break;\n case 'delete':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/delete');\n default:\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage');\n }\n }", "public function validateCatalogCategories()\n {\n $forward = false;\n switch ($this->getActionName()) {\n case self::ACTION_ADD:\n /**\n * adding is not allowed from beginning if user has scope specified permissions\n */\n $forward = true;\n $parentId = $this->_request->getParam('parent');\n if ($parentId) {\n $forward = !$this->_validateCatalogSubCategoryAddPermission($parentId);\n }\n break;\n case self::ACTION_EDIT:\n if (!$this->_request->getParam('id')) {\n $parentId = $this->_request->getParam('parent');\n if ($parentId) {\n $forward = !$this->_validateCatalogSubCategoryAddPermission($parentId);\n } else {\n // no adding root categories\n $forward = true;\n }\n } else {\n try {\n $category = $this->categoryRepository->get($this->_request->getParam('id'));\n } catch (NoSuchEntityException $e) {\n $category = null;\n }\n if (!$category || !$this->_isCategoryAllowed($category)) {\n // no viewing wrong categories\n $forward = true;\n }\n }\n break;\n }\n\n // redirect to first allowed root category\n if ($forward) {\n $firstRootId = current(array_keys($this->_role->getAllowedRootCategories()));\n if (count($this->_role->getAllowedRootCategories()) > 0 && $firstRootId) {\n $this->_redirect(['*/*/*', 'id' => $firstRootId]);\n } else {\n $this->_forward();\n }\n }\n }", "function new_customers_discount( $cart ) {\n // Only for logged in users\n // if ( ! is_user_logged_in() ) return; // We exit\n\n // Only for new customers without orders\n // if ( wc_get_customer_order_count( get_current_user_id() ) != 0 ) return; // We exit\n\n // Set HERE your categories (can be term IDs, slugs or names) in a coma separated array\n // $product = array('', '', '', '', '', '');\n\n $fee_amount = 0;\n\n $discount = 0;\n // Loop through cart items\n\n\n foreach( $cart->get_cart() as $cart_item ){\n \tswitch ($cart_item['product_id']) {\n \t\tcase 2582:\n \t\t$fee_amount = 10;\n \t\t$discount += $cart_item['line_subtotal']*$fee_amount/100;\n \t\tbreak;\n \t\tcase 2591:\n \t\t$fee_amount = 10;\n \t\t$discount += $cart_item['line_subtotal']*$fee_amount/100;\n \t\tbreak;\n \t}\n }\n\n $chosen_gateway = WC()->session->chosen_payment_method;\n \n if ( $chosen_gateway == 'cod' ) {\n \tif ( $fee_amount > 0 ){\n \t\t// $discount = $cart->cart_contents_total * ($fee_amount / 100);\n \t\t$cart->add_fee( __( 'Discount On EasyPaisa Mobile Account', 'woocommerce'), -$discount );\n \t}\n }\n}", "public function authorize()\n {\n// return Gate::allows('admin.discount.delete', $this->discount);\n return true;\n }", "public function get_adminstaff_FilteredProductsSide($parentid,$subcatid,$selectsublist,$selectgender,$description,$weight,$minprice,$maxprice,$uid)\n\t{\n\t\t\n\t\t$parentid = trim($parentid);\n\t\t$subcatid = trim($subcatid); \n\t\t$selectsublist = trim($selectsublist);\n\t\t$selectgender = trim($selectgender);\n\t\t$description = trim($description);\n\t\t$weight = trim($weight);\n\t\t$minprice = trim($minprice);\n\t\t$maxprice = trim($maxprice);\n\t\t $uid1 = trim($uid);\n\t\t$existsdata = $this->db->query(\"SELECT * from tb_admin_cart where userid='$uid1'\")->row_array();\n\t\tif(empty($existsdata))\n\t\t{\n\t\t\t$sql1=\"SELECT * from tb_products where ProductStatus=1\";\n\t\t\tif(!empty($parentid))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND ParentCategory='$parentid'\";\n\t\t\t}\n\t\t\tif(!empty($subcatid))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND SubCategory='$subcatid'\";\n\t\t\t}\n\t\t\tif(!empty($selectsublist))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND SubCategoryList='$selectsublist'\";\n\t\t\t}\n\t\t\tif(!empty($selectgender))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND gender1='$selectgender'\";\n\t\t\t}\n\t\t\tif(!empty($description))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND productdescription like '%$description'\";\n\t\t\t}\n\t\t\tif(!empty($weight))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND grw='$weight'\";\n\t\t\t}\n\t\t\tif(!empty($minprice))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND totalprice>='$minprice'\";\n\t\t\t}\n\t\t\tif(!empty($maxprice))\n\t\t\t{\n\t\t\t\t$sql1.=\" AND totalprice<='$maxprice'\";\n\t\t\t}\t\t\t\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql1=\"SELECT t1.* FROM tb_products as t1 WHERE t1.ProductId not IN (SELECT t2.products FROM tb_admin_cart as t2 WHERE t2.userid='$uid1') \";\n\t\t\n\t\t//$sql1 =\"select * from tb_products where ProductStatus=1\";\n\t\tif(!empty($parentid))\n\t\t{\n\t\t\t$sql1.=\" AND ParentCategory='$parentid'\";\n\t\t}\n\t\tif(!empty($subcatid))\n\t\t{\n\t\t\t$sql1.=\" AND SubCategory='$subcatid'\";\n\t\t}\n\t\tif(!empty($selectsublist))\n\t\t{\n\t\t\t$sql1.=\" AND SubCategoryList='$selectsublist'\";\n\t\t}\n\t\tif(!empty($selectgender))\n\t\t{\n\t\t\t$sql1.=\" AND gender1='$selectgender'\";\n\t\t}\n\t\tif(!empty($description))\n\t\t{\n\t\t\t$sql1.=\" AND productdescription like '%$description'\";\n\t\t}\n\t\tif(!empty($weight))\n\t\t{\n\t\t\t$sql1.=\" AND grw='$weight'\";\n\t\t}\n\t\tif(!empty($minprice))\n\t\t{\n\t\t\t$sql1.=\" AND totalprice>='$minprice'\";\n\t\t}\n\t\tif(!empty($maxprice))\n\t\t{\n\t\t\t$sql1.=\" AND totalprice<='$maxprice'\";\n\t\t}\n\t\t}\n\t\t\n\t\t$result = $this->db->query($sql1)->result_array();\n \n\t\treturn array('getFilterProducts'=>$result); \n \n \n\t}", "public function validateHasAppartements() {\n return $this->cart->items()->where( 'class', Appartement::class )->count() > 0;\n }", "private static function isCategoryProductEnabled($product, $excludedCatIds) {\n\t\t\n\t\tif ( is_array($excludedCatIds) && in_array($product->virtuemart_category_id, $excludedCatIds) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function listByCategoryCount($cid, $filteredProductIds = false)\n {\n $user_id = $this->session->userdata('CUSTOMER_ID');\n if ($user_id) {\n $this->db->select('t1.*,t1.id as product_id, IF(max(t7.quantity) > 0,max(t7.quantity),t1.quantity) as current_quantity, t3.*,t4.discount, t4.special_price, avg(t5.rate) as avgrate,count(t5.id) as reviewnumber,wishlist.product_id as in_wishlist', false);\n } else {\n $this->db->select('t1.*, t1.id as product_id,IF(max(t7.quantity) > 0,max(t7.quantity),t1.quantity) as current_quantity, t3.*, avg(t5.rate) as avgrate,count(t5.id) as reviewnumber', false);\n }\n\n $this->db->select(\"IF(min(t7.price),min(t7.price),t1.price) as least_price\", false);\n $this->db->select(\"(select COUNT(t8.parent_sku) from br_order_item t8 where t8.parent_sku = t1.sku) as salecount\", false);\n $this->db->from('product t1');\n $this->db->join('cat_prod t2', 't2.pid = t1.id');\n $this->db->join('prod_img t3', 't1.id = t3.pid AND t3.main = 1', 'left');\n $this->db->join('review t5', 't1.id = t5.product_id AND t5.status = 1', 'left');\n if ($user_id) {\n $this->db->join('product_assignment t4', \"t4.product_id = t1.id AND t4.user_id = $user_id\", 'left');\n $this->db->join('br_wishlist', \"br_wishlist.product_id = t1.id AND br_wishlist.customer_id = $user_id\", 'left');\n }\n $this->db->join('product_configurable_link t6', 't6.parent_id = t1.id', 'left');\n $this->db->join('product t7', 't7.id = t6.child_id', 'left');\n\n if ($filteredProductIds) {\n // $filteredProductIds = implode(',', $filteredProductIds);\n // $this->db->where(\"( t6.child_id IN ($filteredProductIds) OR t6.parent_id IN ($filteredProductIds) )\", null);\n $this->db->where_in('t1.id', $filteredProductIds);\n }\n $qu = \"t2.cid = \" . intval($cid) . \" AND t1.is_active = 1 AND t1.id NOT IN (select pf.child_id from br_product_configurable_link as pf)\";\n $this->db->where($qu);\n $this->db->where('t1.is_active', 1);\n if (DWS_SHOW_OUT_STOCK != 1) {\n $this->db->having('current_quantity >', 0);\n }\n $this->db->group_by('t1.id');\n $query = $this->db->get();\n return $query->num_rows();\n }", "private function category() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }" ]
[ "0.61943036", "0.6174837", "0.61275464", "0.6003161", "0.5971884", "0.5916364", "0.5854225", "0.5837015", "0.5830323", "0.57401", "0.57376784", "0.5659401", "0.56492877", "0.56051886", "0.5584973", "0.5565244", "0.5540948", "0.5527905", "0.5516805", "0.5499234", "0.5494129", "0.5486704", "0.5481087", "0.5460852", "0.5460075", "0.5451871", "0.54321545", "0.54284334", "0.5409927", "0.53719866", "0.5365235", "0.5364876", "0.53602165", "0.5359165", "0.5352977", "0.5344955", "0.5340679", "0.5334084", "0.53297293", "0.5320907", "0.5308965", "0.53028333", "0.52970934", "0.5292684", "0.5278552", "0.5271017", "0.5266763", "0.5264934", "0.5263607", "0.52631783", "0.5245368", "0.5244114", "0.5239638", "0.5236395", "0.52361405", "0.52305406", "0.52190304", "0.521759", "0.5212129", "0.5212129", "0.52063876", "0.5201792", "0.51979876", "0.51931363", "0.5190702", "0.5188293", "0.5180359", "0.5177023", "0.5172659", "0.5171413", "0.51698875", "0.51536286", "0.5149629", "0.51483667", "0.51401585", "0.51397187", "0.51317024", "0.512982", "0.51257575", "0.51011384", "0.5099333", "0.5097774", "0.5095449", "0.5094273", "0.5089313", "0.50864375", "0.5078754", "0.5078108", "0.5077808", "0.5068729", "0.5064718", "0.50614077", "0.50579184", "0.5056295", "0.50468177", "0.50443506", "0.5043762", "0.5041763", "0.5032439", "0.5030348" ]
0.6727782
0
Restrict Omniva Shipping methods if cart products has restricted shipping classes
public static function restrict_shipping_methods_by_shipclass($rates) { global $woocommerce; $configs = OmnivaLt_Core::get_configs(); $settings = get_option($configs['plugin']['settings_key']); $cart_classes_ids = array(); foreach( $woocommerce->cart->get_cart() as $cart_item ) { $shipping_classes = get_the_terms($cart_item['product_id'], 'product_shipping_class'); if ( empty($shipping_classes) ) { continue; } foreach ( $shipping_classes as $class ) { $cart_classes_ids[] = $class->term_id; } } $cart_classes_ids = array_unique($cart_classes_ids); $restricted_shipclass = $settings['restricted_shipclass'] ?? array(); if ( ! is_array($restricted_shipclass) ) { $restricted_shipclass = array($restricted_shipclass); } foreach ( $cart_classes_ids as $cart_product_class_id ) { if ( in_array($cart_product_class_id, $restricted_shipclass) ) { foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) { if ( ! $ship_method_values['is_shipping_method'] ) continue; unset($rates['omnivalt_' . $ship_method_values['key']]); } break; } } return $rates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getCartShippingMethod()\n {\n }", "function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}", "public function getShippingMethods();", "function has_shipping_enabled_product( $products ) {\r\n\r\n\tforeach ( $products as $product ) {\r\n\t\tif ( !is_product_disable_shipping( $product['product_id'] ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}", "public static function restrict_shipping_methods_by_cats($rates)\n {\n global $woocommerce;\n $configs = OmnivaLt_Core::get_configs();\n $settings = get_option($configs['plugin']['settings_key']);\n $cart_categories_ids = array();\n\n foreach( $woocommerce->cart->get_cart() as $cart_item ) {\n $cats = get_the_terms($cart_item['product_id'], 'product_cat');\n if ( empty($cats) ) {\n continue;\n }\n foreach ( $cats as $cat ) {\n $cart_categories_ids[] = $cat->term_id;\n if ( $cat->parent != 0 ) {\n $cart_categories_ids[] = $cat->parent;\n }\n }\n }\n $cart_categories_ids = array_unique($cart_categories_ids);\n\n $restricted_categories = $settings['restricted_categories'];\n if ( ! is_array($restricted_categories) ) {\n $restricted_categories = array($restricted_categories);\n }\n\n foreach ( $cart_categories_ids as $cart_product_categories_id ) {\n if ( in_array($cart_product_categories_id, $restricted_categories) ) {\n foreach ( $configs['method_params'] as $ship_method => $ship_method_values ) {\n if ( ! $ship_method_values['is_shipping_method'] ) continue;\n unset($rates['omnivalt_' . $ship_method_values['key']]);\n }\n break;\n }\n }\n\n return $rates;\n }", "public function is_available( $package = array() ) {\n global $woocommerce; \n\n if ( $this->enabled == \"no\" ) \n return false;\n \n if ( isset( $woocommerce->cart->cart_contents_total ) && isset( $this->min_amount ) && $this->min_amount && $this->min_amount > $woocommerce->cart->cart_contents_total ) \n return false;\n\n // Make sure method is available for shipping destination\n $country = isset( $package['destination']['country'] ) ? $package['destination']['country'] : $woocommerce->customer->get_shipping_country();\n $state = $woocommerce->customer->get_shipping_state();\n\n $ship_to_countries = '';\n\n if ( $this->availability == 'specific' ) {\n $ship_to_countries = $this->countries;\n } \n else {\n if ( get_option( 'woocommerce_allowed_countries' ) == 'specific' ) {\n $ship_to_countries = get_option( 'woocommerce_specific_allowed_countries' );\n }\n } \n \n if ( is_array( $ship_to_countries ) ) {\n if ( ! in_array( $country, $ship_to_countries ) ) {\n return false; \n } \n }\n \n $applicable_configurations = $this->get_destination_configurations( $country, $state ); \n\n // If there is no configuration that can be applied to this shipping destination, \n // this method is not available\n if ( count( $applicable_configurations ) == 0 ) {\n return false;\n }\n\n // Check whether each item in the cart has an applicable configuration\n $has_physical_products = false;\n\n foreach ($woocommerce->cart->get_cart() as $item ) {\n\n if ( $item['data']->needs_shipping() ) {\n\n $has_physical_products = true;\n\n $item_configurations = $this->get_item_configurations( $item, $applicable_configurations );\n\n if ( count( $item_configurations ) == 0 ) {\n return false;\n } \n } \n }\n\n return $has_physical_products;\n }", "public function isAutoShipping(): bool;", "public function getIsRequiredShipping()\n {\n $model = $this->_coreRegistry->registry('sales_subscription');\n $productId = $model->getSubProductId();\n $product = $this->productRepository->getById($productId);\n $productTypes = ['virtual', 'downloadable'];\n\n if ($product) {\n $productType = $product->getTypeId();\n if (!in_array($productType, $productTypes)) {\n return true;\n }\n }\n return false;\n }", "public function setNoMultiShipping(){\n $emptyCache = false;\n $db = JFactory::getDBO();\n if (JeproshopSettingModelSetting::getValue('allow_multi_shipping')){\n // Upgrading quantities\n $query = \"SELECT sum(\" . $db->quoteName('quantity') . \") AS quantity, product_id, product_attribute_id, count(*) as count FROM \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" WHERE \" . $db->quoteName('cart_id') . \" = \" . (int)$this->cart_id . \" AND \" ;\n $query .= $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \" GROUP BY product_id, product_attribute_id HAVING count > 1\";\n\n $db->setQuery($query);\n $products = $db->loadObjectList();\n\n foreach ($products as $product){\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('quantity') . \" = \" . $product->quantity;\n $query .= \"\tWHERE \" . $db->quoteName('cart_id') . \" = \".(int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id ;\n $query .= \" AND product_id = \" . $product->product_id . \" AND product_attribute_id = \" . $product->product_attribute_id;\n $db->setQuery($query);\n if ($db->query())\n $emptyCache = true;\n }\n\n // Merging multiple lines\n $query = \"DELETE cart_product_1 FROM \" . $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_1 INNER JOIN \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_2 ON ((cart_product_1.cart_id = cart_product_2.\";\n $query .= \"cart_id) AND (cart_product_1.product_id = cart_product_2.product_id) AND (cart_product_1.product_attribute_id = \";\n $query .= \"cart_product_2.product_attribute_id) AND (cart_product_1.address_delivery_id <> cart_product_2.address_delivery_id) \";\n $query .= \" AND (cart_product_1.date_add > cart_product_2.date_add) )\";\n $db->setQuery($query);\n $db->query();\n }\n\n // Update delivery address for each product line\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \") WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . (JeproshopSettingModelSetting::getValue('allow_multi_shipping') ? \" AND \" . $db->quoteName('shop_id') . \" = \" .(int)$this->shop_id : \"\");\n\n $db->setQuery($query);\n\n $cache_id = 'jeproshop_cart_set_no_multi_shipping'.(int)$this->cart_id.'_'.(int)$this->shop_id .((isset($this->address_delivery_id) && $this->address_delivery_id) ? '-'.(int)$this->address_delivery_id : '');\n if (!JeproshopCache::isStored($cache_id)){\n $db->setQuery($query);\n if ($result = (bool)$db->query())\n $emptyCache = true;\n JeproshopCache::store($cache_id, $result);\n }\n\n if (JeproshopCustomization::isFeaturePublished()){\n //Db::getInstance()->execute(\n\t\t\t$query = \" UPDATE \" . $db->quoteName('#__jeproshop_customization') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" ) WHERE \" . $db->quoteName('cart_id') . \" = \" .(int)$this->cart_id;\n\n $db->setQuery($query);\n $db->query();\n }\n if ($emptyCache){\n $this->_products = null;\n }\n }", "public function enable_free_shipping() {\n\t\treturn 'yes' === $this->free_shipping;\n\t}", "public function collectRates(Mage_Shipping_Model_Rate_Request $request)\n {\n if (!$this->getConfigFlag('active') || !$this->getConfigFlag('license_status')) {\n return false;\n }\n if(!$request->getCountryId()){\n return Mage::log('PostNord: No origin country');\n }\n // exclude Virtual products price from Package value if pre-configured\n if (!$this->getConfigFlag('include_virtual_price') && $request->getAllItems()) {\n foreach ($request->getAllItems() as $item) {\n if ($item->getParentItem()) {\n continue;\n }\n if ($item->getHasChildren() && $item->isShipSeparately()) {\n foreach ($item->getChildren() as $child) {\n if ($child->getProduct()->isVirtual()) {\n $request->setPackageValue($request->getPackageValueWithDiscount() - $child->getBaseRowTotal());\n }\n }\n } elseif ($item->getProduct()->isVirtual()) {\n $request->setPackageValue($request->getPackageValueWithDiscount() - $item->getBaseRowTotal());\n }\n }\n }\n\n // Free shipping by qty\n $freeQty = 0;\n if ($request->getAllItems()) {\n foreach ($request->getAllItems() as $item) {\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\n continue;\n }\n\n if ($item->getHasChildren() && $item->isShipSeparately()) {\n foreach ($item->getChildren() as $child) {\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\n $freeQty += $item->getQty() * ($child->getQty() - (is_numeric($child->getFreeShipping()) ? $child->getFreeShipping() : 0));\n }\n }\n } elseif ($item->getFreeShipping()) {\n $freeQty += ($item->getQty() - (is_numeric($item->getFreeShipping()) ? $item->getFreeShipping() : 0));\n }\n }\n }\n \n // Package weight and qty free shipping\n $oldWeight = $request->getPackageWeight();\n $oldQty = $request->getPackageQty();\n\n $request->setPackageWeight($request->getFreeMethodWeight());\n $request->setPackageQty($oldQty - $freeQty);\n\n $request->setPackageWeight($oldWeight);\n $request->setPackageQty($oldQty);\n \n $result = Mage::getModel('shipping/rate_result');\n /* @var $result Mage_Shipping_Model_Rate_Result */\n $methods = new Varien_Data_Collection();\n Mage::dispatchEvent('vconnect_postnord_collect_shipping_methods',array(\n 'request' => $request,\n 'methods' => $methods,\n ));\n if(!$methods->count()){\n return false;\n }\n\n $items = $methods->getItems();\n usort($items, function($a,$b){\n if (isset($a['system_path']) && isset($b['system_path'])) {\n $a['sort_order'] = (int)Mage::getStoreConfig(\"carriers/{$a['system_path']}/sort_order\");\n $b['sort_order'] = (int)Mage::getStoreConfig(\"carriers/{$b['system_path']}/sort_order\");\n if ($a['sort_order'] == $b['sort_order']) {\n return 0;\n }\n return ($a['sort_order'] < $b['sort_order']) ? -1 : 1;\n } else {\n return 0;\n }\n });\n\n foreach ( $items as $_method ){\n $method = $this->_createShippingMethodByCode($request,$freeQty,$_method );\n if( !$method ) {\n continue;\n }\n $result->append($method);\n }\n \n return $result;\n }", "public function getShipping();", "function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function isValidShippingMethod($value){\n if(strcmp($value,\"dhl_normal_shipping_method\")\n || strcmp($value,\"dhl_service_point_shipping_method\")\n ) {\n return true;\n }\n return false;\n }", "public function isShipping()\n {\n return $this->product->isShipping();\n }", "function is_product_disable_shipping( $product_id ) {\r\n\t$enabled = get_post_meta( $product_id, '_disable_shipping', true );\r\n\r\n\tif ( $enabled == 'yes' ) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "function is_product_disable_shipping_weight( $product_id ) {\r\n $enabled = get_post_meta( $product_id, '_disable_shipping', true );\r\n\r\n if ( $enabled == 'yes' ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}", "public function ChooseShippingProvider()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// Setup the default shipping error message\n\t\t$GLOBALS['ShippingError'] = GetLang(\"NoShippingProvidersError\");\n\n\t\t$addressDetails = 0;\n\n\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t// If the customer isn't signed in then they've just entered an address that we need to validate\n\t\t\tif(!CustomerIsSignedIn()) {\n\t\t\t\t$errors = array();\n\t\t\t\t// An invalid address was entered, show the form again\n\t\t\t\t$addressDetails = $this->ValidateGuestCheckoutAddress('shipping', $errors);\n\t\t\t\tif(!$addressDetails) {\n\t\t\t\t\t$this->ChooseShippingAddress($errors);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We've just selected an address\n\t\tif(isset($_GET['address_id'])) {\n\t\t\t$addressDetails = (int)$_GET['address_id'];\n\t\t}\n\n\t\tif($addressDetails !== 0 && !$this->SetOrderShippingAddress($addressDetails)) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// Are we split shipping?\n\t\t$splitShipping = $this->getQuote()->getIsSplitShipping();\n\n\t\t// At this stage, the quote should have a complete shipping address. Make sure there's\n\t\t// nothing missing.\n\t\t$shippingAddresses = $this->getQuote()->getShippingAddresses();\n\t\tforeach($shippingAddresses as $shippingAddress) {\n\t\t\tif(!$shippingAddress->hasCompleteAddress()) {\n\t\t\t\tredirect($redirectOnError);\n\t\t\t}\n\t\t}\n\n\t\t// Now, for each shipping address, fetch available shipping quotes\n\t\t$GLOBALS['HideNoShippingProviders'] = 'none';\n\t\t$GLOBALS['ShippingQuotes'] = '';\n\n\t\t$hideItemList = true;\n\t\tif(count($shippingAddresses) > 1) {\n\t\t\t$hideItemList = false;\n\t\t}\n\t\telse {\n\t\t\t$splitShipping = false;\n\t\t}\n\t\t$hasTransit = false;\n\t\t$numLoopedAddresses = 0;\n\t\t$totalAddresses = count($shippingAddresses);\n\t\tforeach($shippingAddresses as $i => $shippingAddress) {\n\t\t\t++$numLoopedAddresses;\n\n\t\t\tif(!$splitShipping) {\n\t\t\t\t$GLOBALS['HideAddressLine'] = 'display: none';\n\t\t\t\t$GLOBALS['HideItemList'] = 'display: none';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['HideAddressLine'] = '';\n\t\t\t\t$GLOBALS['HideItemList'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['HideHorizontalRule'] = 'display: none';\n\t\t\tif($numLoopedAddresses != $totalAddresses) {\n\t\t\t\t$GLOBALS['HideHorizontalRule'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['AddressId'] = $shippingAddress->getId();\n\n\t\t\t// If no methods are available, this order can't progress so show an error\n\t\t\t$shippingQuotes = $shippingAddress->getAvailableShippingMethods();\n\t\t\tif(empty($shippingQuotes)) {\n\t\t\t\t$GLOBALS['HideNoShippingProviders'] = '';\n\t\t\t\t$GLOBALS['HideShippingProviderList'] = 'none';\n\t\t\t\t$hideItemList = false;\n\t\t\t}\n\n\t\t\t$GLOBALS['ItemList'] = '';\n\t\t\tif(!$hideItemList) {\n\t\t\t\t$items = $shippingAddress->getItems();\n\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t// Only show physical products\n\t\t\t\t\tif($item->isDigital() == true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['ProductQuantity'] = $item->getQuantity();\n\t\t\t\t\t$GLOBALS['ProductName'] = isc_html_escape($item->getName());\n\n\t\t\t\t\t$GLOBALS['HideGiftWrapping'] = 'display: none';\n\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = 'display: none';\n\t\t\t\t\t$GLOBALS['GiftWrappingName'] = '';\n\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = '';\n\t\t\t\t\t$giftWrapping = $item->getGiftWrapping();\n\t\t\t\t\tif($giftWrapping !== false) {\n\t\t\t\t\t\t$GLOBALS['HideGiftWrapping'] = '';\n\t\t\t\t\t\t$GLOBALS['GiftWrappingName'] = isc_html_escape($giftWrapping['wrapname']);\n\t\t\t\t\t\tif($giftWrapping['wrapmessage']) {\n\t\t\t\t\t\t\tif(isc_strlen($giftWrapping['wrapmessage']) > 30) {\n\t\t\t\t\t\t\t\t$giftWrapping = substr($giftWrapping['wrapmessage'], 0, 27).'...';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = isc_html_escape($giftWrapping['wrapmessage']);\n\t\t\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ItemList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ShippingQuoteProduct');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no methods are available, this order can't progress so show an error\n\t\t\tif(empty($shippingQuotes)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(!$GLOBALS['HideAddressLine']) {\n\t\t\t\t$addressLine = array(\n\t\t\t\t\t$shippingAddress->getFirstName().' '.$shippingAddress->getLastName(),\n\t\t\t\t\t$shippingAddress->getCompany(),\n\t\t\t\t\t$shippingAddress->getAddress1(),\n\t\t\t\t\t$shippingAddress->getAddress2(),\n\t\t\t\t\t$shippingAddress->getCity(),\n\t\t\t\t\t$shippingAddress->getStateName(),\n\t\t\t\t\t$shippingAddress->getZip(),\n\t\t\t\t\t$shippingAddress->getCountryName()\n\t\t\t\t);\n\n\t\t\t\t// Please see self::GenerateShippingSelect below.\n\t\t\t\t$addressLine = array_filter($addressLine, array($this, 'FilterAddressFields'));\n\t\t\t\t$GLOBALS['AddressLine'] = isc_html_escape(implode(', ', $addressLine));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['AddressLine'] = '';\n\t\t\t}\n\n\t\t\t// Now build a list of the actual available quotes\n\t\t\t$GLOBALS['ShippingProviders'] = '';\n\t\t\tforeach($shippingQuotes as $quoteId => $method) {\n\t\t\t\t$price = getClass('ISC_TAX')->getPrice(\n\t\t\t\t\t$method['price'],\n\t\t\t\t\tgetConfig('taxShippingTaxClass'),\n\t\t\t\t\tgetConfig('taxDefaultTaxDisplayCart'),\n\t\t\t\t\t$shippingAddress->getApplicableTaxZone()\n\t\t\t\t);\n\t\t\t\t$GLOBALS['ShippingProvider'] = isc_html_escape($method['description']);\n\t\t\t\t$GLOBALS['ShippingPrice'] = CurrencyConvertFormatPrice($price);\n\t\t\t\t$GLOBALS['ShipperId'] = $quoteId;\n\t\t\t\t$GLOBALS['ShippingData'] = $GLOBALS['ShipperId'];\n\n\t\t\t\tif(isset($method['transit'])) {\n\t\t\t\t\t\t$hasTransit = true;\n\n\t\t\t\t\t$days = $method['transit'];\n\n\t\t\t\t\tif ($days == 0) {\n\t\t\t\t\t\t$transit = GetLang(\"SameDay\");\n\t\t\t\t\t}\n\t\t\t\t\telse if ($days == 1) {\n\t\t\t\t\t\t$transit = GetLang('NextDay');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$transit = sprintf(GetLang('Days'), $days);\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['TransitTime'] = $transit;\n\t\t\t\t\t$GLOBALS['TransitTime'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CartShippingTransitTime');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['TransitTime'] = \"\";\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ShippingProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ShippingProviderItem\");\n\t\t\t}\n\n\t\t\t// Add it to the list\n\t\t\t$GLOBALS['ShippingQuotes'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ShippingQuote');\n\t\t}\n\n\t\tif ($hasTransit) {\n\t\t\t$GLOBALS['DeliveryDisclaimer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CartShippingDeliveryDisclaimer');\n\t\t}\n\n\t\t// Show the list of available shipping providers\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . \" - \" . GetLang('ChooseShippingProvider'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"checkout_shipper\");\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "protected function get_items_needing_shipping() {\n\t\treturn array_filter( $this->get_cart(), array( $this, 'filter_items_needing_shipping' ) );\n\t}", "private function checkShippingMethods()\n {\n $methods = ShippingMethod::with('prices')->get();\n $errors = [];\n foreach ($methods as $method) {\n $basePrice = $method->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The shipping method \"%s\" has no price set for your default currency.',\n $method->name\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "function get_item_shipping() {\n\t}", "public function getCartShippingMethodID()\n {\n }", "public function get_shipping_classes() {\n\t\tif ( empty( $this->shipping_classes ) ) {\n\t\t\t$classes = get_terms( 'product_shipping_class', array( 'hide_empty' => '0' ) );\n\t\t\t$this->shipping_classes = $classes && ! is_wp_error( $classes ) ? $classes : array();\n\t\t}\n\t\treturn $this->shipping_classes;\n\t}", "function pb_hide_shipping_method_if_not_available( $rates ) {\n\t\n\t$api_result = include dirname(__FILE__).'/includes/availability.php';\t\n\n\tif ( ! isset($api_result[\"success\"]) ) return $rates;\n\t\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'porterbuddy-wc' === $rate->method_id ) {\n\t\t\tif ($api_result[\"success\"] === false || ! isset($api_result['data']['delivery']) ) {\n\t\t\t\tunset($rates[ $rate_id ]);\n\t\t\t}\n\t\t}\n\t}\n\treturn $rates;\n}", "function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}", "function getShippingChoicesList() {\n\t\tApp::import('Model', 'CartsProduct');\n\t\t$this->CartsProduct = &new CartsProduct;\n\t\t$cart_stats = $this->CartsProduct->getStats($this->CartsProduct->Cart->get_id());\n\n\t\t// pokud nesplnuju podminky pro dopravy doporucenym psanim, zakazu si tyto zpusoby dopravy vykreslit zakaznikovi\n\t\t$conditions = array();\n\t\tif (!$this->isRecommendedLetterPossible()) {\n\t\t\t$conditions = array('Shipping.id NOT IN (' . implode(',', $this->Shipping->getRecommendedLetterShippingIds()) . ')');\n\t\t}\n\n\t\t$shipping_choices = $this->Shipping->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('id', 'name', 'price', 'free'),\n\t\t\t'order' => array('Shipping.order' => 'asc')\n\t\t));\n\t\t\n\t\t// pokud mam v kosiku produkty, definovane v Cart->free_shipping_products v dostatecnem mnozstvi, je doprava zdarma\n\t\tApp::import('Model', 'Cart');\n\t\t$this->Cart = &new Cart;\n\t\tif ($this->Cart->isFreeShipping()) {\n\t\t\t// udelam to tak, ze nastavim hodnotu kosiku na strasne moc a tim padem budu mit v kosiku vzdycky vic, nez je\n\t\t\t// minimalni hodnota kosiku pro dopravu zdarma\n\t\t\t$cart_stats['total_price'] = 99999;\n\t\t}\n\n\t\t// v selectu chci mit, kolik stoji doprava\n\t\tforeach ($shipping_choices as $shipping_choice) {\n\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - ' . $shipping_choice['Shipping']['price'] . ' Kč';\n\t\t\tif ($cart_stats['total_price'] > $shipping_choice['Shipping']['free']) {\n\t\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - zdarma';\n\t\t\t}\n\t\t\t$shipping_choices_list[$shipping_choice['Shipping']['id']] = $shipping_item;\n\t\t}\n\t\t\n\t\treturn $shipping_choices_list;\n\t}", "function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "protected function shouldAddShippingInformation(): bool\r\n {\r\n if (DocumentTypes::requiresDelivery($this->documentType)) {\r\n return true;\r\n }\r\n\r\n return $this->useShipping === Boolean::YES;\r\n }", "function es_has_coupon_free_shipping() {\n global $woocommerce;\n\n foreach ($woocommerce->cart->applied_coupons as $code) {\n $coupon = new WC_Coupon($code);\n if ($coupon->is_valid() === true) {\n if ($coupon->enable_free_shipping()) {\n return true;\n }\n }\n }\n\n return false;\n}", "public function testReturnsFalseInCollectRatesMethodWhenOggettoShippingMethodIsNotActive()\n {\n $modelCarrierMock = $this->getModelMock('oggetto_shipping/carrier', ['isActive']);\n\n $modelCarrierMock->expects($this->once())\n ->method('isActive');\n\n $this->replaceByMock('model', 'oggetto_shipping/carrier', $modelCarrierMock);\n\n $this->assertFalse($modelCarrierMock->collectRates(new Mage_Shipping_Model_Rate_Request));\n }", "public function calculate_shipping( $package = [] ) {\n // First, we need to do some checks to make sure that this shipping method\n // is enabled and this users country is included / allowed. If one of these\n // is not true, just return false.\n // Is this shipping type enabled? If not, do nothing.\n $enabled = $this->get_option( 'enabled' );\n\n if ( $enabled == 'no' ) { return false; }\n if ( ! $this->is_tiered_allowed( $package ) ) { return false; }\n\n\n // If we get to this point, we can add this shipping method to the front\n // end and calculate the shipping rate!\n\n global $woocommerce;\n\n // Get all items from cart.\n $items = $woocommerce->cart->get_cart();\n $cart_total_items = 0;\n\n // Sum non-virtual (i.e. shippable) items\n foreach ( $items as $item ) {\n $product = wc_get_product( $item['product_id'] );\n if ( !$product->is_virtual() ) {\n $cart_total_items += $item['quantity'];\n }\n }\n\n // Set the base shipping fee.\n $shipping = $cart_total_items > 0 ? $this->get_option('basefee') : 0;\n\n // Override base fee with tiered fee if cart items are over the tier quantity.\n if ( $cart_total_items > $this->get_option( 'quantity' ) ) {\n\n // If the tier fee should be progressive, calculate the multiplier and add the tier fee * multiplier.\n if ( $this->get_option( 'progressive' ) == 'yes' ) {\n $multiplier = ceil( $cart_total_items / $this->get_option( 'quantity' ) ) - 1;\n $shipping += $this->get_option( 'tierfee' ) * $multiplier;\n }\n\n // If the tier fee is flat, simply add the tier fee.\n else {\n $shipping += $this->get_option( 'tierfee' );\n }\n }\n\n // Set the shipping rate.\n $rate = [\n 'label' => $this->title,\n 'cost' => $shipping,\n 'calc_tax' => 'per_item'\n ];\n\n $this->add_rate( $rate );\n }", "public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }", "function my_hide_shipping_when_free_is_available( $rates ) {\n\t$free = array();\n\tforeach ( $rates as $rate_id => $rate ) {\n\t\tif ( 'free_shipping' === $rate->method_id ) {\n\t\t\t$free[ $rate_id ] = $rate;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ! empty( $free ) ? $free : $rates;\n}", "public function setShippingMethod() {\n\t\t$json = array();\n\t\t$json['status'] = false;\n\t\t\n\t\tif (isset($this->request->post['code'])) {\n\t\t\t$code=$this->request->post['code'];\n\t\t\t$shipping_method=$this->session->data['shipping_methods'][$code]; \n\t\t\tif ($shipping_method) {\n\t\t\t\tunset($this->session->data['shipping_method']);\n\t\t\t\t$this->session->data['shipping_method'] = $shipping_method;\n\t\t\t\t\n\t\t\t\t$json['status'] = true;\n\t\t\t\t$json['delivery'] = $shipping_method['delivery'];\n\n\t\t\t} else {\n\t\t\t\t$json['error'] = 'Неизвестный способ доставки';\n\t\t\t}\n\t\t} else {\n\t\t\t$json['error'] = 'Не указан тип доставки';\n\t\t}\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "public function shippingPaymentAction()\r\n {\r\n // Load payment options, select option and details\r\n $this->View()->sPayments = $this->getPayments();\r\n $this->View()->sFormData = array('payment' => $this->View()->sUserData['additional']['user']['paymentID']);\r\n $getPaymentDetails = $this->admin->sGetPaymentMeanById($this->View()->sFormData['payment']);\r\n\r\n $paymentClass = $this->admin->sInitiatePaymentClass($getPaymentDetails);\r\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\r\n $data = $paymentClass->getCurrentPaymentDataAsArray(Shopware()->Session()->sUserId);\r\n if (!empty($data)) {\r\n $this->View()->sFormData += $data;\r\n }\r\n }\r\n if ($this->Request()->isPost()) {\r\n $values = $this->Request()->getPost();\r\n $values['payment'] = $this->Request()->getPost('payment');\r\n $values['isPost'] = true;\r\n $this->View()->sFormData = $values;\r\n }\r\n\r\n $this->View()->sBasket = $this->getBasket();\r\n\r\n // Load current and all shipping methods\r\n $this->View()->sDispatch = $this->getSelectedDispatch();\r\n $this->View()->sDispatches = $this->getDispatches($this->View()->sFormData['payment']);\r\n\r\n $this->View()->sLaststock = $this->basket->sCheckBasketQuantities();\r\n $this->View()->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $this->View()->sShippingcostsDifference = $this->View()->sBasket['sShippingcostsDifference'];\r\n $this->View()->sAmount = $this->View()->sBasket['sAmount'];\r\n $this->View()->sAmountWithTax = $this->View()->sBasket['sAmountWithTax'];\r\n $this->View()->sAmountTax = $this->View()->sBasket['sAmountTax'];\r\n $this->View()->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $this->View()->sRegisterFinished = !empty($this->session['sRegisterFinished']);\r\n $this->View()->sTargetAction = 'shippingPayment';\r\n $this->View()->sKUZOOffer = true;\r\n if ($this->Request()->getParam('isXHR')) {\r\n return $this->View()->loadTemplate('frontend/s_k_u_z_o_offer/shipping_payment_core.tpl');\r\n }\r\n }", "function smarty_function_shipping($params, $template)\r\n{\t\r\n\tglobal $config;\r\n\tglobal $order;\t\t\r\n\t\t\r\n\tApp::uses('SmartyComponent', 'Controller/Component');\r\n\t\t$Smarty = new SmartyComponent(new ComponentCollection());\r\n\r\n\tApp::import('Model', 'ShippingMethod');\r\n\t\t$ShippingMethod = new ShippingMethod();\r\n\r\n\t// Get the shipping method \r\n\t$shipping = $ShippingMethod->read(null,$order['Order']['shipping_method_id']);\r\n\t\r\n\t$assignments = array('shipping_alias' => $shipping['ShippingMethod']['code']);\r\n\r\n\t$display_template = $Smarty->load_template($params,'shipping');\t\r\n\t$Smarty->display($display_template,$assignments);\r\n\t\r\n}", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "function filter_shipping( $fields_array ) {\n\t\t\t$fields_array = array_replace($fields_array, $this->update_shipping);\n\t\t\treturn array_diff_key($fields_array, array_flip($this->disabled_shipping));\n\t\t}", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }", "function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}", "function wp_tiered_shipping_init() {\n\n class WC_Tiered_Shipping extends WC_Shipping_Method {\n\n /**\n * __construct() {\n */\n public function __construct() {\n $this->id = 'tiered_shipping';\n $this->title = __( 'Tiered Flat Rate Shipping', $this->id );\n $this->method_title = __( 'Tiered flat rate shipping', $this->id );\n $this->description = __( 'A flat rate shipping method that adjusts depending on the number of products purchased.', $this->id );\n $this->init();\n }\n\n\n /**\n * init()\n *\n * Initialize all settings for this shipping method.\n *\n * @return void\n */\n public function init(): void {\n // Load the settings API\n $this->init_form_fields(); // Overridden below.\n $this->init_settings(); // This is part of the settings API. Loads settings you previously init.\n\n // Save settings.\n add_action( 'woocommerce_update_options_shipping_' . $this->id, [ $this, 'process_admin_options' ] );\n }\n\n\n /**\n * init_form_fields()\n *\n * Initialize settings form fields. This is part of the settings API, but\n * overridden here.\n *\n * @return void\n */\n public function init_form_fields() {\n global $woocommerce;\n\n $this->form_fields = [\n 'enabled' => [\n 'title' => __( 'Enabled/Disabled', $this->id ),\n 'type' => 'checkbox',\n 'label' => 'Enable this shipping method'\n ],\n\n 'usertitle' => [\n 'title' => __( 'Shipping method label', $this->id ),\n 'type' => 'text',\n 'description' => __( 'The label that is visible to the user.', $this->id ),\n 'default' => __( 'Tiered Flat Rate', $this->id )\n ],\n\n 'availability' => [\n 'title' => __( 'Availability', $this->id ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select availability',\n 'options' => [\n 'all' => 'All allowed countries',\n 'except' => 'All allowed countries, except...',\n 'specific' => 'Specific countries'\n ],\n 'default' => __( 'all', $this->id )\n ],\n\n 'countries' => [\n 'title' => __( 'Countries', $this->id ),\n 'type' => 'multiselect',\n 'class' => 'wc-enhanced-select',\n 'options' => $woocommerce->countries->countries,\n 'default' => __( '', $this->id )\n ],\n\n 'basefee' => [\n 'title' => __( 'Base shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Flat shipping fee that is applied automatically to the cart total for any number of items.', $this->id )\n ],\n\n 'tierfee' => [\n 'title' => __( 'Tier shipping fee ($)', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Additional shipping fee added to the base fee if the number of items in the cart exceeds a specified number.', $this->id )\n ],\n\n 'quantity' => [\n 'title' => __( 'Number of items to activate tier shipping fee', $this->id ),\n 'type' => 'text',\n 'description' => __( 'Number of items in the cart needed to activate the additional tier shipping fee.', $this->id )\n ],\n\n 'progressive' => [\n 'title' => __( 'Incremental fee?', $this->id ),\n 'type' => 'checkbox',\n 'label' => __( 'Make the tiered shipping fee incremental' ),\n 'description' => __( 'If this option is checked, the tiered shipping fee will be applied incrementally in multiples of the tier item quantity; otherwise, the tiered shipping fee will be a flat fee if the cart is above the specified quantity.', $this->id )\n ]\n ];\n }\n\n\n /**\n * calculate_shipping()\n *\n * Calculate the shipping rate based on product type and number of items.\n *\n * @param array $package\n */\n public function calculate_shipping( $package = [] ) {\n // First, we need to do some checks to make sure that this shipping method\n // is enabled and this users country is included / allowed. If one of these\n // is not true, just return false.\n // Is this shipping type enabled? If not, do nothing.\n $enabled = $this->get_option( 'enabled' );\n\n if ( $enabled == 'no' ) { return false; }\n if ( ! $this->is_tiered_allowed( $package ) ) { return false; }\n\n\n // If we get to this point, we can add this shipping method to the front\n // end and calculate the shipping rate!\n\n global $woocommerce;\n\n // Get all items from cart.\n $items = $woocommerce->cart->get_cart();\n $cart_total_items = 0;\n\n // Sum non-virtual (i.e. shippable) items\n foreach ( $items as $item ) {\n $product = wc_get_product( $item['product_id'] );\n if ( !$product->is_virtual() ) {\n $cart_total_items += $item['quantity'];\n }\n }\n\n // Set the base shipping fee.\n $shipping = $cart_total_items > 0 ? $this->get_option('basefee') : 0;\n\n // Override base fee with tiered fee if cart items are over the tier quantity.\n if ( $cart_total_items > $this->get_option( 'quantity' ) ) {\n\n // If the tier fee should be progressive, calculate the multiplier and add the tier fee * multiplier.\n if ( $this->get_option( 'progressive' ) == 'yes' ) {\n $multiplier = ceil( $cart_total_items / $this->get_option( 'quantity' ) ) - 1;\n $shipping += $this->get_option( 'tierfee' ) * $multiplier;\n }\n\n // If the tier fee is flat, simply add the tier fee.\n else {\n $shipping += $this->get_option( 'tierfee' );\n }\n }\n\n // Set the shipping rate.\n $rate = [\n 'label' => $this->title,\n 'cost' => $shipping,\n 'calc_tax' => 'per_item'\n ];\n\n $this->add_rate( $rate );\n }\n\n\n /**\n * is_tiered_allowed()\n *\n * Determine if the tiered rate is allowed for this location.\n *\n * @param array $package\n */\n function is_tiered_allowed( $package = [] ) {\n $availability = $this->get_option( 'availability' );\n $user_country = $package['destination']['country'];\n $countries = $this->get_option( 'countries' );\n\n switch ( $availability ) {\n // Plugin availability is set to all countries.\n case 'all':\n return true;\n break;\n\n case 'specific':\n $in_allowed_country = false;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = true;\n break;\n }\n }\n\n return $in_allowed_country;\n break;\n\n case 'except':\n $in_allowed_country = true;\n\n for ( $i=0; $i<sizeof( $countries ); $i++ ) {\n if ( $user_country == $countries[$i] ) {\n $in_allowed_country = false;\n break;\n }\n }\n\n return $in_allowed_country;\n }\n }\n\n }\n}", "function setShipping($ship_key)\n {\n return 4.50;\n }", "public function checkShipment($items) {\n if (!is_array($items)) {\n return 0;\n }\n $arItems = array();\n $arStockItems = array();\n $orderItems = Mage::getModel('sales/order_item')\n ->getCollection()\n ->addFieldToFilter('item_id', array('in' => array_keys($items)));\n if ($orderItems->getSize()) {\n foreach ($orderItems as $orderItem) {\n $arItems[$orderItem->getId()] = $orderItem;\n $arStockItems[$orderItem->getProductId()] = $orderItem->getProductId();\n }\n }\n\n $stockItems = Mage::getModel('cataloginventory/stock_item')\n ->getCollection()\n ->addFieldToFilter('product_id', array('in' => array_keys($arStockItems)));\n if ($stockItems->getSize()) {\n foreach ($stockItems as $stockItem) {\n $arStockItems[$stockItem->getProductId()] = $stockItem;\n }\n }\n foreach ($items as $item_id => $qty) {\n $item = $arItems[$item_id];\n $stockItem = $arStockItems[$item->getProductId()];\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if (!$manageStock) {\n continue;\n }\n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped', 'virtual', 'downloadable')))\n continue;\n\n if ($this->selectWarehouseToShip($item->getProductId(), $qty) == 0) {\n return 0;\n };\n }\n return 1;\n }", "public static function checkForNearProducts() {\n $cartDeliveryPostcodeSessionKey = \\Config::get('appConstants.user_delivery_postcode_session_key');\n $landingPagePostcodeSessionKey = \\Config::get('appConstants.user_landing_postcode_session_key');\n $landingPostcode = session()->get($landingPagePostcodeSessionKey, '');\n $cartPostcode = session()->get($cartDeliveryPostcodeSessionKey, '');\n if (!empty($landingPostcode)\n || !empty($cartPostcode)\n ) {\n return true;\n }\n return false;\n }", "public function disableShopServices()\n {\n return true;\n }", "function addShippingToMessage ( ) {\r\n\t\t$methods =& $this->getExtraShipping();\r\n\r\n\t\tif( $methods === false || count($methods) == 0 ) return;\r\n\r\n\t\t$this->glmsg .= '<shipping-methods>';\r\n\r\n\t\t// add the selected method first, because we can't pass a selection index to google.\r\n\t\tif( ($index = $this->getExtraShippingIndex()) >= 0) {\r\n\t\t\t$this->glmsg .= '<flat-rate-shipping name=\"' . htmlspecialchars( $this->getExtraShipping($index), ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t . '<price currency=\"' . $this->getConfig('shopcurrency') . '\">'\r\n\t\t\t\t\t\t . number_format( $this->cart->getShippingHandlingTotal() / 100, 2, '.', '')\r\n\t\t\t\t\t\t . '</price>'\r\n\t\t\t\t\t\t . '</flat-rate-shipping>';\r\n\t\t}\r\n\r\n\tfor( $i = 0; $i < count($methods) ; ++$i ) {\r\n\t\t\tif( $methods[$i]['id'] == $index ) continue;\t\t\t\r\n\t\t\t$this->glmsg .= '<flat-rate-shipping name=\"' . htmlspecialchars( $methods[$i]['description'], ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t . '<price currency=\"' . $this->getConfig('shopcurrency') . '\">'\r\n\t\t\t\t\t\t . number_format( $this->cart->getShippingHandlingTotal( $methods[$i]['id'] ) / 100, 2, '.', '')\r\n\t\t\t\t\t\t . '</price>'\r\n\t\t\t\t\t\t . '</flat-rate-shipping>';\r\n\t\t}\r\n\t\t$this->glmsg .= '</shipping-methods>';\r\n }", "function filter_woocommerce_correios_shipping_args( $array, $this_id, $this_instance_id, $this_package ) { \n //$array['nVlPeso'] = 1000;\n if($array['nVlPeso'] >= 30){\n return array('nCdServico' => null);\n }\n return $array; \n}", "function warehouse_shipping( $products, $destination_country){\r\n\t\t$pweight=0;\r\n\t\t$amount=0;\r\n\t\t$baseshippingprice=false;\r\n\t\tforeach ( $products as $product ) {\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif($_enable_warehouse!=1) continue;\r\n\t\t\tif ( is_product_disable_shipping_weight( $product['product_id'] ) ) {\r\n continue;\r\n\t\t }\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif ( isset( $product['variation_id'] ) ) {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['variation_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['variation_id'], '_downloadable', true );\r\n\t\t\t} else {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['product_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['product_id'], '_downloadable', true );\r\n\t\t\t}\r\n\r\n\t\t\tif ( ( $is_virtual == 'yes' ) || ( $is_downloadable == 'yes' ) ) {\r\n\t\t\t\t$downloadable_count++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\r\n\t\t\t// if warehouse shipping enable for this product\r\n\t\t\tif($_enable_warehouse==1){\r\n\t\t\t\t\r\n\t\t\t\t$pweight+=$product['data']->get_weight()* $product['quantity'];\r\n\t\t\t}\r\n\t\t\t$price[ $seller_id ]['totalp_price'] += $product['line_total'];\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t$dps_country_rates= get_option('_dps_country_rates', true );\r\n\t\t$dps_weight_rates = get_option('_dps_weight_rates', true );\r\n\t\t$dps_threshold_values = get_option('_dps_threshold_value', true );\r\n\t\t$dps_threshold_value=$dps_threshold_values['threshold'];\r\n\t\tif ( isset( $dps_weight_rates[$destination_country] ) ){\r\n\t\t\t\t\t\r\n\t\t\t$baseshippingprice=false;\r\n\t\t\t$cnt=0;\r\n\t\t\tforeach ( $dps_weight_rates[$destination_country]['wf'] as $weight => $weight_rate ){\r\n\t\t\t\t $weightfrom=$dps_weight_rates[$destination_country]['wf'][$cnt];\r\n\t\t\t\t $weightto=$dps_weight_rates[$destination_country]['wto'][$cnt];\r\n\t\t\t\t $weightrate=$dps_weight_rates[$destination_country]['rate'][$cnt];\r\n\t\t\t\t//echo $price[$seller_id]['state_rates']=$weightrate;\r\n\t\t\t\t\r\n\t\t\t\tif($weightfrom<$pweight && $weightto>=$pweight){\r\n\t\t\t\t\t$priceliesonweightrange=true;\r\n\t\t\t\t\t $price[$seller_id]['shipping_rates']=$weightrate;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t $cnt++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($dps_threshold_value[$destination_country])){\r\n\t\t\tif($dps_threshold_value[$destination_country]>0){\r\n\t\t\t\tif($price[$seller_id]['totalp_price']>$dps_threshold_value[$destination_country]){\r\n\t\t\t\t\t$price[$seller_id]['shipping_rates']=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( !empty( $price ) ) {\r\n foreach ( $price as $s_id => $value ) {\r\n $amount = $amount + ( ( isset($value['shipping_rates']) ? $value['shipping_rates'] : 0 ) );\r\n\t\t\t\t\r\n\t\t\t\t\r\n }\r\n }\r\n\t\t\r\n\t\treturn $amount;\r\n}", "public function getShippingMethods()\n {\n $array = array();\n foreach ($this->config as $key => $item) {\n if ($key == 'allowed_domestic_methods') {\n foreach ($item as $item_internal) {\n $array['Domestic'][] = $item_internal['name'];\n }\n }\n\n if ($key == 'allowed_international_methods') {\n foreach ($item as $item_internal) {\n $array['International'][] = $item_internal['name'];\n }\n }\n }\n return $array;\n }", "public function hasShippingOptions()\n {\n $product = $this->getProduct();\n return strlen($product->getMdlShipments());\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function getCartable();", "function getShipping()\n {\n return array('name'=>'test','cost'=>4.5);\n }", "function register_shipping_method($methods)\n {\n $methods['legacy_pakkelabels_shipping_gls_business'] = 'Legacy_Pakkelabels_Shipping_GLS_Business';\n return $methods;\n }", "public function check_shipping()\n\t{\n\t\tif((!isset($_SESSION['shipping']) || empty($_SESSION['shipping']))\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual'\n\t\t\t&& $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t\t&& $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// check if country of selected shipping address is not allowed\n\t\tif($_SESSION['sendto'] !== false \n\t\t && $_SESSION['cart']->content_type != 'virtual'\n\t\t && $_SESSION['cart']->content_type != 'virtual_weight'\n\t\t && $_SESSION['cart']->count_contents_non_virtual() != 0)\n\t\t{\n\t\t\tif($this->check_country_by_address_book_id($_SESSION['sendto']) == false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function _getShippingAvailability()\n {\n $carriers = [];\n if ($this->getRma()) {\n $carriers = $this->_rmaData->getAllowedShippingCarriers($this->getRma()->getStoreId());\n }\n return !empty($carriers);\n }", "function shipping($module = '') {\n global $language, $PHP_SELF;\n\n $installed_modules_array = array();\n //Get the vendors_id for each vendor in the database\n $modules_array = array();\n $vendors_data_query = tep_db_query(\"select vendors_id from \" . TABLE_VENDORS);\n while ($vendors_data = tep_db_fetch_array($vendors_data_query)) {;\n $vendors_id = $vendors_data['vendors_id'];\n $installed_modules = @constant ('MODULE_VENDOR_SHIPPING_INSTALLED_' . $vendors_id);\n\n if (isset ($installed_modules) && tep_not_null ($installed_modules)) {\n $modules_array = explode(';', $installed_modules);\n $this->modules[$vendors_id] = $modules_array;\n\n foreach ($modules_array as $module_name) {\n //if the module is not already in the array, add it in\n if (!in_array ($module_name, $installed_modules_array)) { \n $installed_modules_array[] = $module_name;\n }//if !in_array\n }//foreach\n }//if isset\n }//while\n\n \n $include_modules = array();\n if ( (tep_not_null($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $modules_array)) ) {\n $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), \n 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)));\n } else {\n reset($modules_array);\n foreach ($installed_modules_array as $value) {\n $class = substr($value, 0, strrpos($value, '.'));\n $include_modules[] = array('class' => $class, \n 'file' => $value);\n }//foreach\n }//if tep_not_null\n\n for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {\n include(DIR_WS_LANGUAGES . $language . '/modules/vendors_shipping/' . $include_modules[$i]['file']);\n include(DIR_WS_MODULES . 'vendors_shipping/' . $include_modules[$i]['file']);\n\n $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];\n }//for\n }", "public function cart_no_shipping()\n\t{\n\n\t\t// get the store cart cookie\n\t\t$cookie = ee()->input->cookie('store_cart');\n\n\t\t// if the cookie has a value\n\t\tif ($cookie) {\n\n\t\t\t// query for the items in the order\n\t\t\t$query = ee()->db\n\t\t\t\t->select('sku, exp_store_order_items.url_title, weight, height, width, length, field_id_26 as container')\n\t \t->where('order_hash', $cookie)\n\t \t->join('store_orders', 'exp_store_orders.id = exp_store_order_items.order_id')\n\t \t->join('channel_data', 'exp_channel_data.entry_id = exp_store_order_items.entry_id')\n\t \t->get('store_order_items');\n\n\t // default the values\n\t $vars['cart_weight'] = 0;\n\t $vars['missing_dimensions'] = 'n';\n\t $vars['container_self'] = 'n';\n\n\t // loop through the cart and update the values\n\t foreach($query->result() as $item)\n\t {\n\t \tif(!empty($item->weight))\n\t \t{\n\t \t\t$vars['cart_weight'] += $item->weight;\n\t \t}\t\n\t \t\n\n\t \tif(!$item->weight || !$item->height || !$item->width || !$item->length)\n\t \t{\n\t \t\t$vars['missing_dimensions'] = 'y';\n\t \t}\n\n\t \tif($item->container == 'Self')\n\t \t{\n\t \t\t$vars['container_self'] = 'y';\n\t \t}\t\n\t }\n\n\t \t// parse the variables into the tagdata\n\t \treturn ee()->TMPL->parse_variables_row(ee()->TMPL->tagdata, $vars);\n\t \t\n } // end of if\n\n\t}", "public function getShippingCost();", "public function getShippingInfo();", "public function initShippingMethod()\n {\n $helper = Mage::helper('onestepcheckout/shipping');\n if (!$this->getQuote()->getShippingAddress()->getShippingMethod()) {\n $shippingRates = $helper->getShippingRates();\n if ((count($shippingRates) == 1)) {\n $currentShippingRate = current($shippingRates);\n if (count($currentShippingRate) == 1) {\n $shippingRate = current($currentShippingRate);\n $shippingMethod = $shippingRate->getCode();\n }\n } elseif ($lastShippingMethod = $helper->getLastShippingMethod()) {\n $shippingMethod = $lastShippingMethod;\n } elseif ($defaultShippingMethod = Mage::helper('onestepcheckout/config')->getDefaultShippingMethod()) {\n $shippingMethod = $defaultShippingMethod;\n }\n if (isset($shippingMethod)) {\n $this->getOnepage()->saveShippingMethod($shippingMethod);\n }\n }\n }", "public function isCatalogShippingVisible()\n {\n return (\n $this->isCatalogInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_SHIPPING)\n ) ? true : false;\n }", "private function _collectShippingInfo(){\n\t\tif(!empty($this->_shippingPriceCache)) return $this->_shippingPriceCache;\n\t\t$return = Mage::getSingleton(\"ultracart/cart\")->_collectShippingInfo();\n\t\t$this->_shippingPriceCache = $return;\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "public function markAsExpressShipping(Order $draftOrder): bool;", "public function getShippingInclTax();", "public function get_shipping_cost()\n {\n $products = $this->get();\n $shipping = 0;\n if (! empty($products)) {\n foreach ($products as $product) {\n if ($product['weight'] <= 200) {\n $shipping += 1.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 500) {\n $shipping += 3.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 800) {\n $shipping += 5.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1000) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } else {\n $shipping += 20.00 * ($_SESSION['cart'][$product['id']]);\n }\n }\n return $shipping; \n }\n else {\n return 0.00;\n }\n\n }", "public function isShippingCarrierFilterEnabled()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_SHIPPING_ENABLE_CARRIER_FILTER);\n }", "public function find_shipping_cost(Request $req){\n $lat = $req->latitude;\n $long = $req->longitude;\n $tamount = $req->total;\n\n $selected_city = $this->getCity($lat,$long);\n\n\n if(!$selected_city || !$lat || !$long){\n echo json_encode(array(\n \"status\" => false,\n \"msg\"=>\"Unable to find your city\"\n )); exit;\n }\n\n $cur_location = strtolower($req->session()->get('location_name'));\n\n\n // Shipping charge calculation\n $locations = DB::table(\"locations\")->where(\"status\",\"0\")->get();\n $product_locations = [];\n foreach ($locations as $key => $value) {\n $product_locations[] = strtolower($value->location_name);\n }\n\n $shipping_data = ShippingSetting::where('id',1)->first();\n\n if(!empty($cur_location) && $cur_location != \"notfound\"){\n if(in_array($cur_location, $product_locations)){\n // if user purchased greater than max order , no shipping charge\n if($tamount <= $shipping_data->min_order_price){\n $shipping_percent = $shipping_data->charge_inside_location;\n }else{\n $shipping_percent = 0;\n }\n\n echo json_encode(array(\n \"status\" => true,\n \"shipping_cost\" => round($shipping_percent,2),\n \"total\" => round(($tamount + $shipping_percent),2)\n )); exit;\n }\n }\n\n\n if($tamount >= $shipping_data->min_order_price){\n $shipping_percent = 0;\n }else if(!in_array($selected_city, $product_locations)){\n // if user purchased min order , outside location\n $shipping_percent = $shipping_data->charge_outside_location;\n }elseif(in_array($selected_city, $product_locations) && $tamount <= $shipping_data->min_order_price){\n // if user purchased min order , inside location\n $shipping_percent = $shipping_data->charge_inside_location;\n }else{\n // if user purchased greater than max order , no shipping charge\n $shipping_percent = 0;\n }\n\n echo json_encode(array(\n \"status\" => true,\n \"shipping_cost\" => round($shipping_percent,2),\n \"total\" => round(($tamount + $shipping_percent),2)\n )); exit;\n\n }", "protected function filter_items_needing_shipping( $item ) {\n\t\t$product = $item['data'];\n\t\treturn $product && $product->needs_shipping();\n\t}", "function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }", "private function isNegotiableShippingPriceSet()\n {\n $priceSet = false;\n $quoteId = $this->context->getRequest()->getParam('negotiableQuoteId');\n\n if ($quoteId) {\n try {\n $quote = $this->quoteRepository->get($quoteId, ['*']);\n\n if ($quote->getExtensionAttributes() !== null\n && $quote->getExtensionAttributes()->getNegotiableQuote() !== null\n && $quote->getExtensionAttributes()->getNegotiableQuote()->getShippingPrice()\n ) {\n $priceSet = true;\n }\n } catch (NoSuchEntityException $e) {\n // If no such entity, skip\n }\n }\n\n return $priceSet;\n }", "public function availableCheckout()\n {\n //and disables method if it is not\n\n $country = $this->_website->getConfig('payment/mercadopago/country');\n\n if (!in_array($country, $this->available_transparent_credit_cart)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_custom/active', 0, 'websites', $this->_website->getId());\n }\n\n if (!in_array($country, $this->available_transparent_ticket)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_customticket/active', 0, 'websites', $this->_website->getId());\n }\n }", "function is_shipping_taxable() {\n\t\tif (isset($this->data['tax_status']) && ($this->data['tax_status']=='taxable' || $this->data['tax_status']=='shipping')) return true;\n\t\treturn false;\n\t}", "public function getShippingDetails();", "private function setShippingOptions() {\n // Reset the settings if this is a recrawl\n if ($this->getSaverData()->isRecrawl()) {\n // Set dimensions and weight\n $this->product->set_weight('');\n $this->product->set_length('');\n $this->product->set_width('');\n $this->product->set_height('');\n\n // Set shipping class\n $this->product->set_shipping_class_id(0);\n }\n\n // No shipping for virtual products.\n if ($this->wcData->isVirtual()) {\n $this->product->set_virtual(true);\n return;\n }\n\n // Not a virtual product.\n $this->product->set_virtual(false);\n\n // Set dimensions and weight\n $this->product->set_weight($this->wcData->getWeight());\n $this->product->set_length($this->wcData->getLength());\n $this->product->set_width($this->wcData->getWidth());\n $this->product->set_height($this->wcData->getHeight());\n\n // Set shipping class\n $this->product->set_shipping_class_id($this->wcData->getShippingClassId());\n }", "public function index(Request $request)\n {\n $products = $this->cartRepo->getCartItems();\n\n // if(!auth()->check())\n // {\n // return redirect()->route('login')->with(['error' => 'Login / Register in order to checkout']);\n // }\n\n $customer = $request->user();\n\n $courier = $this->courierRepo->findCourierById(request()->session()->get('courierId', 1));\n $shippingFee = $this->cartRepo->getShippingFee($courier);\n\n\n $countries = Country::get();\n //Check the if impression kit is in cart then show medical form as checkout page otherwise show simple checkout page\n $impressionKit = false;\n $aligners = false;\n\n foreach($this->cartRepo->getCartItems() as $item)\n {\n $product = Product::with(['categories'])->find($item->id);\n foreach($product->categories as $category)\n {\n if($category->label == \"IK\")\n $impressionKit = true;\n\n if($category->label == \"Aligners\")\n $aligners = true;\n }\n }\n\n $statesList = array(\"AL\"=>\"Alabama\", \"AK\"=>\"Alaska\", \"AZ\"=>\"Arizona\", \"AR\"=>\"Arkansas\", \"CA\"=>\"California\", \"CO\"=>\"Colorado\", \"CT\"=>\"Connecticut\", \"DE\"=>\"Delaware\", \"DC\"=>\"District of Columbia\", \"FL\"=>\"Florida\", \"GA\"=>\"Georgia\", \"HI\"=>\"Hawaii\", \"ID\"=>\"Idaho\", \"IL\"=>\"Illinois\", \"IN\"=>\"Indiana\", \"IA\"=>\"Iowa\", \"KS\"=>\"Kansas\", \"KY\"=>\"Kentucky\", \"LA\"=>\"Louisiana\", \"ME\"=>\"Maine\", \"MD\"=>\"Maryland\", \"MA\"=>\"Massachusetts\", \"MI\"=>\"Michigan\", \"MN\"=>\"Minnesota\", \"MS\"=>\"Mississippi\", \"MO\"=>\"Missouri\", \"MT\"=>\"Montana\", \"NE\"=>\"Nebraska\", \"NV\"=>\"Nevada\", \"NH\"=>\"New Hampshire\", \"NJ\"=>\"New Jersey\", \"NM\"=>\"New Mexico\", \"NY\"=>\"New York\", \"NC\"=>\"North Carolina\", \"ND\"=>\"North Dakota\", \"OH\"=>\"Ohio\", \"OK\"=>\"Oklahoma\", \"OR\"=>\"Oregon\", \"PA\"=>\"Pennsylvania\", \"RI\"=>\"Rhode Island\", \"SC\"=>\"South Carolina\", \"SD\"=>\"South Dakota\", \"TN\"=>\"Tennessee\", \"TX\"=>\"Texas\", \"UT\"=>\"Utah\", \"VT\"=>\"Vermont\", \"VA\"=>\"Virginia\", \"WA\"=>\"Washington\", \"WV\"=>\"West Virginia\", \"WI\"=>\"Wisconsin\",\"WY\"=>\"Wyoming\");\n\n\n // if($impressionKit)\n // $view = 'front.checkout';\n // else\n $view = 'front.checkout.checkout2-update';\n\n return view($view, [\n 'customer' => $customer ?: null,\n 'billingAddress' => '',\n 'address' => $customer ? $customer->addresses()->first() : null,\n 'products' => $this->cartRepo->getCartItems(),\n 'subtotal' => $this->cartRepo->getSubTotal(),\n 'tax' => $this->cartRepo->getTax(),\n 'total' => $this->cartRepo->getSubTotal(),\n 'cartItems' => $this->cartRepo->getCartItemsTransformed(),\n 'shippingFee' => $shippingFee,\n 'countries' => $countries,\n 'aligners' => $aligners,\n 'statesList' => $statesList,\n ]);\n }", "public function isAllowInCart() {\n return !$this->isEnabled();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function isShippingLabelsAvailable()\n {\n return true;\n }", "function jigoshop_upgrade_146() {\n\t\n\tJigoshop_Base::get_options()->add_option( 'jigoshop_show_checkout_shipping_fields', 'yes' );\n\t\n}", "function action_woocommerce_before_shipping_zone_object_save( $instance, $this_data_store ) {\n $shipping_methods = $instance->get_shipping_methods();\n foreach($shipping_methods as $shipping_method){\n if( isset($instance->get_changes()['zone_locations']) ){\n update_shipping_rules($shipping_method, $instance->get_changes()['zone_locations'], $instance->get_id());\n }\n\n }\n\n}", "function getShippingPrice(){\n\t\t$data = $this->_collectShippingInfo();\n\t\tif(Mage::getModel(\"tax/config\")->displayCartShippingExclTax()) return $data->getShippingExclTax();\n\t\telse return $data->getShippingInclTax();\n\t}", "public function getShippingList(Request $request)\n {\n\t\t$user = null;\n\t\t$nope = false;\n\t\t$v = \"\";\n\t\t\n\t\t$signals = $this->helpers->signals;\n\t\t$plugins = $this->helpers->getPlugins();\n\t\t$permissions = $this->helpers->permissions;\n\t\t#$this->helpers->populateTips();\n $cpt = ['user','signals','plugins'];\n\t\t\t\t\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_users','edit_users']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n \n\t\t\t\tif(isset($req['xf']))\n\t\t\t\t{\n\t\t\t\t\t$v = \"shipping-list\";\n\t\t\t\t\t$o = $this->helpers->getOrder($req['xf']);\n\t\t\t\t #dd($o);\n\t\t\t\t\tif(count($o) < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tsession()->flash(\"validation-status-error\",\"ok\");\n\t\t\t\t\t\treturn redirect()->intended('orders');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($req['type']) && $req['type'] == \"edit\") $v = \"edit-order\";\n\t\t\t\t\t\tarray_push($cpt,'o'); \n\t\t\t\t\t\t$countries = $this->helpers->countries;\n\t\t\t\t\t $statuses = $this->helpers->statuses;\n\t\t\t\t\t\t$products = $this->helpers->getProducts();\n\t\t\t\t\t array_push($cpt,'products'); \n\t\t\t\t\t array_push($cpt,'countries'); \n\t\t\t\t\t array_push($cpt,'statuses'); \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"validation-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('orders');\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$v = \"login\";\n\t\t}\n\t\treturn view($v,compact($cpt));\n }", "public function isLowestShippingMultipleAssignmentMethod()\n {\n return ($this->getMultipleAssignmentMethodCode() == 'lowest_shipping') ? true : false;\n }", "public function needs_shipping() {\n\t\tif ( ! wc_shipping_enabled() || 0 === wc_get_shipping_method_count( true ) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$needs_shipping = false;\n\n\t\tforeach ( $this->get_cart_contents() as $cart_item_key => $values ) {\n\t\t\tif ( $values['data']->needs_shipping() ) {\n\t\t\t\t$needs_shipping = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_needs_shipping', $needs_shipping );\n\t}", "public function apply()\n {\n /** @var EavSetup $eavSetup */\n $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);\n\n if (!$eavSetup->getAttribute(Product::ENTITY, 'am_shipping_type')) {\n $eavSetup->addAttribute(\n Product::ENTITY,\n 'am_shipping_type',\n [\n 'type' => 'varchar',\n 'backend' => '',\n 'frontend' => '',\n 'label' => 'Shipping Type',\n 'input' => 'select',\n 'class' => '',\n 'source' => '',\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'visible' => true,\n 'required' => false,\n 'user_defined' => false,\n 'default' => 0,\n 'searchable' => false,\n 'filterable' => false,\n 'comparable' => false,\n 'visible_on_front' => false,\n 'used_in_product_listing' => true,\n 'unique' => false,\n 'apply_to' => ''\n ]\n );\n }\n }", "function f3d_payment_method_filter($available_gateways)\n{\n\tglobal $wp, $current_user;\n\n\t$isDistributor = ($current_user && $current_user->roles && in_array('distributor', $current_user->roles));\n\t$disallow = $isDistributor\n\t\t? ['paypal']\n\t\t: ['bacs'];\n\n\tforeach($available_gateways as $gateway_id => $gateway)\n\t{\n\t\tif (in_array($gateway_id, $disallow))\n\t\t{\n\t\t\tunset($available_gateways[$gateway_id]);\n\t\t}\n\t}\n\n\treturn $available_gateways;\n}", "public function getShippingInvoiced();", "function woocommerce_proceed_to_checkout(){\n\n $chosen_methods = WC()->session->get( 'chosen_shipping_methods' );\n $chosen_shipping = $chosen_methods[0];\n\n if ($chosen_shipping == null || $chosen_shipping == ''){\n echo \"<script>jQuery('.checkout-button').attr('disabled','disabled');</script>\";\n }\n\n }", "public function handle_shipping() {\n if ( ! is_user_logged_in() ) {\n return;\n }\n\n if ( ! dokan_is_user_seller( get_current_user_id() ) ) {\n return;\n }\n\n if ( isset( $_POST['dokan_update_shipping_options'] ) && wp_verify_nonce( $_POST['dokan_shipping_form_field_nonce'], 'dokan_shipping_form_field' ) ) {\n if ( ! current_user_can( 'dokan_view_store_shipping_menu' ) ) {\n wp_die( __( 'You have no access to save this shipping options', 'dokan' ) );\n }\n\n $user_id = dokan_get_current_user_id();\n $s_rates = array();\n $rates = array();\n\n // Additional extra code\n\n if ( isset( $_POST['dps_enable_shipping'] ) ) {\n update_user_meta( $user_id, '_dps_shipping_enable', $_POST['dps_enable_shipping'] );\n }\n\n if ( isset( $_POST['dokan_shipping_type'] ) ) {\n update_user_meta( $user_id, '_dokan_shipping_type', $_POST['dokan_shipping_type'] );\n }\n\n if ( isset( $_POST['dps_shipping_type_price'] ) ) {\n update_user_meta( $user_id, '_dps_shipping_type_price', $_POST['dps_shipping_type_price'] );\n }\n\n if ( isset( $_POST['dps_additional_product'] ) ) {\n update_user_meta( $user_id, '_dps_additional_product', $_POST['dps_additional_product'] );\n }\n\n if ( isset( $_POST['dps_additional_qty'] ) ) {\n update_user_meta( $user_id, '_dps_additional_qty', $_POST['dps_additional_qty'] );\n }\n\n if ( isset( $_POST['dps_pt'] ) ) {\n update_user_meta( $user_id, '_dps_pt', $_POST['dps_pt'] );\n }\n\n if ( isset( $_POST['dps_ship_policy'] ) ) {\n update_user_meta( $user_id, '_dps_ship_policy', $_POST['dps_ship_policy'] );\n }\n\n if ( isset( $_POST['dps_refund_policy'] ) ) {\n update_user_meta( $user_id, '_dps_refund_policy', $_POST['dps_refund_policy'] );\n }\n\n if ( isset( $_POST['dps_form_location'] ) ) {\n update_user_meta( $user_id, '_dps_form_location', $_POST['dps_form_location'] );\n }\n\n if ( isset( $_POST['dps_country_to'] ) ) {\n foreach ( $_POST['dps_country_to'] as $key => $value ) {\n $country = $value;\n $c_price = wc_format_decimal( $_POST['dps_country_to_price'][ $key ] );\n\n if ( ! $c_price && empty( $c_price ) ) {\n $c_price = 0;\n }\n\n if ( ! empty( $value ) ) {\n $rates[ $country ] = $c_price;\n }\n }\n }\n\n update_user_meta( $user_id, '_dps_country_rates', $rates );\n\n if ( isset( $_POST['dps_state_to'] ) ) {\n foreach ( $_POST['dps_state_to'] as $country_code => $states ) {\n foreach ( $states as $key_val => $name ) {\n $country_c = $country_code;\n $state_code = $name;\n $s_price = wc_format_decimal( $_POST['dps_state_to_price'][ $country_c ][ $key_val ] );\n\n if ( ! $s_price || empty( $s_price ) ) {\n $s_price = 0;\n }\n\n if ( ! empty( $name ) ) {\n $s_rates[ $country_c ][ $state_code ] = $s_price;\n }\n }\n }\n }\n\n update_user_meta( $user_id, '_dps_state_rates', $s_rates );\n\n do_action( 'dokan_after_shipping_options_updated', $rates, $s_rates );\n\n $shipping_url = dokan_get_navigation_url( 'settings/regular-shipping' );\n wp_redirect( add_query_arg( array( 'message' => 'shipping_saved' ), $shipping_url ) );\n exit();\n }\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MageWorx_ShippingRules::quote');\n }", "public function getShippingDiscountAmount();", "public function is_available( $shipment = array() ) {\n\n\t\t// standard availability checks (is enabled, ship to is in admin-selected allowed countries, etc)\n\t\t$is_available = parent::is_available( $shipment );\n\n\n\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_2_6() ) {\n\n\t\t\t// it seems that in WC 2.6+ we do need to check if the shipping method is enabled,\n\t\t\t// otherwise it will appear enabled straight after activation {TZ 2016-05-26}\n\t\t\t$is_available = $this->is_enabled() && $is_available;\n\t\t}\n\n\t\treturn apply_filters( 'wc_shipwire_shipping_method_is_available', $is_available, $shipment, $this );\n\t}", "abstract function is_only_premium();", "function add_CDEK_shipping_method($methods)\n {\n $methods['CDEK_shipping_method'] = 'WC_CDEK_Shipping_Method';\n return $methods;\n }", "public function getShippingMethodName();", "public function getShippingAmount();" ]
[ "0.6907243", "0.6636087", "0.6358307", "0.6330188", "0.6259694", "0.61855423", "0.6043022", "0.5997158", "0.5983757", "0.59224397", "0.586835", "0.5858973", "0.58379287", "0.5791495", "0.57680327", "0.57367164", "0.56658185", "0.566548", "0.56456727", "0.56411123", "0.5639651", "0.5636123", "0.56217295", "0.5618535", "0.5617019", "0.5610834", "0.55962336", "0.55949754", "0.55833536", "0.5583212", "0.5574874", "0.5571786", "0.5564493", "0.5541042", "0.5537224", "0.5532153", "0.55226225", "0.5519799", "0.55174285", "0.5495816", "0.5493393", "0.5490572", "0.54890174", "0.5485908", "0.54712933", "0.54685944", "0.5462656", "0.5452916", "0.5446514", "0.5437743", "0.5433443", "0.54306537", "0.5430605", "0.54269665", "0.5425494", "0.5418337", "0.5414016", "0.5391689", "0.53825724", "0.5372256", "0.5364776", "0.5356389", "0.53537506", "0.5343117", "0.53393745", "0.53362095", "0.5326227", "0.5323293", "0.5320596", "0.5305527", "0.5294754", "0.52923584", "0.52841717", "0.5275206", "0.527356", "0.52706915", "0.5266979", "0.5262568", "0.52589464", "0.52581626", "0.52580875", "0.5248849", "0.5247828", "0.52477586", "0.524737", "0.5247071", "0.52467275", "0.5246389", "0.524555", "0.52439106", "0.523816", "0.52356654", "0.52265096", "0.5216862", "0.521584", "0.52148706", "0.52134717", "0.52133757", "0.5195923", "0.51939493" ]
0.73735356
0
Add custom order meta data to make it accessible in Order preview template
public static function admin_order_add_custom_meta_data( $data, $wc_order ) { $configs = OmnivaLt_Core::get_configs(); $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva')); foreach ( $configs['method_params'] as $method_key => $method_values ) { if ( ! $method_values['is_shipping_method'] ) continue; if ( $order->omniva->method != $method_values['key'] ) continue; if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) { $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . ": " . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id); } } if ($order->omniva->method) { $shipping_settings = OmnivaLt_Core::get_settings(); $omnivalt_labels = new OmnivaLt_Labels(); $barcode = $order->omniva->barcodes[0]; $country_code = $shipping_settings['shop_countrycode']; $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true); $data['omnivalt_barcode'] = $barcode; } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCustomFields ($order) {\n \n }", "protected function update_post_meta( &$order ) {\n\t\tglobal $wpdb;\n\n\t\t$edit_data = array(\n\t\t\t'order_key' => $order->get_order_key( 'edit' ),\n\t\t\t'customer_id' => $order->get_customer_id( 'edit' ),\n\t\t\t'payment_method' => $order->get_payment_method( 'edit' ),\n\t\t\t'payment_method_title' => $order->get_payment_method_title( 'edit' ),\n\t\t\t'transaction_id' => $order->get_transaction_id( 'edit' ),\n\t\t\t'customer_ip_address' => $order->get_customer_ip_address( 'edit' ),\n\t\t\t'customer_user_agent' => $order->get_customer_user_agent( 'edit' ),\n\t\t\t'created_via' => $order->get_created_via( 'edit' ),\n\t\t\t'date_completed' => $order->get_date_completed( 'edit' ),\n\t\t\t'date_paid' => $order->get_date_paid( 'edit' ),\n\t\t\t'cart_hash' => $order->get_cart_hash( 'edit' ),\n\n\t\t\t'billing_first_name' => $order->get_billing_first_name( 'edit' ),\n\t\t\t'billing_last_name' => $order->get_billing_last_name( 'edit' ),\n\t\t\t'billing_company' => $order->get_billing_company( 'edit' ),\n\t\t\t'billing_address_1' => $order->get_billing_address_1( 'edit' ),\n\t\t\t'billing_address_2' => $order->get_billing_address_2( 'edit' ),\n\t\t\t'billing_city' => $order->get_billing_city( 'edit' ),\n\t\t\t'billing_state' => $order->get_billing_state( 'edit' ),\n\t\t\t'billing_postcode' => $order->get_billing_postcode( 'edit' ),\n\t\t\t'billing_country' => $order->get_billing_country( 'edit' ),\n\n\t\t\t'billing_email' => $order->get_billing_email( 'edit' ),\n\t\t\t'billing_phone' => $order->get_billing_phone( 'edit' ),\n\n\t\t\t'shipping_first_name' => $order->get_shipping_first_name( 'edit' ),\n\t\t\t'shipping_last_name' => $order->get_shipping_last_name( 'edit' ),\n\t\t\t'shipping_company' => $order->get_shipping_company( 'edit' ),\n\t\t\t'shipping_address_1' => $order->get_shipping_address_1( 'edit' ),\n\t\t\t'shipping_address_2' => $order->get_shipping_address_2( 'edit' ),\n\t\t\t'shipping_city' => $order->get_shipping_city( 'edit' ),\n\t\t\t'shipping_state' => $order->get_shipping_state( 'edit' ),\n\t\t\t'shipping_postcode' => $order->get_shipping_postcode( 'edit' ),\n\t\t\t'shipping_country' => $order->get_shipping_country( 'edit' ),\n\n\t\t\t'discount_total' => $order->get_discount_total( 'edit' ),\n\t\t\t'discount_tax' => $order->get_discount_tax( 'edit' ),\n\t\t\t'shipping_total' => $order->get_shipping_total( 'edit' ),\n\t\t\t'shipping_tax' => $order->get_shipping_tax( 'edit' ),\n\t\t\t'cart_tax' => $order->get_total_tax( 'edit' ),\n\t\t\t'total' => $order->get_total( 'edit' ),\n\n\t\t\t'version' => $order->get_version( 'edit' ),\n\t\t\t'currency' => $order->get_currency( 'edit' ),\n\t\t\t'prices_include_tax' => $order->get_prices_include_tax( 'edit' ),\n\t\t);\n\n\t\t$changes = array();\n\n\t\tif ( $this->creating ) {\n\t\t\t$wpdb->insert(\n\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\tarray_merge( array(\n\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t), $edit_data )\n\t\t\t);\n\n\t\t\t// We are no longer creating the order, it is created.\n\t\t\t$this->creating = false;\n\t\t} else {\n\t\t\t$changes = array_intersect_key( $edit_data, $order->get_changes() );\n\n\t\t\tif ( ! empty( $changes ) ) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\t\t$changes,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$updated_props = array_keys( (array) $changes );\n\n\t\t// If customer changed, update any downloadable permissions.\n\t\tif ( in_array( 'customer_user', $updated_props ) || in_array( 'billing_email', $updated_props ) ) {\n\t\t\t$data_store = WC_Data_Store::load( 'customer-download' );\n\t\t\t$data_store->update_user_by_order_id( $order->get_id(), $order->get_customer_id(), $order->get_billing_email() );\n\t\t}\n\n\t\tdo_action( 'woocommerce_order_object_updated_props', $order, $updated_props );\n\t}", "function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Phone 2').':</strong> <br/>' . get_post_meta( $order->get_id(), 'billing_phone_new', true ) . '</p>';\n}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tparent::save_order_meta_fields( $order, $request );\n\n\t\tupdate_post_meta( $order->get_id(), '_cards_brand_name', $request->payment->payment_type_code );\n\t\tupdate_post_meta( $order->get_id(), '_masked_card_number', WC_EBANX_Request::read( 'ebanx_masked_card_number' ) );\n\t}", "public function add_order_meta_box() {\n\t\t\\add_meta_box(\n\t\t\t'bwcpp_profile_picture_box',\n\t\t\t__( 'Profile Picture', 'bwcpp' ),\n\t\t\tarray( $this, 'render_order_meta_box' ),\n\t\t\t'shop_order',\n\t\t\t'side',\n\t\t\t'default'\n\t\t);\n\t}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tupdate_post_meta( $order->get_id(), '_ebanx_tef_bank', sanitize_text_field( WC_EBANX_Request::read( 'tef' ) ) );\n\n\t\tparent::save_order_meta_fields( $order, $request );\n\t}", "protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }", "public function render_order_meta_box() {\n\t\tglobal $post_id;\n\n\t\t$order = \\wc_get_order( $post_id );\n\t\t$profile_picture = \\get_post_meta( $post_id, '_bwcpp_picture_id', true );\n\t\t?>\n\n\t\t<?php if ( ! empty( $profile_picture ) ) : ?>\n\n\t\t\t<?php $picture = wp_get_attachment_image_src( $profile_picture ); ?>\n\t\t\t<img src=\"<?php echo $picture[0]; ?>\" alt=\"\" width=\"100%\">\n\n\t\t<?php else : ?>\n\n\t\t\t<?php _e( 'User didn\\'t upload any image.', 'bwcpp' ); ?>\n\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $order->get_user_id() ) : ?>\n\t\t\t<a href=\"<?php echo get_edit_user_link( $order->get_user_id() ); ?>\"><?php _e( 'View customer profile', 'bwcpp' ); ?> &rarr;</a>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t}", "function carton_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = false ){\n\treturn add_metadata( 'order_item', $item_id, $meta_key, $meta_value, $unique );\n}", "public static function my_custom_checkout_field_display_admin_order_meta($order){\r\n\t \r\n\t $customer_id = new Customer_ID_Model();\r\n\t $results = $customer_id->getUserProfile();\r\n\r\n\t $user_id = get_post_meta( $order->id, '_customer_user', true );\r\n\r\n\t foreach($results as $result){\r\n\t $user_image = $result->profile;\r\n\t }\r\n\t \r\n\t if (empty($user_image)) {\r\n\t $aid = get_user_meta( $user_id, 'get_avatar', true );\r\n\t $user_img = wp_get_attachment_image_src( $aid, $size = 'small', $icon = false)['0'];\r\n\t } else {\r\n\t $user_img = $user_image;\r\n\t }\r\n\t?>\r\n\t <p><strong>Government Issued ID:</strong></p>\r\n\t <span style=\"margin:20px 0 20px 0\" class=\"image mr-half inline-block\">\r\n\t <a href=\"<?php echo $user_img;?>\" data-lightbox=\"government issued id\" data-title=\"Customer Goverment Issued ID\"><img alt=\"\" src=\"<?php echo $user_img;?>\" class=\"avatar-photo avatar avatar-32 wp-user-avatar wp-user-avatar-32 alignnone photo avatar-default\" width=\"200\" height=\"140\"></a>\r\n\t </span>\r\n\t<?php \r\n }", "protected function save_paypal_meta_data( $order, $posted ) {\n }", "function f3f_order_meta_box( $post ) { ?>\r\n\t<?php wp_nonce_field( plugin_basename( __FILE__ ), 'f3f_feature_options' ); ?>\r\n\t<p><strong><?php _e('Order') ?></strong></p>\r\n\t<p><label class=\"screen-reader-text\" for=\"feature_order\"><?php _e('Order') ?></label><input name=\"feature_order\" type=\"text\" size=\"4\" id=\"feature_order\" value=\"<?php echo get_post_meta($post->ID, 'feature_order', true )?>\" /></p>\r\n<?php }", "function wc_bocpay_display_order_meta_for_admin( $order ){\n $trade_no = get_post_meta( $order->id, 'Bocpay Trade No.', true );\n if( !empty($trade_no ) ){\n echo '<p><strong>交通银行交易流水号:</strong><br />' .$trade_no. '</p>';\n }\n }", "function cb_order_meta_general( $order ) {\n\tif ($order->get_payment_method() == 'coinbase') {\n\t\t?>\n\n\t\t<br class=\"clear\"/>\n\t\t<h3>Coinbase Commerce Data</h3>\n\t\t<div class=\"\">\n\t\t\t<p>Coinbase Commerce Reference # <?php echo esc_html($order->get_meta('_coinbase_charge_id')); ?></p>\n\t\t</div>\n\n\t\t<?php\n\t}\n}", "function jtl_save_testimonial_order_meta($post_id, $post) {\n\tif ($post->post_type == 'testimonial') {\n\t\t// Check to see if order value exists\n\t\t$meta_value = get_post_meta($post_id, 'jlt_testimonial_order', true);\n\t\tif (!$meta_value || empty($meta_value)) {\n\t\t\tadd_post_meta($post_id, 'jlt_testimonial_order', 0, true);\n\t\t}\n\t}\n\t\n}", "public function testUpdateOrderCustomFields()\n {\n }", "public function add_shop_order_metabox() {\n\t\tadd_meta_box( 'instore', __( 'Instore for Woocommerce', 'instore' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' );\n\t}", "function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}", "function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Shipping Method').':</strong> ' . get_post_meta( $order->id, 'shippingMethod', true ) . '</p>';\n }", "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "public function add_meta() {\n\n\t\tglobal $woocommerce, $post;\n\t\t// Text Field\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'author',\n\t\t\t\t'label' => __( 'Author(s)', 'woocommerce' ),\n\t\t\t\t'placeholder' => 'author(s)',\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Author Name(s)', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'release_date',\n\t\t\t\t'label' => __( 'Release Date', 'woocommerce' ),\n\t\t\t\t'placeholder' => date( \"n/j/Y\" ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Release Date', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'preview_file',\n\t\t\t\t'label' => __( 'Preview File (look inside)', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Upload a PDF file sample', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\techo( '<input type=\"button\" class=\"button custom_media\" name=\"preview_file_button\" id=\"preview_file_button\" value=\"Upload/Browse\"/>' );\n\t\twoocommerce_wp_checkbox(\n\t\t\tarray(\n\t\t\t\t'id' => 'local_product',\n\t\t\t\t'label' => __( 'Local Product', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( '(not Longleaf)', 'woocommerce' ),\n\t\t\t\t'cbvalue' => '1'\n\t\t\t)\n\t\t);\n\t}", "function display_sku_as_meta_data( $item, $order ) {\n\t\t\t$product = BEWPI_WC_Order_Compatibility::get_product( $order, $item );\n\t\t\t$sku = $product && BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) ? BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) : '-';\n\t\t\t?>\n\t\t\t<br>\n\t\t\t<ul>\n\t\t\t\t<li>\n\t\t\t\t\t<strong><?php esc_html_e( 'SKU:', 'woocommerce-pdf-invoices' ); ?></strong> <?php echo esc_html( $sku ); ?>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<?php\n\t\t}", "function action_woocommerce_order_items_table( $order ) {\n\t\t// make action magic happen here... \n\t\t$data = get_post_meta( $order->id, '_metatest_data', true );\n\t\techo '<tr>\n\t\t\t\t<th scope=\"row\"><span class=\"np_forudpdate\">Накладная (Новая почта):</span></th>\n\t\t\t\t\t<td>' . $data . '</td>\n\t\t\t\t</tr>';\n\t}", "private function alterOrderInformation()\n {\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $sql = \"UPDATE `s_core_snippets`\n SET `value` = CASE\n WHEN `value` = 'Free text 4' THEN 'Transaction ID'\n WHEN `value` = 'Freitextfeld 4' THEN 'Transaktions-ID'\n ELSE `value`\n END\n WHERE `namespace` = 'backend/order/main'\n AND `value` IN ('Freitextfeld 4', 'Free text 4')\";\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $sql = \"INSERT INTO `s_attribute_configuration` (table_name, column_name, \"\n . \"column_type, position, translatable, display_in_backend, custom, \"\n . \"help_text, support_text, label, entity, array_store) \"\n . \"VALUES ('s_order_attributes','attribute4','string',1,0,1,0,'','','Transaction ID','NULL',NULL)\";\n }\n Shopware()->Db()->query($sql);\n }", "function invoice_order_meta_handler( $item_id, $values, $cart_item_key ) {\n\t\tif ( isset( $values['invoice_number'] ) ) {\n\t\t\twc_add_order_item_meta( $item_id, \"Invoice Number\", $values['invoice_number'] );\n\t\t}\n\t}", "function add_item_fields( $order ) {\n\t\t\n\t\t$line_items = '';\n\t\t\n\t\t// Cart Contents\n\t\t$item_loop = 0;\n\t\tif (sizeof($order->get_items())>0) {\n\t\t\tforeach ($order->get_items() as $item) {\n\t\t\t\t\n\t\t\t\tif ($item['qty']){\n\t\t\t\t\t$item_loop++;\n\t\t\t\t\t$product = $order->get_product_from_item($item);\n\t\t\t\t\t\n\t\t\t\t\t$item_id = '';\n\t\t\t\t\tif ($product->get_sku()) { \n\t\t\t\t\t\t$item_id = $product->get_sku();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$item_id = $product->id;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$item_name \t= $this->get_item_name( $item['name'] );\n\t\n\t\t\t\t\t$item_meta \t= new WC_Order_Item_Meta( $item['item_meta'] );\n\t\t\t\t\t$item_desc \t= $item_meta->display( true, true );\n\t\t\t\t\t$item_desc \t= $this->get_item_name( $item_desc, 255);\n\t\t\t\t\t\n\t\t\t\t\t$item_qty \t\t= $item['qty'];\n\t\t\t\t\t$item_amount \t= $order->get_item_total( $item, false );\n\t\t\t\t\t$item_tax \t\t= 'NO';\n\t\t\t\t\t\n\t\t\t\t\t$this->add_item_field( $item_id, $item_name, $item_desc, $item_qty, $item_amount, $item_tax );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $line_items;\n\t}", "function give_stripe_custom_payment_meta( $charge_args ) {\n\n\t// Sanitize the input posted data to the form.\n\t$posted_data = give_clean( filter_input_array( INPUT_POST ) );\n\n\t// Prepare metadata fields list.\n\t$custom_meta_fields = array(\n\t\t'Text Field' => ! empty( $posted_data['text_field'] ) ? $posted_data['text_field'] : 'undefined',\n\t\t'Dropdown Field' => ! empty( $posted_data['dropdown_field'] ) ? $posted_data['dropdown_field'][0] : 'undefined',\n\t\t'Donor Comment' => ! empty( $posted_data['give_comment'] ) ? $posted_data['give_comment'] : '',\n\t);\n\t$charge_args['metadata'] = array_merge( $charge_args['metadata'], $custom_meta_fields );\n\n\treturn $charge_args;\n}", "function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) {\r\n $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none';\r\n $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0';\r\n ?>\r\n <div class=\"column-container\">\r\n <div class=\"column\">\r\n <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairsaving\" value=\"<?php esc_attr_e( $fairsaving ); ?>\" class=\"small-text\" />\r\n <p class=\"description\"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n <div class=\"column\">\r\n <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairaddress\" value=\"<?php esc_attr_e( $fairaddress ); ?>\" class=\"medium-text\" />\r\n <p class=\"description\"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n}", "function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {\n\tif ($order->get_payment_method() == 'coinbase') {\n\t\t$fields['coinbase_commerce_reference'] = array(\n\t\t\t'label' => __( 'Coinbase Commerce Reference #' ),\n\t\t\t'value' => $order->get_meta( '_coinbase_charge_id' ),\n\t\t);\n\t}\n\n\treturn $fields;\n}", "public static function set_order_data( $order ) {\n\t\t$order->update_meta_data( '_billing_vat_number', self::$data['vat_number'] );\n\t\t$order->update_meta_data( '_vat_number_is_validated', ! is_null( self::$data['validation']['valid'] ) ? 'true' : 'false' );\n\t\t$order->update_meta_data( '_vat_number_is_valid', true === self::$data['validation']['valid'] ? 'true' : 'false' );\n\n\t\tif ( false !== self::get_ip_country() ) {\n\t\t\t$order->update_meta_data( '_customer_ip_country', self::get_ip_country() );\n\t\t\t$order->update_meta_data( '_customer_self_declared_country', ! empty( $_POST['location_confirmation'] ) ? 'true' : 'false' );\n\t\t}\n\t}", "function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}", "function carton_get_order_item_meta( $item_id, $key, $single = true ) {\n\treturn get_metadata( 'order_item', $item_id, $key, $single );\n}", "public function createMetadataForOrder(OrderModel $order): Metadata\n {\n $metaData = new Metadata();\n\n $metaData->setShopType('Magento 2')\n ->setShopVersion($this->_productMetadata->getVersion())\n ->addMetadata('customerId', $order->getCustomerId())\n ->addMetadata('customerGroupId', $order->getCustomerGroupId())\n ->addMetadata('pluginType', 'magento2-merchant-gateway')\n ->addMetadata('pluginVersion', $this->_moduleList->getOne('Heidelpay_MGW')['setup_version'])\n ->addMetadata('storeId', $order->getStoreId());\n\n return $metaData;\n }", "function theme_uc_product_content_show_order($node) {\n //dsm($node);\n \n $ret = '<div class=\"field\"><div class=\"field-label\">Invoice:</div>';\n $ret .= '<div class=\"field-items\">';\n $ret .= uc_order_load_invoice($node->order);\n $ret .= '</div></div>';\n \n return $ret;\n}", "public function createCustomOrder()\n {\n AutoEvent::select('custom_order')->increment('custom_order', 1);\n $this->custom_order = 0;\n }", "protected function addMeta() {\n foreach ($this->meta_info as $key => $meta) {\n $this->header.=\"<meta name='\" . $key . \"' content='\" . $meta . \"' /> \\n\";\n }\n }", "function sv_wc_admin_custom_order_fields_add_to_notes( $order_id, $post) {\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes1 $order_id:' . print_r( $order_id, true ) );\n\n\t//error_log( 'method_name1 $var:' . print_r( $var, true ) );\n\n\t$updated_custom_fields = isset( $_POST['wc-admin-custom-order-fields'] ) ? $_POST['wc-admin-custom-order-fields'] : null;\n\n\tif ( empty( $updated_custom_fields ) ) {\n\t\treturn;\n\t}\n\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes2 $order_id:' . print_r( $order_id, true ) );\n\n\t$order = wc_get_order( $post );\n\t$order_fields = wc_admin_custom_order_fields()->get_order_fields();\n\n\tforeach ( $order_fields as $custom_field ) {\n\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes3 $order_id:' . print_r( $order_id, true ) );\n\n\t\t$field_id = $custom_field->get_id();\n\t\t$field_meta_key = $custom_field->get_meta_key();\n\t\t$updated_value = isset( $updated_custom_fields[ $field_id ] ) ? $updated_custom_fields[ $field_id ] : '';\n\n\t\t// Update a custom field value unless it's empty...\n\t\t// A value of 0 is valid, so check for that first.\n\t\t// Empty string is also allowed to clear out custom fields completely.\n\t\tif ( '0' === $updated_value || '' === $updated_value || ! empty( $updated_value ) ) {\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes4 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t// Special handling for date fields.\n\t\t\tif ( 'date' === $order_fields[ $field_id ]->get_type() ) {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes5 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$updated_value = strtotime( $updated_value );\n\t\t\t\t// Add Order Note\n\t\t\t\t$order->add_order_note( $order, 'updated value: ' . $updated_value);\n\n\t\t\t\t$order_fields[ $field_id ]->set_value( $updated_value );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $order_fields[ $field_id ]->get_value() );\n\n\t\t\t\t// This column is used so that date fields can be searchable.\n\t\t\t\t$order->update_meta_data( $field_meta_key . '_formatted', $order_fields[ $field_id ]->get_value_formatted() );\n\n\t\t\t} else {\n\t\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes6 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t$order->update_meta_data( $field_meta_key, $updated_value );\n\t\t\t}\n\n\t\t// ...Or if it's empty, delete the custom field meta altogether.\n\t\t} else {\n\n\t\t\terror_log( 'sv_wc_admin_custom_order_fields_add_to_notes7 $order_id:' . print_r( $order_id, true ) );\n\n\t\t\t\t// Remove order note\n\t\t\t$order->add_order_note( $order, 'removed value/set blank: ' . $updated_value);\n\t\t\t\n\t\t\t$order->delete_meta_data( $field_meta_key );\n\t\t\t$order->delete_meta_data( $field_meta_key . '_formatted' );\n\t\t}\n\n\t\t$order->save_meta_data();\n\t}\n\t\n}", "private function memberAddOrder($data){\n $fields = array(\n 'app_id' => $this->appId,\n 'data' => array(\n 'msg_type' => 'order_add',\n 'order_id' => $data['order_id']\n ),\n 'headings' => [\n 'en' => '你有新的訂單',\n 'zh-Hant' => '你有新的訂單'\n ],\n 'contents' => [\n 'en' => '你有新的訂單待處理',\n 'zh-Hant' => '你有新的訂單待處理'\n ],\n 'small_icon' => 'ic_stat_onesignal_default',\n 'ios_badgeType' => 'Increase',\n 'ios_badgeCount' => 1,\n 'filters' => array(\n array(\n 'field' => 'tag',\n 'key' => 'id',\n 'relation' => '=',\n 'value' => $data['store_id']\n )\n )\n );\n return $fields;\n }", "public function licence_keys_meta_box() {\n\t\tglobal $woocommerce, $post, $wpdb, $wc_api_manager_helpers, $woocommerce_plugin_update_api_manager;\n\n\t\t$post_data = $wc_api_manager_helpers->get_postmeta_data( $post->ID );\n\n\t\tif ( isset( $post_data['_billing_email'][0] ) )\n\t\t\t$email = $post_data['_billing_email'][0];\n\n\t\tif ( isset( $post_data['_order_key'][0] ) )\n\t\t\t$order_key = $post_data['_order_key'][0];\n\n\t\t// Get the user order info\n\t\t$data = $wc_api_manager_helpers->get_order_info_by_email_with_order_key( $email, $order_key );\n\n\t\tif ( ! empty( $data ) ) {\n\n\t\t\t?>\n\t\t\t<div class=\"order_licence_keys wc-metaboxes-wrapper\">\n\n\t\t\t\t<div class=\"wc-metaboxes\">\n\n\t\t\t\t\t<?php\n\n\t\t\t\t\t// Get activation info\n\t\t\t\t\t$current_info = $wc_api_manager_helpers->get_users_activation_data( $data['user_id'], $data['order_key'] );\n\n\t\t\t\t\t$active_activations = 0;\n\n\t\t\t \tif ( ! empty( $current_info ) ) foreach ( $current_info as $key => $activations ) {\n\n\t\t\t \t\tif ( $activations['activation_active'] == 1 && $post_data['_order_key'][0] == $activations['order_key'] ) {\n\n\t\t\t\t\t\t\t$active_activations++;\n\n\t\t\t \t\t}\n\n\t\t\t \t}\n\n\t\t\t \t$num_activations = ( $active_activations > 0 ) ? $active_activations : 0;\n\n\t\t\t\t\t// Activations limit or unlimited\n\t\t\t\t\tif ( $data['is_variable_product'] == 'no' && $data['_api_activations_parent'] != '' )\n\t\t\t\t\t\t$activations_limit = absint( $data['_api_activations_parent'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] =='no' && $data['_api_activations_parent'] == '' )\n\t\t\t\t\t\t$activations_limit = 'unlimited';\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' && $data['_api_activations'] != '' )\n\t\t\t\t\t\t$activations_limit = absint( $data['_api_activations'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' && $data['_api_activations'] == '' )\n\t\t\t\t\t\t$activations_limit = 'unlimited';\n\n\t\t\t\t\t// Software Title\n\t\t\t\t\tif ( $data['is_variable_product'] == 'no' )\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['_api_software_title_parent'] );\n\t\t\t\t\telse if ( $data['is_variable_product'] == 'yes' )\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['_api_software_title_var'] );\n\t\t\t\t\telse\n\t\t\t\t\t\t$software_title = sanitize_text_field( $data['software_title'] );\n\n\t\t\t\t\t?>\n\t\t \t\t<div class=\"wc-metabox closed\">\n\t\t\t\t\t\t<h3 class=\"fixed\">\n\t\t\t\t\t\t\t<div class=\"handlediv\" title=\"<?php _e( 'Click to toggle', $woocommerce_plugin_update_api_manager->text_domain ); ?>\"></div>\n\t\t\t\t\t\t\t<strong><?php printf( __( 'API Key: %s | Activation Limit: %s | Activations: %s | API Access Permission: %s | Product Title: %s | Version: %s', $woocommerce_plugin_update_api_manager->text_domain ), $data['order_key'], $activations_limit, $num_activations, $data['_api_update_permission'], $software_title, $data['current_version'] ); ?></strong>\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"user_id\" value=\"<?php echo $data['user_id']; ?>\" />\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" class=\"wc-metabox-content\">\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API License Key', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"order_key\" value=\"<?php echo $data['order_key']; ?>\" readonly />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Activation Limit', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $data['is_variable_product'] =='no' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_activations_parent\" value=\"<?php echo $data['_api_activations_parent'] ?>\" placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\telseif ( $data['is_variable_product'] == 'yes' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_activations\" value=\"<?php echo $data['_api_activations'] ?>\" placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API Access Permission', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" class=\"short\" name=\"_api_update_permission\" value=\"yes\" <?php checked( $data['_api_update_permission'], 'yes' ); ?> placeholder=\"<?php _e( 'Unlimited', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Software Title', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $data['is_variable_product'] =='no' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_software_title_parent\" value=\"<?php echo $data['_api_software_title_parent']; ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\telseif ( $data['is_variable_product'] == 'yes' ) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"_api_software_title_var\" value=\"<?php echo $data['_api_software_title_var']; ?>\" />\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'API License Email', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"license_email\" value=\"<?php echo $data['license_email']; ?>\" placeholder=\"<?php _e( 'Email Required', $woocommerce_plugin_update_api_manager->text_domain ); ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t<label><?php _e( 'Software Version', $woocommerce_plugin_update_api_manager->text_domain ); ?>:</label>\n\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"short\" name=\"current_version\" value=\"<?php echo $data['current_version']; ?>\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\n\t\t} // end if $data\n\n\t}", "function carton_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'order_item', $item_id, $meta_key, $meta_value, $prev_value );\n}", "function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}", "function add_custom_meta() {\n global $post;\n }", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}", "private function compare_with_meta_field(string $meta_key, string $order)\n {\n }", "private function compare_with_meta_field(string $meta_key, string $order)\n {\n }", "private function packMeta()\n {\n $transport = $this->modx->fromJSON(file_get_contents(__DIR__ . '/../transport.json'));\n unset($transport['support']['db']);\n\n $this->builder->setPackageAttributes([\n 'changelog' => file_get_contents(__DIR__ . '/../meta/changelog.txt'),\n 'license' => file_get_contents(__DIR__ . '/../meta/license.txt'),\n 'readme' => file_get_contents(__DIR__ . '/../meta/readme.txt'),\n 'requires' => $transport['support']\n ]);\n }", "public function add_fields_to_csv_export_column_data( $order_data, $order, $csv_generator ) {\r\n\r\n\t\t$field_data = array();\r\n\t\t$new_order_data = array();\r\n\t\t$one_row_per_item = $this->is_one_row_per_item( $csv_generator );\r\n\r\n\t\tforeach ( $this->fields as $name => $options ) {\r\n\t\t\t$field_data[ $name ] = get_post_meta( version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id(), $name, true );\r\n\t\t}\r\n\r\n\t\tif ( $one_row_per_item ) {\r\n\r\n\t\t\tforeach ( $order_data as $data ) {\r\n\t\t\t\t$new_order_data[] = array_merge( $field_data, (array) $data );\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$new_order_data = array_merge( $field_data, $order_data );\r\n\t\t}\r\n\r\n\t\treturn $new_order_data;\r\n\t}", "function shippingDetails($order) {\n echo '<h2>Shipping details</h2>';\n echo get_post_meta( $order->id, 'shippingMethod', true );\n }", "public function get_customer_meta_fields()\n {\n\n $show_fields = apply_filters('wc_pos_customer_meta_fields', array(\n 'outlet_filds' => array(\n 'title' => __('Point of Sale', 'wc_point_of_sale'),\n 'fields' => array(\n 'outlet' => array(\n 'label' => __('Outlet', 'wc_point_of_sale'),\n 'type' => 'select',\n 'name' => 'outlet[]',\n 'multiple' => true,\n 'options' => WC_POS()->outlet()->get_data_names(),\n 'description' => __('Ensure the user is logged out before changing the outlet.', 'wc_point_of_sale')\n ),\n 'discount' => array(\n 'label' => __('Discount', 'wc_point_of_sale'),\n 'type' => 'select',\n 'options' => array(\n 'enable' => 'Enable',\n 'disable' => 'Disable'\n ),\n 'description' => ''\n ),\n )\n ),\n ));\n\n if ( get_option( 'wc_pos_enable_user_card', 'no' ) == 'yes' ) {\n $show_fields['outlet_filds']['fields']['user_card_number'] = array(\n 'label' => __( 'Card Number', 'wc_point_of_sale' ),\n 'type' => 'input',\n 'description' => 'Enter the number of the card to associate this customer with.'\n );\n $show_fields['outlet_filds']['fields']['user_card_number_print'] = array(\n 'label' => __( 'Print Customer Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['user_card_number_scan'] = array(\n 'label' => __( 'Load Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n }\n $show_fields['outlet_filds']['fields']['disable_pos_payment'] = array(\n 'label' => __( 'Tendering', 'wc_point_of_sale' ),\n 'desc' => 'Disable tendering ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['approve_refunds'] = array(\n 'label' => __( 'Refunds', 'wc_point_of_sale' ),\n 'desc' => 'Enable refund ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n return $show_fields;\n }", "function action_woocommerce_order_item_meta_start( $item_name, $item, $order ) { \r\n\t\r\n\t$product_id = $item['product_id'];\r\n\t$_enable_warehouse=get_metadata('post',$product_id,'_enable_warehouse',true);\r\n\tif($_enable_warehouse==1) \r\n\treturn $item_name.' (shipped by warehouse) ';\r\n\telse return $item_name;\r\n\t\r\n\t\r\n}", "public function custom_meta_add() {\n\t\tif( !$this->options->show_on || in_array(get_the_id(), $this->options->show_on ) ){\n\t\t\tforeach( $this->options->display_on as $post_type ){\n\t\t\t\tadd_meta_box(\n\t\t\t\t\t$this->unique_key, // Unique Key\n\t\t\t\t\t$this->options->title ? esc_html__( $this->options->title ) : 'Related Content', //Title\n\t\t\t\t\tarray(&$this, 'custom_meta_render' ), // Callback (builds html)\n\t\t\t\t\t$post_type, // Post type\n\t\t\t\t\t$this->options->context, // Context\n\t\t\t\t\t$this->options->priority, // Priority\n\t\t\t\t\t$callback_args = null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}", "public function backfill_postmeta( &$order ) {\n\t\t$data = $this->get_order_data_from_table( $order );\n\n\t\tif ( is_null( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $this->get_postmeta_mapping() as $column => $meta_key ) {\n\t\t\tif ( isset( $data->$column ) ) {\n\t\t\t\tupdate_post_meta( $order->get_id(), $meta_key, $data->$column );\n\t\t\t}\n\t\t}\n\t}", "function hj_preorder_item_data( $item_data, $cart_item ) {\n // return $item_data;\n //\n // // get title text\n // $name = 'Estimated release';\n //\n // // don't add if empty\n // if ( ! $name )\n // return $item_data;\n //\n // $pre_order_meta = array(\n // 'name' => $name,\n // 'display' => $cart_item['data'],\n // );\n //\n // // add title and localized date\n // if ( ! empty( $pre_order_meta ) )\n // $item_data[] = $pre_order_meta;\n //\n // return $item_data;\n\n if ( HJPO::can_preorder( $cart_item['product_id'] ) ) {\n $timestamp = HJPO::preorder_date( $cart_item['product_id'] );\n if ( $timestamp ) {\n // $date = date_i18n( get_option( 'date_format' ), $timestamp );\n $date = HJPO::preorder_date_diff( $cart_item['product_id'] );\n }\n else {\n $date = 'Soon';\n }\n $item_data[] = array(\n 'name' => 'Estimated Release',\n 'display' => $date\n );\n }\n\n return $item_data;\n}", "public function add_fields_to_xml_export_order_list_format( $order_format, $order ) {\r\n\t\t$order_id = version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id();\r\n\t\t$export_format = get_option( 'wc_customer_order_xml_export_suite_orders_format', 'legacy' );\r\n\r\n\t\t// add a <CheckoutFields> tag for new formats to hold all custom fields\r\n\t\tif ( 'legacy' !== $export_format ) {\r\n\t\t\t$order_format['CheckoutFields'] = array();\r\n\t\t}\r\n\r\n\t\tforeach ( $this->get_fields() as $name => $options ) {\r\n\r\n\t\t\tif ( 'legacy' === $export_format ) {\r\n\r\n\t\t\t\t// add all fields as tags for backwards compat\r\n\t\t\t\t$order_format[ $name ] = get_post_meta( $order_id, $name, true );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// only add custom fields for new formats\r\n\t\t\t\tif ( $options['custom'] ) {\r\n\t\t\t\t\t$order_format['CheckoutFields'][ $name ] = get_post_meta( $order_id, $name, true );\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $order_format;\r\n\t}", "public function order_details_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_details_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "function ppom_make_meta_data( $cart_item, $context=\"cart\" ){\n\t\n\tif( ! isset($cart_item['ppom']['fields']) ) return $cart_item;\n\t\n\t$ppom_meta_ids = '';\t\n\t// removing id field\n\tif ( !empty( $cart_item ['ppom'] ['fields']['id'] )) {\n\t\t$ppom_meta_ids = $cart_item ['ppom'] ['fields']['id'];\n\t\tunset( $cart_item ['ppom'] ['fields']['id']);\n\t}\n\t\n\t$ppom_meta = array(); \n\t\n\tforeach($cart_item['ppom']['fields'] as $key => $value) {\n\t\t\n\t\t// if no value\n\t\tif( $value == '' ) continue;\n\t\t$product_id = ppom_get_product_id($cart_item['data']);\n\t\t// $cart_item['data'] ->post_type == 'product' ? $cart_item['data']->get_id() : $cart_item['data']->get_parent_id();\n\t\t$field_meta = ppom_get_field_meta_by_dataname( $product_id, $key, $ppom_meta_ids);\n\t\t\n\t\t// If field deleted while it's in cart\n\t\tif( empty($field_meta) ) continue;\n\t\t\n\t\t$field_type = isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\t$field_title= isset($field_meta['title']) ? $field_meta['title'] : '';\n\t\t\n\t\t// third party plugin for different fields types\n\t\t$field_type = apply_filters('ppom_make_meta_data_field_type', $field_type, $field_meta);\n\t\t\n\t\t$meta_data = array();\n\t\t\n\t\tswitch( $field_type ) {\n\t\t\t\n\t\t\tcase 'quantities':\n\t\t\t\t$total_qty = 0;\n\t\t\t\t$qty_values = array();\n\t\t\t\tforeach($value as $label => $qty) {\n\t\t\t\t\tif( !empty($qty) ) {\n\t\t\t\t\t\t$qty_values[] = \"{$label} = {$qty}\";\n\t\t\t\t\t\t// $ppom_meta[$label] = $qty;\n\t\t\t\t\t\t$total_qty += $qty;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$qty_values[] = __('Total','ppom').' = '.$total_qty;\n\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(\",\",$qty_values));\n\t\t\t\t// A placeholder key to handle qunantity display in item meta data under myaccount\n\t\t\t\t$ppom_meta['ppom_has_quantities'] = $total_qty;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'file':\n\t\t\t\tif( $context == 'order') {\n\t\t\t\t\t$uploaded_filenames = array();\n\t\t\t\t\tforeach($value as $file_id => $file_uploaded) {\n\t\t\t\t\t\t$uploaded_filenames[] = $file_uploaded['org'];\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(',',$uploaded_filenames));\n\t\t\t\t} else {\n\t\t\t\t\t$file_thumbs_html = '';\n\t\t\t\t\tforeach($value as $file_id => $file_uploaded) {\n\t\t\t\t\t\t$file_name = $file_uploaded['org'];\n\t\t\t\t\t\t$file_thumbs_html .= ppom_create_thumb_for_meta($file_name, $product_id);\n\t\t\t\t\t}\n\t\t\t\t\t// $ppom_meta['ppom_has_files'][$key] = $value;\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>$file_thumbs_html);\n\t\t\t\t\t// $ppom_meta[$field_title] = $file_thumbs_html;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'cropper':\n\t\t\t\tif( $context == 'order') {\n\t\t\t\t\t$uploaded_filenames = array();\n\t\t\t\t\tforeach($value as $file_id => $file_cropped) {\n\t\t\t\t\t\t$uploaded_filenames[] = $file_cropped['org'];\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(',',$uploaded_filenames));\n\t\t\t\t} else {\n\t\t\t\t\t$file_thumbs_html = '';\n\t\t\t\t\t// ppom_pa($value);\n\t\t\t\t\tforeach($value as $file_id => $file_cropped) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$file_name = $file_cropped['org'];\n\t\t\t\t\t\t$file_thumbs_html .= ppom_create_thumb_for_meta($file_name, $product_id, true);\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>$file_thumbs_html);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'image':\n\t\t\t\tif($value) {\n\t\t\t\t\t\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>ppom_generate_html_for_images($value));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'audio':\n\t\t\t\tif($value) {\n\t\t\t\t\t$ppom_file_count = 1;\n\t\t\t\t\tforeach($value as $id => $audio_meta) {\n\t\t\t\t\t\t$audio_meta = json_decode(stripslashes($audio_meta), true);\n\t\t\t\t\t\t$audio_url\t= stripslashes($audio_meta['link']);\n\t\t\t\t\t\t$audio_html = '<a href=\"'.esc_url($audio_url).'\" title=\"'.esc_attr($audio_meta['title']).'\">'.$audio_meta['title'].'</a>';\n\t\t\t\t\t\t$meta_lable\t= $field_title.': '.$ppom_file_count++;\n\t\t\t\t\t\t// $ppom_meta[$meta_lable] = $audio_html;\n\t\t\t\t\t\t$meta_data = array('name'=>$meta_lable, 'value'=>$audio_html);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'bulkquantity':\n\t\t\t\t\n\t\t\t\t$bq_value = $value['option'].' ('.$value['qty'].')';\n\t\t\t\t// $ppom_meta[$key] = $value['option'].' ('.$value['qty'].')';\n\t\t\t\t$meta_data = array('name'=>$key, 'value'=>$bq_value);\n\t\t\t\t// A placeholder key to handle qunantity display in item meta data under myaccount\n\t\t\t\t$ppom_meta['ppom_has_quantities'] = array('name'=>$key, 'value'=>$value['qty'],'hidden'=>true);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// NOTE: We have DISABLE this due to REST API values\n\t\t\tcase 'checkbox':\n\t\t\t\t\n\t\t\t\t$option_posted = $value;\n\t\t\t\t\n\t\t\t\tif( is_array($option_posted) ) {\n\t\t\t\t\t\n\t\t\t\t\t$option_posted = array_map('stripslashes', $option_posted);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$option_label_array = array();\n\t\t\t\t$options_data_array = array();\n\t\t\t\t\n\t\t\t\t$product = new WC_Product($product_id);\n\t\t\t\t$options_filter\t = ppom_convert_options_to_key_val($field_meta['options'], $field_meta, $product);\n\t\t\t\t\n\t\t\t\tforeach($option_posted as $posted_value) {\n\t\t\t\t\tforeach($options_filter as $option_key => $option) {\n\t \n\t $option_value = stripslashes($option['raw']);\n\t \n\t if( $posted_value == $option_value ) {\n\t $option_label_array[] = $option['label'];\n\t $options_data_array[] = array('option'=>$option['raw'],'price'=>$option['price'],'id'=>$option['option_id']);\n\t }\n\t }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( ppom_is_api_enable() ) {\n\t\t\t\t\t$meta_data = array('name'\t\t=>$field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> json_encode($options_data_array),\n\t\t\t\t\t\t\t\t\t\t'display'\t=> implode(',',$option_label_array), \n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=> implode(',',$option_label_array));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'select':\n\t\t\tcase 'radio':\n\t\t\t\t\n\t\t\t\t$posted_value = stripslashes($value);\n\t\t\t\t\n\t\t\t\t$option_price\t= '';\n\t\t\t\t$option_data\t= array();\n\t\t\t\t\n\t\t\t\t$product = new WC_Product($product_id);\n\t\t\t\t$options_filter\t = ppom_convert_options_to_key_val($field_meta['options'], $field_meta, $product);\n\t\t\t\t\n\t\t\t\tforeach($options_filter as $option_key => $option) {\n\t \n $option_value = stripslashes($option['raw']);\n \n if( $posted_value == $option_value ) {\n $option_price = $option['label'];\n $option_data[] = array('option'=>$option['raw'],'price'=>$option['price'],'id'=>$option['option_id']);\n break;\n }\n }\n\t\t\t\t\n\t\t\t\tif( ppom_is_api_enable() ) {\n\t\t\t\t\t$meta_data = array('name'\t\t=> $field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> json_encode($option_data),\n\t\t\t\t\t\t\t\t\t\t'display'\t=> $option_price, \n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$meta_data = array('name'\t\t=> $field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $option_price,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'measure':\n\t\t\t\t\n\t\t\t\t// if units are set for this\n\t\t\t\tif( !empty ($cart_item['ppom']['unit'][$key]) ) {\n\t\t\t\t\t$field_title .= ' ('.$cart_item['ppom']['unit'][$key].')';\n\t\t\t\t}\n\t\t\t\t$meta_data = array('name' => $field_title, 'value' => $value);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$value = is_array($value) ? implode(\",\", $value) : $value;\n\t\t\t\t// $ppom_meta[$field_title] = stripcslashes($value);\n\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>stripcslashes($value));\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Getting option price if field have\n\t\t$option_price = ppom_get_field_option_price( $field_meta, $value );\n\t\tif( $option_price != 0 ) {\n\t\t\t$meta_data['price'] = $option_price;\n\t\t}\n\t\t\n\t\t$meta_data_field = apply_filters('ppom_meta_data_field', $meta_data, $key, $field_meta, $product_id);\n\t\t$ppom_meta[$key] = $meta_data_field;\n\t}\n\t\n\t\n\t// ppom_pa($ppom_meta);\n\treturn apply_filters('ppom_meta_data', $ppom_meta, $cart_item, $context);\n}", "public function add_meta_box() {\n\t\tadd_meta_box( 'woocommerce-shipment-tracking', __( 'Shipment Tracking', 'woocommerce-shipment-tracking' ), array( $this, 'meta_box' ), 'shop_order', 'side', 'high' );\n\t}", "protected function include_extended_info( &$orders_data, $query_args ) {\n\t\t$mapped_orders = $this->map_array_by_key( $orders_data, 'order_id' );\n\t\t$products = $this->get_products_by_order_ids( array_keys( $mapped_orders ) );\n\t\t$coupons = $this->get_coupons_by_order_ids( array_keys( $mapped_orders ) );\n\t\t$customers = $this->get_customers_by_orders( $orders_data );\n\t\t$mapped_customers = $this->map_array_by_key( $customers, 'customer_id' );\n\n\t\t$mapped_data = array();\n\t\tforeach ( $products as $product ) {\n\t\t\tif ( ! isset( $mapped_data[ $product['order_id'] ] ) ) {\n\t\t\t\t$mapped_data[ $product['order_id'] ]['products'] = array();\n\t\t\t}\n\n\t\t\t$is_variation = '0' !== $product['variation_id'];\n\t\t\t$product_data = array(\n\t\t\t\t'id' => $is_variation ? $product['variation_id'] : $product['product_id'],\n\t\t\t\t'name' => $product['product_name'],\n\t\t\t\t'quantity' => $product['product_quantity'],\n\t\t\t);\n\n\t\t\tif ( $is_variation ) {\n\t\t\t\t$variation = wc_get_product( $product_data['id'] );\n\t\t\t\t$separator = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation );\n\n\t\t\t\tif ( false === strpos( $product_data['name'], $separator ) ) {\n\t\t\t\t\t$attributes = wc_get_formatted_variation( $variation, true, false );\n\t\t\t\t\t$product_data['name'] .= $separator . $attributes;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$mapped_data[ $product['order_id'] ]['products'][] = $product_data;\n\t\t}\n\n\t\tforeach ( $coupons as $coupon ) {\n\t\t\tif ( ! isset( $mapped_data[ $coupon['order_id'] ] ) ) {\n\t\t\t\t$mapped_data[ $product['order_id'] ]['coupons'] = array();\n\t\t\t}\n\n\t\t\t$mapped_data[ $coupon['order_id'] ]['coupons'][] = array(\n\t\t\t\t'id' => $coupon['coupon_id'],\n\t\t\t\t'code' => wc_format_coupon_code( $coupon['coupon_code'] ),\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $orders_data as $key => $order_data ) {\n\t\t\t$defaults = array(\n\t\t\t\t'products' => array(),\n\t\t\t\t'coupons' => array(),\n\t\t\t\t'customer' => array(),\n\t\t\t);\n\t\t\t$orders_data[ $key ]['extended_info'] = isset( $mapped_data[ $order_data['order_id'] ] ) ? array_merge( $defaults, $mapped_data[ $order_data['order_id'] ] ) : $defaults;\n\t\t\tif ( $order_data['customer_id'] && isset( $mapped_customers[ $order_data['customer_id'] ] ) ) {\n\t\t\t\t$orders_data[ $key ]['extended_info']['customer'] = $mapped_customers[ $order_data['customer_id'] ];\n\t\t\t}\n\t\t}\n\t}", "function ogp_extras() {\n global $meal;\n\n foreach( $meal->ingredients as $ingredient ) { ?>\n <meta property=\"<?php echo Facebook_Sample_Application::APP_NS; ?>:ingredient\" content=\"<?php echo htmlspecialchars( $ingredient ) ?>\">\n<?php\n }\n}", "public function display_account_order_details( ){\n\t\tif( $this->is_page_visible( \"order_details\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_order_details.php' );\n\t\t}\n\t}", "function add_custom_meta_for_asso_event()\n{\n add_meta_box('asso_event_meta_box',\n 'Asso. event',\n 'display_asso_event_meta_box',\n 'asso_event', 'normal', 'high'\n );\n}", "public function afterPlaceOrder($order)\n {\n $this->aliExpressOrderRepository->create(['order' => $order]);\n }", "private function add_transaction_info($post)\n {\n global $woocommerce;\n $orderId = $post['x_invoice_num'];\n $order = new WC_Order($orderId);\n $message = __('Server Paysto payment system return data in post: ', 'woocommerce') .\n print_r($post, true);\n $order->add_order_note($message);\n return;\n }", "protected function set_meta_desc()\r\r\n {\r\r\n define('_KEYWORDS',_BUY_ONLINE);\r\r\n define('_DESCRIPTION',_BUY_ONLINE);\r\r\n define('_TITLE_PAGE',_BUY_ONLINE);\r\r\n }", "public function specificInformation(Varien_Event_Observer $observer)\r\n {\r\n /** @var Mage_Sales_Model_Order_Payment $payment */\r\n $payment = $observer->getPayment();\r\n if ($payment && 0 === stripos($payment->getMethod(), 'cmpayments')) {\r\n $order = $payment->getOrder();\r\n if ($order) {\r\n /** @var Varien_Object $transport */\r\n $transport = $observer->getTransport();\r\n if (Mage::app()->getStore()->isAdmin()) {\r\n if ($order->getCmpaymentsChargeId()) {\r\n $transport->setData('CmPayments Charge Id', $order->getCmpaymentsChargeId());\r\n }\r\n } else {\r\n // Here it's possible to show extra info in \"My Orders\" in the frontend.\r\n }\r\n }\r\n }\r\n }", "public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }", "function registry_post_meta_boxes_setup() {\n\n /* Add meta boxes on the 'add_meta_boxes' hook. */\n add_action( 'add_meta_boxes', 'registry_add_post_meta_boxes', 1 );\n\n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_info_meta', 10, 2 );\n \n /* Save post info meta on the 'save_post' hook. */\n add_action( 'save_post', 'registry_save_coz_num_meta', 10, 2 );\n \n}", "public function set_checkout_order_meta( $order_id ) {\n\n\t\t$order = wc_get_order( $order_id );\n\n\t\tif ( $order && isset( WC()->cart->taxes['avatax'] ) ) {\n\n\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_calculated', 'yes' );\n\n\t\t\tif ( $date_created = SV_WC_Order_Compatibility::get_date_created( $order ) ) {\n\t\t\t\tupdate_post_meta( $order_id, '_wc_avatax_tax_date', $date_created->date( 'Y-m-d' ) );\n\t\t\t}\n\t\t}\n\t}", "public function show(Order $order)\n {\n //\n\n }", "public function show(order $order)\n {\n //\n }", "public function order_inserted_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_html_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function setOrder($order);", "function wordimpress_custom_checkout_field_update_order_meta( $order_id ) {\n if ( $_POST['inscription_checkbox'] ) {\n //It does: update post meta for this order\n update_post_meta( $order_id, 'NOLA Terms', esc_attr( $_POST['inscription_checkbox'] ) );\n }\n if ( $_POST['inscription_textbox'] ) {\n update_post_meta( $order_id, 'Allergy Information', esc_attr( $_POST['inscription_textbox'] ) );\n }\n}", "public function save_order_payment_type_meta_data( $order, $data ) {\n if ( $data['payment_method'] === $this->id && isset($_POST['payment_duration']) )\n $order->update_meta_data('_payment_duration', esc_attr($_POST['payment_duration']) );\n }", "public function add_metabox() {\n add_meta_box(\n 'customer_info',\n __( 'Customer Info', 'textdomain' ),\n array( $this, 'render_metabox' ),\n 'customer',\n 'advanced',\n 'default'\n );\n\n }", "function accouk_custom_category_order_meta_field($tag) {\n \n $current_category_order = get_term_meta($tag->term_id, 'category_order', true);\n\n ?>\n <tr class=\"form-field\">\n <th valign=\"top\" scope=\"row\"><label for=\"term_fields[category_order]\"><?php _e('Category order'); ?></label></th>\n <td>\n <input type=\"number\" value=\"<?php echo esc_attr($current_category_order); ?>\" id=\"term_fields[category_order]\" name=\"term_fields[category_order]\"><br/>\n <p class=\"description\"><?php _e('Enter a number to order the category in navigation menus. This must be present in order for a category to show in navigation.'); ?></p><br />\n </td>\n </tr> \n\n <?php\n}", "function gift_membership_order_meta_handler( $item_id, $cart_item, $order_id ) {\r\n \r\n if( isset( $cart_item->legacy_values['gift_recipient_name'] ) ) {\r\n wc_add_order_item_meta( $item_id, 'Recipient Name', $cart_item->legacy_values['gift_recipient_name'] );\r\n }\r\n if( isset( $cart_item->legacy_values['gift_recipient_email'] ) ) {\r\n wc_add_order_item_meta( $item_id, 'Recipient Email', $cart_item->legacy_values['gift_recipient_email'] );\r\n }\r\n}", "public static function update_order_meta( $order_id ) {\n\t\tupdate_post_meta( $order_id, '_billing_vat_number', self::$data['vat_number'] );\n\t\tupdate_post_meta( $order_id, '_vat_number_is_validated', ! is_null( self::$data['validation']['valid'] ) ? 'true' : 'false' );\n\t\tupdate_post_meta( $order_id, '_vat_number_is_valid', true === self::$data['validation']['valid'] ? 'true' : 'false' );\n\n\t\tif ( false !== self::get_ip_country() ) {\n\t\t\tupdate_post_meta( $order_id, '_customer_ip_country', self::get_ip_country() );\n\t\t\tupdate_post_meta( $order_id, '_customer_self_declared_country', ! empty( $_POST['location_confirmation'] ) ? 'true' : 'false' );\n\t\t}\n\t}", "public function show(Order $order)\n { \n //\n }", "public function __construct($order=null)\n {\n $this->data = $order;\n }", "protected function getOrderFields() {\n return 'Title, CoverImage';\n }", "public function show(Order $order)\n {\n //\n }", "private function addQuoteExtensionAttributesToOrder($order)\n {\n $quoteId = $order->getQuoteId();\n\n /** @var \\Magento\\Quote\\Model\\Quote $mageQuote */\n $mageQuote = $this->mageQuoteFactory->create()->load($quoteId);\n if (!$mageQuote->getId() || !$mageQuote->getLinkedQuotationId()) {\n //no mage quote data available or no quotation quote linked\n return $order;\n }\n\n $quotationId = $mageQuote->getLinkedQuotationId();\n\n /** @var Quote $quotation */\n $quotation = $this->quoteFactory->create()->load($quotationId);\n if (!$quotation->getId()) {\n //no quote data available\n return $order;\n }\n\n $extensionAttributes = $order->getExtensionAttributes();\n if ($extensionAttributes === null) {\n $extensionAttributes = $this->orderExtensionFactory->create();\n }\n\n //modify extension attributes, add the quote increment id\n $extensionAttributes->setQuoteationIncrementId($quotation->getIncrementId());\n\n //add a backend url\n $backendUrl = $this->backendUrl->getUrl(\n 'quotation/quote/view',\n ['quote_id' => $quotation->getId()]\n );\n $extensionAttributes->setQuoteationBackendUrl($backendUrl);\n\n //set extension attributes\n $order->setExtensionAttributes($extensionAttributes);\n\n return $order;\n }", "private function set_metafile_fields(){\n\n\t\t\t// add more fields for your requierements\n $custom_fields = array( \n\t\t\t\t'field_name1'\t=> __( 'field name 1', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name2'\t=> __( 'field name 2', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name3'\t=> __( 'field name 3', self::$plugin_obj->class_name ),\n\t\t\t );\n\n\n foreach( $custom_fields as $custom_attrname => $custom_value){\n self::$metafile_fields->$custom_attrname = $custom_value;\n } \n\n }", "public function show(Order $order)\n {\n\n }", "public function setOrderData($orderData): Order\n {\n $this->id = $orderData->getIncrementId();\n $this->email = $orderData->getCustomerEmail();\n $this->quoteId = $orderData->getQuoteId();\n $this->storeName = $orderData->getStore()->getName();\n $this->purchaseDate = $orderData->getCreatedAt();\n $this->deliveryMethod = $orderData->getShippingDescription();\n $this->deliveryTotal = (float) number_format(\n (float) $orderData->getShippingAmount(),\n 2,\n '.',\n ''\n );\n $this->currency = $orderData->getOrderCurrencyCode();\n\n /** @var OrderPaymentInterface|InfoInterface $payment */\n $payment = $orderData->getPayment();\n if ($payment) {\n if ($payment->getMethod()) {\n $methodInstance = $payment->getMethodInstance();\n if ($methodInstance) {\n $this->payment = $methodInstance->getTitle();\n }\n }\n }\n\n $this->couponCode = (string) $orderData->getCouponCode();\n\n /*\n * custom order attributes\n */\n $customAttributes = $this->getConfigSelectedCustomOrderAttributes(\n $orderData->getStore()->getWebsite()->getId()\n );\n\n if ($customAttributes) {\n $fields = $this->helper->getOrderTableDescription();\n $this->custom = [];\n foreach ($customAttributes as $customAttribute) {\n if (isset($fields[$customAttribute])) {\n $field = $fields[$customAttribute];\n $value = $this->_getCustomAttributeValue(\n $field,\n $orderData\n );\n if ($value) {\n $this->_assignCustom($field, $value);\n }\n }\n }\n }\n\n /*\n * Billing address.\n */\n $this->processBillingAddress($orderData);\n\n /*\n * Shipping address.\n */\n $this->processShippingAddress($orderData);\n\n $websiteId = $orderData->getStore()->getWebsiteId();\n\n $includeCustomOptions = $this->helper->getWebsiteConfig(\n Config::XML_PATH_CONNECTOR_SYNC_ORDER_PRODUCT_CUSTOM_OPTIONS,\n $websiteId\n );\n\n $orderItemProcessor = $this->orderItemProcessorFactory\n ->create(['data' => [\n 'websiteId' => $websiteId,\n 'includeCustomOptions' => $includeCustomOptions\n ]]);\n\n /*\n * Order items.\n */\n try {\n foreach ($orderData->getAllItems() as $productItem) {\n $productData = $orderItemProcessor->process($productItem);\n $this->mergeProductData($productData);\n }\n } catch (\\InvalidArgumentException $e) {\n $this->logger->debug(\n 'Error processing items for order ID: ' . $orderData->getId(),\n [(string) $e]\n );\n $this->products = [];\n }\n\n $this->orderSubtotal = (float) number_format(\n (float) $orderData->getData('subtotal'),\n 2,\n '.',\n ''\n );\n $this->discountAmount = (float) number_format(\n (float) $orderData->getData('discount_amount'),\n 2,\n '.',\n ''\n );\n $orderTotal = abs(\n $orderData->getData('grand_total') - $orderData->getTotalRefunded()\n );\n $this->orderTotal = (float) number_format($orderTotal, 2, '.', '');\n $this->orderStatus = $orderData->getStatus();\n\n if (!$this->schemaValidator->isValid($this->toArray())) {\n throw new SchemaValidationException(\n $this->schemaValidator,\n __(\"Validation error\")\n );\n }\n\n return $this;\n }", "function md_custom_woocommerce_checkout_fields( $fields )\n{\n $fields['order']['order_comments']['placeholder'] = 'Pop any info you need us to know in here, please';\n\n return $fields;\n}", "public static function add_meta_boxes( $screen_id, $order ) {\n\t\t$hook_to_check = sb_is_hpos_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'shop_order';\n\t\tif ( $hook_to_check === $screen_id ) {\n\t\t\t$order = wc_get_order( $order );\n\t\t\t$payment_method = $order->get_payment_method();\n\t\t\tif ( in_array( $payment_method, WC_Swedbank_Plugin::PAYMENT_METHODS, true ) ) {\n\t\t\t\t$payment_id = $order->get_meta( '_payex_payment_id' );\n\t\t\t\tif ( ! empty( $payment_id ) ) {\n\t\t\t\t\t$screen = sb_is_hpos_enabled() ? wc_get_page_screen_id( 'shop-order' ) : 'shop_order';\n\n\t\t\t\t\tadd_meta_box(\n\t\t\t\t\t\t'swedbank_payment_actions',\n\t\t\t\t\t\t__( 'Swedbank Pay Payments Actions', 'swedbank-pay-woocommerce-checkout' ),\n\t\t\t\t\t\t__CLASS__ . '::order_meta_box_payment_actions',\n\t\t\t\t\t\t$screen,\n\t\t\t\t\t\t'side',\n\t\t\t\t\t\t'high'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function parse_orderby_meta($orderby_raw)\n {\n }", "function simply_add_custom_general_fields()\n{\n // You can create text, textarea, select, checkbox and custom fields\n global $woocommerce, $post;\n // Custom fields will be created here...\n ?>\n <div class=\"options_group\">\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_family_code\"><?php echo __('Family Code', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n $family_code = get_post_meta($post->ID, 'family_code', true);\n\n echo $family_code;\n\n ?>\n\n </p>\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_mpartname\"><?php echo __('Mpartname', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n\t\t$mpartname = get_post_meta($post->ID, 'mpartname', true);\n\n\t\techo $mpartname;\n\n\t\t?>\n\n </p>\n </div>\n <?php\n}", "function vw_mobile_app_pro_posttype_bn_testimonial_meta_box() {\n\tadd_meta_box( 'vw-mobile-app-pro-posttype-testimonial-meta', __( 'Enter Details', 'vw-mobile-app-pro-posttype' ), 'vw_mobile_app_pro_posttype_bn_testimonial_meta_callback', 'testimonials', 'normal', 'high' );\n}", "function client_meta_init()\n{\n add_meta_box('client_meta', 'Ссылка', 'client_meta_setup', 'client', 'side', 'low');\n // add a callback function to save any data a user enters in\n add_action('save_post','client_meta_save');\n}", "function load_avaialable_special_offers($order) {\n $special_offers = array();\n if (!empty($order->commerce_line_items)) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n if (!empty($line_item_wrapper->value()->commerce_product)) {\n $product = $line_item_wrapper->commerce_product->value();\n if (!empty($product->field_special_offers)) {\n $offers = $line_item_wrapper->commerce_product->field_special_offers->value();\n foreach($offers as $offer) {\n $special_offers[$offer->product_id] = $offer;\n }\n }\n }\n }\n }\n return array('special_offers' => $special_offers);\n}", "function my_meta_init()\n{\n // http://codex.wordpress.org/Function_Reference/wp_enqueue_script\n // http://codex.wordpress.org/Function_Reference/wp_enqueue_style\n \n //wp_enqueue_script('my_meta_js', MY_THEME_PATH . '/custom/meta.js', array('jquery'));\n wp_enqueue_style('my_meta_css', MY_THEME_PATH . '/custom/shop-meta.css');\n \n // review the function reference for parameter details\n // http://codex.wordpress.org/Function_Reference/add_meta_box\n \n // add a meta box for each of the wordpress page types: posts and pages\n foreach (array('product') as $type) \n {\n add_meta_box('my_all_meta', 'Prezzo e Descrizione Prodotto', 'my_meta_setup', $type, 'normal', 'high');\n }\n \n // add a callback function to save any data a user enters in\n add_action('save_post','my_meta_save');\n}", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }" ]
[ "0.70488423", "0.66073596", "0.6603358", "0.65571195", "0.6403869", "0.64009315", "0.63575566", "0.6328107", "0.6316174", "0.6279935", "0.6276825", "0.61757296", "0.6167488", "0.6158622", "0.61157036", "0.6092842", "0.60830194", "0.60816646", "0.6073258", "0.60278296", "0.6027216", "0.60226923", "0.6003685", "0.5915674", "0.5901899", "0.58890706", "0.58340937", "0.58107877", "0.5808717", "0.57982177", "0.577807", "0.5767235", "0.57668346", "0.57396835", "0.568791", "0.5669631", "0.5669515", "0.5666713", "0.56646043", "0.56630075", "0.5644929", "0.56046647", "0.5603833", "0.5603042", "0.5603042", "0.5600806", "0.55969614", "0.55868125", "0.55744344", "0.5572706", "0.5570772", "0.5555656", "0.5554967", "0.5526251", "0.549636", "0.5478981", "0.5475653", "0.5473195", "0.5473087", "0.54716456", "0.54580545", "0.5448344", "0.544399", "0.5442138", "0.5441679", "0.5439997", "0.5439619", "0.5437299", "0.54047084", "0.5403486", "0.5400873", "0.53963786", "0.53864497", "0.5383263", "0.5382119", "0.53810424", "0.5379421", "0.53777343", "0.53762096", "0.5371717", "0.5368153", "0.5365497", "0.5362211", "0.53461826", "0.5343965", "0.53427386", "0.53393316", "0.533737", "0.5328192", "0.53271705", "0.53265774", "0.5320285", "0.5318332", "0.5315837", "0.5314117", "0.5314117", "0.5314117", "0.5314117", "0.5314117", "0.5314117" ]
0.7091814
0
Add weight to order
public static function add_cart_weight( $wc_order_id ) { global $woocommerce; $weight = $woocommerce->cart->cart_contents_weight; OmnivaLt_Wc_Order::update_meta($wc_order_id, '_cart_weight', $weight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setWeight($weight);", "public function setWeight($weight);", "public function setWeight($weight);", "public function setWeight($weight);", "function set_weight($weight) {\n $this->weight = $weight;\n }", "public function setWeight($weight)\n {\n $this->weight = $weight;\n }", "public function setWeight() {\n }", "function getWeight() { return $this->_weight; }", "function getWeight(){return $this->weight;}", "protected function sortItemsByWeight() {\n\t\tusort($this->items, function($a, $b) {\n\t\t\tif($a->getWeight() > $b->getWeight())\n\t\t\t\treturn -1;\n\t\t\telse if($a->getWeight() == $b->getWeight() && $a->getPrice() > $b->getPrice())\n\t\t\t\treturn -1;\n\t\t\telse \n\t\t\t\treturn 1;\n\t\t});\t\t\n\t}", "public function setWeight($num, $weight)\n {\n $this->_weights[$num] = $weight;\n }", "public function setWeight($weight=1)\n\t{\n\t\t$this->weight = intval($weight);\n\t}", "public function addWeight() {\n\n if(!$this->app->session->get('userID')) {\n return $this->generateResponse(401);\n }\n\n $this->weight->weight = $this->request->weight->weight;\n $this->weight->weighed_date = $this->request->weight->date;\n $this->weight->user_id = $this->app->session->get('userID');\n\n if(!$this->weight->validateWeight('add')) {\n return $this->generateResponse(422, 'invalid weight',\n array('errors' => $this->weight->errors));\n }\n\n if(!$this->weight->save() || !isset($this->weight->weight_id) ||\n !$this->weight->weight_id) {\n return $this->generateResponse(500);\n }\n\n $date = strtotime($this->request->weight->date);\n $changeLastWeek =\n $this->weight->closestWeightToDate($this->weight->user_id,\n date('Y-m-d', mktime(0, 0, 0,\n date('n',\n $date),\n date('j',\n $date) - 7,\n date('Y',\n $date))));\n\n $this->response =\n array('weight' =>\n array('id' => $this->weight->weight_id,\n 'weight_id' => $this->weight->weight_id,\n 'date' => $this->weight->weighed_date,\n 'weight' => $this->weight->weight,\n 'changed' => round($this->weight->weight -\n $changeLastWeek, 2)));\n\n return $this->generateResponse();\n\n\n }", "function sort_by_weight( $a, $b ) {\n if( $a->weight == $b->weight ){ return 0 ; }\n return ($a->weight < $b->weight) ? -1 : 1;\n}", "public function putWeights(&$weights)\n {\n $weightIndex = 0;\n foreach ($this->layers as $layer) {\n $neurons = $layer->getNeurons();\n foreach ($neurons as $neuron) {\n $neuronWeights = $neuron->getWeights();\n foreach ($neuronWeights as $key => $weight) {\n $neuron->setWeight($key, $weights[$weightIndex]);\n $weightIndex++;\n }\n }\n }\n }", "public function get_weight(){\n\t\treturn $this->weight;\n\t}", "public function getWeight() \r\n {\r\n return $this->weight;\r\n }", "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 setWeight(?int $weight)\n {\n $this->weight = $weight;\n\n return $this;\n }", "public function setWeight($weight) {\n $this->weight = $weight;\n return $this;\n }", "function pewc_set_product_weight_meta( $cart_item_data, $item, $group_id, $field_id, $value ) {\n\n\t$item_weight = ! empty( $cart_item_data['product_extras']['weight'] ) ? $cart_item_data['product_extras']['weight'] : 0;\n\tif( $item['field_type'] == 'calculation' && ( ! empty( $item['formula_action'] ) && $item['formula_action'] == 'weight' ) ) {\n\t\t$cart_item_data['product_extras']['weight'] = $item_weight + $value;\n\t}\n\n\treturn $cart_item_data;\n\n}", "function pewc_set_product_weight( $cart ) {\n\n\tif ( is_admin() && ! defined( 'DOING_AJAX' ) ) {\n\t\treturn;\n\t}\n\n\tif ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) {\n\t\treturn;\n\t}\n\n\tforeach( $cart->get_cart() as $cart_item ) {\n\t\t$item_weight = floatval( $cart_item['data']->get_weight() );\n\t\tif ( ! empty( $cart_item['product_extras']['weight'] ) ) {\n\t\t\t$item_weight += $cart_item['product_extras']['weight'];\n\t\t\t$cart_item['data']->set_weight( $item_weight );\n\t\t}\n\t}\n\n}", "function get_weight() {\n\t\tif ($this->data['weight']) return $this->data['weight'];\n\t}", "public function setWeight($weight)\n {\n $this->weight = $weight;\n return $this;\n }", "public function add($node, $weight = null) {\n // last wins, thus the order in which nodes are added is significant.\n // TODO: self::DEFAULT_WEIGHT does not work for inherited classes that \n // override the DEFAULT_WEIGHT constant.\n $this->_nodes[] = array(\n 'object' => $node, \n 'weight' => (int) ($weight !== null ? $weight : self::DEFAULT_WEIGHT), \n );\n $this->reset();\n }", "public function GetWeight() {\n\t\treturn 10;\n\t}", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight() {\n\t\treturn $this->weight;\n\t}", "function getWeight() {\n return $this->weight;\n }", "public function setWeightAttribute($weight = null)\n\t{\n\t\t$this->attributes['weight'] = intval($weight);\n\t}", "public function getWeight() {\n return $this->weight;\n }", "public function addElement( $name, $weight ) {\n\t\tif ( ( is_string( $name ) || is_numeric( $name ) ) && is_numeric( $weight ) ) {\n\t\t\t$this->data[ $name ] = $weight;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function cmp_weight($a, $b) {\n\t\tif ($a -> weight == $b -> weight)\n\t\t\treturn 0;\n\t\treturn ($a -> weight > $b -> weight) ? -1 : 1;\n\t}", "public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }", "public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }", "public function setWeight($weight)\n {\n $this->weight = $weight;\n\n return $this;\n }", "public function testTermWeight(): void {\n /** @var \\Drupal\\rdf_taxonomy\\TermRdfStorage $storage */\n $storage = $this->container->get('entity_type.manager')->getStorage('taxonomy_term');\n\n // Returns an ordered list of term labels from the backend.\n $get_labels = function () use ($storage): array {\n $this->createTerms();\n $tree = $storage->loadTree('test_vocab');\n return array_map(function (\\stdClass $term): string {\n return $term->name;\n }, $tree);\n };\n\n // Check that with no weight mapping the terms are ordered alphabetically.\n $this->assertSame(['Abc', 'Bcd', 'Cde', 'Xyz'], $get_labels());\n\n // Add the 'weight' mapping.\n SparqlMapping::loadByName('taxonomy_term', 'test_vocab')\n ->addMappings([\n 'weight' => [\n 'value' => [\n 'predicate' => 'http://example.com/test_vocab/weight',\n 'format' => 'xsd:integer',\n ],\n ],\n ])\n ->save();\n\n // Check that with weight mapping the terms are ordered by weight and\n // eventually alphabetically by label.\n $this->assertSame(['Xyz', 'Cde', 'Abc', 'Bcd'], $get_labels());\n }", "public function getWeight() : float\n\t{\n\t\treturn $this->weight;\n\t}", "public function getWeight() {\n }", "public function total_weight() {\n\t\t$itemIDs = $this->itemids();\n\t\t$q = ItemMasterItemQuery::create();\n\t\t$q->withColumn('SUM('.ItemMasterItem::get_aliasproperty('weight').')', 'total');\n\t\t$q->select('total');\n\t\t$q->filterByItemid($itemIDs);\n\t\treturn $q->findOne();\n\t}", "public function setWeight($treatment, $weight) {\n\t\tif (!is_array($this->_treatments)) {\n\t\t\t$this->_treatments = array();\n\t\t}\n\t\tif (!in_array($treatment, $this->_treatments)) {\n\t\t\t$this->_treatments[] = $treatment;\n\t\t}\n\t\tif (!is_array($this->_weights)) {\n\t\t\t$this->_weights = array();\n\t\t}\n\t\t$this->_weights[$treatment] = $weight;\n\t\tif ($this->getRowID() !== null) {\n\t\t\t// update the data entry in DB\n\t\t}\n\t}", "private function calculateOrderWeight(Collection $orderItems)\n {\n $skuQty = $orderItems->pluck('quantity_ordered', 'seller_sku')->toArray();\n $skuWeight = Product::whereIn('sku', array_keys($skuQty))->get()->pluck('weight', 'sku');\n\n $totalWeight = $skuWeight->map(function ($weight, $sku) use ($skuQty) {\n return $skuQty[$sku] * $weight;\n })->sum();\n\n return $totalWeight;\n }", "public function getWeight() {\n return $this->item->getWeight();\n }", "public function weight()\n {\n return $this->getCartItemCollection()->sum(function ($item) {\n return $item->getTotalWeight();\n });\n }", "public function setWeight(Weight $weight)\n {\n $this->values['Weight'] = $weight;\n return $this;\n }", "public function setWeight(Weight $weight)\n {\n $this->values['Weight'] = $weight;\n return $this;\n }", "public function weight() {\r\n\t\treturn (int)$this->techData['weight'];\r\n\t}", "public function getWeight() : int\n {\n return $this->_weight;\n }", "public function getWeight()\n {\n }", "public function getWeight()\n {\n }", "function _ting_boost_field_sort($a, $b) {\n if ($a['weight'] == $b['weight']) {\n return 0;\n }\n return ($a['weight'] > $b['weight']) ? -1 : 1;\n}", "public function getTotalWeight()\n {\n return $this->getQuantity() * $this->getProduct()->getWeight();\n }", "function values($price, $weight=0.45){\n $price = $price + ($price * $weight);\n return $price;\n}", "private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}", "function xanth_db_install_weight_entry()\r\n{\r\n\t//depend from content format module,category,view mode\r\n\treturn 200;\r\n}", "protected function getTotalWeight() {\n\t\t$totalWeight = array_reduce($this->items, function($total, $current) {\n\t\t\t$total += $current->getWeight();\n\n\t\t\treturn $total;\n\t\t});\n\n\t\treturn $totalWeight;\n\t}", "function get_weighted_terms( $taxonomy ) {\n\n $terms = get_terms( $taxonomy );\n foreach( $terms as $term ) {\n $term_weight = (int) get_term_meta( $term->term_id, 'weight', true );\n $term->weight = ($term_weight) ? $term_weight : 0;\n }\n usort($terms, 'sort_by_weight');\n\n //$terms = wp_cache_set( $cache_key, $terms, 'weighted_terms', 86400 ); // one day\n\n return $terms;\n}", "private function weightScore() {\n $this->maxScore = round($this->maxScore*self::SCORE_WEIGHT); \n }", "public function getTotalWeight()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->Weight && $item->Quantity) {\n $total = $total + ($item->Weight * $item->Quantity);\n }\n }\n \n return $total;\n }", "public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function weight($value)\n {\n $this->attribute('probability',$value);\n \n return $this;\n }", "public function setEdgeWeight(EdgeInterface $edge, ?float $weight = null): void;", "private function _calculate_weight( $carts )\n\t{\n\t\t$total_weight = 0;\n\t\t$weights = 0;\n\n\t\tforeach( $carts as $cart_product )\n\t\t{\n\t\t\t$product = $cart_product['data'];\n\t\t\t// jika berat kosong (null), berat default diambil dari nilai berat setting JNE\n\t\t\t$weight = ( $product->weight ) ? $product->weight : $this->jne_settings['weight'] ;\n\t\t\t// detai content \n\t\t\t$content = '<tr class=\"row-jne-weight-data\"><td class=\"col-1\">'. $product->post->post_title;\n\t\t\t// memiliki volume\n\t\t\tif( $product->length && $product->width && $product->height ) {\n\t\t\t\t// hitung volume\n\t\t\t\t$volume = $product->length * $product->width * $product->height;\n\t\t\t\t// hitung volumetrik\n\t\t\t\t$volumetik = ($volume / 6000) * $weight;\n\t\t\t\t// Apabila hitungan volumetrik lebih berat dari berat aktual, maka biaya kirim dihitung berdasarkan berat volumetrik.\n\t\t\t\t$weight = ($volumetik > $weight) ? $volumetik : $weight ;\n\t\t\t\t// detai content \n\t\t\t\t$content .= sprintf(' (%sx%sx%s)', $product->length, $product->width, $product->height);\n\t\t\t} \n\t\t\t// detai content \n\t\t\t$content .= '</td><td class=\"col-2\">:</td><td class=\"col-3\">'. $this->_floor_dec($weight).' kg</td></tr>';\n\n\t\t\t// hitung berat per kuantitas\n\t\t\t$weight = $weight * $cart_product['quantity'];\n\t\t\t// increase\n\t\t\t$weights += $weight;\n\n\t\t\t// set detai content \n\t\t\t$this->_tooltip_content .= $content;\n\t\t}\n\t\t\n\t\t// prehitungan toleransi\n\t\tif($weights > 1) {\n\t\t\t$tolerance = $this->jne_settings['tolerance'];\n\t\t\t$_weights = $this->_floor_dec($weights, 2);\n\t\t\t$intval = intval($weights);\n\t\t\t$diff = $_weights - $intval;\n\t\t\t$total_weight = $diff > $tolerance ? ceil($weights) : $intval;\n\n\t\t\t/* uncomment this for debugging\n\t\t\tjne_rate_debug(array(\n\t\t\t\t'weights' => array(\n\t\t\t\t\t'default' => $weights,\n\t\t\t\t\t'precision' => $_weights\n\t\t\t\t),\n\t\t\t\t'fraction' => array(\n\t\t\t\t\t'up' => ceil($weights),\n\t\t\t\t\t'down' => $intval\n\t\t\t\t),\n\t\t\t\t'diff' => array(\n\t\t\t\t\t'default' => $weights - $intval,\n\t\t\t\t\t'precision' => $diff\n\t\t\t\t),\n\t\t\t\t'tolerance' => $tolerance,\n\t\t\t\t'total_weight' => $total_weight\n\t\t\t));\n\t\t\t*/\n\t\t\n\t\t\t$this->_tooltip_content .= '<tr class=\"row-jne-weight-tolerance\"><td class=\"col-1 text-right\">Tolerance</td><td class=\"col-2\">:</td><td class=\"col-3\">'.$tolerance.' kg</td></tr>';\n\t\t} \n\t\telse $total_weight = 1;\n\t\t\t\n\t\t$this->_tooltip_content .= '<tr class=\"row-jne-weight-total\"><td class=\"col-1 text-right\">Total</td><td class=\"col-2\">:</td><td class=\"col-3\">'.$total_weight.' kg</td></tr>';\n\n\t\treturn $total_weight;\n\t}", "function _ting_ranking_field_sort($a, $b) {\n if ($a['weight'] == $b['weight']) {\n return 0;\n }\n return ($a['weight'] > $b['weight']) ? -1 : 1;\n}", "public function getWeightTotal(): float;", "public function setWeightDeclared($weightDeclared) {\n $this->_weightDeclared = $weightDeclared;\n }", "function sortPlayersOnWeight2($a, $b) {\n if ($a['weight'] == $b['weight']) {\n return 0;\n }\n return ($a['weight'] < $b['weight']) ? -1 : 1;\n}", "public function setWeight(float $weight) : void\n\t{\n\t\tif($weight < 0.0) {\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t'Weight must be greater than 0.0 ounces'\n\t\t\t);\n\t\t}\n\t\t\n\t\tif($weight > 1120.0) {\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t'Weight must not be greater than 1120.0 ounces (70 pounds)'\n\t\t\t);\n\t\t}\n\t\t\n\t\t$this->weight = $weight;\n\t}", "public function totalWeight($extraAmount = 0) {\r\n\t\t$amount = $extraAmount + $this->amount;\r\n\t\tif ($this->isStackable()) {\r\n\t\t\t$stackAmount = $this->stackAmount($extraAmount);\r\n\t\t} else {\r\n\t\t\t$stackAmount = $amount;\r\n\t\t}\r\n\r\n\t\treturn ($stackAmount * $this->weight());\r\n\t}", "public function setWeight(?SupermodelIoLogisticsExpressExportDeclarationLineItemsItemWeight $weight): self\n {\n $this->initialized['weight'] = true;\n $this->weight = $weight;\n\n return $this;\n }", "public function getProducts_attributes_weight() {\n\t\treturn $this->products_attributes_weight;\n\t}", "public function getWeightLimit()\n {\n }", "function carton_get_weight( $weight, $to_unit ) {\n\n\t$from_unit \t= strtolower( get_option('carton_weight_unit') );\n\t$to_unit\t= strtolower( $to_unit );\n\n\t//Unify all units to kg first\n\tif ( $from_unit !== $to_unit ) {\n\n\t\tswitch ( $from_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 0.001;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 0.4536;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 0.0283;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Output desired unit\n\t\tswitch ( $to_unit ) {\n\t\t\tcase 'g':\n\t\t\t\t$weight *= 1000;\n\t\t\tbreak;\n\t\t\tcase 'lbs':\n\t\t\t\t$weight *= 2.2046;\n\t\t\tbreak;\n\t\t\tcase 'oz':\n\t\t\t\t$weight *= 35.274;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn ( $weight < 0 ) ? 0 : $weight;\n}", "public function addOrder(Order $order);", "protected function get_unified_font_weight( $weight ) {\r\n\t\treturn str_replace( array( 'normal', 'regular' ), '400', $weight );\r\n\t}", "public function setWeight(FedEx_PickupService_Weight $weight)\n {\n $this->Weight = $weight;\n return $this;\n }", "protected function getWeight(OrderItemInterface $order_item) {\n $purchasedEntity = $order_item->getPurchasedEntity();\n\n if ($purchasedEntity->get('weight')->isEmpty()) {\n $weight = new Weight(1, WeightUnit::GRAM);\n }\n else {\n /** @var \\Drupal\\physical\\Plugin\\Field\\FieldType\\MeasurementItem $weight_item */\n $weight_item = $purchasedEntity->get('weight')->first();\n\n $weight = $weight_item->toMeasurement();\n }\n\n return $weight;\n }", "public function getWeightings() {\n\t\treturn $this->_weights;\n\t}", "private static function weightsSort($a, $b) {\n $config_a = $a['config'];\n $config_b = $b['config'];\n if ($config_a['weight'] == $config_b['weight']) {\n return 0;\n }\n return ($config_a['weight'] < $config_b['weight']) ? -1 : 1;\n }", "abstract public function setWeight(array $questions): array ;", "public function addWeight($dateWeighed, $timeWeighed, $weight, $weightType, $pigid, $user)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(record_id)\r\n\t\t\t\t\tFROM weight_record\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO weight_record(record_date, record_time, weight, pig_id, remarks, user) \r\n\t\t\t\t\t\t\tVALUES('\" .$dateWeighed. \"','\" .$timeWeighed. \"','\" .$weight. \"','\" .$pigid. \"','\" .$weightType. \"','\" .$user. \"');\";\r\n\t\t\t\t\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t\t \"newId\"=> $link->insert_id);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n \t\"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t $this->userTransactionEdit($user,$max,\"weight\",0,$weight,1,$pigid);\r\n\t\t\t return $data;\r\n\t\t}", "public function addVoteWeight($change)\n {\n if (!config('vote.allow_weight_changes')) {\n return false;\n }\n\n $weight = max(0, $this->weight + $change); // set a minimum of zero\n $this->update(['weight' => $weight]);\n event(new VoterWeightChanged($this));\n return true;\n }", "private function addEdge($fromId, $toId, $weight) {\r\n $aux = 0;\r\n \r\n if ($weight < 1) {\r\n $weight = 1;\r\n //To-do: Exception\r\n }\r\n \r\n $this->inLinks[$toId][$fromId] = $weight;\r\n $this->outLinks[$fromId][$toId] = $weight;\r\n }", "protected function setWeight($newWeight) \r\n {\r\n if(gettype($newWeight) == \"integer\") {\r\n $this->name = $newWeight;\r\n } else {\r\n throw new Exception(\"Weight must be an integer, type of \" . gettype($newWeight) . \" was sent in\");\r\n }\r\n $this->weight = $newWeight;\r\n }", "public function __construct($weight = 1, $wildcard = '*')\n {\n $this->weight = $weight;\n $this->wildcard = $wildcard;\n }", "private function weightedRandomTreatment() {\n\t\t$weights = $this->getWeightings();\n\t\t$max = array_sum($weights);\n\t\t$soFar = 0;\n\t\t$random = mt_rand(0, $max - 1);\n\t\tforeach($weights as $k => $v) {\n\t\t\t$soFar += $v;\n\t\t\tif ($random < $soFar) {\n\t\t\t\treturn $k;\n\t\t\t}\n\t\t}\n\t}", "public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\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 }" ]
[ "0.69013083", "0.69013083", "0.69013083", "0.69013083", "0.6837963", "0.65614253", "0.6515175", "0.6496309", "0.6466544", "0.6348909", "0.6319474", "0.63033366", "0.6245078", "0.6218488", "0.61552805", "0.6125397", "0.61204094", "0.60478884", "0.6027215", "0.6021576", "0.5994107", "0.5987808", "0.5975749", "0.59713006", "0.5968398", "0.59609544", "0.595459", "0.595459", "0.595459", "0.595459", "0.595459", "0.595459", "0.5943379", "0.5943379", "0.5943379", "0.5943379", "0.5943379", "0.5943379", "0.5943379", "0.5922639", "0.591881", "0.59101343", "0.59075034", "0.589674", "0.5840793", "0.583383", "0.583383", "0.583383", "0.58211505", "0.57602525", "0.57515866", "0.57418984", "0.573353", "0.57230836", "0.5719557", "0.5714506", "0.5704046", "0.5704046", "0.5657462", "0.5655583", "0.565502", "0.565502", "0.56234753", "0.55497324", "0.5534409", "0.5505789", "0.54944444", "0.5477655", "0.5449068", "0.5445819", "0.5430578", "0.54267275", "0.54109114", "0.5408212", "0.53862983", "0.53662366", "0.5365921", "0.53614587", "0.53484654", "0.5332368", "0.5319196", "0.5314932", "0.5308741", "0.5305147", "0.52671665", "0.52545196", "0.52500534", "0.524164", "0.5239064", "0.5217805", "0.52132356", "0.5197834", "0.51947427", "0.5191756", "0.5189969", "0.51851636", "0.5179092", "0.51545024", "0.5153297", "0.51476496" ]
0.6470937
8
Display and edit Omniva info on the order edit page
public static function admin_order_display( $wc_order_id, $print_barcode = true, $admin_panel = true ) { if ( is_object($wc_order_id) ) { $wc_order_id = $wc_order_id->get_id(); } $configs = OmnivaLt_Core::get_configs(); $order = OmnivaLt_Wc_Order::get_data($wc_order_id); $send_method = $order->omniva->method; $omnivalt_labels = new OmnivaLt_Labels(); $is_omniva = false; foreach ( $configs['method_params'] as $ship_method => $ship_values ) { if ( ! $ship_values['is_shipping_method'] ) continue; if ( $send_method == $ship_values['key'] ) { $is_omniva = true; } } if ( $send_method !== false && ! $is_omniva ) { self::add_Omniva_manually(); } if ( ! $is_omniva ) return; if ( self::is_admin_order_edit_page($order->id) ) { echo '<br class="clear"/>'; echo '<hr style="margin-top:20px;">'; echo '<h4>' . __('Omniva shipping', 'omnivalt') . '</h4>'; } echo '<div class="address">'; foreach ( $configs['method_params'] as $ship_method => $ship_values ) { if ( ! $ship_values['is_shipping_method'] ) continue; if ( $send_method != $ship_values['key'] ) continue; $field_value = $order->shipment->formated_shipping_address; if ( $ship_values['key'] == 'pt' || $ship_values['key'] == 'ps' ) { $field_value = OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id); } echo '<p><strong class="title">' . $ship_values['title'] . ':</strong> ' . $field_value . '</p>'; } if ( self::is_admin_order_edit_page($order->id) ) { echo self::build_shipment_size_text($order->shipment->size); } $services = OmnivaLt_Helper::get_order_services($order); if ( ! empty($services) ) { echo '<p><strong class="title">' . __('Services', 'omnivalt') . ':</strong> '; $output = ''; foreach ( $services as $service ) { if ( ! empty($output) ) $output .= ', '; foreach ( $configs['additional_services'] as $service_key => $service_values ) { if ( $service === $service_key ) $output .= $service_values['title']; } } echo $output . '</p>'; } if ( $print_barcode ) { echo str_replace('<br/>', '', $omnivalt_labels->print_tracking_link($order, $admin_panel, false)); } echo '</div>'; if ( ! self::is_admin_order_edit_page($order->id) ) { return; } echo '<div class="edit_address">'; if ( $send_method == 'pt' || $send_method == 'ps' ) { $values = array( 'terminal_key' => OmnivaLt_Configs::get_method_terminals_type($send_method), 'change_title' => sprintf(__('Change %s', 'omnivalt'), strtolower(OmnivaLt_Configs::get_method_title($send_method))), ); $all_terminals = OmnivaLt_Terminals::get_terminals_list('ALL', $values['terminal_key']); $selected_terminal = $order->omniva->terminal_id; echo '<p class="form-field-wide">'; echo '<label for="omnivalt_terminal">' . $values['change_title'] . '</label>'; echo '<input type="hidden" id="omniva-order-country" value="' . $order->shipping->country . '">'; echo '<select id="omnivalt_terminal" class="select short" name="omnivalt_terminal_id">'; echo '<option>-</option>'; foreach ($all_terminals as $country => $country_terminals) { foreach ($country_terminals as $county => $terminals) { echo '<optgroup data-country="' . $country . '" label="' . $county . '">'; foreach ($terminals as $terminal_id => $terminal_name) { $selected = ($terminal_id == $selected_terminal) ? 'selected' : ''; echo '<option value="' . $terminal_id . '" ' . $selected . '>' . $terminal_name . '</option>'; } echo '</optgroup>'; } } echo '</select>'; echo '</p>'; } else { echo __('The delivery address is changed in the fields above', 'omnivalt'); } echo self::build_shipment_size_fields($order->shipment->size); foreach ( $configs['additional_services'] as $service_key => $service_values ) { if ( $service_values['add_always'] ) continue; if ( ! $service_values['in_order'] ) continue; echo '<p class="form-field-wide">'; $field_id = 'omnivalt_' . $service_key; echo '<label for="' . $field_id . '">' . $service_values['title'] . '</label>'; if ($service_values['in_order'] === 'checkbox') { echo '<select id="' . $field_id . '" class="select short" name="' . $field_id . '">'; echo '<option value="no">' . __('No', 'omnivalt') . '</option>'; $selected = (in_array($service_key, $services)) ? 'selected' : ''; echo '<option value="yes" ' . $selected . '>' . __('Yes', 'omnivalt') . '</option>'; echo '</select>'; } echo '</p>'; } echo '</div>'; echo '<hr style="margin-top:20px;">'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function edit(order $order)\n {\n //\n }", "public function edit(Order $order){\n\n }", "public function edit(OrderDetails $orderDetails)\n {\n //\n }", "public function edit(Order $order)\n {\n // return view('backend.order.detail');\n }", "public function edit(TxShopDomainModelOrderItem $order)\n {\n //\n }", "public function edit(Orders $orders)\r\n {\r\n //\r\n }", "public function edit(RequestOrder $requestOrder)\n\n {\n\n //\n\n }", "public function edit(ProductOrder $productOrder)\n {\n //\n }", "public function edit(CustomerOrder $customerOrder)\n {\n //\n }", "public function edit(CustomerOrder $customerOrder)\n {\n //\n }", "public function edit($oid)\n {\n //加载修改页面\n $data = DB::table('Order')->where('oid',$oid)->first();\n return view('Admin.Order.edit',['ob'=>$data]);\n }", "public function edit(Orders $orders)\n {\n //\n }", "public function edit(Orders $orders)\n {\n //\n }", "public function edit(orders $orders)\n {\n //\n }", "public function editAction() {\n try {\n\n $pageHeading = \"Edit-Order\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n\n if ($this->_request->isPost()) {\n\n\n $id = $this->_request->getParam('txtId');\n $firstname = $this->_request->getParam('first_name');\n $lastname = $this->_request->getParam('last_name');\n $companyname = $this->_request->getParam('company_name');\n $email = $this->_request->getParam('email_address');\n $address1 = $this->_request->getParam('address1');\n $address2 = $this->_request->getParam('address2');\n $city = $this->_request->getParam('city_name');\n $state = $this->_request->getParam('state_region');\n $postcode = $this->_request->getParam('post_code');\n $country = $this->_request->getParam('country_name');\n $phonenumber = $this->_request->getParam('phone_number');\n $password = $this->_request->getParam('order_password');\n $currency = $this->_request->getParam('currency');\n $defaultgateway = $this->_request->getParam('payment_method');\n $credit = 0;\n $taxexempt = $this->_request->getParam('tax_exempt');\n $latefeeoveride = $this->_request->getParam('late_fees');\n $overideduenotices = $this->_request->getParam('overdue_notices');\n if ($overideduenotices == \"\") {\n $overideduenotices = 0;\n }\n $separateinvoices = $this->_request->getParam('separate_invoices');\n if ($separateinvoices == \"\") {\n $separateinvoices = 0;\n }\n\n\n $disableautocc = $this->_request->getParam('disable_cc_processing');\n if ($disableautocc == \"\") {\n $disableautocc = 0;\n }\n\n $datecreated = $this->getSystemDateTime();\n $notes = $this->_request->getParam('admin_notes');\n $billingcid = 0;\n $securityqid = $this->_request->getParam('security_question');\n $securityqans = $this->_request->getParam('security_answer');\n $groupid = 0;\n $cardtype = null;\n $cardlastfour = null;\n $cardnum = null;\n $startdate = null;\n $expdate = null;\n $issuenumber = null;\n $bankname = null;\n $banktype = null;\n $bankcode = null;\n $bankacct = null;\n $gatewayid = null;\n $lastlogin = null;\n $ip = null;\n $host = null;\n $status = $this->_request->getParam('status');\n $language = $this->_request->getParam('language');\n $pwresetkey = null;\n $pwresetexpiry = null;\n\n\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $objOrderEntity = new Base_Model_Lib_Order_Entity_Order();\n $objOrderEntity->setId($id);\n $objOrderEntity->setFirstname($firstname);\n $objOrderEntity->setLastname($lastname);\n $objOrderEntity->setCompanyname($companyname);\n $objOrderEntity->setEmail($email);\n $objOrderEntity->setAddress1($address1);\n $objOrderEntity->setAddress2($address2);\n $objOrderEntity->setCity($city);\n $objOrderEntity->setState($state);\n $objOrderEntity->setPostcode($postcode);\n $objOrderEntity->setCountry($country);\n $objOrderEntity->setPhonenumber($phonenumber);\n $objOrderEntity->setPassword($password);\n $objOrderEntity->setCurrency($currency);\n $objOrderEntity->setDefaultgateway($defaultgateway);\n $objOrderEntity->setCredit($credit);\n $objOrderEntity->setTaxexempt($taxexempt);\n $objOrderEntity->setLatefeeoveride($latefeeoveride);\n $objOrderEntity->setOverideduenotices($overideduenotices);\n $objOrderEntity->setSeparateinvoices($separateinvoices);\n $objOrderEntity->setDisableautocc($disableautocc);\n $objOrderEntity->setDatecreated($datecreated);\n $objOrderEntity->setNotes($notes);\n $objOrderEntity->setBillingcid($billingcid);\n $objOrderEntity->setSecurityqid($securityqid);\n $objOrderEntity->setSecurityqans($securityqans);\n $objOrderEntity->setGroupid($groupid);\n $objOrderEntity->setCardtype($cardtype);\n $objOrderEntity->setCardlastfour($cardlastfour);\n $objOrderEntity->setCardnum($cardnum);\n $objOrderEntity->setStartdate($startdate);\n $objOrderEntity->setExpdate($expdate);\n $objOrderEntity->setIssuenumber($issuenumber);\n $objOrderEntity->setBankname($bankname);\n $objOrderEntity->setBanktype($banktype);\n $objOrderEntity->setBankcode($bankcode);\n $objOrderEntity->setBankacct($bankacct);\n $objOrderEntity->setGatewayid($gatewayid);\n $objOrderEntity->setLastlogin($lastlogin);\n $objOrderEntity->setIp($ip);\n $objOrderEntity->setHost($host);\n $objOrderEntity->setStatus($status);\n $objOrderEntity->setLanguage($language);\n $objOrderEntity->setPwresetkey($pwresetkey);\n $objOrderEntity->setPwresetexpiry($pwresetexpiry);\n $objOrderService->order = $objOrderEntity;\n\n if ($objOrderService->updateOrder()) {\n $this->_redirect('/admin/order/?status=edited');\n } else {\n $this->_redirect('/admin/order/add/?error=1');\n }\n } else {\n\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $orderId = $this->_request->getParam('id');\n $orderInfo = $objOrderService->getOrder($orderId);\n $this->view->orderInfo = $orderInfo;\n }\n } catch (Exception $ex) {\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\n }\n }", "public function edit(OrderItem $orderItem)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit($oid)\n {\n $data = Orders::where('oid',$oid) -> first();\n // dd($data);\n return view('admin.a_order.edit',[\n 'title'=>'修改订单',\n 'data'=>$data\n ]);\n }", "public function edit(Order $order, Calification $calification)\n {\n //\n }", "public function edit(Order $order)\n {\n //\n $estados = DB::table('statuses')->select('name')->where('name','not like','Pagado')->get();\n return view('vendor.multiauth.admin.orders.edit',compact('order','estados'));\n }", "public function getEdit($order_id)\n {\n $order = Order::find($order_id);\n\n $statuses = OrderStatus::all();\n\n $products = Product::all();\n\n $max_invoice_number = (int) Order::whereRaw('YEAR(created_at)='.date('Y'))->max('invoice_number');\n\n return view('admin::orders.order', compact('order', 'max_invoice_number', 'statuses', 'products'));\n }", "public function editInvoice($order_id)\n {\n $submitted = Request::get('submitted');\n if ($submitted) {\n } else {\n $order = Invoice::where('id', '=', $order_id)->get();\n $order_details =[];\n \n return view('common.edit_invoice')\n ->with('order', $order[0])\n ->with('order_details', $order_details);\n\n // return view('common.edit_invoice')->with('order', $order)->with('order_details', $order_details)->with('before_image',$before_image);\n }\n }", "function edit_order($order_id){\n /**/ //GET ORDER BY ID\n /**/ /**************************************************/\n /**/ /**/$order = $this->order_model->get($order_id);/**/\n /**/ /**************************************************/\n /**/ $order_shift = $this->shift_model->get($order->shift_id);\n /**/ $order->shift_date = $order_shift->date;\n /**/ $this->e_order($order);\n /**/ }", "public function editAction() {\n\t\t$form = $this->getForm ( '/admin/invoices/process' );\n\t\t\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\t$rs = $this->invoices->find ( $id )->toArray ();\n\t\t\tif (! empty ( $rs )) {\n\t\t\t\t$rs ['invoice_date'] = Shineisp_Commons_Utilities::formatDateOut ( $rs ['invoice_date'] );\n\t\t\t\t\n\t\t\t\t$parent = Customers::find ( $rs ['customer_id'] );\n\t\t\t\t\n\t\t\t\t//if customer comes from reseller\n\t\t\t\tif ($parent ['parent_id']) {\n\t\t\t\t\t$rs ['customer_parent_id'] = $parent ['parent_id'];\n\t\t\t\t} else {\n\t\t\t\t\t$rs ['customer_parent_id'] = $rs ['customer_id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Create the buttons in the edit form\r\n\t\t\t\t$this->view->buttons = array(\r\n\t\t\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/confirm/id/$id\", \"label\" => $this->translator->translate('Delete'), \"params\" => array('css' => null)),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t// Check if the order has been invoiced\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/sendinvoice/id/$id\", \"label\" => $this->translator->translate('Email invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/print/id/$id\", \"label\" => $this->translator->translate('Print invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/confirmoverwrite/id/$id\", \"label\" => $this->translator->translate('Overwrite invoice'), \"params\" => array('css' => null));\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/edit/id/\".$rs ['order_id'], \"label\" => $this->translator->translate('Order'), \"params\" => array('css' => null));\r\n\t\t\t\t\n\t\t\t\t$form->populate ( $rs );\n\t\t\t}\n\t\t}\n\t\t$this->view->title = $this->translator->translate(\"Invoice Edit\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the selected order.\");\n\t\t\n\t\t$this->view->mex = urldecode ( $this->getRequest ()->getParam ( 'mex' ) );\n\t\t$this->view->mexstatus = $this->getRequest ()->getParam ( 'status' );\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'applicantform' );\n\t}", "public function show(Order $order)\n { \n //\n }", "public function edit(Order $order)\n\t{\n return view('orders.edit', compact('order'));\n\t}", "public function edit(Order $order)\n {\n return view('backend.order.edit', compact('order'));\n }", "public function edit($id)\n {\n $cont = new RestController();\n $order = $cont->getRequest('Orders(' . $id . ')?$expand=OrderFieldValue($expand=OrderField),OrderType,ClientAlias($select=Id,Name),User($select=Id,UserName),OrderProductPackage($expand=ProductPackage($expand=Product))');\n if ($order instanceof View) {\n return $order;\n }\n\n if(!empty($order->OrderProductPackage)){\n //getting the products because we can't do it in the query\n foreach ($order->OrderProductPackage as $k => $val) {\n $product = $cont->getRequest(\"Products(\" . $val->ProductPackage->Product_Id . \")\");\n if (!$product instanceof View) {\n $order->OrderProductPackage[$k]->ProductPackage->Product = $product;\n }\n }\n }\n\n $orderFields = $this->editValues($order->OrderFieldValue);\n $users = UsersController::usersList();\n\n\n $paymentTerms = $cont->getEnumProperties(['ContractTerms']);\n $paymentTerms = isset($paymentTerms['ContractTerms']) ? $paymentTerms['ContractTerms'] : [];\n\n $countries = CountriesController::countriesList();\n\n return view('orders.edit', compact('order', 'orderFields', 'users','paymentTerms','countries'));\n }", "public function edit(GroceryOrder $groceryOrder)\n {\n //\n }", "public function displayEditOrder(Order $order)\n {\n $allProducts = Product::all();\n return view('order.edit_order', [\n 'order' => $order,\n 'all_products' => $allProducts,\n ]);\n }", "public function edit(StatusOrder $statusOrder)\n {\n //\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function show(Order $order)\n {\n //\n\n }", "public function modifyOrder(){\r\n $cookies = new CookieModel();\r\n $cookie_id = $cookies -> read();\r\n $Form = M('userinfo');\r\n $condition_in['stuid'] = $cookie_id;\r\n $data = $Form->where($condition_in)->find();\r\n if (! $data['manager']) $this->redirect('/');\r\n $key = $_REQUEST['id'];\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->find();\r\n if ($_REQUEST['number']) $data['number'] = $_REQUEST['number'];\r\n if ($_REQUEST['area']) $data['area'] = $_REQUEST['area'];\r\n if ($_REQUEST['ordertime']) $data['ordertime'] = $_REQUEST['ordertime'];\r\n if ($_REQUEST['address']) $data['address'] = $_REQUEST['address'];\r\n if ($_REQUEST['pay']) $data['pay'] = $_REQUEST['pay'];\r\n if ($_REQUEST['phone']) $data['phone'] = $_REQUEST['phone'];\r\n if ($_REQUEST['food']) $data['food'] = $_REQUEST['food'];\r\n if ($_REQUEST['amount']) $data['amount'] = $_REQUEST['amount'];\r\n if ($_REQUEST['status']) $data['status'] = $_REQUEST['status']; \r\n if ($_REQUEST['pay_status']) $data['pay_status'] = $_REQUEST['pay_status'];\r\n $data['id'] = $key;\r\n $form->save($data);\r\n $this->redirect('/index.php/Admin/index');\r\n //$this->display();\r\n }", "public function editorderformAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t$viewRender = $sm->get('ViewRenderer');\n\t\t\t$htmlViewPart = new ViewModel();\n\t\t\t\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$order_id = $posts['order_id'];\n\t\t\t\t\n\t\t\t\t$orderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t$order = (array)$orderTable->fetchOrderDetails($order_id);\n\t\t\t\t$order['exp_delivery_date'] = date($config['formDateFormat'], strtotime($order['exp_delivery_date']));\n\t\t\t\t$orderAttachments = (array)$orderTable->fetchOrderAttachments($order_id);\n\t\t\t\tif(count($orderAttachments) > 0){\n\t\t\t\t\t$order['order_attachment'] = json_encode($orderAttachments);\n\t\t\t\t}\n\t\t\t\t$orderFullAttachments = (array)$orderTable->fetchOrderAttachments($order_id, true);\n\t\t\t\t$newOrderForm = $sm->get('Order\\Form\\OrderForm');\n\t\t\t\t$newOrderForm->get('order_save')->setLabel(\"Update\");\n\t\t\t\t$newOrderForm->setData($order);\n\t\t\t\t\n\t\t\t\t$htmlViewPart->setTemplate('order/index/neworder')\n\t\t\t\t\t\t\t ->setTerminal(true)\n\t\t\t\t\t\t\t ->setVariables(array('newOrderForm' => $newOrderForm, 'orderFullAttachments' => $orderFullAttachments, 'config' => $config));\n\t\t\t}\n\t\t\n\t\t\t$html = $viewRender->render($htmlViewPart);\t\n\t\t\t\n\t\t\treturn $this->getResponse()->setContent($html);\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function edit(Order $order)\n {\n $entity = $order;\n $services = Service::all();\n return view('admin.orders.ed_form', compact('services', 'entity'));\n }", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function show(Order $order)\n {\n\n }", "public function edit(Producto $producto)\n {\n \n }", "public function edit(OrderProcessing $orderProcessing)\n {\n //\n }", "public function edit(producto $producto)\n {\n //\n }", "function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }", "public function edit_toko(){\n\t}", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function edit(InstitutoProcedencia $institutos_procedencia)\n {\n //\n }", "public function edit($id)\n {\n $order= Sales_order::find($id);\n //$party = $order->party;\n return view('return.create',compact('order'));\n\n\n\n }", "public function show(Order $order)\n {\n //\n }", "public function edit(Order $order)\n {\n $products = OrderProduct::select(\n \"order_products.id\",\n \"order_products.qty\",\n \"order_products.sub_total\",\n \"products.id\",\n \"products.product_name\",\n \"products.price\"\n )\n ->leftJoin(\"products\", \"products.id\", \"=\", \"order_products.product_id\")\n ->where('order_id', $order->id)\n ->get();\n\n return view('orders.edit', compact('order', 'products'));\n }", "public function edit(Order $order)\n {\n return view('inventory.orders.edit', compact('order'));\n }", "public function edit(Order $order)\n {\n return view('vendor.voyager.order.edit', compact('order'));\n }", "public function edit(Owner $owner)\n {\n //\n }", "public function edit($order_no)\n {\n $order = Order::where('order_no', $order_no)->first();\n return view('admin.orders.edit', compact('order'));\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function edit(OrderRequest $request, Order $order)\n {\n Form::populate($order);\n return response()->view('order::admin.order.edit', compact('order'));\n }", "public function edit($id)\n {\n //\n return view('admin.updateItems.editOrder')->with([\n 'order' => Order::find($id),\n \n ]);\n }", "public function edit(POSOrder $order)\n {\n if (auth()->user()->can('pos_order.update', $order)) {\n $products = auth()->user()->pos->activeProducts;\n return view('pos.orders.edit', compact('order', 'products'));\n }\n abort(403);\n }", "public function editAction(){\n\t\t$id = $this->getInput('id');\n\t\t$info = Ola_Service_Area::get(intval($id)); \n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t $this->assign('info', $info);\t\n\t}", "public function edit($id_order)\n {\n $order = Order::find($id_order);\n return view('admin/entrimeja/edit', compact('order'));\n }" ]
[ "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.73095393", "0.7272874", "0.7201015", "0.7159024", "0.70351195", "0.7031224", "0.69223624", "0.67601496", "0.67417604", "0.6729618", "0.6705346", "0.6705346", "0.6693861", "0.6676409", "0.6676409", "0.6668832", "0.6646752", "0.66144335", "0.6599235", "0.65774614", "0.6567961", "0.65593076", "0.651182", "0.650783", "0.65009475", "0.64888704", "0.64798343", "0.6470384", "0.64666945", "0.6443403", "0.6436925", "0.64368373", "0.6415412", "0.64054334", "0.6404909", "0.64041615", "0.6393592", "0.6389545", "0.63895226", "0.6364678", "0.6362111", "0.6361277", "0.6338281", "0.63242227", "0.6319257", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6311151", "0.6309541", "0.6292522", "0.628702", "0.62843543", "0.6282894", "0.6267552", "0.6263226", "0.6253379", "0.62483287", "0.62478137", "0.62379295", "0.6234414", "0.6229758", "0.62281066" ]
0.0
-1
proxy function for registering styles (helps with cachebusting)
function appc_enqueue_style( $handle, $src = '', $deps = array(), $ver = false, $media = 'all' ) { wp_enqueue_style( $handle, $src, $deps, ($ver ? $ver : filemtime( str_replace(TEMPLATE_THEME_URL, TEMPLATE_THEME_PATH, $src) )), $media); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function register_style();", "function register_style() {\n}", "function wp_register_style($handle, $src, $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "public function registerStyles() {\n $this->registerStylesCommon();\n \n if(is_admin()) {\n $this->registerStylesAdmin();\n } else {\n $this->registerStylesFrontend();\n }\n }", "protected static function registerStyles() {\n\t\tforeach (static::$styles as $handle => $stylePath) {\n\t\t\tstatic::registerStyle($handle, $stylePath);\n\t\t}\n\t}", "protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }", "public function registerStyles() {\n $this->styles['mkdf-bootstrap'] = 'assets/css/mkdf-bootstrap.css';\n $this->styles['mkdf-page-admin'] = 'assets/css/mkdf-page.css';\n $this->styles['mkdf-options-admin'] = 'assets/css/mkdf-options.css';\n $this->styles['mkdf-meta-boxes-admin'] = 'assets/css/mkdf-meta-boxes.css';\n $this->styles['mkdf-ui-admin'] = 'assets/css/mkdf-ui/mkdf-ui.css';\n $this->styles['mkdf-forms-admin'] = 'assets/css/mkdf-forms.css';\n $this->styles['mkdf-import'] = 'assets/css/mkdf-import.css';\n $this->styles['font-awesome-admin'] = 'assets/css/font-awesome/css/font-awesome.min.css';\n\n foreach ($this->styles as $styleHandle => $stylePath) {\n sienna_mikado_register_skin_style($styleHandle, $stylePath);\n }\n\n }", "function SA_dev_register_style($handle, $src, $ver){echo '<link rel=\"stylesheet\" href=\"'.$src.'\" type=\"text/css\" charset=\"utf-8\" />'.\"\\n\";}", "function ft_hook_add_css() {}", "public function register_styles() {\n\n\t\t\twp_register_style(\n\t\t\t\t\"$this->ID-style\",\n\t\t\t\tplugins_url( 'style.css', __FILE__ ),\n\t\t\t\tnull,\n\t\t\t\t$this->version\n\t\t\t);\n $file_tmpl = 'ui/timeago/locale/jquery.timeago.%s.js';\n wp_register_script( 'timeago-locale', WP_STREAM_URL . sprintf( $file_tmpl, 'en' ), array( 'timeago' ), '1' );\n wp_register_style( 'select2', WP_STREAM_URL . 'ui/select2/select2.css', array(), '3.5.1' );\n\t\t}", "protected function generateCSS() {}", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "public function getStyleLoader();", "function hook_style() {\n\t\treturn null;\n\t}", "function wp_style_loader_src($src, $handle)\n {\n }", "private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "public function styles(){\n //Enqueue styles\n /**\n * wp_enqueue_style('sample-style',$this->directory_uri . '/sample.css');\n * ...\n * ....\n */\n }", "function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}", "function add_my_stylesheet() {\n}", "function ruven_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\t$env = ( wp_get_environment_type() === 'local') ? 'min.' : '';\n\n\twp_enqueue_style( 'ruven-style', get_template_directory_uri() . '/assets/css/style.'. $env .'css', array(),\n\t$theme_version );\n\twp_style_add_data( 'ruven-style', 'rtl', 'replace' );\n\n\n}", "function wp_register_styles() {\n // Developer Tier Admin Stylesheet\n wp_register_style( \"{$this->namespace}-admin\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/admin.css\", array(), '2.1', 'screen' );\n // CodeMirror Library\n wp_register_style( \"codemirror\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/codemirror.css\", array(), '2.25', 'screen' );\n }", "function zweidrei_eins_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' ); \n\twp_enqueue_style( 'style', get_stylesheet_uri(), array(), $theme_version );\n\n\t/** \t\n\t * Add custom css\n\t * Bulma: Free, open source, and modern CSS framework based on Flexbox\n\t * https://bulma.io/ \n\t * Version: 0.9.0\n\t * Child: custom.css\n\t */\n\twp_enqueue_style( 'style1', get_template_directory_uri() . '/assets/css/bulma.min.css', array(), $theme_version );\n\twp_enqueue_style( 'style2', get_template_directory_uri() . '/assets/css/custom.css', array(), $theme_version );\n\n\t\n\n}", "static function register_styles( $styles ) {\n\t\tforeach ( $styles as $stylename => $conf ) {\n\t\t\t// the child theme may be allowed to overwrite the configuration in\n\t\t\t// which case we support for null configuration, ie. child theme turned\n\t\t\t// the resource off\n\t\t\tif ( $conf !== null ) {\n\t\t\t\tif ( is_string( $conf ) ) {\n\t\t\t\t\t$path = $conf;\n\t\t\t\t\t$require = array();\n\t\t\t\t\t$cache_bust = '';\n\t\t\t\t\t$media = 'all';\n\t\t\t\t} else { // array configuration passed\n\t\t\t\t\t$path = $conf['path'];\n\n\t\t\t\t\t// compute requirements\n\t\t\t\t\tif ( isset( $conf['require'] ) ) {\n\t\t\t\t\t\tif ( is_string( $conf['require'] ) ) {\n\t\t\t\t\t\t\t$require = array( $conf['require'] );\n\t\t\t\t\t\t} else { // assume array\n\t\t\t\t\t\t\t$require = $conf['require'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // no dependencies\n\t\t\t\t\t\t$require = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute cache bust\n\t\t\t\t\tif ( isset( $conf['cache_bust'] ) ) {\n\t\t\t\t\t\t$cache_bust = $conf['cache_bust'];\n\t\t\t\t\t} else { // no cache bust\n\t\t\t\t\t\t$cache_bust = '';\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute media\n\t\t\t\t\tif ( isset( $conf['media'] ) ) {\n\t\t\t\t\t\t$media = $conf['media'];\n\t\t\t\t\t} else { // no media\n\t\t\t\t\t\t$media = 'all';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twp_register_style( $stylename, $path, $require, $cache_bust, $media );\n\t\t\t}\n\t\t}\n\t}", "public function registerStylesFrontend() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style('wpjb-css', $p.\"frontend.css\", array('wpjb-glyphs'), $v );\n }", "protected function loadStylesheets() {}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function registerStyle(Style $style)\n {\n if ($style->isRegistered()) {\n return $style;\n }\n\n $registeredStyle = parent::registerStyle($style);\n $this->usedFontsSet[$style->getFontName()] = true;\n\n return $registeredStyle;\n }", "private function load_public_styles() {\n\n\t}", "public function get_custom_css()\n {\n }", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "function wp_styles()\n {\n }", "function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }", "public function registerStyles()\n {\n wp_register_style('swiper-css', THEME_DIR_URI .'/assets/css/swiper.min.css', [], false, 'all');\n wp_register_style('dist-css', THEME_DIR_URI .'/assets/css/dist.css', [], false, 'all');\n wp_register_style('regional-css', THEME_DIR_URI .'/regional.css', [], false, 'all');\n wp_register_style('regional-style', THEME_DIR_URI .'/style.css', [], false, 'all');\n\n // Default app style file\n //wp_enqueue_style('style-css');\n\n // App styles\n wp_enqueue_style('swiper-css');\n wp_enqueue_style('dist-css');\n wp_enqueue_style('regional-css');\n wp_enqueue_style('regional-style');\n }", "function wp_enqueue_style($handle, $src = '', $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "function wp_deregister_style($handle)\n {\n }", "function egg_styles()\n{\n\tglobal $wp_styles; // call global $wp_styles variable to add conditional wrapper around ie stylesheet\n\n\t// register main stylesheet\n\twp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.css?091714', array(), '', 'all' );\n\t// wp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.min.css', array(), '', 'all' );\n\n\t// ie-only style sheet\n\twp_register_style( 'egg-ie-only', get_stylesheet_directory_uri() . '/assets/css/ie.css', array(), '' );\n\n\twp_enqueue_style( array(\n\t\t'egg-stylesheet',\n\t\t'egg-ie-only'\n\t) );\n\t\n\t$wp_styles->add_data( 'egg-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet\n}", "function wp_add_inline_style($handle, $data)\n {\n }", "function init(){\r\n wp_register_style( 'twitlink_style',$this->plugin_url.'css/style.css',null,$this->version ); \r\n }", "function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }", "function styles() {\n\twp_register_style(\n\t\t'fontawesome',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/fontawesome/css/font-awesome.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'ionicons',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/ionicons/css/ionicons.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/css/bootstrap.min.css\",\n\t\tarray( 'fontawesome' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'sanitize',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/sanitize/sanitize.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'vincentragosta',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/css/vincentragosta---twenty-seventeen.css\",\n\t\tarray( 'bootstrap', 'fontawesome', 'ionicons', 'sanitize' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n}", "function jehaann_style(){\n wp_register_style('style', get_stylesheet_uri(),'','1.0','all');\n\n //cargando hojas de estilos\n\n wp_enqueue_style('style');\n}", "function add_styles() {\n\t\tif ( is_active_widget( false, false, $this->id_base, true ) ) {\n\t\t\twp_enqueue_style( 'font-awesome' );\n\t\t\t\n\t\t\t//wp_enqueue_style( 'my-style', \\trends\\helper\\utils::get_widgets_uri( 'social_icons', '/assets/my-style.css') );\n\t\t\t\n\t\t}\n\t}", "function prefix_add_my_stylesheet() {\n wp_register_style( 'prefix-style', plugins_url('style1.css', __FILE__) );\n wp_enqueue_style( 'prefix-style',plugins_url('style1.css', __FILE__) );\n wp_enqueue_script( 'prefix-style',plugins_url('close.js', __FILE__) );\n wp_enqueue_style( 'fa-style',plugins_url('font-awesome-4.2.0/css/font-awesome.min.css', __FILE__) );\n \n}", "function horse_manager_stylesheet() {\n wp_register_style( 'horse-style', plugins_url('/inc/horse_styles.css', __FILE__) );\n wp_enqueue_style( 'horse-style' );\n}", "function wptheme_register_styles() {\n\t\t$theme = wp_get_theme();\n\t\t$version = $theme['Version'];\n\t\t$stylesheets = '';\n\n\t\t// Register stylesheets\n\t $stylesheets .= wp_register_style('wptheme', get_stylesheet_directory_uri().'/style.css', array(), $version, 'screen, projection');\n\n\t\t// enqueue registered styles\n\t\twp_enqueue_style('wptheme');\n\n\t}", "function child_generate_update_dynamic_css_cache() {\n\tif ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) {\n\t\treturn;\n\t}\n\n\t$css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css();\n\tupdate_option( 'generate_dynamic_css_output', wp_strip_all_tags( $css ) );\n}", "public function renderCSS()\n {\n }", "function register_block_style($block_name, $style_properties)\n {\n }", "function ag_set_predefined_style() {\n\tif(!isset($_POST['lcwp_nonce']) || !wp_verify_nonce($_POST['lcwp_nonce'], 'lcwp_nonce')) {die('Cheating?');}\n\tif(!isset($_POST['style'])) {die('data is missing');}\n\n\trequire_once(AG_DIR .'/settings/preset_styles.php');\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t$style_data = ag_preset_styles_data($_POST['style']);\n\tif(empty($style_data)) {die('Style not found');}\n\t\n\t\n\t// override values\n\tforeach($style_data as $key => $val) {\n\t\tupdate_option($key, $val);\t\t\n\t}\n\n\n\t// if is not forcing inline CSS - create static file\n\tif(!get_option('mg_inline_css')) {\n\t\tag_create_frontend_css();\n\t}\n\t\n\tdie('success');\n}", "function thememount_hook_dynamic_css(){\n\tob_start(); // begin collecting output\n\tinclude get_template_directory().'/css/dynamic-style.php';\n\t$css = ob_get_clean(); // retrieve output from myfile.php, stop buffering\n\t\n\t/* Now add the dynamic-style.php style in header */\n\t$output = \"<style> $css </style>\";\n\techo $output;\n}", "public function setStyleLoader($styleLoader);", "function loadStyles() {\n\t\twp_register_style('hashee_styles', $this->pluginPath . 'css/hashee_styles.css');\n\t\twp_enqueue_style('hashee_styles');\n\t}", "public function registerStylesCommon() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-vendor-datepicker\", $x.\"date-picker/css/datepicker.css\");\n wp_register_style('wpjb-glyphs', $p.\"wpjb-glyphs.css\", array(), $v );\n wp_register_style('wpjb-stripe-elements', $p.\"wpjb-stripe-elements.css\", array(), $v );\n }", "public function register_plugin_styles() {\n\t\t\tglobal $pagenow;\n\n\t\t\t$is_frontend = ( ! is_admin() ) ? true : false;\n\t\t\t$is_valid_post_page = ( ! empty( $pagenow ) && in_array( $pagenow, array( 'edit.php', 'post.php', 'post-new.php' ), true ) ) ? true : false;\n\t\t\t$is_valid_admin_page = ( ( ! empty( $_GET['page'] ) && 'wc-smart-coupons' === wc_clean( wp_unslash( $_GET['page'] ) ) ) || ( ! empty( $_GET['tab'] ) && 'wc-smart-coupons' === wc_clean( wp_unslash( $_GET['tab'] ) ) ) ) ? true : false; // phpcs:ignore\n\n\t\t\tif ( $is_frontend || $is_valid_admin_page || $is_valid_post_page ) {\n\n\t\t\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\t\t\twp_register_style( 'smart-coupon', untrailingslashit( plugins_url( '/', WC_SC_PLUGIN_FILE ) ) . '/assets/css/smart-coupon' . $suffix . '.css', array(), $this->plugin_data['Version'] );\n\t\t\t\twp_enqueue_style( 'smart-coupon' );\n\t\t\t}\n\n\t\t}", "private function load_admin_styles() {\n\n\t}", "function add_qoorate_stylesheet(){\n\t\t// TODO: make call to get styles from QOORATE\n\t\t// MAYBE TODO: cacheing ... place in DB options?\n\t\t\n\t\t//$styleUrl = plugins_url('/css/guthrie.css', __FILE__);\n\t\t//$styleFile = WP_PLUGIN_DIR . '/guthrie/css/guthrie.css';\n\t\t//if ( file_exists($styleFile) ) {\n\t\t//\t\t//echo($styleUrl.\"<br />\");\n\t\t//\t\twp_register_style('guthrie', $styleUrl);\n\t\t//\t\twp_enqueue_style('guthrie');\n\t\t//}\n\t\t// unregister our really old jquery bundled with WP\n\t\t// Maybe we can keep it? should it be an option?\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' );\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function styles() {\n\n\twp_enqueue_style(\n\t\t'styles',\n\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/style.css',\n\t\t[],\n\t\tERI_SCAFFOLD_VERSION\n\t);\n\n\tif ( is_page_template( 'templates/page-styleguide.php' ) ) {\n\t\twp_enqueue_style(\n\t\t\t'styleguide',\n\t\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/styleguide-style.css',\n\t\t\t[],\n\t\t\tERI_SCAFFOLD_VERSION\n\t\t);\n\t}\n}", "function styles_load_custom()\n{\n wp_register_style( 'google-fonts-roboto-style',\n '//fonts.googleapis.com/css?family=Roboto',\n array(), '', 'all' );\n wp_enqueue_style( 'google-fonts-roboto-style' );\n\n wp_register_style( 'font-awesome-style-cdn',\n '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',\n array(), '4.7.0', 'all' );\n wp_enqueue_style( 'font-awesome-style-cdn' );\n\n wp_register_style( 'bootstrap-style-cdn',\n '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',\n array(), '3.3.7', 'all' );\n wp_enqueue_style( 'bootstrap-style-cdn' );\n\n wp_register_style( 'bootstrap-theme-style-cdn',\n '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css',\n array('bootstrap-style-cdn'), '3.3.7', 'all' );\n wp_enqueue_style( 'bootstrap-theme-style-cdn' );\n\n wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array(), filemtime( get_stylesheet_directory() . '/style.css' ) );\n\n\n}", "public function registerStylesAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-admin-css\", $p.\"admin.css\", array(), $v);\n wp_register_style(\"wpjb-colorpicker-css\", $p.\"colorpicker.css\", array(), $v);\n wp_register_style(\"wpjb-vendor-ve-css\", $x.\"visual-editor/visual-editor.css\", array(), $v);\n wp_register_style(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.css\", array(), $v);\n }", "function inkthemes_enqueue_styles() {\n global $themeslug, $options;\n wp_register_style($themeslug . 'storecss', get_template_directory_uri() . '/admin/theme-page-style.css');\n wp_enqueue_style($themeslug . 'storecss');\n}", "private function initStyle(){\n\t\t\t$file_style_normal = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_normal.class.php';\n\t\t\t$file_style_gdi = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_gdi.class.php';\n\t\t\t\n\t\t\t// include the files\n\t\t\tinclude_once($file_style_normal);\n\t\t\tinclude_once($file_style_gdi);\n\t\t\t\n\t\t\t// get class\n\t\t\tif ($this->config->get('gd', 'pmod_'.$this->moduleID))\n\t\t\t\t$this->style = registry::register('wowstatus_style_gdi');\n\t\t\t\telse\n\t\t\t\t\t$this->style = registry::register('wowstatus_style_normal');\n\t\t}", "public function loadStyle(){\n \t\treturn null;\n \t}", "public static function register_style( $handle, $src, $deps = array() ) {\n\t\t$path = plugin_dir_path( __DIR__ ) . $src;\n\t\t$url = plugin_dir_url( __DIR__ ) . $src;\n\t\twp_register_style( $handle, $url, $deps, file_exists( $path ) ? strval( filemtime( $path ) ) : false );\n\t}", "function styles() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool additive_style_debug\n\t */\n\t$debug = apply_filters( 'additive_style_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_style( 'additive-fonts',\n\t\t\"https://fonts.googleapis.com/css?family=Arvo:400,700|Lato:300,400,700\",\n\t\tarray(),\n\t\tnull\n\t);\n\n\twp_enqueue_style(\n\t\t'normalize',\n\t\tADDITIVE_URL . \"/assets/css/normalize{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'skeleton',\n\t\tADDITIVE_URL . \"/assets/css/skeleton{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'additive',\n\t\tADDITIVE_URL . \"/assets/css/additive{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'font-awesome',\n\t\tADDITIVE_URL . \"/assets/css/font-awesome{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n}", "public function getFrontendStyles() {\n }", "public function getFrontendStyles() {\n }", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nimiq_Miner_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nimiq_Miner_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/nimiq-miner-public.css', array(), $this->version, 'all' );\n\n\t}", "protected function loadCss() {}", "public function styles(){\n\n\t\t//wp_enqueue_style('component-header_fixed-style', $this->directory_uri . '/assets/dist/css/headerFixed.css');\n\t}", "function get_stylesheet()\n {\n }", "function enqueue_cached_css() {\n\ttry {\n\t\t$cachebuster = get_latest_revision_id();\n\t} catch ( Exception $exception ) {\n\t\t$cachebuster = date( 'Y-m-d-H' );\n\t}\n\n\twp_enqueue_style(\n\t\tCSS_HANDLE,\n\t\tadd_query_arg( 'action', CSS_HANDLE, admin_url( 'admin-ajax.php' ) ),\n\t\tarray(),\n\t\t$cachebuster,\n\t\t'all'\n\t);\n}", "public function enqueue_styles( $hook ) {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nginx_Helper_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nginx_Helper_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\tif ( 'settings_page_nginx' !== $hook ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_enqueue_style( $this->plugin_name . '-icons', plugin_dir_url( __FILE__ ) . 'icons/css/nginx-fontello.css', array(), $this->version, 'all' );\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/nginx-helper-admin.css', array(), $this->version, 'all' );\n\n\t}", "function setup() {\n\tadd_filter( 'fl_builder_render_css', __NAMESPACE__ . '\\\\styles', 10, 3 );\n}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "function ic_add_style_attribute( $tag, $handle ) {\n\t$handles = array(\n\t\t'main_stylesheet',\n\t);\n\tforeach( $handles as $styles) :\n\t\tif ( $styles === $handle ) {\n\t\t\treturn str_replace( ' href', ' rel=\"preload\" as=\"style\" href', $tag );\n\t\t}\n\tendforeach;\n\treturn $tag;\n}", "static function _style_on() {\n\t\treturn self::style( true );\n\t}", "public function register_styles() {\n\t\t\t$woocommerce_base = WC()->template_path();\n\t\t\t$assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';\n\n\t\t\t// register dependencies\n\t\t\twp_register_style( 'jquery-selectBox', YITH_WCWL_URL . 'assets/css/jquery.selectBox.css', array(), '1.2.0' );\n\t\t\twp_register_style( 'yith-wcwl-font-awesome', YITH_WCWL_URL . 'assets/css/font-awesome.min.css', array(), '4.7.0' );\n\t\t\twp_register_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );\n\n\t\t\t// register main style\n\t\t\t$located = locate_template( array(\n\t\t\t\t$woocommerce_base . 'wishlist.css',\n\t\t\t\t'wishlist.css'\n\t\t\t) );\n\n\t\t\tif( ! $located ){\n\t\t\t wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$stylesheet_directory = get_stylesheet_directory();\n\t\t\t\t$stylesheet_directory_uri = get_stylesheet_directory_uri();\n\t\t\t\t$template_directory = get_template_directory();\n\t\t\t\t$template_directory_uri = get_template_directory_uri();\n\n\t\t\t\t$style_url = ( strpos( $located, $stylesheet_directory ) !== false ) ? str_replace( $stylesheet_directory, $stylesheet_directory_uri, $located ) : str_replace( $template_directory, $template_directory_uri, $located );\n\n\t\t\t\twp_register_style( 'yith-wcwl-user-main', $style_url, array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n }\n\n\t\t\t// theme specific assets\n $current_theme = wp_get_theme();\n\n\t\t\tif( $current_theme->exists() ){\n\t\t\t $theme_slug = $current_theme->Template;\n\n\t\t\t if( file_exists( YITH_WCWL_DIR . 'assets/css/themes/' . $theme_slug . '.css' ) ){\n\t\t\t wp_register_style( 'yith-wcwl-theme', YITH_WCWL_URL . 'assets/css/themes/' . $theme_slug . '.css', array( $located ? 'yith-wcwl-user-main' : 'yith-wcwl-main' ), $this->version );\n }\n }\n\t\t}", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Points_Of_Sale_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Points_Of_Sale_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/points-of-sale-admin.css', array(), $this->version, 'all');\n\n\t}", "function chappell_construction_register_stylesheets() {\n wp_register_style('home', CHILD_CSS_URL . '/home.css', array(), 1.0);\n wp_register_style('residence', CHILD_CSS_URL . '/residence.css', array(), 1.0);\n}", "public function register_plugin_styles() {\n\t\twp_register_style ( 'tr-plugin-styles', plugins_url ( 'tr_top_ratter/css/tr_top_ratter.css?v=' . microtime () ) );\n\t\twp_enqueue_style ( 'tr-plugin-styles' );\n\t\t\n\t\twp_register_style ( 'tr_jquery_custom_style', plugins_url ( 'tr_top_ratter/css/jquery-ui.min.css' ) );\n\t\twp_enqueue_style ( 'tr_jquery_custom_style' );\n\t}", "function custom_stylesheet() {\n\t// Respects SSL, Style.css is relative to the current file\n\twp_register_style( 'custom-style', get_bloginfo('template_directory'). '/custom/custom.css' );\n\twp_enqueue_style( 'custom-style' );\n}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Plugin_Name_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Plugin_Name_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/drinkers-edition-admin.css', array(), $this->version, 'all' );\n\n\t}", "function enqueues() {\n\t\twp_register_style( 'ks-thematic-actions', plugin_dir_url( __FILE__ ) . 'style.css' );\n\t wp_enqueue_style( 'ks-thematic-actions' );\n\t}", "function reverie_css_style()\n{\t\n\t// normalize stylesheet\n\t// wp_register_style( 'reverie-normalize-stylesheet', get_template_directory_uri() . '/css/normalize.css', array(), '' );\n\t\n\t// foundation stylesheet\n\twp_register_style( 'reverie-foundation-stylesheet', get_template_directory_uri() . '/css/foundation.css', array(), '' );\t\n\t\n\t// Register the main style under root directory\n\twp_register_style( 'reverie-stylesheet', get_stylesheet_directory_uri() . '/style.css', array(), '', 'all' );\n\t\n\twp_enqueue_style( 'reverie-normalize-stylesheet' );\n\twp_enqueue_style( 'reverie-foundation-stylesheet' );\n\twp_enqueue_style( 'reverie-stylesheet' );\n\t\n}", "public function widget_styles() {\n\t\twp_register_style( 'elementor-addons', plugins_url( '/assets/css/frontend.css', __FILE__ ) , array() ,ELEMENT_ADDON_VER );\n\t\twp_register_style( 'elementor-addons-custom-frontend', plugins_url( '/assets/css/custom-frontend.css', __FILE__ ) , array() , ELEMENT_ADDON_VER);\n\t\twp_register_style( 'elementor-addons-content-filter', plugins_url( '/assets/widgets/content-filter.css', __FILE__ ) , array() , ELEMENT_ADDON_VER );\n\t}", "function hook_image_style_flush($style) {\n // Empty cached data that contains information about the style.\n cache_clear_all('*', 'cache_mymodule', TRUE);\n}", "function sp_admin_scripts_style_sc ($hook) {\n\tif( $hook == 'post.php' || $hook == 'post-new.php' ) {\n\twp_register_style( 'shortcode-style', esc_url( get_template_directory_uri() . '/library/shortcode/css/sc-style.css' ) );\n\twp_enqueue_style( 'shortcode-style' );\n\t}\n}", "function wcfm_csm_load_styles( $end_point ) {\r\n\tglobal $WCFM, $WCFMu;\r\n\t$plugin_url = trailingslashit( plugins_url( '', __FILE__ ) );\r\n\r\n\tswitch( $end_point ) {\r\n\t\tcase 'wcfm-build':\r\n\t\t\twp_enqueue_style( 'wcfmu_build_css', $plugin_url . 'css/wcfm-style-build.css', array(), $WCFM->version );\r\n\t\tbreak;\r\n\t}\r\n}", "function your_namespace()\n{\n wp_register_style('namespace', plugins_url('inc/style.css', __FILE__));\n wp_enqueue_style('namespace');\n}", "function WDA_admin_css_all_page() { \n wp_register_style($handle = 'WDA_admin-css-all', $src = plugins_url('css/WDA_style.css', __FILE__), $deps = array(), $ver = '1.0.0', $media = 'all');\n wp_enqueue_style('WDA_admin-css-all');\n}", "public function registerStyle(Style $style)\n {\n $registeredStyle = parent::registerStyle($style);\n $this->registerFill($registeredStyle);\n $this->registerBorder($registeredStyle);\n\n return $registeredStyle;\n }", "public function styles() {\n\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_jstree',\n\t\t\t\t'src' => $this->get_base_url() . '/css/jstree/style.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'form_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_admin',\n\t\t\t\t'src' => $this->get_base_url() . '/css/admin.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'plugin_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_frontend',\n\t\t\t\t'src' => $this->get_base_url() . '/css/frontend.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field_types' => array( 'dropbox' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\n\t}", "function child_generate_get_dynamic_css() {\n\t$css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css();\n\n\treturn apply_filters( 'generate_dynamic_css', $css );\n}", "public function build_css() {\n\t\t\t\n\t\t}", "public function get_stylesheet()\n {\n }", "public function get_stylesheet()\n {\n }" ]
[ "0.7890705", "0.78633857", "0.6997006", "0.6866037", "0.6849605", "0.6818273", "0.6607477", "0.6599884", "0.63790053", "0.63356215", "0.6270124", "0.6259263", "0.6229501", "0.6223928", "0.6209575", "0.6156702", "0.6138852", "0.6127931", "0.612644", "0.6120763", "0.6089088", "0.60665476", "0.6060141", "0.6058825", "0.6052354", "0.6044424", "0.60388243", "0.60200113", "0.6017593", "0.60045844", "0.5997611", "0.59878826", "0.5981273", "0.59803843", "0.5968065", "0.5949972", "0.59377086", "0.59294486", "0.59174734", "0.5914449", "0.59032404", "0.5890704", "0.588706", "0.588288", "0.5882833", "0.5871094", "0.58628464", "0.58393747", "0.58373386", "0.5836173", "0.58262855", "0.58246154", "0.58237356", "0.5815508", "0.58125085", "0.5803338", "0.58012784", "0.5797221", "0.57954377", "0.57926875", "0.57870954", "0.57840693", "0.5782225", "0.57791847", "0.5774668", "0.5772196", "0.57604593", "0.575712", "0.575712", "0.57537246", "0.5752162", "0.574466", "0.5741587", "0.57336193", "0.57262427", "0.57258165", "0.57126284", "0.5688686", "0.5688482", "0.5688149", "0.5684301", "0.5683653", "0.56770825", "0.56675035", "0.56664497", "0.56636864", "0.5662854", "0.5655286", "0.5653905", "0.56526536", "0.56522113", "0.5646839", "0.5644955", "0.56415284", "0.56339306", "0.56327343", "0.5629105", "0.5624258", "0.5622377", "0.5622377" ]
0.57316816
74
proxy function for registering styles (helps with cachebusting)
function appc_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = true ) { if(!$ver) { if($ver = @filemtime( str_replace(TEMPLATE_THEME_URL, TEMPLATE_THEME_PATH, $src)) ) { // all good here } else { $current_theme = wp_get_theme(); $ver = $current_theme->get('Version'); } } wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function register_style();", "function register_style() {\n}", "function wp_register_style($handle, $src, $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "public function registerStyles() {\n $this->registerStylesCommon();\n \n if(is_admin()) {\n $this->registerStylesAdmin();\n } else {\n $this->registerStylesFrontend();\n }\n }", "protected static function registerStyles() {\n\t\tforeach (static::$styles as $handle => $stylePath) {\n\t\t\tstatic::registerStyle($handle, $stylePath);\n\t\t}\n\t}", "protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }", "public function registerStyles() {\n $this->styles['mkdf-bootstrap'] = 'assets/css/mkdf-bootstrap.css';\n $this->styles['mkdf-page-admin'] = 'assets/css/mkdf-page.css';\n $this->styles['mkdf-options-admin'] = 'assets/css/mkdf-options.css';\n $this->styles['mkdf-meta-boxes-admin'] = 'assets/css/mkdf-meta-boxes.css';\n $this->styles['mkdf-ui-admin'] = 'assets/css/mkdf-ui/mkdf-ui.css';\n $this->styles['mkdf-forms-admin'] = 'assets/css/mkdf-forms.css';\n $this->styles['mkdf-import'] = 'assets/css/mkdf-import.css';\n $this->styles['font-awesome-admin'] = 'assets/css/font-awesome/css/font-awesome.min.css';\n\n foreach ($this->styles as $styleHandle => $stylePath) {\n sienna_mikado_register_skin_style($styleHandle, $stylePath);\n }\n\n }", "function SA_dev_register_style($handle, $src, $ver){echo '<link rel=\"stylesheet\" href=\"'.$src.'\" type=\"text/css\" charset=\"utf-8\" />'.\"\\n\";}", "function ft_hook_add_css() {}", "public function register_styles() {\n\n\t\t\twp_register_style(\n\t\t\t\t\"$this->ID-style\",\n\t\t\t\tplugins_url( 'style.css', __FILE__ ),\n\t\t\t\tnull,\n\t\t\t\t$this->version\n\t\t\t);\n $file_tmpl = 'ui/timeago/locale/jquery.timeago.%s.js';\n wp_register_script( 'timeago-locale', WP_STREAM_URL . sprintf( $file_tmpl, 'en' ), array( 'timeago' ), '1' );\n wp_register_style( 'select2', WP_STREAM_URL . 'ui/select2/select2.css', array(), '3.5.1' );\n\t\t}", "protected function generateCSS() {}", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "public function getStyleLoader();", "function hook_style() {\n\t\treturn null;\n\t}", "function wp_style_loader_src($src, $handle)\n {\n }", "private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "public function styles(){\n //Enqueue styles\n /**\n * wp_enqueue_style('sample-style',$this->directory_uri . '/sample.css');\n * ...\n * ....\n */\n }", "function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}", "function add_my_stylesheet() {\n}", "function ruven_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' );\n\t$env = ( wp_get_environment_type() === 'local') ? 'min.' : '';\n\n\twp_enqueue_style( 'ruven-style', get_template_directory_uri() . '/assets/css/style.'. $env .'css', array(),\n\t$theme_version );\n\twp_style_add_data( 'ruven-style', 'rtl', 'replace' );\n\n\n}", "function wp_register_styles() {\n // Developer Tier Admin Stylesheet\n wp_register_style( \"{$this->namespace}-admin\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/admin.css\", array(), '2.1', 'screen' );\n // CodeMirror Library\n wp_register_style( \"codemirror\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/codemirror.css\", array(), '2.25', 'screen' );\n }", "function zweidrei_eins_register_styles() {\n\n\t$theme_version = wp_get_theme()->get( 'Version' ); \n\twp_enqueue_style( 'style', get_stylesheet_uri(), array(), $theme_version );\n\n\t/** \t\n\t * Add custom css\n\t * Bulma: Free, open source, and modern CSS framework based on Flexbox\n\t * https://bulma.io/ \n\t * Version: 0.9.0\n\t * Child: custom.css\n\t */\n\twp_enqueue_style( 'style1', get_template_directory_uri() . '/assets/css/bulma.min.css', array(), $theme_version );\n\twp_enqueue_style( 'style2', get_template_directory_uri() . '/assets/css/custom.css', array(), $theme_version );\n\n\t\n\n}", "static function register_styles( $styles ) {\n\t\tforeach ( $styles as $stylename => $conf ) {\n\t\t\t// the child theme may be allowed to overwrite the configuration in\n\t\t\t// which case we support for null configuration, ie. child theme turned\n\t\t\t// the resource off\n\t\t\tif ( $conf !== null ) {\n\t\t\t\tif ( is_string( $conf ) ) {\n\t\t\t\t\t$path = $conf;\n\t\t\t\t\t$require = array();\n\t\t\t\t\t$cache_bust = '';\n\t\t\t\t\t$media = 'all';\n\t\t\t\t} else { // array configuration passed\n\t\t\t\t\t$path = $conf['path'];\n\n\t\t\t\t\t// compute requirements\n\t\t\t\t\tif ( isset( $conf['require'] ) ) {\n\t\t\t\t\t\tif ( is_string( $conf['require'] ) ) {\n\t\t\t\t\t\t\t$require = array( $conf['require'] );\n\t\t\t\t\t\t} else { // assume array\n\t\t\t\t\t\t\t$require = $conf['require'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // no dependencies\n\t\t\t\t\t\t$require = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute cache bust\n\t\t\t\t\tif ( isset( $conf['cache_bust'] ) ) {\n\t\t\t\t\t\t$cache_bust = $conf['cache_bust'];\n\t\t\t\t\t} else { // no cache bust\n\t\t\t\t\t\t$cache_bust = '';\n\t\t\t\t\t}\n\n\t\t\t\t\t// compute media\n\t\t\t\t\tif ( isset( $conf['media'] ) ) {\n\t\t\t\t\t\t$media = $conf['media'];\n\t\t\t\t\t} else { // no media\n\t\t\t\t\t\t$media = 'all';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twp_register_style( $stylename, $path, $require, $cache_bust, $media );\n\t\t\t}\n\t\t}\n\t}", "public function registerStylesFrontend() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style('wpjb-css', $p.\"frontend.css\", array('wpjb-glyphs'), $v );\n }", "protected function loadStylesheets() {}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function registerStyle(Style $style)\n {\n if ($style->isRegistered()) {\n return $style;\n }\n\n $registeredStyle = parent::registerStyle($style);\n $this->usedFontsSet[$style->getFontName()] = true;\n\n return $registeredStyle;\n }", "private function load_public_styles() {\n\n\t}", "public function get_custom_css()\n {\n }", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "function wp_styles()\n {\n }", "function hookRegisterStyles() {\n\t \tif (!is_admin() && get_option('fse_load_fc_libs') == true) {\n\t \t\t// Check if user has its own CSS file in the theme folder\n\t \t\t$custcss = get_template_directory().'/fullcalendar.css';\n\t \t\tif (file_exists($custcss))\n\t \t\t$css = get_bloginfo('template_url').'/fullcalendar.css';\n\t \t\telse\n\t \t\t$css = self::$plugin_css_url.'fullcalendar.css';\n\t \t\twp_enqueue_style('fullcalendar', $css);\n\t \t}\n\t }", "public function registerStyles()\n {\n wp_register_style('swiper-css', THEME_DIR_URI .'/assets/css/swiper.min.css', [], false, 'all');\n wp_register_style('dist-css', THEME_DIR_URI .'/assets/css/dist.css', [], false, 'all');\n wp_register_style('regional-css', THEME_DIR_URI .'/regional.css', [], false, 'all');\n wp_register_style('regional-style', THEME_DIR_URI .'/style.css', [], false, 'all');\n\n // Default app style file\n //wp_enqueue_style('style-css');\n\n // App styles\n wp_enqueue_style('swiper-css');\n wp_enqueue_style('dist-css');\n wp_enqueue_style('regional-css');\n wp_enqueue_style('regional-style');\n }", "function wp_enqueue_style($handle, $src = '', $deps = array(), $ver = \\false, $media = 'all')\n {\n }", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "function wp_deregister_style($handle)\n {\n }", "function egg_styles()\n{\n\tglobal $wp_styles; // call global $wp_styles variable to add conditional wrapper around ie stylesheet\n\n\t// register main stylesheet\n\twp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.css?091714', array(), '', 'all' );\n\t// wp_register_style( 'egg-stylesheet', get_stylesheet_directory_uri() . '/assets/css/style.min.css', array(), '', 'all' );\n\n\t// ie-only style sheet\n\twp_register_style( 'egg-ie-only', get_stylesheet_directory_uri() . '/assets/css/ie.css', array(), '' );\n\n\twp_enqueue_style( array(\n\t\t'egg-stylesheet',\n\t\t'egg-ie-only'\n\t) );\n\t\n\t$wp_styles->add_data( 'egg-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet\n}", "function wp_add_inline_style($handle, $data)\n {\n }", "function init(){\r\n wp_register_style( 'twitlink_style',$this->plugin_url.'css/style.css',null,$this->version ); \r\n }", "function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }", "function styles() {\n\twp_register_style(\n\t\t'fontawesome',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/fontawesome/css/font-awesome.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'ionicons',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/ionicons/css/ionicons.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/css/bootstrap.min.css\",\n\t\tarray( 'fontawesome' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_register_style(\n\t\t'sanitize',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/sanitize/sanitize.min.css\",\n\t\tarray(),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'vincentragosta',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/css/vincentragosta---twenty-seventeen.css\",\n\t\tarray( 'bootstrap', 'fontawesome', 'ionicons', 'sanitize' ),\n\t\tVINCENTRAGOSTA_COM_VERSION\n\t);\n}", "function jehaann_style(){\n wp_register_style('style', get_stylesheet_uri(),'','1.0','all');\n\n //cargando hojas de estilos\n\n wp_enqueue_style('style');\n}", "function add_styles() {\n\t\tif ( is_active_widget( false, false, $this->id_base, true ) ) {\n\t\t\twp_enqueue_style( 'font-awesome' );\n\t\t\t\n\t\t\t//wp_enqueue_style( 'my-style', \\trends\\helper\\utils::get_widgets_uri( 'social_icons', '/assets/my-style.css') );\n\t\t\t\n\t\t}\n\t}", "function prefix_add_my_stylesheet() {\n wp_register_style( 'prefix-style', plugins_url('style1.css', __FILE__) );\n wp_enqueue_style( 'prefix-style',plugins_url('style1.css', __FILE__) );\n wp_enqueue_script( 'prefix-style',plugins_url('close.js', __FILE__) );\n wp_enqueue_style( 'fa-style',plugins_url('font-awesome-4.2.0/css/font-awesome.min.css', __FILE__) );\n \n}", "function horse_manager_stylesheet() {\n wp_register_style( 'horse-style', plugins_url('/inc/horse_styles.css', __FILE__) );\n wp_enqueue_style( 'horse-style' );\n}", "function wptheme_register_styles() {\n\t\t$theme = wp_get_theme();\n\t\t$version = $theme['Version'];\n\t\t$stylesheets = '';\n\n\t\t// Register stylesheets\n\t $stylesheets .= wp_register_style('wptheme', get_stylesheet_directory_uri().'/style.css', array(), $version, 'screen, projection');\n\n\t\t// enqueue registered styles\n\t\twp_enqueue_style('wptheme');\n\n\t}", "function child_generate_update_dynamic_css_cache() {\n\tif ( apply_filters( 'generate_dynamic_css_skip_cache', false ) ) {\n\t\treturn;\n\t}\n\n\t$css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css();\n\tupdate_option( 'generate_dynamic_css_output', wp_strip_all_tags( $css ) );\n}", "public function renderCSS()\n {\n }", "function register_block_style($block_name, $style_properties)\n {\n }", "function ag_set_predefined_style() {\n\tif(!isset($_POST['lcwp_nonce']) || !wp_verify_nonce($_POST['lcwp_nonce'], 'lcwp_nonce')) {die('Cheating?');}\n\tif(!isset($_POST['style'])) {die('data is missing');}\n\n\trequire_once(AG_DIR .'/settings/preset_styles.php');\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t$style_data = ag_preset_styles_data($_POST['style']);\n\tif(empty($style_data)) {die('Style not found');}\n\t\n\t\n\t// override values\n\tforeach($style_data as $key => $val) {\n\t\tupdate_option($key, $val);\t\t\n\t}\n\n\n\t// if is not forcing inline CSS - create static file\n\tif(!get_option('mg_inline_css')) {\n\t\tag_create_frontend_css();\n\t}\n\t\n\tdie('success');\n}", "function thememount_hook_dynamic_css(){\n\tob_start(); // begin collecting output\n\tinclude get_template_directory().'/css/dynamic-style.php';\n\t$css = ob_get_clean(); // retrieve output from myfile.php, stop buffering\n\t\n\t/* Now add the dynamic-style.php style in header */\n\t$output = \"<style> $css </style>\";\n\techo $output;\n}", "public function setStyleLoader($styleLoader);", "function loadStyles() {\n\t\twp_register_style('hashee_styles', $this->pluginPath . 'css/hashee_styles.css');\n\t\twp_enqueue_style('hashee_styles');\n\t}", "public function registerStylesCommon() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-vendor-datepicker\", $x.\"date-picker/css/datepicker.css\");\n wp_register_style('wpjb-glyphs', $p.\"wpjb-glyphs.css\", array(), $v );\n wp_register_style('wpjb-stripe-elements', $p.\"wpjb-stripe-elements.css\", array(), $v );\n }", "public function register_plugin_styles() {\n\t\t\tglobal $pagenow;\n\n\t\t\t$is_frontend = ( ! is_admin() ) ? true : false;\n\t\t\t$is_valid_post_page = ( ! empty( $pagenow ) && in_array( $pagenow, array( 'edit.php', 'post.php', 'post-new.php' ), true ) ) ? true : false;\n\t\t\t$is_valid_admin_page = ( ( ! empty( $_GET['page'] ) && 'wc-smart-coupons' === wc_clean( wp_unslash( $_GET['page'] ) ) ) || ( ! empty( $_GET['tab'] ) && 'wc-smart-coupons' === wc_clean( wp_unslash( $_GET['tab'] ) ) ) ) ? true : false; // phpcs:ignore\n\n\t\t\tif ( $is_frontend || $is_valid_admin_page || $is_valid_post_page ) {\n\n\t\t\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\t\t\twp_register_style( 'smart-coupon', untrailingslashit( plugins_url( '/', WC_SC_PLUGIN_FILE ) ) . '/assets/css/smart-coupon' . $suffix . '.css', array(), $this->plugin_data['Version'] );\n\t\t\t\twp_enqueue_style( 'smart-coupon' );\n\t\t\t}\n\n\t\t}", "private function load_admin_styles() {\n\n\t}", "function add_qoorate_stylesheet(){\n\t\t// TODO: make call to get styles from QOORATE\n\t\t// MAYBE TODO: cacheing ... place in DB options?\n\t\t\n\t\t//$styleUrl = plugins_url('/css/guthrie.css', __FILE__);\n\t\t//$styleFile = WP_PLUGIN_DIR . '/guthrie/css/guthrie.css';\n\t\t//if ( file_exists($styleFile) ) {\n\t\t//\t\t//echo($styleUrl.\"<br />\");\n\t\t//\t\twp_register_style('guthrie', $styleUrl);\n\t\t//\t\twp_enqueue_style('guthrie');\n\t\t//}\n\t\t// unregister our really old jquery bundled with WP\n\t\t// Maybe we can keep it? should it be an option?\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' );\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function styles() {\n\n\twp_enqueue_style(\n\t\t'styles',\n\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/style.css',\n\t\t[],\n\t\tERI_SCAFFOLD_VERSION\n\t);\n\n\tif ( is_page_template( 'templates/page-styleguide.php' ) ) {\n\t\twp_enqueue_style(\n\t\t\t'styleguide',\n\t\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/styleguide-style.css',\n\t\t\t[],\n\t\t\tERI_SCAFFOLD_VERSION\n\t\t);\n\t}\n}", "function styles_load_custom()\n{\n wp_register_style( 'google-fonts-roboto-style',\n '//fonts.googleapis.com/css?family=Roboto',\n array(), '', 'all' );\n wp_enqueue_style( 'google-fonts-roboto-style' );\n\n wp_register_style( 'font-awesome-style-cdn',\n '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css',\n array(), '4.7.0', 'all' );\n wp_enqueue_style( 'font-awesome-style-cdn' );\n\n wp_register_style( 'bootstrap-style-cdn',\n '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',\n array(), '3.3.7', 'all' );\n wp_enqueue_style( 'bootstrap-style-cdn' );\n\n wp_register_style( 'bootstrap-theme-style-cdn',\n '//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css',\n array('bootstrap-style-cdn'), '3.3.7', 'all' );\n wp_enqueue_style( 'bootstrap-theme-style-cdn' );\n\n wp_enqueue_style( 'theme-styles', get_stylesheet_directory_uri() . '/style.css', array(), filemtime( get_stylesheet_directory() . '/style.css' ) );\n\n\n}", "public function registerStylesAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-admin-css\", $p.\"admin.css\", array(), $v);\n wp_register_style(\"wpjb-colorpicker-css\", $p.\"colorpicker.css\", array(), $v);\n wp_register_style(\"wpjb-vendor-ve-css\", $x.\"visual-editor/visual-editor.css\", array(), $v);\n wp_register_style(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.css\", array(), $v);\n }", "function inkthemes_enqueue_styles() {\n global $themeslug, $options;\n wp_register_style($themeslug . 'storecss', get_template_directory_uri() . '/admin/theme-page-style.css');\n wp_enqueue_style($themeslug . 'storecss');\n}", "private function initStyle(){\n\t\t\t$file_style_normal = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_normal.class.php';\n\t\t\t$file_style_gdi = $this->root_path.'portal/realmstatus/wowclassic/styles/wowstatus.style_gdi.class.php';\n\t\t\t\n\t\t\t// include the files\n\t\t\tinclude_once($file_style_normal);\n\t\t\tinclude_once($file_style_gdi);\n\t\t\t\n\t\t\t// get class\n\t\t\tif ($this->config->get('gd', 'pmod_'.$this->moduleID))\n\t\t\t\t$this->style = registry::register('wowstatus_style_gdi');\n\t\t\t\telse\n\t\t\t\t\t$this->style = registry::register('wowstatus_style_normal');\n\t\t}", "public function loadStyle(){\n \t\treturn null;\n \t}", "public static function register_style( $handle, $src, $deps = array() ) {\n\t\t$path = plugin_dir_path( __DIR__ ) . $src;\n\t\t$url = plugin_dir_url( __DIR__ ) . $src;\n\t\twp_register_style( $handle, $url, $deps, file_exists( $path ) ? strval( filemtime( $path ) ) : false );\n\t}", "function styles() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool additive_style_debug\n\t */\n\t$debug = apply_filters( 'additive_style_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_style( 'additive-fonts',\n\t\t\"https://fonts.googleapis.com/css?family=Arvo:400,700|Lato:300,400,700\",\n\t\tarray(),\n\t\tnull\n\t);\n\n\twp_enqueue_style(\n\t\t'normalize',\n\t\tADDITIVE_URL . \"/assets/css/normalize{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'skeleton',\n\t\tADDITIVE_URL . \"/assets/css/skeleton{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'additive',\n\t\tADDITIVE_URL . \"/assets/css/additive{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n\n\twp_enqueue_style(\n\t\t'font-awesome',\n\t\tADDITIVE_URL . \"/assets/css/font-awesome{$min}.css\",\n\t\tarray(),\n\t\tADDITIVE_VERSION\n\t);\n}", "public function getFrontendStyles() {\n }", "public function getFrontendStyles() {\n }", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nimiq_Miner_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nimiq_Miner_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/nimiq-miner-public.css', array(), $this->version, 'all' );\n\n\t}", "protected function loadCss() {}", "public function styles(){\n\n\t\t//wp_enqueue_style('component-header_fixed-style', $this->directory_uri . '/assets/dist/css/headerFixed.css');\n\t}", "function get_stylesheet()\n {\n }", "function enqueue_cached_css() {\n\ttry {\n\t\t$cachebuster = get_latest_revision_id();\n\t} catch ( Exception $exception ) {\n\t\t$cachebuster = date( 'Y-m-d-H' );\n\t}\n\n\twp_enqueue_style(\n\t\tCSS_HANDLE,\n\t\tadd_query_arg( 'action', CSS_HANDLE, admin_url( 'admin-ajax.php' ) ),\n\t\tarray(),\n\t\t$cachebuster,\n\t\t'all'\n\t);\n}", "function appc_enqueue_style( $handle, $src = '', $deps = array(), $ver = false, $media = 'all' ) {\r\n\twp_enqueue_style( $handle, $src, $deps, ($ver ? $ver : filemtime( str_replace(TEMPLATE_THEME_URL, TEMPLATE_THEME_PATH, $src) )), $media);\r\n}", "public function enqueue_styles( $hook ) {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nginx_Helper_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nginx_Helper_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\tif ( 'settings_page_nginx' !== $hook ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_enqueue_style( $this->plugin_name . '-icons', plugin_dir_url( __FILE__ ) . 'icons/css/nginx-fontello.css', array(), $this->version, 'all' );\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/nginx-helper-admin.css', array(), $this->version, 'all' );\n\n\t}", "function setup() {\n\tadd_filter( 'fl_builder_render_css', __NAMESPACE__ . '\\\\styles', 10, 3 );\n}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "static function _style_on() {\n\t\treturn self::style( true );\n\t}", "function ic_add_style_attribute( $tag, $handle ) {\n\t$handles = array(\n\t\t'main_stylesheet',\n\t);\n\tforeach( $handles as $styles) :\n\t\tif ( $styles === $handle ) {\n\t\t\treturn str_replace( ' href', ' rel=\"preload\" as=\"style\" href', $tag );\n\t\t}\n\tendforeach;\n\treturn $tag;\n}", "public function register_styles() {\n\t\t\t$woocommerce_base = WC()->template_path();\n\t\t\t$assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';\n\n\t\t\t// register dependencies\n\t\t\twp_register_style( 'jquery-selectBox', YITH_WCWL_URL . 'assets/css/jquery.selectBox.css', array(), '1.2.0' );\n\t\t\twp_register_style( 'yith-wcwl-font-awesome', YITH_WCWL_URL . 'assets/css/font-awesome.min.css', array(), '4.7.0' );\n\t\t\twp_register_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );\n\n\t\t\t// register main style\n\t\t\t$located = locate_template( array(\n\t\t\t\t$woocommerce_base . 'wishlist.css',\n\t\t\t\t'wishlist.css'\n\t\t\t) );\n\n\t\t\tif( ! $located ){\n\t\t\t wp_register_style( 'yith-wcwl-main', YITH_WCWL_URL . 'assets/css/style.css', array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$stylesheet_directory = get_stylesheet_directory();\n\t\t\t\t$stylesheet_directory_uri = get_stylesheet_directory_uri();\n\t\t\t\t$template_directory = get_template_directory();\n\t\t\t\t$template_directory_uri = get_template_directory_uri();\n\n\t\t\t\t$style_url = ( strpos( $located, $stylesheet_directory ) !== false ) ? str_replace( $stylesheet_directory, $stylesheet_directory_uri, $located ) : str_replace( $template_directory, $template_directory_uri, $located );\n\n\t\t\t\twp_register_style( 'yith-wcwl-user-main', $style_url, array( 'jquery-selectBox', 'yith-wcwl-font-awesome' ), $this->version );\n }\n\n\t\t\t// theme specific assets\n $current_theme = wp_get_theme();\n\n\t\t\tif( $current_theme->exists() ){\n\t\t\t $theme_slug = $current_theme->Template;\n\n\t\t\t if( file_exists( YITH_WCWL_DIR . 'assets/css/themes/' . $theme_slug . '.css' ) ){\n\t\t\t wp_register_style( 'yith-wcwl-theme', YITH_WCWL_URL . 'assets/css/themes/' . $theme_slug . '.css', array( $located ? 'yith-wcwl-user-main' : 'yith-wcwl-main' ), $this->version );\n }\n }\n\t\t}", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Points_Of_Sale_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Points_Of_Sale_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/points-of-sale-admin.css', array(), $this->version, 'all');\n\n\t}", "function chappell_construction_register_stylesheets() {\n wp_register_style('home', CHILD_CSS_URL . '/home.css', array(), 1.0);\n wp_register_style('residence', CHILD_CSS_URL . '/residence.css', array(), 1.0);\n}", "public function register_plugin_styles() {\n\t\twp_register_style ( 'tr-plugin-styles', plugins_url ( 'tr_top_ratter/css/tr_top_ratter.css?v=' . microtime () ) );\n\t\twp_enqueue_style ( 'tr-plugin-styles' );\n\t\t\n\t\twp_register_style ( 'tr_jquery_custom_style', plugins_url ( 'tr_top_ratter/css/jquery-ui.min.css' ) );\n\t\twp_enqueue_style ( 'tr_jquery_custom_style' );\n\t}", "function custom_stylesheet() {\n\t// Respects SSL, Style.css is relative to the current file\n\twp_register_style( 'custom-style', get_bloginfo('template_directory'). '/custom/custom.css' );\n\twp_enqueue_style( 'custom-style' );\n}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Plugin_Name_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Plugin_Name_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/drinkers-edition-admin.css', array(), $this->version, 'all' );\n\n\t}", "function enqueues() {\n\t\twp_register_style( 'ks-thematic-actions', plugin_dir_url( __FILE__ ) . 'style.css' );\n\t wp_enqueue_style( 'ks-thematic-actions' );\n\t}", "function reverie_css_style()\n{\t\n\t// normalize stylesheet\n\t// wp_register_style( 'reverie-normalize-stylesheet', get_template_directory_uri() . '/css/normalize.css', array(), '' );\n\t\n\t// foundation stylesheet\n\twp_register_style( 'reverie-foundation-stylesheet', get_template_directory_uri() . '/css/foundation.css', array(), '' );\t\n\t\n\t// Register the main style under root directory\n\twp_register_style( 'reverie-stylesheet', get_stylesheet_directory_uri() . '/style.css', array(), '', 'all' );\n\t\n\twp_enqueue_style( 'reverie-normalize-stylesheet' );\n\twp_enqueue_style( 'reverie-foundation-stylesheet' );\n\twp_enqueue_style( 'reverie-stylesheet' );\n\t\n}", "public function widget_styles() {\n\t\twp_register_style( 'elementor-addons', plugins_url( '/assets/css/frontend.css', __FILE__ ) , array() ,ELEMENT_ADDON_VER );\n\t\twp_register_style( 'elementor-addons-custom-frontend', plugins_url( '/assets/css/custom-frontend.css', __FILE__ ) , array() , ELEMENT_ADDON_VER);\n\t\twp_register_style( 'elementor-addons-content-filter', plugins_url( '/assets/widgets/content-filter.css', __FILE__ ) , array() , ELEMENT_ADDON_VER );\n\t}", "function hook_image_style_flush($style) {\n // Empty cached data that contains information about the style.\n cache_clear_all('*', 'cache_mymodule', TRUE);\n}", "function sp_admin_scripts_style_sc ($hook) {\n\tif( $hook == 'post.php' || $hook == 'post-new.php' ) {\n\twp_register_style( 'shortcode-style', esc_url( get_template_directory_uri() . '/library/shortcode/css/sc-style.css' ) );\n\twp_enqueue_style( 'shortcode-style' );\n\t}\n}", "function wcfm_csm_load_styles( $end_point ) {\r\n\tglobal $WCFM, $WCFMu;\r\n\t$plugin_url = trailingslashit( plugins_url( '', __FILE__ ) );\r\n\r\n\tswitch( $end_point ) {\r\n\t\tcase 'wcfm-build':\r\n\t\t\twp_enqueue_style( 'wcfmu_build_css', $plugin_url . 'css/wcfm-style-build.css', array(), $WCFM->version );\r\n\t\tbreak;\r\n\t}\r\n}", "function your_namespace()\n{\n wp_register_style('namespace', plugins_url('inc/style.css', __FILE__));\n wp_enqueue_style('namespace');\n}", "function WDA_admin_css_all_page() { \n wp_register_style($handle = 'WDA_admin-css-all', $src = plugins_url('css/WDA_style.css', __FILE__), $deps = array(), $ver = '1.0.0', $media = 'all');\n wp_enqueue_style('WDA_admin-css-all');\n}", "public function registerStyle(Style $style)\n {\n $registeredStyle = parent::registerStyle($style);\n $this->registerFill($registeredStyle);\n $this->registerBorder($registeredStyle);\n\n return $registeredStyle;\n }", "public function styles() {\n\n\t\t$styles = array(\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_jstree',\n\t\t\t\t'src' => $this->get_base_url() . '/css/jstree/style.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'form_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_admin',\n\t\t\t\t'src' => $this->get_base_url() . '/css/admin.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'admin_page' => array( 'plugin_settings' ),\n\t\t\t\t\t\t'tab' => $this->_slug,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'handle' => 'gform_dropbox_frontend',\n\t\t\t\t'src' => $this->get_base_url() . '/css/frontend.css',\n\t\t\t\t'version' => $this->_version,\n\t\t\t\t'enqueue' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'field_types' => array( 'dropbox' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn array_merge( parent::styles(), $styles );\n\n\t}", "function child_generate_get_dynamic_css() {\n\t$css = generate_base_css() . generate_font_css() . generate_advanced_css() . generate_spacing_css();\n\n\treturn apply_filters( 'generate_dynamic_css', $css );\n}", "public function build_css() {\n\t\t\t\n\t\t}", "public function get_stylesheet()\n {\n }", "public function get_stylesheet()\n {\n }" ]
[ "0.7890282", "0.78628534", "0.6996365", "0.6864333", "0.6848449", "0.68174607", "0.66062295", "0.6599564", "0.6379043", "0.63348484", "0.6269828", "0.6258235", "0.62285924", "0.62247765", "0.6210139", "0.6156451", "0.6138767", "0.612643", "0.61249393", "0.6120361", "0.60882074", "0.6065424", "0.60592306", "0.60572547", "0.60511446", "0.60432386", "0.60380614", "0.60198045", "0.60170305", "0.6004061", "0.599844", "0.5986668", "0.5980135", "0.5980104", "0.59664226", "0.59494036", "0.5936945", "0.59288263", "0.5915866", "0.59139544", "0.5902487", "0.588932", "0.5885579", "0.5881617", "0.5881533", "0.5869536", "0.58607286", "0.58381647", "0.58372617", "0.58362526", "0.5825694", "0.5824337", "0.5822269", "0.5815601", "0.5810777", "0.5802702", "0.5799442", "0.57968074", "0.57943636", "0.5791124", "0.5785947", "0.57830113", "0.5780199", "0.5779192", "0.5775158", "0.57712704", "0.57587236", "0.5757418", "0.5757418", "0.575266", "0.57524514", "0.574324", "0.5741453", "0.5733947", "0.5731317", "0.5725719", "0.572492", "0.5711148", "0.56882715", "0.5687743", "0.5686607", "0.5683113", "0.56829613", "0.56755227", "0.5666586", "0.5665231", "0.566316", "0.5661402", "0.56537473", "0.5653214", "0.5652244", "0.5651349", "0.56461805", "0.5643312", "0.5640428", "0.5634196", "0.5633099", "0.56292135", "0.5623694", "0.5622216", "0.5622216" ]
0.0
-1
/ Relation with user
public function user() { return $this->belongsTo('App\User'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function relUser(){\n return $this->hasOne('App\\User', 'id', 'id_user');\n }", "public function user(): Relation\n {\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }", "function userelation($relation) { atkuse(\"relation\" , $relation); }", "public function user()\n {\n return $this->belongsTo(User::class);//relacionamento da ordem 1\n }", "public function user(): BelongsTo;", "public function user()\n {\n \t// belongsTo(RelatedModel, foreignKey = to_user_id, keyOnRelatedModel = user_id)\n \treturn $this->belongsTo('App\\User','to_user_id','user_id');\n }", "public function user()\n {\n \treturn $this->hasMany('App\\User');\n }", "public function utilisateur() {\n $relation = $this->belongsTo(\"Utilisateur\");\n return $relation;\n }", "public function user() {\n \treturn $this->belongsTo('App\\Models\\User');\n }", "public function user_R(){\n $this->belongsTo('App\\User');\n }", "public function users(){\n\t\treturn $this->belongsToMany('Alsaudi\\\\Eloquent\\\\UserRelation',\n\t\t\t'trip_user','trip_id','user_id');\n\t}", "public function user() {\n \treturn $this->belongsTo(User::class, 'user_id');\n }", "public function user() {\n return $this->hasMany(User::class); //devolverá un arreglo de objetos relacionados\n }", "public function user(){\n return $this->belongsTo('Corp\\Models\\User');\n }", "public function toUser()\n {\n return $this->belongsTo('App\\User',\"to_user\", \"id\");\n }", "public function user(){\n \treturn $this->belongsTo('App\\User','user_id');\n }", "public function user()\n {\n return $this->belongsTo('Furniture\\User', 'user_id');\n }", "public function user(){\n return $this->hasMany('App\\User');//un rol puede pertenecer a varios usuarios\n }", "public function user()\n {\n return $this->belongsTo('LRC\\Data\\Users\\User','user_id');\n }", "public function user () {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->hasMany(User::class);\n }", "public function user() {\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n \treturn $this->belongsTo(User::class);\n }", "public function user()\n {\n \treturn $this->belongsTo(User::class);\n }", "public function user()\n {\n \treturn $this->belongsTo(User::class);\n }", "public function user(){\n return $this->belongsTo(User::class, 'user_id', 'id');//https://laravel.com/docs/5.8/eloquent-relationships#one-to-many\n }", "public function getUser()\n {\n \treturn $this->belongsTo('App\\User', 'user_id');\n }", "public function user() {\n \treturn $this->belongsTo('App\\User');\n }", "public function user() {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n return $this->belongsTo('friends\\Models\\User','user_id');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user()\n {\n \treturn $this->belongsTo('App\\User');\n }", "public function user(){\n\t\t\treturn $this->belongsTo('User', 'user_id');\n\t\t}", "public\tfunction user() {\n\t\treturn\t$this->belongsTo('App\\User');\n\t}", "public function user(){\n \treturn $this->belongsTo(User::class);\n }", "public function user(){\n \treturn $this->belongsTo(User::class);\n }", "public function user() {\n \n \treturn $this->belongsTo('User','created_by','id');\n }", "public function user(){\n \treturn $this->belongsTo('App\\User');\n }", "public function user(){\n \treturn $this->belongsTo('App\\User');\n }", "public function user () {\n //pertnecer a a tanña de user\n return $this->belongsTo(User::class);\n }", "public function user()\n {\n \treturn $this -> belongsTo( User :: class );\n }", "public function user_to(){\n return $this->belongsTo('App\\User', 'user_to_id');\n }", "public function user() {\r\n\t\treturn $this->belongsTo('User', 'user_id');\r\n\t}", "public function user(){\n return $this->hasMany('App\\Models\\User');\n }", "public function user() \n { \n return $this->belongsTo('User'); \n }", "public function user()\n {\n return $this->belongsTo(UserProxy::modelClass());\n }", "public function user()\n {\n return $this->belongsTo('Tangfastics\\Models\\User');\n }", "public function fromUser()\n {\n return $this->belongsTo('App\\User',\"from_user\", \"id\");\n }", "public function user() {\n\t\t\treturn $this->belongsTo(User::class,'user_id');\n }", "public function user() {\n return $this->belongsTo('App\\Models\\User');\n }", "public function user()\n {\n return $this->belongsTo('App\\User', 'personnel_no', 'personnel_no');\n }", "public function user() {\n return $this->belongsTo('User','userID','userID');\n }", "public function user() {\n \t\n \treturn $this->belongsTo(User::class);\n }", "public function user()\n {\n //un perfil puede tener muchas usuarios\n return $this->hasMany(User::class);\n }", "function user(){\n return $this->belongsTo('App\\User','user_id');\n }", "public function user()\n\t{\n\t\t//return $this->belongsTo('User');\n\t}", "public function user()\n {\n return $this->belongsTo('App\\Models\\User', 'usu_mod_id', 'id');\n }", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function user()\n {\n return $this->belongsTo('Modules\\Users\\Models\\User', 'user_id', 'id');\n }", "public function user()\n {\n return $this->belongsTo('ScreenTec\\Models\\User');\n }", "public function user(){\n\n //class midwife belongs to class user\n \n return $this->belongsTo(User::class);\n}", "public function user(){\n\t\treturn $this->belongsTo('App\\User');\n\t}", "public function user()\n\t{\n\t\treturn $this->belongsTo('user', 'user_id');\n\t}", "public function isUserInRelation($relation, Authenticatable $user = null);", "public function user() {\r\n return $this->belongsTo('App\\User');\r\n }", "public function user(){\n return $this->belongsTo('App\\User', 'id', 'user_id');\n }", "public function user() {\n // sukuria sasaja su user modeliu\n return $this->hasOne('App\\User', 'id', 'user_id');\n }", "public function user(){\n return $this->belongsTo('App\\Model\\User');\n }", "public function user(){\n return $this->hasMany('App\\User');\n }", "public function user(){\n return $this->belongsTo('App\\User', 'user_id');\n }", "public function user(){\n return $this->belongsTo('App/User','id_users');\n }", "public function user() {\n\t\t// belongsTo(RelatedModel, foreignKey = _id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo('App\\User', 'user_id');\n\t}", "public function user() {\n return $this->belongsTo('User'); // \n // return $this->belongsTo('User', 'user_id'); // column 'user_id'\n }", "public function user($user);", "public function user(){\n return $this->hasOne('App\\User');\n }", "public function user()\n {\n return $this->belongsTo('App\\Models\\User');\n }", "public function user(){\n return $this->belongsTo('App\\User', 'user-id');\n }", "public function user()\n {\n return $this->belongsTo('User');\n }", "public function user(){\n return $this->belongsTo('User','user_id');\n }", "public function user() {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function user() {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function user()\n {\n return $this->belongsTo(\\App\\User::class);\n\t}", "public function user() {\n\t\treturn $this->belongsTo(User::class, 'user_id');\n\t}", "public function createdbyuser() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\User');\n }", "public function user()\n {\n return $this->belongsTo(AccountProxy::modelClass());\n }", "public function user() {\n return $this->hasOne('App\\Models\\User', 'user_id');\n}", "public function user()\n {\n return $this->belongsTo(CommunityFacade::getUserClass());\n }", "public function user(){\n return $this->belongsTo('App\\Models\\User');\n }", "public function user(){\n return $this->belongsTo('App\\Models\\User');\n }", "public function user(){\n return $this->belongsTo('App\\Models\\User');\n }", "public function user() \n\t{\n\t\t#return $this->belongsTo('App\\Models\\User', 'email', 'email');\n\t\treturn $this->belongsTo('App\\Models\\User', 'user_id', 'id');\n\t}", "public function user( ) {\n return $this->belongsTo('App\\User', 'user_id', 'id');\n }", "public function user(){\n\t\treturn $this->hasOne(\\App\\Models\\User::class,'id','created_by_user_id');\n\t}", "public function user(){\n return $this->belongsTo(User::class);\n }", "public function user()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\User');\n\t}", "public function user() \n\t{\n\t\treturn $this->belongsTo('User');\n\t}", "public function user()\r\n {\r\n return $this->belongsTo(User::class);\r\n }", "public function user()\n\t{\n\t\t\treturn $this->belongsTo(User::class);\n\t}" ]
[ "0.71607596", "0.71237993", "0.7036356", "0.6950054", "0.68387103", "0.66922486", "0.66738", "0.6647518", "0.6645079", "0.6641173", "0.66248256", "0.6607574", "0.6594521", "0.65822357", "0.65677243", "0.65618455", "0.65602964", "0.6553677", "0.6553315", "0.6552752", "0.65511703", "0.65458304", "0.65458304", "0.6542109", "0.6542109", "0.65413314", "0.653316", "0.6529816", "0.6529816", "0.6528283", "0.65212166", "0.65212166", "0.65212166", "0.65212166", "0.6504067", "0.64954245", "0.64868057", "0.64868057", "0.647367", "0.64698297", "0.64698297", "0.6461643", "0.64612114", "0.64611024", "0.64606273", "0.64601713", "0.64355737", "0.6431201", "0.64305264", "0.6427001", "0.64258343", "0.6420995", "0.6414223", "0.6413873", "0.641145", "0.6407835", "0.6407603", "0.63963515", "0.6395282", "0.6391298", "0.6391298", "0.6386044", "0.63847506", "0.6382825", "0.637862", "0.63745695", "0.6372645", "0.6371862", "0.6367125", "0.63660806", "0.6363115", "0.63616115", "0.6356186", "0.6353512", "0.63531595", "0.63521326", "0.63393164", "0.63347286", "0.63344437", "0.63342005", "0.6334082", "0.6333077", "0.6332343", "0.6332343", "0.6332302", "0.63304496", "0.63278025", "0.63257265", "0.63250875", "0.6323006", "0.6319451", "0.6319451", "0.6319451", "0.63190925", "0.6315415", "0.63061935", "0.6305692", "0.630174", "0.6296651", "0.6292856", "0.62928134" ]
0.0
-1
/ Relation with comments
public function comments(){ return $this->hasMany('App\Models\Comments', 'article_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function comment();", "public function comments(){\n }", "public function getComment() {}", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function record_comment(){\n\t\t\t\n\t\t}", "abstract protected function get_commentable_object();", "public function comment()\n {\n \treturn $this->hasMany('App\\Model\\Comment');\n }", "public function getComment()\n{\n return $this->hasMany(Comment::className(), ['article_id' => 'id']);\n}", "public function the_comment()\n {\n }", "public function getComments() {}", "public function comment()\n {\n \treturn $this->hasMany('App\\Comment','idTinTuc','id');\n }", "public function getComment(): string;", "public function isComment() {}", "public function comments() \n {\n \treturn $this->hasMany('App\\Comment');\n }", "public function getDocComment();", "public function comment(){\n return $this->hasMany('App\\Comment');\n }", "public function comment()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n \treturn $this->hasMany(Comment::class, 'article_id');\n }", "public function comment()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comment(){\n return $this->hasMany(Comment::class);\n }", "public function comments(){\n \treturn $this->hasMany('App\\Comment');\n }", "public function comment()\n {\n return $this->hasMany('Modules\\Comment\\Model\\Comment','user_id');\n }", "public function have_comments()\n {\n }", "public function comments(){\n return $this->hasMany('App\\TextPostComment', 'post_id');\n }", "public function getCreditComment();", "public function comments(){\n return $this->hasMany('Corp\\Models\\Comment');\n }", "public function comment()\n {\n return $this->hasMany(Comment::class);\n }", "public function comments()\n {\n return $this->hasMany('App\\NoteComment');\n }", "public function comments() {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany(CitationComment::class);\n }", "public function createComment(): CommentableInterface;", "function newUnderComment();", "function the_comment()\n {\n }", "public function get_comments()\n {\n }", "public function comments()\n {\n \treturn $this->hasMany(Comment::class);\n }", "public function comment(){\n return $this->hasOne(AdminComment::class);\n }", "public function comments(): Relation\n {\n return $this->hasMany(Comment::class, 'user_id');\n }", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "function Comments ( &$pDBCon, $tb, $field )\n\t{\n\t\t$this->pDBInterface \t= &$pDBCon;\n\t\t$this->sCommentTb \t\t= $tb;\n\t\t$this->sField \t\t\t= $field;\n\t}", "public function getComment()\n { \n return $this->comment;\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment', 'author_id', 'id');\n }", "public function comments(){\n\t\t// Comment, 'foreign_key', 'local_key'\n\t\treturn $this->hasMany(Comment::class, 'post_id', 'id');\n\t}", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "function comments()\n {\n return $this->morphMany('App\\Comments', 'commentable');\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments()\n\t{\n\t\treturn $this->hasMany('Comment');\n\t}", "public function comments()\n {\n return $this->morphedByMany('App\\Comment', 'likeable');\n }", "function comment_link($comment = \\null)\n {\n }", "function comment_author_link($comment_id = 0)\n {\n }", "public function comments()\n\t{\n\t\treturn $this->has_many('comment');\n\t}", "function comment_connection($comment) {\nglobal $wpdb;\n\n//replace new lines \\n with line breaks <br /> in order to detect comment reference\n$comment = nl2br($comment);\n\n//replace extra spaces after @\n$r = \"@\";\n$s = \"@ \";\n$i = 1;\n$blank = substr_count($comment, $s);\nif ($blank > 0) \n\t$comment = str_replace($s, $r, $comment, $i);\n\n\t//determine if someone is referencing a comment\n\t$count = substr_count($comment, \"@\");\n\n\tif ($count > 0) {\n\n\t\t//find the post ID without printing to screen\n\t\t$pid = get_the_ID();\n\n\t\t//find the comment ID without printing to screen\n\t\t$cid = get_comment_ID();\n\t\n\t\t//this is the big change\n\t\t//determine all occurances of @ and their following authors\n\t\t//then loads into array\n\t\tpreg_match_all(\"/@(.*)(:|\\<br \\/\\>|,|-)/\", $comment, $out);\n\n\t\tforeach ($out[1] as $ref) {\n\t\t\t//solves little problem with colon usage\n\t\t\tif (substr_count($ref, ':') > 0) \n\t\t\t\t$ref = substr($ref, 0, strpos($ref, ':'));\n\t\t\t//solves other little problem with extra spaces\n\t\t\tif (substr_count($ref, ' ') <= 2)\n\t\t\t\t$array[$x] = $ref;\n\n\t\t\t//retrieve comment info from database\n\t\t\t$d = db_query($pid, $cid, $array[$x]);\n\n\t\t\t//replace the authors with their comment IDs\n\t\t\t//don't worry, that extra i there isn't a spelling mistake\n\t\t\t//it simply means that references with the wrong case are still replaced\n\t\t\tif ($d != NULL) {\n\t\t\t\t$replacement = preg_replace('/\\s$/', '', $array[$x]);\n\t\t\t\t$comment = str_ireplace('@' . $replacement, '@<a href=#comment-' . $d . '>' . $replacement . '</a>', $comment);\n\t\t}\n\t}\n}\nreturn $comment; //print the modified comments\n}", "public function comments() {\n return $this->hasMany('App\\Comment');\n }", "public function allComments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment');\n\t}", "public function comments() {\n return $this->morphMany(Comment::class,'commentable', 'parent_type', 'parent_id')->orderBy('created_at', 'ASC');\n }", "public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }", "public function comments()\n {\n return $this->hasMany(ExampleComment::class, 'from_user');\n }", "public function comments(){\n return $this->morphMany(Comment::class, 'commentable');\n }", "public function comments(){\n // Note that Comment::class == string 'App\\Comment'\n\n #? When this is called as a property, not a method, Laravel will know to 'eager-load' the relationship\n return $this->hasMany(Comment::class);\n\n }", "public function comments() {\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = image_id, localKey = id)\n\t\treturn $this->hasMany('App\\Comment')->with('user')->orderBy('id', 'desc');\n\t}", "public function comments()\n\t{\n\t\treturn $this->morphMany('TGL\\Comments\\Comment', 'commentable');\n\t}", "function edit_comment_link($text = \\null, $before = '', $after = '')\n {\n }", "function get_comments(){\n\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "function charangoten_custom_comment(&$a1, $op) {\n if ($op == 'insert' || $op == 'update') {\n if ($a1['stream_publish']) {\n //dpm($a1, \"dff_custom_comment, publishing to stream\");\n $node = node_load($a1['nid']);\n \n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $a1['subject'],\n 'href' => url('node/' . $a1['nid'], array('absolute' => TRUE, 'fragment' => 'comment-' . $a1['cid'])),\n 'description' => $a1['comment'],\n 'properties' => array(t('In reply to') => array('text' => $node->title, 'href' => url(\"node/\" . $node->nid, array('absolute' => TRUE)))),\n );\n\n $user_message = t('Check out my latest comment on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$a1['nid'], array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n}", "public function commentLog()\n {\n return $this->belongsTo('App\\Models\\CommentLog', 'reference', 'comment');\n }", "public function testCreateTaskComments()\n {\n }", "public function comments()\n {\n return $this->hasMany(Comment::class, 'subject_id', 'id')->where('comments.subject_type', Wiki::class)->with(['user', 'likes']);\n }", "function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}", "public function comments()\n {\n return $this->hasMany(Comment::class)->dernier();\n }", "public function comments() {\r\n\t\treturn new Engine_ProxyObject($this, Engine_Api::_() -> getDbtable('comments', 'core'));\r\n\t}", "public function comm($c){\n\t\t$this->comment = $c;\n\t}", "public function testFlagCommentRelationship()\n {\n $narrativeCreated = new Narrative;\n\n $date = date('Y-m-d H:i:s');\n\n $narrativeCreated->TopicID = 1;\n $narrativeCreated->CategoryID = 1;\n $narrativeCreated->LanguageID = 1;\n $narrativeCreated->DateCreated = $date;\n $narrativeCreated->Name = \"Test\";\n $narrativeCreated->Agrees = 1;\n $narrativeCreated->Disagrees = 1;\n $narrativeCreated->Indifferents = 1;\n $narrativeCreated->Published = true;\n\n $narrativeCreated->save();\n\n $commentCreated = Comment::create(array('NarrativeID'=>1,'Name'=>'test','Agrees'=>0,'Indifferents'=>1,'Disagrees'=>1,'DateCreated'=>date('Y-m-d H:i:s'), 'Comment'=>'TEST'));\n \n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = NULL;\n $flagCreated->CommentID = 1;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $comment = Flag::find(1)->comment();\n $this->assertNotNull($comment);\n\n }", "function get_comment_author_link($comment_id = 0)\n {\n }", "public function comment(){\n return $this->hasMany(User::class);\n }", "function comments_link_feed()\n {\n }", "public function comments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment')->where('parent_id', 0)->orderBy('updated_at', 'desc');\n\t}", "public function comments(){\n // du Model `Comment` sous le nom scopeDernier()\n return $this->hasMany('App\\Comment')->dernier();\n}", "public function comment()\n {\n return $this->belongsTo('App\\SchoolComment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }", "public function comments()\n {\n return $this->hasMany('App\\Models\\Comment');\n }" ]
[ "0.7364311", "0.67684007", "0.6674589", "0.6662705", "0.6662705", "0.6662705", "0.6662705", "0.6662705", "0.6662705", "0.65926075", "0.6586284", "0.6557693", "0.6506177", "0.650606", "0.64508593", "0.64133275", "0.6389357", "0.62761617", "0.6270902", "0.6237311", "0.6198116", "0.61743534", "0.6149734", "0.61463326", "0.6114584", "0.6108399", "0.61083937", "0.61005986", "0.609132", "0.6085971", "0.6085397", "0.6084946", "0.6065398", "0.60649776", "0.60450065", "0.60449", "0.6035814", "0.60357", "0.60310835", "0.6024543", "0.6011566", "0.6005316", "0.5968496", "0.5958654", "0.59526485", "0.59458226", "0.5941776", "0.5929704", "0.59265894", "0.591815", "0.59177846", "0.59177846", "0.59177846", "0.5915664", "0.5912385", "0.5910819", "0.5907426", "0.5906351", "0.5905915", "0.59054756", "0.59028983", "0.59022015", "0.5900688", "0.58975494", "0.587592", "0.587487", "0.5872973", "0.58536893", "0.5847477", "0.58430123", "0.58416325", "0.5839571", "0.5838025", "0.5837962", "0.58346653", "0.58310807", "0.58270013", "0.5819432", "0.5816797", "0.58154154", "0.5813606", "0.5811325", "0.58104753", "0.5810248", "0.58090806", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.58001935", "0.5793958", "0.5793958", "0.5793958", "0.5793958" ]
0.6009602
41
/ Relation with categories
public function categories() { return $this->belongsToMany('App\Models\Categories', 'category_article', 'article_id', 'category_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findCategories();", "public function category() {\n\t\treturn $this->belongsToMany('Category');\n\t}", "public function categories()\n {\n \treturn $this->hasMany('App\\Category');\n }", "public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }", "public function getCategory();", "public function getCategory();", "public function getCategory() {}", "public function getCategories();", "public function getCategories();", "public function categories()\n {\n \treturn $this->belongsTo( 'App\\Category', 'category_id');\n }", "public function categories()\n\t{\n\t\treturn $this->belongsToMany(Category::class);\n\t}", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany('App\\Category');\n }", "public function categories() {\n return $this->belongsTo(\"Category\", \"category_id\", \"id\");\n }", "public function categories(){\n return $this->belongsToMany(category::class);\n }", "public function categories() {\n\t\t// sukuria sasaja su Category modeliu:\n\t\treturn $this->hasOne('App\\Category', 'id', 'category');\n\t}", "public function categories() {\n return $this->belongsToMany('App\\PodcastMetaData', 'podcast_metas', 'podcast_id', 'meta_id')->where('meta_type', 'podcast_category');\n }", "public function categories()\n {\n return $this->belongsTo(Category::class);\n }", "public function createCategory();", "public function category() {\n return $this->belongsTo('Category','catID','catID');\n\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class);\n }", "public function categories()\n {\n // belongsToMany(RelatedModel, pivotTable, thisKeyOnPivot = brand_id, otherKeyOnPivot = category_id)\n return $this->belongsToMany(Category::class);\n }", "public function categories(){\n return $this->belongsTo('App\\Category');\n }", "public function categories()\n {\n return $this->belongsTo(Categories::class);\n }", "public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }", "public function category() {\n return $this->belongsTo('App\\Models\\category','cat_id');\n }", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function category()\n {\n \treturn $this->belongsTo(Category::class);\n }", "public function categories()\n {\n \treturn $this->belongsToMany('App\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function category(){\n \treturn $this->belongsTo(\"Category\",\"category_id\");\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Category');\n }", "public function category()\n {\n // hasOne, hasMany, belongsTo, belongsToMany\n return $this->belongsTo(Category::class);\n }", "public function categories()\n {\n return $this->belongsTo('App\\Categories', 'category_id');\n }", "public function categoriesSon()\n {\n return $this->hasMany(self::class);\n }", "public function getAllWithCategory();", "public function category()\n {\n return $this->belongsTo(Categories::class);\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'film_category', 'film_id', 'category_id');\n }", "public function category(){\n return $this->belongsTo('App\\Category', 'cat-id');\n }", "public function category()\n {\n\n return $this->belongsTo(Category::class);\n\n }", "public function categories()\n {\n return $this->hasMany(\\Hydrofon\\Category::class, 'parent_id');\n }", "public function category()\n {\n \treturn $this->belongsTo('App\\Category','category_id','id');\n }", "public function getViewedCategory();", "public function categories(){\n\n return $this->belongsTo('App\\Http\\Models\\Category');\n\n }", "public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }", "private function makeRelationBetweenCategoryAndDummyTable() {}", "public function category() {\n\t\treturn $this->belongsTo(Category::class, 'category_id', 'id');\n\t}", "public function categories()\n {\n return $this->belongsToMany('App\\Category', 'categories_games', 'game_id', 'categorie_id');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'tree_id'])->viaTable('{{%news_tree}}', ['news_id' => 'id']);\n }", "public function cat(){\n return $this->hasOne(Category::class, 'id','category_id');\n }", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable('product_category', ['product_id' => 'id']);\n }", "public function getAllCategories();", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])\n ->viaTable('user_category', ['user_id' => 'id']);\n }", "public function category()\n\t{\n\t\treturn $this->belongsTo('App\\Model\\Content\\Category');\n\t}", "public function categories(){\n\treturn \t$this->belongsToMany('Category')->withTimestamps();\n\t}", "public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }", "public function category()\n\t{\n\t return $this->belongsTo(Category::class);\n\t}", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n{\n return $this->belongsTo(Category::class);\n}", "public function category()\n\t{\n\t\treturn $this->belongsTo(Category::class);\n\t}", "public function categories()\n {\n return $this->belongsToMany(\n Category::class, \n 'category_ticket', \n 'ticket_id', \n 'category_id'\n );\n }", "public function getCategory()\n{\n return $this->hasOne(Category::className(), ['id' => 'category']);\n}", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function getCategory()\n {\n }", "public function categoryProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = cate_id, localKey = cate_id)\n return $this->hasMany('App\\CategoryProductRelation','cate_id','cate_id');\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'company_category', 'company_id', 'category_id');\n }", "public function category(){\n return $this->belongsTo('Backpack\\NewsCRUD\\app\\Models\\Category', 'category_id');\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category() {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Categories::class, 'category_id');\n }", "public function getBookCategories() {\n return $this->hasMany(BookCategory::className(), ['book_id' => 'id']);\n }", "public function cat(){\n return $this->belongsTo(Cat::class);\n }", "public function category()\n {\n $this->belongsTo(Category::class, 'category_id');\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category(){\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo('App\\Category');\n }", "public function getCategories():ActiveQuery\n {\n return $this\n ->hasMany(Category::class, ['id' => 'categoryId'])\n ->viaTable(CategoryBloc::tableName(), ['blocId' => 'id']);\n }", "public function category() {\n return $this->belongsTo('App\\Category');\n }", "public function categories()\n {\n return $this->belongsToMany(BlogCategory::class, 'blog_map_categories', 'blog_id', 'category_id');\n }", "public function category(){\n return $this->belongsTo('App\\Models\\Category');\n }", "public function category(){\n return $this->belongsTo('App\\Models\\Category');\n }", "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 categories() {\n return $this->belongsToMany('App\\Models\\Category', 'category_post', 'post_id', 'category_id');\n }", "public function categories() {\n return $this->hasMany('App\\Models\\Category', 'user_id');\n }", "public function categories()\n {\n return $this->morphedByMany(\n Category::class,\n 'metable'\n );\n }", "public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }", "public function category() {\n \treturn $this->belongsToMany(Category::class, 'product_details', 'category_id');\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }", "public function category()\n {\n return $this->belongsTo(Category::class);\n }" ]
[ "0.72922957", "0.7135391", "0.7075353", "0.7050535", "0.69474804", "0.69474804", "0.69262844", "0.6916318", "0.6916318", "0.6820317", "0.6796248", "0.6780266", "0.6763207", "0.6763207", "0.6763207", "0.67588496", "0.6754839", "0.6736917", "0.6710322", "0.67055666", "0.66986716", "0.66879946", "0.6685545", "0.6685545", "0.6685545", "0.666232", "0.6645057", "0.66387796", "0.6620185", "0.661805", "0.66023314", "0.66023314", "0.6598385", "0.657859", "0.65759355", "0.6544259", "0.65382195", "0.65273607", "0.65266347", "0.65163827", "0.65027", "0.64978695", "0.6497151", "0.6492628", "0.6485034", "0.6482867", "0.6479708", "0.64767414", "0.6459497", "0.64548934", "0.6449188", "0.6447792", "0.64435524", "0.6443353", "0.6442637", "0.64350677", "0.64326656", "0.6426779", "0.64237547", "0.6422606", "0.64189607", "0.64110225", "0.6401351", "0.6396589", "0.63932276", "0.6387793", "0.6385839", "0.6385257", "0.63690567", "0.63602626", "0.63598686", "0.63598686", "0.63598686", "0.63573825", "0.6355611", "0.6354648", "0.63462883", "0.63424903", "0.63424903", "0.63424903", "0.63424903", "0.6341651", "0.6334414", "0.63337487", "0.63330084", "0.6331379", "0.6331379", "0.6325159", "0.63210225", "0.63207144", "0.6320402", "0.63185817", "0.6318561", "0.63168114", "0.63168114", "0.63168114", "0.63168114", "0.63168114", "0.63168114", "0.63168114" ]
0.6504534
40
/ Relation with article_status
public function status() { return $this->belongsTo('App\Models\Article_Status'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function article_status() {\n return Registry::prop('article', 'status');\n}", "public function status()\n {\n //retorna un solo objeto, ya que el usuario solo tiene un status\n return $this->belongsTo('Vest\\Tables\\Status');\n }", "public function getSource()\n {\n return 'article_status';\n }", "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 status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n {\n return $this->belongsTo('App\\Status');\n }", "public function status()\n\t{\n\t\treturn $this->hasOne(Status::class,'id','status_id');\t\t\t\t\n\t}", "public function getStatus()\n {\n return $this->hasOne(Status::className(), ['id' => 'status_id']);\n }", "public function status() {\n return $this->belongsTo(Status::class);\n }", "public function getStatus () {\n return $this->hasOne('App\\Models\\Admin\\Status', 'id', 'status');\n }", "public function status()\n {\n return $this->belongsTo(RentalStatus::class, 'rental_status_id');\n }", "public function status()\n {\n return $this->belongsTo(Status::class);\n }", "public function status()\n {\n return $this->belongsTo(Status::class);\n }", "public function status()\n {\n return $this->belongsTo( Status::class );\n }", "public function status()\n\t{\n\t\treturn $this->hasOne('Quill\\Status\\Models\\Status', 'id', 'status');\n\t}", "public function status() {\n return $this->hasOne(Status::class, 'id', 'status_id');\n }", "public function status()\n {\n return $this->belongsTo(StatusAgendamento::class);\n }", "public function status()\n {\n return $this->belongsTo(\\App\\Models\\CaseFileStatus::class, \"status_id\", \"id\");\n }", "public function getStatus()\n {\n return $this->hasOne(Status::class, ['id' => 'status_id']);\n }", "public function getStatus()\n {\n return $this->belongsTo(TaskStatus::class, 'status');\n }", "public function status()\n {\n return $this->belongsTo(PropertyStatus::class);\n }", "function getVotingStatus($articleID = NULL,&$support = 0 ,&$total =0 )\n\t\t{\t\t\t\n\t\t\t# fetch articles \n\t\t\t$query = \"select count(*) as `total` from tbl_vote_status where\n\t\t\t affiliate_article_id = $articleID\";\n\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t$total\t\t= $row['total'];\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$query = \"select count(*) as `support` from tbl_vote_status where\n\t\t\t affiliate_article_id = $articleID and status ='support' \";\n\t\t\t \n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\twhile($row = $rs->FetchRow()) {\n\t\t\t\t$support\t\t= $row['support'];\n\t\t\t}\n\t\t}", "public function status()\n {\n return $this->belongsToMany(ThreadStatus::class)\n ->withTimestamps();\n }", "function active_article($id_article)\n{\n\n global $connection;\n\n $sql = \"UPDATE blog_articles\n SET active_article = 1\n WHERE id_article= '$id_article'\";\n $sth = $connection->prepare($sql);\n $sth->execute();\n}", "public function updater_articles()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->hasMany('App\\Article','updated_user','id');\n }", "function apachesolr_index_node_status_callback($entity_id, $entity_type, $entity = NULL) {\n if ($entity === NULL) {\n $entity = entity_load($entity_type, array($entity_id));\n $entity = $entity ? reset($entity) : FALSE;\n }\n if (empty($entity)) {\n // If the object failed to load, just stop.\n return FALSE;\n }\n // Make sure we have an integer value.\n // Anything different from 1 becomes zero\n return ($entity->status == 1 ? 1 : 0);\n}", "public function getStatus()\n {\n \n return $this->_em->createQuery('SELECT s,u FROM TechCorpFrontBundle:Status s \n JOIN s.user u ORDER BY s.createdAt DESC');\n }", "public function is_article();", "public function status()\n {\n return $this->belongsTo('App\\MasterModel\\MasterFilingStatus', 'status_id', 'id');\n }", "public function statuses() {\n return $this->hasMany('App\\Models\\Status', 'user_id'); // user_id coming from statues table\n }", "public function status(){\n return $this->hasOne(InspectionStatus::class,'id','inspection_status_id');\n }", "public function getArticle()\n {\n return $this->hasOne(Article::className(), ['id'=>'article_id']);\n }", "public function countConditionement_article(){\n\t\t\t\t\t return count($this->listeConditionement_article());\n\t\t\t\t\t }", "public function getRelationshipStatus()\n\t{\n\t\treturn $this->relationship_status;\n\t}", "function getObjectsStatuses()\n {\n return $this->hasMany(ObjectStatus::className(), ['status_id' => 'id']);\n }", "static function set_invite_status(RowUpdate &$upd, RowResult $entity, $status) {\r\n $link_name = null;\r\n\r\n if ($entity->base_model == 'User') {\r\n $link_name = 'users';\r\n } elseif ($entity->base_model == 'Contact') {\r\n $link_name = 'contacts';\r\n }\r\n\r\n if ($link_name != null) {\r\n $id = $entity->getField('id');\r\n $params[$id] = array('name' => 'accept_status', 'value' => $status);\r\n $upd->addUpdateLink($link_name, $id, $params);\r\n }\r\n }", "public function status(): BelongsTo\n {\n return $this->belongsTo(CampaignStatus::class);\n }", "public function article(){\n return $this->belongsTo('Corp\\Models\\Article');\n }", "public function hasArticleId(){\n return $this->_has(2);\n }", "public function article()\n {\n \treturn $this->belongsTo(Article::class);\n }", "abstract public function getStatus();", "public function articles() {\n // 1 articulo tiene muchos tag NOMBRE PLURAL\n return $this->belongsToMany('\\App\\Article')->withTimestamps();\n\n }", "public function user_statuses()\n {\n return $this->belongsTo('App\\UserStatus', 'status_id');\n }", "public function article()\n {\n return $this->belongsTo('App\\Models\\Article\\Article', 'article_id');\n }", "public function articles(){\n return $this->hasMany('Corp\\Models\\Article');\n }", "public function statuses(){\n return $this->hasMany('App\\Models\\Status', 'user_id');\n }", "function get_blog_status($id, $pref)\n {\n }", "public function status()\n {\n return $this->status->get($this->entity->status);\n }", "public function status()\n {\n return $this->hasOne('App\\ProjectStatus', 'id', 'project_status_id');\n }", "public function status()\n {\n return $this->hasOne('ProfileStatusType', 'id', 'status_type_id');\n }", "public function statuses() {\n return $this->hasMany('Larabook\\Statuses\\Status')->latest();\n }", "public function article()\n {\n return $this->hasMany(Article::class);\n }", "public function article()\n {\n return $this->belongsTo(Article::class, 'article_id');\n }", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function rentals() \n {\n return $this->belongsTo('id', 'status_id');\n }", "function add_article($article_id){\n\n\t\t\tif(isset($article_id) && is_numeric($article_id) && $article_id > 0 ) {\n\n\t\t\t\t$add_article_arr = array(\n\n\t\t\t\t\t'plan_id' => $this->value('plan_id'),\n\n\t\t\t\t\t'article_id' => $this->value('article_id'),\n\n\t\t\t\t\t'status' => 1,\n\n\t\t\t\t); \n\n\t\t\t\t$query = \"select count(*) from plan_article pa \n\n\t\t\t\t\t\t inner join article a \ton a.article_id = pa.article_id and a.status = 1\n\n\t\t\t\t\t\t where pa.plan_id = '{$this->value('plan_id')}' and pa.article_id = '{$this->value('article_id')}' \";\n\n\t\t\t\t$result = @mysql_query($query);\n\n\t\t\t\tif(is_resource($result)){\n\n\t\t\t\t\t$row = @mysql_fetch_array($result);\n\n\t\t\t\t\tif($row[0] == 0 ){\n\n\t\t\t\t\t\t$this->insert($this->config['table']['plan_article'],$add_article_arr);\t\n\n\t\t\t\t\t}\t\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "public function getArtists($status);", "public function article(): BelongsTo{\n return $this->belongsTo(Article::class);\n }", "public function getAllActiveArticleByDeevonaute()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t\t\t->from('tdArticle td_a')\n\t\t\t\t->where('td_a.active = false')\n\t\t\t\t->leftJoin('td_a.Author a')\n\t\t\t\t->where('a.id = ?', $this->getId());\n\t\t\t\t\n\t\t// return Doctrine_Core::getTable('tdArticle')->listAllArticles($q);\n\t\treturn $q->execute();\n\t}", "public function articles(){ //establece la relacion entre modelos, en este caso 1 a muchos\n return $this -> hasMany('App\\Article');\n }", "public function article()\n {\n return $this->belongsTo(Article::class);\n }", "public function article()\n {\n return $this->belongsTo('Article');\n }", "public function article() {\n\n return $this->belongsTo('App\\Article');\n }", "public function statuses()\n\t{\n\t\treturn $this->hasMany('Afreshysoc\\Models\\Status',\n\t\t\t'user_id');\n\t}", "public function statuses() {\n return $this->morphMany('App\\Status', 'statusable');\n }", "public function getStatus(){\n return $this->film['status'];\n }", "public function status($id);", "public function subsidyStatus()\n {\n return $this->hasOne('App\\SubsidyStatus', 'log_id');\n }", "public function getStatusAttribute()\n {\n return $this->audit()->first();\n }", "abstract protected function getStatusesInfos();", "function getJoinOnStatus()\n { \n return $this->getJoinOnFieldX('registration_status');\n }", "public function articles(){\n return $this->hasMany('\\App\\Article');\n }", "function is_post_status_viewable($post_status)\n {\n }", "public function articles()\n\t{\n\t\treturn\t$this->belongsToMany('App\\Article')->withTimestamps();\n\t}", "public function getTagArticles()\n{\n return $this->hasMany(\n TagArticles::className(), ['article_id' => 'id']\n );\n}", "public function updaterArticlesCount()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->updater_articles()\n ->selectRaw('updated_user, count(*) as aggregate')\n ->groupBy('updated_user');\n }", "private function loadArticleNumberSearchInformations()\n {\n $jsonData = $this->getData();\n switch ($jsonData[\"searchResult\"][\"resultArticleNumberStatus\"]) {\n case 'nothingFound':\n $this->isArticleNumberSearch = true;\n $this->articleNumberSearchStatus = self::NOTHING_FOUND;\n break;\n case 'resultsFound':\n $this->isArticleNumberSearch = true;\n $this->articleNumberSearchStatus = self::RESULTS_FOUND;\n break;\n case 'noArticleNumberSearch':\n default:\n $this->isArticleNumberSearch = false;\n $this->articleNumberSearchStatus = self::NO_RESULT;\n }\n }", "public function getTags()\n{\n return $this->hasMany(Tags::className(), ['id' => 'tag_id'])\n ->viaTable('tag_articles', ['article_id' => 'id']);\n}", "public function articles(){\n return $this->hasMany(Article::class);\n }", "function get_post_status_object($post_status)\n {\n }", "public function likes()\n {\n \treturn $this->hasMany(Like::class, 'article_id');\n }", "public function buildingArticles()\n {\n return $this->belongsTo('App\\Models\\Manage\\Content\\Building\\Service\\Articles\\TfBuildingArticles', 'articles_id', 'articles_id');\n }", "public function articles() {\n //hasMany representa la relacion de un a muchos\n return $this->hasMany(\"App\\Article\");\n }", "public function getComment()\n{\n return $this->hasMany(Comment::className(), ['article_id' => 'id']);\n}", "public function status()\n {\n return $this->hasOne(StatusRequest::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::STATUS_FOREIGN_KEY);\n }", "function _update_term_count_on_transition_post_status($new_status, $old_status, $post)\n {\n }", "function setTermStatus($term){\n $termClass = new DatabaseTable('terms');\n $termNew = [\n 'tid'=>$term['tid'],\n 'tmid'=>$term['tmid'],\n 'tname'=>$term['tname'],\n 'tsdate'=>$term['tsdate'],\n 'tedate'=>$term['tedate'],\n 'tstatus'=>checkDateStatus($term['tsdate'], $term['tedate'])\n ];\n $termClass->update($termNew, 'tid');\n $term = $termClass->find('tid', $term['tid']);\n $term = $term->fetch();\n return $term;\n }", "function favorite_status($guid_one, $guid_two){\n \n\t$guid_one = (int)$guid_one;\n\t$guid_two = (int)$guid_two;\n\t\n\t$check = check_entity_relationship($guid_one, \"favorite\", $guid_two);\n\t\n\tif($check) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getDetailedStatus() {}", "public function articles() {\n return $this->hasMany('Drstock\\Article','category_id');}", "public function isRelated();", "public function subpropertyInMultipleLeftJoinCountTest() {}", "function statuses() {\n //return parent::statusesWithCount( self::tableName(), self::arrayStatuses() );\n\n global $wpdb;\n\n $table_name = self::tableName();\n $statuses = self::arrayStatuses();\n $field_name = 'status';\n /*\n * @ToDo Decommentare qui se non vogliamo i conteggi dinamici in base al filtro\n * @ToDo La query è molto onerosa\n *\n *\n */\n $table_orders = BNMExtendsOrders::tableName();\n $sql = <<< SQL\n SELECT DISTINCT( {$table_orders}.{$field_name} ),\n COUNT(*) AS count\n FROM `{$table_name}`\n LEFT JOIN `{$table_orders}`\n ON {$table_orders}.id = {$table_name}.id_order\n GROUP BY {$table_orders}.{$field_name}\nSQL;\n\n\n\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public function userDayStatuses()\n {\n \treturn $this->hasMany(UserDayStatus::class);\n }", "public function licenseStatus()\n {\n return $this->belongsTo('CityBoard\\Entities\\LicenseStatus');\n }", "public function getStatusLabelAttribute()\n{\n if ($this->status == 0) {\n return '<span class=\"badge badge-secondary\">Draft</span>';\n }\n return '<span class=\"badge badge-success\">Aktif</span>';\n}", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function test_rel(){\n\t\t//$data1 = array('name'=>'jack','age'=>24);\n\t\t//$a->data($data1)->save();\n\n\t\t//$a = new article();\n\t\t//$a->data(array('title'=>'art1','content'=>'test'))->save();\n\t\t//$a = new user_article_author();\n\t\t//$a->data(array('user_id'=>1,'article_id'=>1,'status'=>'open'))->save();\n\t\t$a = new user_article_author();\n\t\t$b = $a->rel();\n\t\tdump ($b->where('user.user_id = 1')->select());\n\t\tdump($b->sql);\n\t}" ]
[ "0.68494546", "0.5825532", "0.5714712", "0.57084435", "0.5696605", "0.5696605", "0.5696605", "0.5696605", "0.56956965", "0.56737125", "0.5672041", "0.564987", "0.5645704", "0.5640428", "0.5640428", "0.561347", "0.5568815", "0.5562462", "0.5522208", "0.54810756", "0.5400448", "0.5388128", "0.53676295", "0.5349065", "0.5336153", "0.5330717", "0.5326484", "0.5273424", "0.52728903", "0.52631295", "0.5256084", "0.52339697", "0.52195024", "0.519829", "0.51904005", "0.51778245", "0.51502", "0.51276475", "0.5098102", "0.5092956", "0.5071957", "0.5057426", "0.5053717", "0.5044427", "0.50233275", "0.5020969", "0.50195765", "0.49994183", "0.49866986", "0.4983924", "0.497715", "0.49739325", "0.49673188", "0.49638346", "0.4959047", "0.4950005", "0.4940187", "0.49300772", "0.49280047", "0.49187627", "0.4917984", "0.49104768", "0.49095201", "0.49050042", "0.4898038", "0.48837787", "0.48788518", "0.48784706", "0.48736307", "0.48653072", "0.4864911", "0.48602644", "0.48596257", "0.4851445", "0.48491466", "0.48370492", "0.4830851", "0.48278746", "0.48268676", "0.48129582", "0.48033652", "0.4797567", "0.47859308", "0.4782397", "0.4768277", "0.47633556", "0.47574493", "0.47558135", "0.4755056", "0.47530094", "0.47510448", "0.475074", "0.47470862", "0.47441378", "0.4740893", "0.4737132", "0.4733619", "0.47279528", "0.4725405", "0.47252232" ]
0.7595282
0
/ Creates new article Returns true or false
public function create_article($request, $status_id = 1) { $this->user_id = Auth::user()->id; $this->title = $request['title']; $this->preview = $request['preview']; $this->img = $request['imgUrl']; $this->content = $request['articleContent']; $this->status_id = $status_id; if($this->save()){ if(!is_null($request['category_'])) { if($this->categories()->sync($request['category_'])) { return $this->id; } else { return false; } } else { return $this->id; } } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article = new Articles();\n\n $article->title = $this->request->getPost(\"title\");\n $article->slug = str_replace(' ','_', strtolower($article->title));\n $article->content = $this->request->getPost(\"content\");\n $article->category = $this->request->getPost(\"category\");\n $article->isPublished = $this->request->getPost(\"isPublished\");\n $article->author = $this->request->getPost(\"author\");\n $article->createdOn = new RawValue('now()');\n $article->views = 1;\n \n\n if (!$article->save()) {\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"article was created successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }", "function newArticle(Article $cours) {\n $query = $this->dbh->prepare(\"INSERT INTO articles (discipline, titre, contenu, auteur, creation_date) \"\n . \"VALUES (:discipline,:titre, :contenu, :auteur, :creation_date);\");\n $query->bindValue('discipline', $cours->getDiscipline());\n $query->bindValue('titre', $cours->getTitre());\n $query->bindValue('contenu', $cours->getContenu());\n $query->bindValue('auteur', $cours->getAuteur());\n $query->bindValue('creation_date', $cours->getDate());\n $query->execute();\n return TRUE;\n }", "public function createAction()\n {\n // Checking a for a valid csrf token\n if ($this->request->isPost()) {\n if (!$this->security->checkToken()) {\n //if the csrf token is not valid, end the algorithm here\n return;\n }\n }\n\n // Getting a request instance\n $request = new Request();\n\n // Check whether the request was made with method POST\n if ($request->isPost()) {\n\n //TODO Question: is there a way to auto map the post data to a model?\n $article = new Article();\n $article->creationDate = $date = date('Y-m-d H:i:s');\n $article->title = $this->request->getPost('title');\n $article->summary = $this->request->getPost('summary');\n $article->content = $this->request->getPost('content');\n\n //try to save the article to the database, if it fails let the user know what went wrong\n if (!$article->save()) {\n //get all the validationErrors and store them in the flashSessions and return the view\n foreach ($article->getMessages() as $message) {\n //append the validation errors to the flash session\n $this->flashSession->error($message);\n }\n return;\n }\n\n //let the user know the article was saved successfully\n $this->flashSession->message('message', 'The article has successfully been created');\n\n //return to the admin article overview so the user can see the new article in the list\n return $this->response->redirect(\"/article\");\n }\n }", "public function Article_Insert($Article_Object) {\n\t\t$sql = \"SELECT id,catagory_id, title, writter_id FROM articles WHERE id =$Article_Object->id \";\n\t\t$result = $GLOBALS['DB_Conn']->query($sql);\n\t\tif ($result->num_rows > 0) \n\t\t\treturn false;\n\t\telse{\n\t\t\t$sql1 = \"INSERT INTO articles(id,catagory_id,title,content\t,status,writter_id)\n\t\t\tVALUES ($Article_Object->id,$Article_Object->catagory_id,$Article_Object->title,$Article_Object->content,$Article_Object->status,\n\t\t\t\t$Article_Object->writter_id)\";\n\n\t\t\tif ($GLOBALS['DB_Conn']->query($sql1) === TRUE) {\n\t\t\t \treturn true;\n\t\t\t} else {\n\t\t\t return false;\n\t\t\t}\n\t\t}\n\n\t\treturn true; // True if success, False if not\n\t}", "public function insert($article);", "public function is_article();", "function createArticle($title, $description, $image, $category, $imagefile, $active){\r\n global $conn;\r\n try {\r\n //Controleer als het bestand een afbeelding is.\r\n $imageFileType = pathinfo(basename($image), PATHINFO_EXTENSION);\r\n if ($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\") {\r\n echo 'Het nieuwsartikel kon niet worden toegevoegd, controleer als de geuploade afbeelding wel een jpg, png of jpeg bestand is!';\r\n return false;\r\n } else {\r\n //Stuur post gegevens naar de database.\r\n $stmt = $conn->prepare(\"INSERT INTO news(title, description, image, categoryID, active) \r\n VALUES(:title, :description, :image, :categoryID, :active)\");\r\n $stmt->bindparam(\":title\", $title);\r\n $stmt->bindparam(\":description\", $description);\r\n $stmt->bindparam(\":image\", $image);\r\n $stmt->bindparam(\":categoryID\", $category);\r\n $stmt->bindparam(\":active\", $active);\r\n $stmt->execute();\r\n //Upload afbeelding.\r\n uploadImage($image, $imagefile);\r\n echo 'Nieuwsartikel is toegevoegd';\r\n return $stmt;\r\n }\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n }\r\n }", "public function create() {\n $article = Article::where('url_key','po-umolchaniyu')->first();\n if(!$article) {\n $article = new Article;\n $article->title = 'По умолчанию';\n $article->url_key = 'po-umolchaniyu';\n $article->news = 0;\n $article->save();\n }\n return $article;\n }", "public function create()\n {\n if (Gate::denies('save', new Article())){\n abort(403);\n }\n $this->title = \"Add new article\";\n $categories = Category::select(['title', 'alias', 'parent_id', 'id'])->get();\n $lists = array();\n foreach ($categories as $category){\n if($category->parent_id == 0){\n $lists[$category->title] = array();\n } else{\n $lists[$categories->where('id', $category->parent_id)->first()->title][$category->id] = $category->title;\n }\n }\n //dd($lists);\n $this->content = view(env('THEME') .'.admin.articles_create')->with('categories', $lists)->render();\n return $this->renderOutput();\n }", "public function create()\n {\n $this->authorize('create', Article::class);\n return view('articles.create');\n }", "public function add() {\n\t\t// then redirect them to the edit page\n\t\t\n\t\t$article = new Article;\n\t\t\n\t\t$article->title = 'Untitled';\n\t\t$article->user_id = current_user()->id;\n\t\t$article->section_id = 1;\n\t\t$article->content = 'Content goes here';\n\t\t$article->is_approved = 0;\n\t\t$article->status = 'draft';\t\t\n\t\t\n\t\tif($article->save() == FALSE) {\n\t\t\t$this->session->set_flashdata('error', 'Unable to create new article');\n\t\t\tredirect('admin/articles/');\n\t\t}\n\t\t\n\t\t// Remove content forced in to satisfy TinyMapper validation\n\t\t$this->db->where('id', $article->id);\n\t\t$this->db->update('articles', array(\n\t\t\t'title' => 'Untitled '.$article->id,\n\t\t\t'content' => 'Content goes here'\n\t\t));\n\t\t\n\t\t// Set success message\n\t\t$this->session->set_flashdata('success', 'New article successfully created');\n\t\t\n\t\tredirect('admin/articles/edit/id/'.$article->id);\n\t}", "public function store()\n\t{\n\t\tif ($this->validateArticleForm() === true)\n\t\t{\n\t\t\t$Article = $this->saveArticleProperties();\n\t\t\tif (!is_null($Article))\t$this->saveArticleDetail($Article);\n\t\n\t\t\t// redirect\n\t\t\tSession::flash('message', 'Successfully created article!');\n\t\t\treturn Redirect::to('admin/articles');\n\t\t}else return $this->validateArticleForm();\n\t}", "public function actionCreate()\n {\n $model = new Article();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n switch ($model->category_id){\n case Article::CAT_VIDEO:\n return $this->redirect(['video']);\n break;\n case Article::CAT_SUPPORT:\n return $this->redirect(['support']);\n break;\n case Article::CAT_BLOG:\n return $this->redirect(['blog']);\n break;\n default:\n return $this->redirect(['index']);\n }\n } else {\n\n return $this->render('create', [\n 'model' => $model,\n 'categories' => ArticleCategory::find()->active()->all(),\n ]);\n }\n }", "public function create() {\n //\n return view('admin.article.create');\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'title' => 'required',\n\t\t\t'text' => 'required'\n\t\t);\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('article/create');\n\t\t} else {\n\t\t\t$article = new Article;\n\t\t\t$article->title = Input::get('title');\n\t\t\t$article->text = Input::get('text');\n\t\t\t$article->save();\n\t\t\tSession::flash('message', 'Successfully created article!');\n\t\t\treturn Redirect::to('article/'.$article->id);\n\t\t}\n\t}", "private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }", "public function prepareCreate($inputs){ \t\n\t\t$this->validation($inputs);\n\t\t$article=$this->one('title',$this->title); \n\t\t\n\t\tif ((($article['title'])===($this->title))&& ($this->title != null)){ \n\t\t\t$this->errors[]=\"Le titre de cet article existe déjà!\";\n\t\t};\n\n\t\tif (!empty($this->errors)){\n\t\t\t$this->saveInputs = $this->isErrors($inputs); \n\t\t\treturn false; \n\t\t};\n\n\t\t$fields = array(\n\t\t\t'title'=>($this->title), \n\t\t\t'description'=>($this->description),\n\t\t\t'content'=>($this->content),\n\t\t\t'publicated'=>($this->published),\n\t\t\t'date_publication'=>($this->publishedDate), \n\t\t\t'date_creation'=>($this->setDate()),\n\t\t\t'author_id'=>($this->authorId)\n\t\t);\n\t\treturn $this->recordValid('create', $fields);\n\t}", "public function store(createArticleRequest $request)\n\t{\n\t\t$article = new Article($request->all());\n\n\t\t$name = $request->input('interest');\n\n\t\t$tag_id = DB::table('interests')\n\t\t\t->select('interests.id')\n\t\t\t->where('name','=',$name)->get();\n\n\t\t$article->interest()->attach($tag_id);\n\n\t\tAuth::user()->article()->save($article);\n\n\n\n\t\tflash()->overlay('Your article has been created', 'Thank you for posting');\n\t\t\n\t\treturn redirect('article');\n\t}", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$category = Category::whereName('news')->first();\n\t\t$member = Auth::user()->member;\n\n\t\t$validator = Article::validate($input);\n\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::to('/news/create/')->withInput($input)->withErrors($validator);\n\t\t}\n\n\t\t$article = new Article();\n\t\t$article->slug = $input['slug'];\n\t\t$article->subject = $input['subject'];\n\t\t$article->body = $input['body'];\n\t\t$article->member()->associate($member);\n\t\t$article->category()->associate($category);\n\t\t$article->save();\n\n\t\treturn Redirect::to('/news/');\n\t}", "public function create()\n {\n $data=PagesController::dataCommune('article.create',false);\n return view('articles.create',$data);\n }", "public function create()\n {\n\n $categories = $this->categoryModel->getCategories();\n $tags = $this->tagModel->getTags();\n\n $data = [\n 'title' =>'',\n 'slug' => '',\n 'body' => '',\n 'created_at' => '',\n 'categories' => $categories,\n 'tags' => $tags,\n 'date'=>'',\n 'image' => '',\n 'user_id' =>'',\n 'status' =>'',\n\n ];\n $this->view('articles/create', $data);\n\n\n }", "public function actionCreate()\n {\n $model = new Article();\n if(!empty($_GET['kind'])) $model->kind=$_GET['kind'];\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function addArticle(): void\n {\n $this->title = $_POST['titleArticle'];\n $this->content = $_POST['contentArticle'];\n $this->category = $_POST['categoryArticle'];\n $datetime = new DateTime();\n $this->date = $datetime->format('Y-m-d H:i:s');\n $this->author = $_SESSION['user']['id'];\n\n $this->image = $_FILES['imageArticle'];\n $tmp_file = $this->image['tmp_name'];\n $type_file = $this->image['type'];\n\n $temp = explode(\".\", $this->image['name']);\n $name_file = round(microtime(true)) . '.' . end($temp);\n\n $destination = 'application/views/images/';\n\n if (!is_uploaded_file($tmp_file) === true) {\n exit(\"Le fichier est introuvable\");\n };\n if (!strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'bmp')) {\n exit(\"Le fichier n'est pas une image\");\n }\n if (preg_match('#[\\x00-\\x1F\\x7F-\\x9F/\\\\\\\\]#', $name_file)) {\n exit(\"Nom de fichier non valide\");\n } else if (!move_uploaded_file($tmp_file, $destination . $name_file)) {\n exit(\"Impossible de copier le fichier dans $destination\");\n } else {\n move_uploaded_file($tmp_file, $destination . $name_file);\n }\n\n $this->articleModel->addArticle($this->title, $this->content, $this->category, $name_file, $this->date, $this->author);\n\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function create()\n {\n $this->authorize('update', Article::class);\n $article = new Article();\n return view('articles.create', compact('article'));\n }", "public function create()\n\t{\n\t\treturn View::make('pages.article.create');\n\t}", "public function create()\n {\n //\n return view('Admin.Article.add');\n }", "public function create()\n {\n $datas=$this->articleRepository->create();\n return view('backend.article.create', [\n 'datas' => $datas,\n ]);\n }", "public function create()\n {\n //Проверяем есть ли у пользователя права на добавление article save - проверяемое действие, условие будем формировать в класе политике безопасности \\App\\Article\n //создали класс политики безопасности php artisan make:policy ArticlesPolicy\n if (Gate::denies('save', new Article)) {\n abort(403);\n\n }\n $this->title = Lang::get('ru.add_new_article');\n\n //получаем категории из таблицы\n $categories = Category::select('title', 'alias', 'parent_id', 'id')->get();\n // формируем выпадающий списток с группами документации collective расширение для html и forms\n //выпадающий список select с групами\n $lists = array();\n\n foreach ($categories as $category) {\n //значит это родительская категория\n if ($category->parent_id == 0) {\n $lists[$category->title] = array();\n }\n\n //если это модель дочерней категории\n //where - в категориях найдем конкретную модель у которой id находится значение родителя\n //но whereвозвращает коллекцию, но мы знаем что у дочерней модели может быть только один родитель\n /// а значит выбираем first()\n else {\n $lists[$categories->where('id', $category->parent_id)->first()->title][$category->id] = $category->title;\n }\n }\n $this->content = view(config('settings.theme') . '.admin.articles_create_content')->with('categories', $lists)->render();\n return $this->renderOut();\n\n }", "public function actionCreate()\n\t{\n\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\t\n\t\t$model=new Articles;\n\t\tif(isset($_POST['Articles']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\tif (isset(Yii::app()->user->isAdmin) && Yii::app()->user->isAdmin){\n\t\t\t\t$model->status = 0;\n\t\t\t}\n\t\t\t$model->user_id = Yii::app()->user->id;\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\tif (Yii::app()->user->isAdmin){\n\t\t\t\t\t$this->redirect(array('admin')); //,'id'=>$model->id));\n\t\t\t\t}else{\n\t\t\t\t\t$this->redirect(array('list')); //,'id'=>$model->id));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->render('create',array('model'=>$model));\n\t}", "public function create(): bool;", "public function store(Requests\\ArticleRequest $request)\n {\n //Unless validation pass the code below will never be fired\n $this->createArticle($request);\n \n flash()->success('Your article has been created');\n return redirect('articles');\n }", "public function createActionPost() : object\n {\n $request = $this->app->request;\n $session = $this->app->session;\n $response = $this->app->response;\n $title = $request->getPost(\"contentTitle\");\n $doCreate = $request->getPost(\"doCreate\");\n $db = $this->app->db;\n $db->connect();\n $sql = \"SELECT title FROM content\";\n $titles = $db->executeFetchAll($sql);\n\n if (isset($doCreate)) {\n foreach ($titles as $t) {\n if ($t->title == $title) {\n $session->set(\"existError\", true);\n return $response->redirect(\"cms/create\");\n }\n }\n $db->connect();\n $sql = \"INSERT INTO content (title) VALUES (?);\";\n $db->execute($sql, [$title]);\n $contentId = $db->lastInsertId();\n $slug = slugify($title);\n $session->set(\"adminid\", $contentId);\n return $response->redirect(\"cms/edit/${slug}\");\n }\n }", "function newArticle() {\n\n $results = array();\n $results['pageTitle'] = \"Neuer Artikel | Ape Blog\";\n $results['formAction'] = \"newArticle\";\n\n if ( isset( $_POST['saveChanges'] ) ) {\n\n // User hat die Form ausgefüllt und auf Speicher gedrückt, so werden die Eingaben abgespeichert, \n // und mit der Funktion insert() auf die Datenbank geschrieben.\n $article = new Article;\n $article->storeFormValues( $_POST );\n $article->insert();\n header( \"Location: admin.php?status=changesSaved\" );\n\n } elseif ( isset( $_POST['cancel'] ) ) {\n\n // Wenn der User auf \"Abbrechen\" clickt, wird zurück zur Liste geleitet.\n header( \"Location: admin.php\" );\n } else {\n\n // User bekommt eine leere Form angezeigt.\n $results['article'] = new Article;\n require( TEMPLATE_PATH . \"/admin/editArticle.php\" );\n }\n\n}", "public function createAction() : object\n {\n $title = \"Skapa nytt innehåll\";\n\n // Check if not logged in, redirect to login page\n if (!$this->app->session->get('user')) {\n return $this->app->response->redirect(\"content/login\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $title = getPost(\"contentTitle\");\n\n $sql = \"INSERT INTO content (title) VALUES (?);\";\n $this->app->db->execute($sql, [$title]);\n\n return $this->app->response->redirect(\"content\");\n }\n\n // Add and render page to add content\n $this->app->page->add(\"content/create\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function isNew(): bool;", "public function isNew(): bool;", "public function createNewArticle($data)\n {\n /* Set author id for article */\n $data['user_id'] = \\Auth::user()->id;\n\n /* Create new article */\n $article = self::create($data);\n\n return $article;\n }", "public function create_new()\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$result = $model->create_new();\n\t\tif ($result){\n\t\t\theader('Location:/home');\n\t\t\tuser_msg('Post created successfully'); // <-- this doesn't work, why?\n\t\t}\n\t}", "public function create()\n {\n $create = true;\n return view('articles.create')->with('create',$create);\n }", "public function create()\n {\n return view('back.article.create');\n }", "function init_article($title, $content,$views, $publish_date, $update_date, $author) {\n $article = ORM::for_table('pw_article')->create();\n $article->art_title = $title;\n $article->art_content= $content;\n $article->art_views = $views;\n $article->art_publish_date= $publish_date;\n $article->art_update_date =$update_date;\n $article->art_author=$author;\n $article->save();\n return $article;\n}", "public function create()\n {\n return false;\n }", "public function isNew();", "public function isNew();", "protected function givenNewDocumentIsCreated()\n {\n }", "public function create()\n {\n return true;\n }", "public function create()\n {\n return true;\n }", "public function save(ArticleDAO $article): bool\n {\n if (isset($article->id)) {\n return $this->update($article);\n }\n $time = time();\n\n $stmt = $this->connection->prepare('\n INSERT INTO article \n (created_at, content, user_id, title,) \n VALUES \n (:created_at, :content, :user_id, :title)\n ');\n $stmt->bindParam(':created_at', $time);\n $stmt->bindParam(':title', $article->title);\n $stmt->bindParam(':user_id', $article->user_id);\n $stmt->bindParam(':content', $article->content);\n return $stmt->execute();\n }", "public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }", "public function createArticleOrd(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"INSERT INTO articolo SET id_ordine=:ultimo_ord, nome_articolo=:articolo, quantita = 1, taglia=:taglia\";\n $stmt1 = $this->conn->prepare($query1);\n $this->ultimo_ord=htmlspecialchars(($this->ultimo_ord));\n $this->articolo=htmlspecialchars(strip_tags($this->articolo));\n $this->quantita=htmlspecialchars(strip_tags($this->quantita));\n $this->quantita=htmlspecialchars(strip_tags($this->taglia));\n\n $stmt1->bindParam(\":ultimo_ord\", $this->ultimo_ord);\n $stmt1->bindParam(\":articolo\", $this->articolo);\n $stmt1->bindParam(\":taglia\", $this->taglia);\n $stmt1->execute();\n\n if($stmt1){\n return true;\n }\n else\n return false;\n }", "public function create()\n {\n // 글쓰기 폼\n return view('article.create');\n }", "public function create()\n {\n return redirect()->route('admin::categories.createSpec', ['Article']);\n }", "public function create()\n {\n return view('admin.article.create'); \n\n }", "public function actionCreate() {\n $model = new ArticleModel;\n if (isset($_POST['ArticleModel'])) {\n $isUseOuterUrl = $_POST['isUseOuterUrl']*1;\n if ($isUseOuterUrl=='1' && empty($_POST['ArticleModel']['outer_url'])) {\n $errMsg = '您没有填写url '.$isUseOuterUrl;\n } elseif ($isUseOuterUrl=='0' && empty($_POST['ArticleModel']['content'])) {\n $errMsg = '您没有输入活动详情 '.$_POST['ArticleModel']['content'].$isUseOuterUrl;\n } else {\n $model->attributes = $_POST['ArticleModel'];\n if ($isUseOuterUrl==1) {\n //unset($_POST['ArticleModel']['content']);\n $model->content = '&nbsp;';\n } else {\n //unset($_POST['ArticleModel']['outer_url']);\n $model->outer_url = '';\n }\n $model->admin_id = Yii::app()->memberadmin->id;\n $model->admin_name = Yii::app()->memberadmin->name;\n\n // 查出第一张图片为封面图\n $imgpreg = '<img.*?src=\"(.*?)\">';\n $ret = preg_match($imgpreg, $_POST['ArticleModel']['content'], $matched);\n if ($ret) {\n $model->surface_url = $matched[1];\n }\n \n if ($model->save()) {\n // 未发布不产生url\n if ($model->status == ArticleModel::STATUS_PUBLISHED) {\n $model->visit_url = $this->createFanghuServerUrl('article/show', array(\n 'id'=>$model->id,\n 'sign'=> $model->makeSign($model->id),\n ));\n $model->save();\n\n // 如果是发布 增加统计记录\n //StasticArticleModel::addStastic($model, date('Y-m-d'));\n }\n // 增加操作日志\n ArticleOperLogModel::saveAnOper($model->id, 0, $model->status);\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n \n //$model->abstract = htmlspecialchars_decode(mb_substr(strip_tags($model->content), 0, 40));\n\n }\n $arrAttributeLabels = $model->attributeLabels();\n $form = $this->beginWidget('CSmartyValidatorJs', array(\n 'id' => 'actcms-form',\n 'enableClientValidation' => true,\n 'clientOptions' => array(\n 'validateOnSubmit' => false,\n 'validateOnChange' => true,\n ),\n ));\n foreach ($model->FormElements as $attributeName => $value) {\n $form->error($model, $attributeName);\n }\n\n $this->endWidget();\n $js = '';\n Yii::app()->getClientScript()->render($js,1);\n //报错信息处理\n $errMsg = $errMsg ? $errMsg : CHtml::errorSummary($model,'<i class=\"ace-icon fa fa-times\"></i>请更正以下错误');\n $this->smarty->assign(\"errormsgs\", CHtml::errorSummary($model));\n //render data\n $arrRender = array(\n 'modelName' => 'ArticleModel',\n 'attributes' => $model->getAttributes(),\n 'attributeLabels' => $arrAttributeLabels,\n 'FormElements'=>$model->FormElements,\n 'action' => 'Create',\n 'errormsgs' => $errMsg, //报错信息处理\n 'jsShell'=>$js,\n 'dataObj' => $model,\n 'isUseOuterUrl' => $isUseOuterUrl,\n 'arrType' => ArticleModel::$ARR_TYPE,\n 'arrStatus' => ArticleModel::$ARR_STATUS,\n 'domain_str' => Yii::app()->params['FanghuServerDomain'],\n );\n\n $this->smartyRender('actcms/create.tpl', $arrRender);\n }", "function createArticle() {\n \t/*return redirect('/home')*/\n \treturn view('/articles/create');\n }", "protected function sendNewArticle(){\n if (!empty($_POST['title'] && !empty($_POST['article']))) {\n $this->sendArticle();\n header('Location: index.php');\n }\n else {\n $this->prepareCreateArticle();\n }\n }", "public function create()\n {\n //创建文章页面\n\t return view('article/create');\n }", "public function post_article($title, $content, $blog_id, $image, $tags, $category_id)\n\t{\n\t\techo \"insert\";\n\t\t\n\t\t$query = \"INSERT INTO articles (title, content, blog_id, image, creation_date, edition_date, tags, category_id) VALUES(:title, :content, :blog_id, :image, CURDATE(), CURDATE(), :tags, :category_id )\";\n\t\t$instance = db::getInstance();\n\t\t$bdd = $instance->getConnect();\n\t\t\n\t\t$search = $bdd->prepare($query);\n\t\t$search->bindparam(\":title\", $title, PDO::PARAM_STR);\n\t\t$search->bindparam(\":content\", $content, PDO::PARAM_STR);\n\t\t$search->bindparam(\":blog_id\", $blog_id, PDO::PARAM_INT);\n\t\t$search->bindparam(\":category_id\", $category_id, PDO::PARAM_INT);\n\t\t$search->bindparam(\":image\", $image, PDO::PARAM_STR);\n\t\t$search->bindparam(\":tags\", $tags, PDO::PARAM_STR);\n\n\t\t$res = $search->execute();\n\t\tvar_dump($res);\n\t\tif($res != false)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function postNew()\n\t\t{\n\t\t\t\n\n\t\t\t$imagen = Input::file('img');\n\t\t\t$codigoIMG = str_random(5);\n\t\t\t$filename = date('Y-m-d-H-m-s').\"-\".$codigoIMG.\".jpg\";\n\t\t\t$article = $this->articleteRepo->newArticle($filename);\n\t\t\t$manager = new ArticleManager($article, Input::all());\n\n\n\t\t\n\t\t\tif($manager->save())\n\t\t\t{\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tImage::make($imagen->getRealPath())->save(public_path().'/blog/img/'.$filename);\n\t\t\t\t\n\t\t\t\treturn Redirect::to('/adminpanel')->with('message','New article created');\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\treturn Redirect::back()->withInput()->withErrors($manager->getErrors());\n\t\t\t}\n\n\t\t}", "public function testSetCreationArticle() {\n\n $obj = new Collaborateurs();\n\n $obj->setCreationArticle(true);\n $this->assertEquals(true, $obj->getCreationArticle());\n }", "public function store(Requests\\AdminArticleCreate $article)\n {\n $this->dispatch(new CreateArticle(\\Auth::user(), \\Input::get('title'), \\Input::get('text')));\n\n return \\Redirect::route('admin.article.index');\n }", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "public function saveArticle()\n {\n $article = new ArticlesList;\n $article->issue = Input::get('issue');\n $article->articleno = Input::get('articleNo');\n $article->language = Input::get('language');\n $article->articleHeading = Input::get(\"heading\");\n $article->author = Input::get(\"author\");\n\n //include the advertisement\n if (Input::hasFile('adImage')) {\n $fileName = Input::get('issue') . '-' . Input::get('articleNo') . '.' . Input::file('adImage')->getClientOriginalExtension();\n Input::file('adImage')->move(public_path() . '/Images/magazines/articles/' . Input::get('issue') . '/ads/', $fileName);\n $adImageLink = '/Images/magazines/articles/' . Input::get('issue') . '/ads/' . $fileName;\n $article->hasAd = true;\n $article->adImage = $adImageLink;\n }\n $status = $article->save();\n\n if ($status == true) {\n $article = new ArticleData;\n $article->issue = $_POST['issue'];\n $article->articleno = $_POST['articleNo'];\n\n $link = null;\n if (Input::hasFile('image')) {\n $fileName = Input::get('issue') . '-' . Input::get('articleNo') . '.' . Input::file('image')->getClientOriginalExtension();\n Input::file('image')->move(public_path() . '/Images/magazines/articles/' . Input::get('issue') . '/', $fileName);\n $link = '/Images/magazines/articles/' . Input::get('issue') . '/' . $fileName;\n Log::info($link);\n } else {\n return Redirect::back()->with('error', \"Image is required!\")->withInput();\n }\n\n $article->image = $link;\n $article->data = $_POST['data'];\n $status = $article->save();\n\n if ($status == true) {\n return Redirect::to('addarticle/' . Input::get('issue'))\n ->with('success', Input::get('articleNo') . ' added successfully!');\n } else {\n return Redirect::back()->with('error', 'Article not saved');\n }\n }\n return Redirect::back()->with('error', 'Article not saved');\n }", "public function store() {\n\n //\n try {\n $article = new Article;\n $article->title = Input::get('title');\n $article->description = Input::get('description');\n $article->category = Input::get('category');\n $article->open_at = Input::get('open_at');\n $article->status = Input::get('status');\n $article->lang = Input::get('lang');\n $article->meta_name = Input::get('meta_name');\n $article->meta_content = Input::get('meta_content');\n $article->meta_title = Input::get('meta_title');\n $article->h1 = Input::get('h1');\n\n $article->save();\n //create a corresponding tw/cn article at same time.\n $refLang = (Input::get('lang')=='tw') ? 'cn' : 'tw';\n $refArticle = new Article;\n $refArticle->title = Input::get('title');\n $refArticle->description = Input::get('description');\n $refArticle->category = Input::get('category');\n $refArticle->status = 0;\n $refArticle->lang = $refLang;\n $article->meta_name = Input::get('meta_name');\n $article->meta_content = Input::get('meta_content');\n $article->meta_title = Input::get('meta_title');\n $article->h1 = Input::get('h1');\n\n $refArticle->save();\n\n $refArticle->langRef = $article->id;\n $article->langRef = $refArticle->id;\n $refArticle->save();\n $article->save();\n\n return Redirect::to('admin/articles?category=' . Input::get('category') . '&lang=' . Input::get('lang'));\n }\n catch(Exception $e) {\n return Redirect::back()->withInput()->withErrors('新增失敗');\n }\n }", "function createArticle($fields)\n {\n return $this->articles()->create($fields);\n }", "public function createArticle() {\n\n\t\t$ArticleItem = new ArticleItem();\n\n\t\t$this->articles[] = $ArticleItem;\n\n\t\treturn $ArticleItem->getArticle();\n\n\t}", "public function store(CreateArticleRequest $request)\n {\n $input = $request->all();\n\n $article = $this->articleRepository->create($input);\n\n Flash::success('Article saved successfully.');\n\n return redirect(route('articles.index'));\n }", "public function testStoreNewWidgetArticle(): void\n {\n $token = $this->loginByEmail(self::ROLE_DEVELOPER[0], self::ROLE_DEVELOPER[1]);\n\n // Create data\n $data = [\n 'body' => 'body',\n 'button_text' => 'button_text',\n 'settings' => [\n 'completion_time' => '13',\n ]\n ];\n\n // Request\n $response = $this->post('api/cms/v1/widget-article?token=' . $token, $data);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n 'id',\n 'widget_type_id',\n 'body',\n 'button_text',\n 'settings_id',\n 'created_at',\n 'updated_at',\n 'widget_settings',\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $responseJSON['success']);\n $this->assertEquals(200, $responseJSON['code']);\n $this->assertEquals('Created new widget Article.', $responseJSON['message']);\n $this->assertCount(8, $data);\n $this->assertEquals(WidgetArticle::getWidgetTypeId(), $data['widget_type_id']);\n $this->assertEquals('body', $data['body']);\n $this->assertEquals('button_text', $data['button_text']);\n }", "public function create()\n {\n return view('admin.article.create');\n }", "public function create()\n {\n return view('admin.article_create');\n }", "public function createArticle($t, $a, $c, $v, $f) {\n date_default_timezone_set('PST');\n \n \n $date = date(\"Y-m-d H:i:s\");\n $this->title = $t;\n $this->author = $a;\n $this->content = $c;\n $this->visibility = $v;\n $this->featured = $f;\n $this->dateCreated = $date;\n\n $query = $this->db->prepare(\"INSERT INTO articles (title, author, content, created_at, featured, visibility) VALUES (?, ?, ?, ?, ?, ?)\");\n $query->bindValue(1, $this->title);\n $query->bindValue(2, $this->author);\n $query->bindValue(3, $this->content);\n $query->bindValue(4, $date);\n $query->bindValue(5, $this->featured);\n $query->bindValue(6, $this->visibility);\n \n try {\n $query->execute();\n }\n catch(PDOException $e) {\n return $e->getMessage();\n }\n \n return \"success\";\n }", "public function create()\n {\n return view('article.create');\n }", "public function create()\n {\n return view('article.create');\n }", "public function create()\n {\n return view('article.create');\n }", "function Create() {\n\t\t\tif ($this->__put($this->__name, FALS, FALSE, FALSE, Array('Content-Length'=>0)) == 200) return TRUE;\n\t\t\telse return FALSE;\n\t\t}", "private function createArticle(ArticleRequest $request){\n\n $article = \\Auth::user()->articles()->create($request->all());\n\n $this->syncTags($article, $request->input('tag_list'));\n\n return $article; \n }", "public function create()\n {\n $data['title'] = \"บทความของฉัน\";\n $data['subtitle'] = \"สร้างรายการใหม่\";\n\n return view('article.add', $data);\n }", "public function store(ArticlesFormRequest $request)\n {\n $article = new Article;\n $article->fill($request->all());\n $article->published = $request->get('published', false);\n $article->featured = $request->get('featured', false);\n $article->authenticated = $request->get('authenticated', false);\n $article->is_page = $request->get('is_page', false);\n $article->save();\n\n $article->permissions()->sync($request->get('permissions', []));\n if ($request->tags) {\n $article->tag(explode(',', $request->tags));\n }\n\n event(new ArticleWasCreated($article));\n\n flash()->success(trans('cms::article.store.success'));\n\n return redirect()->route('administrator.articles.index');\n }", "public static function store(ArticleRequest $request)\n {\n $article = New Article;\n $input=$request->all();\n $article->titre=$input['titre'];\n if (!isset($input['anonym'])){\n $article->auteur=$input['auteur'];\n } else {\n $article->auteur=\"Auteur anonyme\";\n }\n $article->contenu=$input['contenu'];\n $article->published_at=$input['published_at'];\n $article->presentation=$input['presentation'];\n $article->cat_id=$input['cat_id'];\n $article->relu=false;\n $article->save();\n\n $article->image = Article::saveFile($request,'image',\"Image_$article->id\");\n $article->fichier=Article::saveFile($request,'fichier',\"Article_$article->id\");\n $article->save();\n\n return redirect('/')->with('message','Merci d\\'avoir publié cet article ! Il sera mis en ligne au plus tôt.');\n }", "public function create(): bool\n {\n return true;\n }", "public function isNew()\n {\n return false;\n }", "public function store()\n {\n $article = Article::create($this->validateRequest());\n $this->storeImage($article);\n return redirect('articles');\n }", "public function run()\n {\n //\n if (articles::count() == 0){\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_1',\n 'img' => 'article_1',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_2',\n 'img' => 'article_2',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_3',\n 'img' => 'article_3',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_4',\n 'img' => 'article_4',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_5',\n 'img' => 'article_5',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_6',\n 'img' => 'article_6',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_7',\n 'img' => 'article_1',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_8',\n 'img' => 'article_2',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_9',\n 'img' => 'article_3',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_10',\n 'img' => 'article_4',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_11',\n 'img' => 'article_5',\n ]);\n articles::create([\n 'title' => 'Duis vehicula nunc dictum risus faucibus, ut dictum tellus adipiscing',\n 'text' => 'Vivamus ipsum eros, sollicitudin non neque nec, varius ultricies sem. Quisque leo justo, tincidunt quis consequat interdum, posuere nec dolor. Praesent interdum, augue et hendrerit tincidunt, dolor purus lobortis urna, ac sagittis turpis magna eu sem. Proin pretium, metus eu dictum fermentum, turpis magna hendrerit lacus, sed lacinia tellus eros sed nibh. Aliquam erat volutpat. Nullam eu tempor velit, sed imperdiet nibh.\n\nEtiam nibh libero, tempor ac mi sit amet, maximus rutrum ipsum. Duis facilisis tellus justo, sed venenatis ligula porta a. Integer id enim urna. Aenean id tortor convallis, elementum magna non, faucibus nulla.\n\nFusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\nMauris in aliquam velit, sed fringilla dui.\nProin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.\n\n1.Fusce sapien quam, ultrices eget bibendum at, laoreet eu justo.\n2.Mauris in aliquam velit, sed fringilla dui.\n3.Proin imperdiet rhoncus cursus.\nMauris diam enim, dictum non lacus at, faucibus vestibulum neque. Mauris tempus sem ac blandit molestie. Ut fermentum, diam scelerisque blandit vestibulum, est dolor fermentum odio, in ullamcorper nunc ante id velit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean a odio neque. Vestibulum ac pulvinar nulla. Nulla aliquam porttitor est, condimentum finibus libero eleifend volutpat.',\n 'desc' => 'Sed porta, nulla nec tincidunt viverra, est dui lobortis erat, ut euismod dui massa eget ipsum. Integer a lobortis mauris. In quis lectus sem. Nullam sagittis pellentesque ligula, eget elementum nibh consectetur in. Maecenas convallis accumsan hendrerit. Donec a augue velit.',\n 'alias' => 'article_12',\n 'img' => 'article_6',\n ]);\n }\n }", "public function add(){\n $article = ArticleFormValidation::getData();\n $add = null;\n \n if(!is_null($article)){\n $add = $this->model->add($article);\n }\n if($add){\n $msg = \"Article successfully added\";\n }else{\n $err = \"Error adding article\";\n }\n include 'views/article-form.php';\n }", "private function createArticle(Requests\\ArticleRequest $request)\n {\n $article = new Article($request->all());\n \n \\Auth::user()->articles()->save($article);\n \n $this->syncTags($article, $request->input('tag_list'));\n \n return $article;\n }", "public function store(Request $request)\n {\n //save a new article\n $article = new Articles;\n $article->title = $request->input('title');\n $article->description = $request->input('description');\n $article->author = $request->input('author');\n if($article->save()){\n return ArticlesApiResource($article);\n }else{\n return false;\n }\n }", "public function create() {\n\t\treturn view('articles.create');\n\t}", "function add_news($data) {\n if ($this->db->insert('news', $data)) {\n return TRUE;\n }\n }", "public function create()\n\t{\n\t\t//\n\t\treturn \\View::make('specialties.articles.create');\n\t}", "public function create() {\n\n //\n return View::make('admin.articles.create');\n }", "public function store(Request $request)\n {\n Gate::authorize(PermissionEnum::AddArticle);\n\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string|between:3,200',\n 'excerpt' => 'string|max:200|nullable',\n 'body' => 'required|string',\n 'image' => 'image|nullable',\n 'is_pinned' => 'nullable',\n ]);\n\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 400);\n }\n\n $article = new Article;\n $article->uuid = Str::uuid();\n\n $this->updateArticle($request, $article);\n\n return response()->json(ArticleResource::make($article), 201);\n }", "public function create()\n {\n $title = Input::get('title');\n $text = Input::get('text');\n $tags = '<p><b>';\n $article = new App\\News;\n $article->title = strip_tags($title, $tags);\n $article->text_news = strip_tags($text, $tags);\n $article->created_at = new \\DateTime();\n $article->save();\n $last = App\\News::orderby('id', 'desc')->first();\n $last['url'] = IndexController::translitURL($last['title']);\n $last['created'] = IndexController::restyleDate($last['created_at']);\n\n return ['article'=>$last];\n }", "private function isNew()\n {\n return true;\n }", "public function isNew() {}", "public function create()\n {\n return view('article.addArticle');\n }", "public function store(ArticleAdd $request)\n {\n $data = $request->except('_token');\n $data['url'] = '';\n try {\n Article::create($data);\n } catch (\\Exception $e) {\n error_info();\n }\n success_info();\n }", "public function insertArticleAction() {\n $requiredParams = ['author', 'text'];\n if ($params = __request::checkParams($requiredParams)) {\n $article_id = $this->datasource->insertArticle($params['author'], $params['text']);\n\n return ['id' => $article_id];\n }\n\n __::bad_request('Missing parameters');\n }", "public function create()\n {\n $articles = null;\n return view('article.create',compact('articles'));\n }", "public function store(ArticleCreateRequest $request)\n {\n $formInput = $this->formatRequestInput($request);\n\n // Store the New article\n $fournisseur = Article::create($formInput); // $request->input()\n\n // Sessions Message\n $request->session()->flash('msg_success',__('messages.modelSaved', ['modelname' => 'Article'] ));\n\n return redirect()->action('ArticleController@index');\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}" ]
[ "0.7101365", "0.7055585", "0.7008658", "0.691531", "0.6909122", "0.67142475", "0.6642268", "0.6641754", "0.66194713", "0.65755147", "0.65549445", "0.65533096", "0.6506585", "0.6484604", "0.64811873", "0.6461899", "0.6457859", "0.64474726", "0.6422754", "0.64218986", "0.6414208", "0.64117026", "0.64059806", "0.6391342", "0.63899845", "0.63827443", "0.63760304", "0.6368366", "0.63638616", "0.6352876", "0.63488567", "0.6347917", "0.63362634", "0.6323138", "0.63143", "0.63143", "0.6312653", "0.6306379", "0.63015354", "0.6299558", "0.62923765", "0.6290317", "0.6287354", "0.6287354", "0.6285054", "0.6283504", "0.6283504", "0.62789917", "0.62730217", "0.6272491", "0.62605065", "0.62539256", "0.6240611", "0.62358344", "0.6233695", "0.62239814", "0.62057215", "0.6202552", "0.6197354", "0.6194443", "0.6193629", "0.6186296", "0.6182385", "0.61793053", "0.6175932", "0.6171362", "0.6170837", "0.61642593", "0.6163428", "0.6159548", "0.61576754", "0.6156574", "0.6156574", "0.6156574", "0.6152763", "0.6149088", "0.6141711", "0.61354095", "0.61339426", "0.6133843", "0.6133107", "0.612442", "0.6123739", "0.61175853", "0.6116851", "0.6116626", "0.611568", "0.61072844", "0.6105192", "0.60962677", "0.6091452", "0.60892576", "0.60889715", "0.6085772", "0.6078153", "0.60739005", "0.60693556", "0.60615456", "0.60569155", "0.6054969" ]
0.6422178
19
/ Updates existing article
public function update_article($request, $status_id = 1) { $this->title = $request['title']; $this->preview = $request['preview']; $this->img = $request['imgUrl']; $this->content = $request['articleContent']; $this->status_id = $status_id; if($this->update()){ if(!is_null($request['category_'])) { if($this->categories()->sync($request['category_'])) { $msg = new Article_Reject_Messages; if(!is_null($msg->all()->where('article_id', $this->id)->first())) $msg->all()->where('article_id', $this->id)->first()->delete(); return true; } else { return false; } } else { $this->categories()->detach(); return true; } } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($article);", "public function update()\n {\n update($this->id, $article);\n }", "public function update(Request $request) {\n $id = $request->get(\"id\");\n $result = false;\n $this->validate($request, [\n 'title' => 'required|max:255',\n ]);\n if ($id == 0) {\n $articles = new Articles();\n $articles->title = $request->title;\n $articles->save();\n } else {\n $articles = Articles::findOrFail($id);\n if ($articles) {\n $articles->published = $request->published ? $request->published : 0;\n }\n }\n //get alias\n if (!$request->alias == '') {\n $articles->alias = $request->alias;\n } else {\n $articles->alias = str_slug($request->title, '-');\n }\n $result = $articles->update($request->all());\n\n if ($result) {\n Session::flash('success', 'Article saved successfully!');\n } else {\n Session::flash('error', 'Article failed to save successfully!');\n }\n if ($articles && $articles->id) {\n return redirect('admin/articles/edit/' . $articles->id);\n }\n return redirect('admin/articles/create');\n }", "public function update(Request $request,$id, Article $article)\n {\n $article = Article::find($id);\n\n $article->content = $request->content;\n $article->user_name = $request->user_name;\n $article->save();\n return redirect()->route('article.show', ['id' => $article->id]);\n }", "public function actionUpdate()\n\t{\n\n\t\t//print_r (Yii::app()->user);\n\t\tif (Yii::app()->user->isAdmin){\n\t\t\t$this->layout = \"admin\";\n\t\t}\n\t\n\t\t$model=$this->loadarticles();\n\t\t$params=array('Articles'=>$model);\n//\t\tif(Yii::app()->user->checkAccess('updateOwnArticle',$params))\n//\t\t{\n//\t\t\t\n\t\t\tif(isset($_POST['Articles']))\n\t\t\t{\n\t\t\t\t$model->attributes=$_POST['Articles'];\n\t\t\t\tif($model->save()){\n\t\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t\t\t}\n\t\t\t}\n//\t\t}else{\n//\t\t\techo \"no permissions\";\n//\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function editAction($id){\n // Checking a for a valid csrf token\n if ($this->request->isPost()) {\n if (!$this->security->checkToken()) {\n //if the csrf token is not valid, end the algorithm here\n return;\n }\n }\n\n //find the article based on the supplied id\n $article = Article::findFirst(['id = ?0', 'bind' => [$id]]);\n\n // Getting a request instance\n $request = new Request();\n\n //if the request is a post perform an update on the record, else prepare the view\n if ($request->isPost()) {\n\n //map the post data to the db record and update it\n $article->title = $this->request->getPost('title');\n $article->summary = $this->request->getPost('summary');\n $article->content = $this->request->getPost('content');\n $article->creationDate = $this->request->getPost('creationDate');\n\n\n //try to update the article, if it fails let the user know what went wrong\n if(!$article->update()){\n //get all the validationErrors and store them in the flashSessions\n foreach ($article->getMessages() as $message) {\n //append the validation errors to the flash session\n $this->flashSession->error($message);\n }\n\n //make sure to pass the article object back to the view because it still requires this object\n $this->view->setVar('article', $article);\n return;\n }\n\n //let the user know the article was updated successfully\n $this->flashSession->message('message', 'The article has successfully been updated');\n\n //just redirect to the article overview\n return $this->response->redirect(\"/article\");\n\n }else{\n //Prepare the edit view\n $this->view->setVar(\"article\" , $article);\n }\n }", "public function update($article , createArticleRequest $request)\n\t{\t\n\t\t\n\t\t$article->created_at = Carbon::now();\n\t\t$article->update($request->all());\n\n\t\tflash()->overlay('Your article has been updated', 'Thank you');\n\n\t\treturn redirect('article');\n\t}", "public function update(Request $request, Article $article)\n {\n \t$this->authorize('update', $article);\n\t $this->validate($request, ['title'=>'required|max:60|min:3', 'content'=>'required']);\n\n//\t\t\t$article = Article::find($id);\n\t\t\t$article->title = request('title');\n\t\t\t$article->content = request('content');\n\t\t\t$article->save();\n\n\t\t\treturn redirect(\"/article/$article->id\");\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n //\n }", "public function update(Article $article) {\n\n // $article = instance of Article class (not a number!!!)\n\n // $article = Article::findOrFail($article); // we move to route model binding\n\n // $validatedAttributes = request()->validate([\n // 'title' => 'required|min:3',\n // 'excerpt' => 'required',\n // 'body' => ['required', 'max:255']\n // ]); \n\n // 1st way\n\n // $article = Article::find($article->id ); // must be number\n // $article->title = request('title');\n // $article->excerpt = request('excerpt');\n // $article->body = request('body');\n\n // $article->save(); // applicate in database to store the record\n\n\n // 2nd way\n // update() from Laravel model\n\n $article->update($this->validateArticle());\n\n\n return redirect( route('articles.show', $article) );\n \n }", "public\n function update(Request $request, Article $article)\n {\n $article->title = $request->title;\n $article->body = $request->body;\n $article->save();\n\n Cache::forget('article:'.$article->id);\n Cache::forget('article:all');\n\n return redirect(route('article.index'));\n }", "public function modifyArticle() {\n \n $article = ArticleFormValidation::getData();\n $mod = false;\n if(!is_null($article)){\n $mod = $this->model->modify($article);\n }\n if($mod){\n $msg = 'Article updated correctly';\n }else{\n $err = 'Error updating article';\n }\n include 'views/article-form.php';\n }", "public function update(UpdateArticleRequest $request, Article $article)\n {\n\n $article->fill($request->validated());\n// $article->title = $request->input('title');\n// $article->body = $request->input('body');\n $article->save();\n return response()->redirectToRoute('articles.index');\n }", "public function update(StoreArticleRequest $request)\n {\n //\n $input = $request->except('id');\n $input['intro']=mb_substr($request->get('content'),0,46);\n \n $request->input('intro',mb_substr($request->get('content'),0,46));\n \n $article = Article::find($request->get('id'));\n $article->update($input);\n $article->tags()->sync($request->get('tag_list'));\n //dd($request->all());\n return redirect('/');\n }", "public function update(Article $article)\n { Article::update($this->validateArticle());\n\n redirect(route('articles.show', $article));\n\n }", "public function updateArticle($id, $article)\n {\n Db::update('article', $article, 'WHERE id = ?', array($id));\n }", "function update()\n {\n global $config;\n $query=file_get_contents(\"sql/updateArticle.sql\"); \n $query =sprintf($query, $config->prefix.self::$table); \n $query = $config->sql->prepare($query);\n $param=array(\n $this->title, $this->content, $this->lang, $this->date,\n $this->cat, $this->id, $this->lang\n );\n $result=$query->execute($param);\n if ($result) {\n return true;\n } else {\n print_r($query->errorInfo());\n }\n \n }", "public function edit(Article $article)\n {\n //\n }", "public function edit(Article $article)\n {\n //\n }", "public function edit(Article $article)\n {\n //\n }", "public function edit(Article $article)\n {\n //\n }", "public function edit(Article $article)\n {\n //\n }", "public function update($id , Request $request){\n \n $articles = Articles::findOrFail($id);\n $articles->update($request->all());\n \n return redirect('articles');\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $article = Articles::findFirstByid($id);\n if (!$article) {\n $this->flash->error(\"article does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article->id = $this->request->getPost(\"id\");\n $article->title = $this->request->getPost(\"title\");\n $article->slug = $this->request->getPost(\"slug\");\n $article->content = $this->request->getPost(\"content\"); \n $article->isPublished = $this->request->getPost(\"isPublished\"); \n\n if (!$article->save()) {\n\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"edit\",\n \"params\" => array($article->id)\n ));\n }\n\n $this->flash->success(\"article was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }", "public function update($id)\n\t{\n $input = Input::all();\n $article = Article::find($id);\n unset($input['_method']);\n unset($input['_token']);\n $article->name = $input['name'];\n $article->description = $input['description'];\n $article->price = $input['price'];\n $article->total_in_shelf = $input['total_in_shelf'];\n $article->total_in_vault = $input['total_in_vault'];\n $article->store_id = $input['store_id'];\n $article->update();\n \n return Redirect::route('services.show', $id);\n\t}", "public function update(Request $request)\n {\n $article = Article::find($request->id);\n $article->title = $request->title;\n $article->category_id = $request->category_id;\n $article->text = $request->text;\n if ($article->save()) {\n return redirect()->route('adminArticleIndex')->with('status', 'Article id:'.$request->id.' update successful!');\n }\n }", "public function update(Request $request, Article $article)\n {\n $validate = $request->validate([\n 'title'=>'required|string|max:500',\n 'content'=>'required'\n ]);\n $article->title = $request->title;\n $article->content = $request->content;\n if (Auth::user()->role_id == 1 || Auth::user()->role_id == 4) {\n $article->user_id = $request->user_id;\n }\n $article->save();\n\n return redirect(\"/articles/\".$article->id);\n }", "public function editArticle(): void\n {\n $this->articleId = $_GET['editId'];\n $this->title = $_POST['titleArticle'];\n $this->content = $_POST['contentArticle'];\n $this->category = $_POST['categoryArticle'];\n $datetime = new DateTime();\n $this->editDate = $datetime->format('Y-m-d H:i:s');\n\n if ($this->image['tmp_name'] !== null) {\n $this->image = $_FILES['imageArticle'];\n $tmp_file = $this->image['tmp_name'];\n $type_file = $this->image['type'];\n\n $temp = explode(\".\", $this->image['name']);\n $name_file = round(microtime(true)) . '.' . end($temp);\n\n $destination = 'application/views/images/';\n\n if (!is_uploaded_file($tmp_file) === true) {\n exit(\"Le fichier est introuvable\");\n };\n if (!strstr($type_file, 'jpg') && !strstr($type_file, 'jpeg') && !strstr($type_file, 'bmp')) {\n exit(\"Le fichier n'est pas une image\");\n }\n if (preg_match('#[\\x00-\\x1F\\x7F-\\x9F/\\\\\\\\]#', $name_file)) {\n exit(\"Nom de fichier non valide\");\n } else if (!move_uploaded_file($tmp_file, $destination . $name_file)) {\n exit(\"Impossible de copier le fichier dans $destination\");\n } else {\n move_uploaded_file($tmp_file, $destination . $name_file);\n }\n $this->articleModel->editImageOfArticle($name_file, $this->articleId);\n }\n\n $this->articleModel->editArticle($this->articleId, $this->title, $this->content, $this->category, $this->editDate);\n\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function update(ArticleAdd $request, $id)\n {\n //需求:添加成功后仍留在当前页面\n $data = $request->except('_token');\n $url = route('article.index').'?';\n $url.=$data['data'];\n //避免入库字段冲突\n unset($data['data']);\n try {\n Article::where('id', $id)->update($data);\n } catch (\\Exception $e) {\n error_info($e->getMessage());\n }\n success_info($url);\n }", "public function update(Request $request, $id)\n {\n \n //// $article->title = $request->title;\n //// $article->subject = $request->subject;\n //// $article->save();\n\n Article::find($id)->update([\n 'title' => $request->title,\n 'subject' => $request->subject\n ]);\n\n return redirect('/article');\n }", "public function update(ArticleRequest $request, $id)\n {\n $data = $request->all();\n if ($image = $request->file('image')) {\n $image_pass = $image->getRealPath();\n // Cloudinaryへアップロード\n Cloudder::upload($image_pass, null);\n list($width, $height) = getimagesize($image_pass);\n // 直前にアップロードした画像のユニークIDを取得します。\n $image_id = Cloudder::getPublicId();\n // URLを生成します\n $imageUrl = Cloudder::show($image_id, [\n 'width' => $width,\n 'height' => $height\n ]);\n }\n \n $article = Article::findOrFail($id);\n $auth_id = Auth::id();\n\n $article->user_id = $auth_id;\n $article->title = $request->title;\n $article->image = $imageUrl;\n $article->img_article = $request->img_article;\n $article->movie_link = $request->movie_link;\n $article->movie_link2 = $request->movie_link2;\n $article->movie_link3 = $request->movie_link3;\n $article->movie_link4 = $request->movie_link4;\n $article->movie_link5 = $request->movie_link5;\n $article->movie_link6 = $request->movie_link6;\n $article->movie_link7 = $request->movie_link7;\n $article->movie_link8 = $request->movie_link8;\n $article->movie_link9 = $request->movie_link9;\n $article->movie_link10 = $request->movie_link10;\n $article->comment = $request->comment;\n $article->method = $request->method;\n $article->phrase = $request->phrase;\n $article->goal = $request->goal;\n\n $article->save();\n\n \n // $article->update($request->validated());\n // dd($article);\n return redirect()->route('articles.index');\n\n // $rules = [\n // 'title' => 'required',\n // 'method'=> 'required',\n // 'phrase' => 'required',\n // 'goal'=> 'required',\n // ];\n\n // $validated = $this->validate($request, $rules);\n\n // Article::create($validated);\n // return redirect('articles')>with('message', '編集しました。');\n }", "public function UpdateArticle(array $data)\n {\n $query = \"UPDATE articles SET title = '\" . $this->escape($data['title']) . \"', text = '\" . $this->escape($data['text']) . \"' WHERE id='\" . (int)$data['id'] . \"'\";\n $this->query($query);\n\n }", "public function edit($id){\n $data = array(\n \"title\" => $this->input->post('input_title'),\n \"category_id\" => $this->input->post('input_category'),\n \"content\" => $this->input->post('input_content')\n );\n \n $this->db->where('id', $id);\n $this->db->update('articles', $data); // Untuk mengeksekusi perintah update data\n }", "public function update($id, CreateArticleRequest $request) {\n\t\t$article = $this->article->update($id, $request->all());\n\t\tif ($article) {\n\t\t\treturn redirect()->action('ArticlesController@show', [$article['slug']]);\n\t\t}\n\t\t//error\n\t}", "public function update(Request $request, $id)\n {\n $articles = Article::find($id)->update($request->all());\n if ($articles) {\n Session::flash(\"notice\",\"Article Updated!!\");\n return redirect()->route('articles.show',$id);\n } else {\n Session::flash(\"error\",\"Failed to update!!\");\n return redirect()->route('articles.show',$id);\n }\n \n \n }", "public function update(ArticleRequest $request, $id)\n {\n $post = \\App\\Models\\Post::find($id);\n $this->authorize('update', $post);\n\n $post->post_name = request('name');\n $post->post_title = request('title');\n $post->post_content = request('content');\n $post->updated_at = now();\n $post->save();\n //$post->update($request->all());\n return redirect()->route('article.show', $post->post_name);\n }", "public function update($id) {\n\n //\n try {\n $article = Article::find($id);\n\n $article->title = Input::get('title');\n $article->description = Input::get('description');\n $article->category = Input::get('category');\n $article->open_at = Input::get('open_at');\n $article->status = Input::get('status');\n $article->meta_name = Input::get('meta_name');\n $article->meta_content = Input::get('meta_content');\n $article->meta_title = Input::get('meta_title');\n $article->h1 = Input::get('h1');\n\n $article->save();\n\n return Redirect::to('admin/articles?category=' . Input::get('category') . '&lang=' . Input::get('lang'));\n }\n catch(Exception $e) {\n return Redirect::back()->withInput()->withErrors('修改失敗');\n }\n }", "function modifierArticle($data){\n global $connexion;\n $requete = $connexion -> prepare('\n UPDATE articles\n SET \n title = :title, \n modified_at = NOW(),\n introduction = :introduction, \n content = :content, \n image_url = :image_url, \n category_id = :category_id\n WHERE \n id = :id');\n $requete -> execute([\n ':title' => $data['title'],\n ':introduction' => $data['introduction'],\n ':content' => $data['content'],\n ':image_url' => $data['image_url'],\n ':category_id' => $data['category_id'],\n ':id' =>$data['id']\n ]);\n \n header('location:article.php?id='.$data['id'].'');\n\n}", "public function update($id)\n\t{\n\t\t$input = Input::all();\n\t\t$article = Article::find($id);\n\n\t\t$validator = Article::validateUpdate($input, $article->id);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::to('/news/'.$article->id.'/edit/')->withInput($input)->withErrors($validator);\n\t\t}\n\n\t\t$article->subject = $input['subject'];\n\t\t$article->body = $input['body'];\n\t\t$article->save();\n\n\t\treturn Redirect::to('/news/');\n\t}", "public function update(Request $request, Article $article)\n {\n Gate::authorize(PermissionEnum::EditOwnArticle, $article);\n\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string|between:3,200',\n 'excerpt' => 'string|max:200|nullable',\n 'body' => 'required|string',\n 'image' => 'image|nullable',\n 'is_pinned' => 'nullable',\n ]);\n\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 400);\n }\n\n $this->updateArticle($request, $article);\n\n return response()->json(ArticleResource::make($article), 201);\n }", "private function updateArticle(Request $request, Article $article) {\n $article->title = $request->title;\n $article->body = $request->body;\n $article->user()->associate($request->user());\n\n if ($request->has('excerpt')) {\n $article->excerpt = $request->excerpt;\n }\n\n if ($request->has('is_pinned') && UtilsHelper::isBoolean($request->is_pinned) && $request->user()->tokenCan(PermissionEnum::PinArticle)) {\n $article->is_pinned = boolval($request->is_pinned);\n }\n\n if ($request->hasFile('image') && $request->file('image')->isValid()) {\n if(Storage::exists($article->image_location . '/' . FileHelper::getModelImage($article))) {\n Storage::delete($article->image_location . '/' . FileHelper::getModelImage($article));\n }\n $article->image_extension = $request->image->extension();\n $request->image->storeAs($article->image_location, FileHelper::getModelImage($article));\n }\n\n $article->save();\n }", "public function update(Request $request)\n {\n $article=Article::Where('id',$request->id)->update([\n 'catagory_id'=>$request->catagory,\n 'title'=>$request->title,\n 'content'=>$request->content,\n 'created_by'=>$request->author, \n 'status'=>$request->status\n ]);\n return redirect('article')->with('update','berhasil update article'); \n }", "public function update($name, Requests\\ArticleRequest $request)\n {\n $article = Article::where('excerpt', $name)->first();\n\n $article->update($request->all());\n\n return redirect('/articles');\n }", "public function update(Request $request, Article $article)\n {\n abort_if($article->user_id != auth()->id(), 403);\n\n $validData = $request->validate($this->validation_rules);\n\t\t$article->title = $validData['title'];\n $article->category_id = $validData['category_id'];\n $article->desc = $validData['desc'];\n $article->price_per_day = $validData['price_per_day'];\n $article->price_per_week = $validData['price_per_week'];\n $article->city = $validData['city'];\n $article->images_url = $validData['images_url'];\n $article->save();\n\n\t\treturn redirect('/articles/' . $article->id . '/edit')->with('status', 'Artikeln är uppdaterad!');\n\n }", "public function update(Request $request, $id)\n {\n //validate the data\n $this->validate($request,array('title'=>'required','content'=>'required'));\n //find the article id\n $articles = Article::find($id);\n //match input\n $articles->title = $request->input('title');\n $articles->content = $request->input('content');\n //save it\n $articles->save();\n //flash message\n //Session:flash('flash_message','Article is saved');\n //back to showpage\n return redirect()->route('backend.article.show',$articles->id);\n }", "public function update(Request $request, $id)\n {\n request()->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);\n Article::find($id)->update($request->all());\n return redirect()->route('articles.index')\n ->with('success','Article updated successfully');\n }", "public function update($id)\n\t{\n\t\t$target_id = Input::all()[\"target_id\"];\n\t\t$article1 = Article::find($id);\n\t\t$article2 = Article::find($target_id);\n\t\t$temp = clone $article1;\n\n\t\t$article1->title = $article2->title;\n\t\t$article1->text = $article2->text;\n\t\t$article1->text_autocomplete = $article2->text_autocomplete;\n\t\t$article1->save();\n\n\t\t$article2->title = $temp->title;\n\t\t$article2->text = $temp->text;\n\t\t$article2->text_autocomplete = $temp->text_autocomplete;\n\t\t$article2->save();\n\n\t\treturn Redirect::to('article/'.$id);\n\t}", "public function update(ArticleRequest $request, $id)\n {\n $data = array_merge($request->all(), [\n 'last_user_id' => \\Auth::id()\n ]);\n\n $art = $this->article->update($id, $data);\n $sou_data = [\n \"pid\"=> $art->id,\n \"category_id\"=>$data[\"category_id\"],\n \"user_id\"=>$data['last_user_id'],\n \"slug\"=>$art->slug,\n \"title\"=>$data['title'],\n \"page_image\"=>$data['page_image'],\n \"subtitle\"=>$data['subtitle'],\n \"meta_description\"=>$data['meta_description'],\n \"content\"=>$data[\"content\"],\n \"updated_at\"=>strtotime($data[\"published_at\"]),\n ];\n Xunsearch::edit($sou_data);\n\n $this->article->syncTag(json_decode($request->get('tags')));\n\n return $this->noContent();\n }", "function update_article($db, $title, $category, $tags, $intro, $article)\n\t{\n\t\t$string_array = '';\n\n\t\t// Check whether tags is an array and its length.\n\t\tif(is_array($tags))\n\t\t{\n\t\t\tif(sizeof($tags) > 4)\n\t\t\t\tthrow new Exception('Tag Discription of this article is too long.');\n\t\t\t\t\n\t\t\t$string_array = implode(',', $tags);\n\t\t}\n\t\telse if(is_string($tags))\n\t\t\t$string_array = $tags;\n\t\telse\n\t\t\tthrow new Exception('Tag needs to be either an array or an array in string form.');\n\n\t\t// printf's parameters' %s must be surrounded with ''\n\t\t$sql = sprintf(\"UPDATE blog.articles SET category='%s', tags='%s', intro='%s', article='%s' WHERE title='%s'\",\n\t\t\t\t\t\tmysqli_real_escape_string($db, $category),\n\t\t\t\t\t\tmysqli_real_escape_string($db, $tags),\n\t\t\t\t\t\tmysqli_real_escape_string($db, $intro),\n\t\t\t\t\t\tmysqli_real_escape_string($db, $article),\n\t\t\t\t\t\tmysqli_real_escape_string($db, $title));\n\t\t$result = mysqli_query($db, $sql);\n\n\t\treturn $result;\t\n\t}", "public function update(ArticleRequest $request, $id) {\n //\n $data['title'] = $request->get('title');\n $data['body'] = $request->get('editor-markdown-doc');\n $data['manager_id'] = auth('manager')->id();\n $data['type'] = $request->get('editor-markdown-doc') ? 1 : 2;\n $this->repository->update($data, $id);\n flash()->success('文章更新成功');\n return redirect(route('admin.article.index'));\n }", "public function update(Request $request, $article)\n {\n $update = Article::find($article);\n\n $update->date = $request->date;\n $update->titre = $request->titre;\n $update->auteur = $request->auteur;\n $update->texte = $request->texte;\n $update->image = $request->file('image')->hashName();\n\n $update->save();\n $request->file('image')->storePublicly('images', 'public');\n return redirect()->back();\n }", "public function update($id, Requests\\ArticleRequest $request) {\n $article = Article::findOrFail($id);\n $article->update($request->all());\n \n flash()->success('Article has been updated!');\n return redirect('articles');\n }", "public function update(Request $request, $article_id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string|min:3|max:200',\n 'body' => 'required|min:3|max:2000',\n 'category_id' => 'required|integer'\n ]);\n\n if ($validator->fails()) {\n return $this->failResponse($validator->errors()->first() , 'Error in validation');\n }\n $isUpdated = $this->repository->update($article_id, $request->all());\n\n if ($isUpdated) {\n return $this->successResponse(null,'Article has been updated Successfully');\n }\n return $this->successResponse(null,'No data has been updated of Article.');\n\n }", "public function update(Request $request, Article $article)\n {\n $this->validate(request(), [\n 'title' => 'required|unique:articles',\n 'description' => 'required',\n 'category' => 'required'\n ]);\n $article->update([\n 'title' => $request->title,\n 'description' => $request->description\n ]);\n session()->flash('success', \"Article updated successfully\");\n\n return redirect(route('articles.index'));\n }", "public function update(ArticleRequest $request, Article $article)\n {\n\n //dd(get_class_methods( $this->articleManager));\n $this->articleManager->build($article, $request);\n\n return redirect()->route('articles.index')->with('warning', \"L'article a bien été modifié\");\n }", "public function testUpdateWidgetArticle(): void\n {\n $token = $this->loginByEmail(self::ROLE_DEVELOPER[0], self::ROLE_DEVELOPER[1]);\n\n // Create data\n $data = [\n 'body' => 'body',\n 'button_text' => 'button_text',\n 'settings' => [\n 'completion_time' => '13',\n ]\n ];\n\n // Request\n $response = $this->put('api/cms/v1/widget-article/1?token=' . $token, $data);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n 'id',\n 'widget_type_id',\n 'body',\n 'button_text',\n 'settings_id',\n 'created_at',\n 'updated_at',\n 'widget_settings',\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $responseJSON['success']);\n $this->assertEquals(200, $responseJSON['code']);\n $this->assertEquals('Updated the widget Article.', $responseJSON['message']);\n $this->assertCount(8, $data);\n $this->assertEquals(WidgetArticle::getWidgetTypeId(), $data['widget_type_id']);\n $this->assertEquals('body', $data['body']);\n $this->assertEquals('button_text', $data['button_text']);\n }", "public function update($id, CreateArticleRequest $request, Article $article)\n {\n \n $article_to_update = $article->find($id);\n $uploaded_image = $request->file('image_file');\n $parameter = $request->all();\n\n if (isset($uploaded_image)) {\n\n $ext = $uploaded_image->getClientOriginalExtension();\n $newImageName = $article_to_update->id . \".\" . $ext;\n\n $uploaded_image->move(\n base_path() . '/public/img/uploads/article/', $newImageName\n );\n Image::make(base_path() . '/public/img/uploads/article/' . $newImageName, array(\n 'width' => 170,\n 'height' => 120,\n ))->save(base_path() . '/public/img/uploads/article/' . $newImageName);\n unset($parameter['image_file']);\n $parameter['image'] = $newImageName;\n $article_to_update->update($parameter);\n\n } else {\n $parameter['image'] = $article_to_update->image;\n $article_to_update->update($parameter);\n } \n \n Session::flash('message', 'The article was successfully edited!.');\n Session::flash('flash_type', 'alert-success'); \n return redirect('articles');\n }", "public function update(ArticleRequest $request, $id)\n {\n $article = Article::find($id);\n $article->article = $request->article;\n $article->category_id = $request->category;\n $article->content = $request->content;\n $article->status = $request->status;\n $article->user_id = $request->author;\n if ($request->hasFile('image')) {\n $filename = time().\".\".$request->file('image')->getClientOriginalExtension();\n if ($article->image != 'article.jpg') {\n Storage::disk('article')->delete($article->image);\n Storage::disk('thumbnail')->delete($article->image);\n }\n Image::make($request->file('image'))->save(public_path('images/articles/' . $filename));\n Image::make($request->file('image'))->resize(350, 183)->save(public_path('images/thumbnails/' . $filename));\n $article->image = $filename;\n } else {\n $article->image = $article->image;\n }\n $article->slug = slug_th($request->article);\n $article->save();\n $article->tags()->sync($request->tags, true);\n return back()->with([\n 'alert' => 'alert-success',\n 'message' => 'บันทึกข้อมูลเรียบร้อย!',\n ]);\n }", "public function saveArticle(Article $article) {\n if ($article->getId() === 0 ||$article->getId() == null) {\n $request = DB::getInstance()->prepare(\"\n INSERT INTO articles(title, content, user_fk) VALUES (:title, :content, :user_fk)\n \");\n\n $request->bindValue(':title', $article->getTitle());\n $request->bindValue(':content', $article->getContent());\n $request->bindValue(':user_fk', $article->getUserFk());\n\n $request->execute();\n\n if ($request) {\n echo \"Article saved in DB\";\n }\n }\n\n // Else it's an update of the article\n else {\n $request = DB::getInstance()->prepare(\"\n UPDATE articles SET title = :title, content = :content, user_fk = :user_fk WHERE id = :id\n \");\n\n $request->bindValue(':title', $article->getTitle());\n $request->bindValue(':content', $article->getContent());\n $request->bindValue(':user_fk', $article->getUserFk());\n $request->bindValue(':id', $article->getId());\n\n $request->execute();\n\n if ($request) {\n echo \"Article updated\";\n }\n }\n\n }", "public function update(Request $request, $id)\n {\n $article = Article::findOrFail($id);\n $article->title = $request->input('title');\n $article->date = $request->input('date');\n $article->author = $request->input('author');\n $article->details = $request->input('details');\n $article->save();\n\n return redirect()->route('articles')->with('message', 'แก้ไขข้อมูลได้สำเร็จ');\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title_article' => 'required|min:6',\n 'content_article' => 'required|min:50',\n ]);\n\n $article = Article::find($id);\n $article->user_id = auth()->id();\n $article->title_article = $request->title_article;\n $article->content_article = $request->content_article;\n $article->save();\n\n return redirect('article')->with('info', 'Update article successfully !');\n }", "public function update(ArticleEditFormRequest $request, $id)\n {\n\t\tif($request->hasFile('img')) { \n /*\n Unlike when a new page is created, when this page is being EDITED user doesnt \n have to upload a new file. Only validate If file is being uploaded (if detected)\n */\n $this->validate($request, [\n 'img' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n $image = $request->file('img');\n $newName = $request->get('slug'). '-' .time().'.'.$image->getClientOriginalExtension();\n $image->move(public_path('images'), $newName);\n\n } else {\n $newName = 'default-img.png'; \n }\n\n\n \n $article = Article::whereId($id)->firstOrFail();\n\n $article->title = $request->get('title');\n $article->content = $request->get('content');\n $article->h2 = $request->get('h2');\n // $article->img = $request->get('img');\n\t\t$article->img = $newName;\n $article->slug = Str::slug($request->get('title'), '-');\n\n\n $article->save();\n // Instead of creating a new savePages() method to save pages. we can sync them\n $article->pages()->sync($request->get('pages'));\n\n return redirect(action('Admin\\ArticlesController@edit', $article->id))\n ->with('status', 'The article has been updated!')\n ->with('article', $article);\n }", "public function update(Article $article, ArticleRequest $request)\n\t{\n\t\t$article->update($request->all());\n\n\t\treturn redirect('articles/'.$article->id);\n\t}", "public function update(ArticleRequest $request, $id)\n {\n $input=$request->all();\n $article=Article::find($id);\n $article->titre=$input['titre'];\n $article->auteur=$input['auteur'];\n $article->contenu=$input['contenu'];\n $article->presentation=$input['presentation'];\n $article->cat_id=$input['cat_id'];\n $article->relu=false;\n if(isset($input['image'])){\n $article->image = Article::saveFile($request,'image',\"Image_$id\");\n }\n $article->save();\n return redirect(\"/article/$id\")->with('message','Merci d\\'avoir édité cet article ! Il sera remis en ligne une fois relu');\n }", "public function update(ArticlesRequest $request, $id)\n {\n // update an article\n $article = Article::findOrFail($id);\n $article->title = $request->input('title');\n $article->body = $request->input('body');\n\n // create new image\n if ($file = $request->file('image')) {\n $name = uniqid('threedium_', true).'.'.$file->getClientOriginalExtension();\n \\Image::make($file)->save(public_path('images/').$name);\n $article->image = $name;\n }\n\n if ($article->update()) {\n return redirect()->back()->with('success', 'Article updated successfully!');\n }\n }", "public function update(Request $request, $id)\n {\n // 接受提交过来的数据\n $title = $request -> input('title','没有标题');\n $author = $request -> input('author','超级大坏哥');\n $content = $request -> input('editorValue','空内容');\n $article = Articles::find($id);\n $article -> title = $title;\n $article -> author = $author;\n $article -> content = $content;\n $res = $article -> save();\n if($res){\n return redirect('/admin/articles')->with('success','修改成功');\n }else{\n return back()->with('error','修改失败');\n }\n }", "public function update($id)\n\t{\n\t\tif ($this->validateArticleForm() === true)\n\t\t{\n\t\t\t$Article = $this->saveArticleProperties($id);\n\t\t\tif (!is_null($Article))\t$this->saveArticleDetail($Article);\n\t\n\t\t\t// redirect\n\t\t\tSession::flash('message', 'Successfully updated article!');\n\t\t\treturn Redirect::to('admin/articles');\n\t\t}else return $this->validateArticleForm();\n\t}", "public function update(Request $request, Article $article)\n {\n if(Auth::id() != $article->user_id){\n return abort(401);\n }\n\n $request->validate([\n 'title'=>'min:3|max:70|required',\n 'content'=>'min:50|required',\n 'categories'=>'required'\n ]);\n\n\n $article->update($request->all());\n\n $article->categories()->sync($request->categories);\n\n\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n // dd($request->all(), $id);\n $validator = Validator::make($request->all(), [\n 'title' => ['required', 'max:150'],\n 'content' => ['required']\n ]);\n\n if ($validator->fails()) {\n return redirect('article/' . $id . '/edit')\n ->withErrors($validator)\n ->withInput();\n }\n\n $article = Article::find($id);\n $url = $article->image;\n if ($request->hasFile('image')) {\n if ($request->file('image')->isValid()) {\n\n //second validation if image is exist\n $validator = Validator::make($request->all(), [\n 'image' => 'image|mimes:jpeg,png,jpg|max:3072',\n ]);\n\n if ($validator->fails()) {\n return redirect('article/' . $id . '/edit')\n ->withErrors($validator)\n ->withInput();\n }\n\n $imageName = time() . '.' . $request->image->extension();\n\n $request->image->storeAs('/public', $imageName);\n $url = Storage::url($imageName);\n\n //delete previous image if exist\n if ($article->image) {\n $getName = explode(\"/\", $article->image);\n Storage::disk('public')->delete($getName[2]);\n }\n }\n }\n\n $article->title = $request->title;\n $article->image = $url;\n $article->content = $request->content;\n $article->topic = $request->topic;\n $article->slug = Str::slug($request->title, '-');\n $article->user_id = Auth::id();\n $article->save();\n\n return redirect()->route('article.index')\n ->with('success', 'Article successfully updated');\n }", "public function update(Request $request, Article $article)\n {\n $attributes = $request->validate([\n 'title' => 'required',\n 'content' => 'required',\n 'slug' => 'required|unique:articles,slug',\n 'password' => 'nullable',\n 'private' => 'nullable',\n ]);\n\n $article->update($attributes);\n\n return redirect(route('articles.show', $article->id)); \n }", "public function update(ArticleRequest $request, $article)\n {\n $newArticle = $this->articleHandler($request, $article);\n\n // 跳转至文章展示页\n return redirect('article/'.($newArticle['url'] ? $newArticle['url'] : $newArticle['uuid']));\n }", "public function update(Request $request, Article $article)\n {\n $validatedData = $request->validate([\n 'title' => 'required|max:255',\n 'body' => 'required',\n 'category_id' => 'required|exists:categories,id',\n 'tags' => 'exists:tags,id'\n ]);\n $article->update($validatedData);\n $article->tags()->sync($request->tags);\n return redirect()->route('articles.index');\n }", "public function update(EditRequest $request, $id)\n {\n\n \n \n $articles = Article::find($id);\n if($request->hasFile('pic')){\n $pic = $request->file('pic');\n $fileName = time() . '.'.$pic->getClientOriginalExtension();\n // 'images/cars/' . $filename;\n if(Image::make($pic)->save(public_path('images/'.$fileName))){\n $articles->pic = $fileName;\n }\n }\n \n $articles->title = $request->title;\n $articles->datum = $request->datum;\n $articles->latLngLat = $request->latLngLat;\n $articles->latLngLng = $request->latLngLng;\n $articles->tijdstip = $request->tijdstip;\n $articles->text = $request->text;\n $articles->category_id = $request->input('category_id');\n \n $articles->user_id = Auth::user()->id;\n if( $articles->save()){\n session()->flash('success','Uw munchie werd aangepast!');\n return redirect('myarticles');\n }\n \n }", "public function update(ArticleRequest $request, $id)\n {\n $article = Article::findOrFail($id);\n $data = $request->all();\n $data['user_id'] = Auth::user()->id;\n $image = Input::file('image');\n if(isset($image)) {\n $imageName = time().'.'.$image->getClientOriginalExtension();\n $data['image'] = $imageName;\n $image->move(\"uploads\",$imageName);\n \n //delete old img\n if($article->image != '' && file_exists(\"uploads/\".$article->image)) {\n unlink(\"uploads/\".$article->image);\n }\n }\n $article->update($data);\n//<<<<<<< stefan_ristevski\n//=======\n \n // $tags = $request->input('tag');\n // if($request->input('tag') == null) {\n // $tags = [];\n // }\n // $article->tags()->sync($tags);\n \n//>>>>>>> master\n return redirect('article');\n }", "public function actionUpdate($id) {\n $updateModel = $this->loadModel($id);\n $oldStatus = $updateModel->status;\n if (isset($_POST['ArticleModel'])) {\n $isUseOuterUrl = $_POST['isUseOuterUrl']*1;\n if ($isUseOuterUrl=='1' && empty($_POST['ArticleModel']['outer_url'])) {\n $errMsg = '您没有填写url '.$isUseOuterUrl;\n } elseif ($isUseOuterUrl=='0' && empty($_POST['ArticleModel']['content'])) {\n $errMsg = '您没有输入活动详情 '.$_POST['ArticleModel']['content'].$isUseOuterUrl;\n } else {\n $updateModel->attributes = $_POST['ArticleModel'];\n if ($isUseOuterUrl=='1') {\n //$_POST['ArticleModel']['content'] = ' ';\n // 必须有内容 坑爹的yii\n $updateModel->content = '&nbsp;';\n } else {\n //$_POST['ArticleModel']['outer_url'] = '';\n $updateModel->outer_url = '';\n }\n //print_r($_POST);\n //print_r($updateModel->toArray());exit;\n\n //$updateModel->abstract = htmlspecialchars_decode(mb_substr(strip_tags($updateModel->content), 0, 40));\n\n // 查出第一张图片为封面图\n $imgpreg = '<img.*?src=\"(.*?)\">';\n $ret = 0;//preg_match($imgpreg, $updateModel->content, $matched);\n if ($ret) {\n $updateModel->surface_url = $matched[1];\n }\n \n // 未发布不产生url\n //if ($updateModel->status == ArticleModel::STATUS_PUBLISHED) {\n $updateModel->visit_url = $this->createFanghuServerUrl('article/show', array(\n 'id'=>$updateModel->id,\n 'sign'=> $updateModel->makeSign($updateModel->id),\n ));\n\n // 如果是发布 增加统计记录\n //StasticArticleModel::addStastic($updateModel, date('Y-m-d'));\n //} else {\n // $updateModel->visit_url = '';\n //}\n\n if ($updateModel->save()) {\n // 增加操作日志\n ArticleOperLogModel::saveAnOper($updateModel->id, $oldStatus, $updateModel->status);\n\n $this->redirect(array('view', 'id' => $updateModel->id));\n }\n }\n }\n $model = new ArticleModel;\n $arrAttributeLabels = $model->attributeLabels();\n $form = $this->beginWidget('CSmartyValidatorJs', array(\n 'id' => 'actcms-form',\n 'enableClientValidation' => true,\n 'clientOptions' => array(\n 'validateOnSubmit' => false,\n 'validateOnChange' => true,\n ),\n ));\n foreach ($model->FormElements as $attributeName => $value) {\n $form->error($model, $attributeName);\n }\n\n $this->endWidget();\n $js = '';\n Yii::app()->getClientScript()->render($js, 1);\n //render data\n $arrRender = array(\n 'primaryKey'=>'id',\n 'modelName' => 'ArticleModel',\n 'attributes' => $model->getAttributes(),\n 'attributeLabels' => $arrAttributeLabels,\n 'FormElements' => $model->FormElements,\n 'action' => 'Update',\n 'errormsgs' => CHtml::errorSummary($updateModel, '<i class=\"ace-icon fa fa-times\"></i>请更正以下错误'), //报错信息处理\n 'jsShell' => $js,\n 'model' => $updateModel,\n 'dataObj' => $updateModel,\n 'isUseOuterUrl' => $updateModel->outer_url ? 1 : 0,\n 'arrType' => ArticleModel::$ARR_TYPE,\n 'arrStatus' => ArticleModel::$ARR_STATUS,\n 'domain_str' => Yii::app()->params['FanghuServerDomain'],\n );\n\n $this->smartyRender('actcms/update.tpl', $arrRender);\n }", "public function update(ArticleRequest $request, $id)\n {\n $this->article->updateArticle($request->all(),$id);\n return redirect('article/homepage/'.getUser('webUser')->id);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n\t\t\t'title' => 'required|max:255|unique:article,id,'.$id,\n 'content' => 'required|max:60000',\n 'tag' =>'required',\n ]);\n //使用Purifier防止Xss注入\n $content = Purifier::clean($request->input('content'));\n\n $article = Article::find($id);\n $article->title = $request->input('title');\n $article->content = $content;\n $article->original_content = $request->input('content'); \n $article->user_id = $request->session()->get('admin')['id'];\n if(is_array($request->input('tag'))){\n $tag_id = ','.implode(',',$request->input('tag')).',';\n }\n $article->tag_id = $tag_id;\n $article->state = 1;\n\n if($article->save()){\n return Redirect::to('article/show/'.$id);\n }else{\n return Redirect::back()->withInput()->withError('修改失败');\n }\n }", "public function update_journal_article($id,$journal_id,$volume_number,$issue_number,$status,$month,$year,$article_title,$article_short_name,$article_type,$doi_number,$doi_link,$university_name,$country,$author_name,$pdf_link,$full_text_link,$full_text,$aabstract,$abstract_link,$supplimentary_link,$enter_keywords,$starting_page_number,$ending_page_number,$enter_issn){\n $sql49 = \"update articals set journal_id='$journal_id',artical_name='$article_title',artical_short_name='$article_short_name',artical_type_id='$article_type',artical_number='$issue_number',doi_number='$doi_number',doi_link='$doi_link',author_names='$author_name',university_name='$university_name',country_name='$country',pdf_link='$pdf_link',full_text_link='$full_text_link',artical_content='$full_text',abstract='$aabstract',abstract_link='$abstract_link',supplimentry_link='$supplimentary_link',keywords='$enter_keywords',starting_page_number='$starting_page_number',ending_page_number='$ending_page_number',issn_number='$enter_issn',volume_number='$volume_number',issue_number='$issue_number',modified_by=1,modified_on=NOW(),year='$year',month='$month',status='$status' where artical_id='$id'\"; \n $result49 = mysqli_query($this->db,$sql49);\n return $result49;\n }", "public function update(Request $request, Article $article)\n {\n $response = Gate::inspect('update', $article);\n\n if ($response->allowed()) {\n $this->validate(request(), [\n 'title' => 'required',\n 'short_description' => 'required',\n 'image' => 'nullable|image',\n 'content' => 'required'\n ]);\n\n $user = auth()->user();\n\n $image = null;\n $file = null;\n if($request->has('image')){\n $image = $this->uploadImage($request->image, Article::class);\n }else{\n $image = $article->image;\n }\n\n if($request->has('zip_files')){\n $file = $this->uploadeFilesAndZip($request->zip_files, Article::class);\n }else{\n $file = $article->file;\n }\n\n $data = [\n 'title' => $request->title,\n 'short_description' => $request->short_description,\n 'content' => $request->content,\n 'user_id' => $user->id,\n 'image' => $image,\n 'file' => $file,\n 'approved' => $user->role->id == 1 ? true : false\n ];\n\n $article->update($data);\n $article->categories()->sync($request->categories);\n\n return redirect()->route('articles.index');\n } else {\n return redirect()->back()->withErrors(['error' => $response->message()]);\n }\n\n }", "public function update(Request $request)\n {\n // Get article\n $article = Article::find($request->input('id'));\n\n if (!$article) {\n return response()->json(['message' => 'Not Found'], 404);\n }\n\n $article->title = $request->input('title');\n $article->body = $request->input('body');\n\n if ($article->save()) {\n return new ArticleResource($article);\n } else {\n return response()->json(['message' => 'Not Modified'], 304);\n }\n }", "public function modifyArticle(Article $article)\n\t{\n\t\t$req = $this->db->prepare('UPDATE articles SET article_number = :article_number, title = :title , content =:content WHERE id = :id ' );\n\n\t\t$modifiedArticle = $req->execute(array(\n\t\t\t\t'id'=>$article->getId(),\n\t\t\t\t'article_number'=>$article->getArticleNumber(),\n\t\t\t\t'title'=>$article->getTitle(),\n\t\t\t\t'content'=>$article->getContent()));\t\n\n\t\treturn $modifiedArticle;\n\n\n\t}", "public function update(ArticleRequest $request, Article $article)\n {\n\n $article->tags()->sync(request('tags'));\n\n $article->update($request->all());\n\n session()->flash('flash_message','The article has been updated');\n\n return redirect('articles');\n }", "public function update(Request $request, Article $article, $id)\n {\n //\n $this->validate(request(), [\n 'article_id' => 'required|exists:articles,id',\n 'size' => 'required',\n 'stock' => 'required|numeric'\n ]);\n\n $product = Product::find($id);\n $product->size = request('size');\n $product->stock = request('stock');\n $product->save();\n return redirect('/article/' . $product->article->id);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n ]);\n\n Article::find($id)->update($request->input());\n\n Session::flash('success', 'Successfully updated the article');\n\n return redirect()->route('article.index');\n }", "public function update(Request $request, $id)\n {\n $about=About::find($id);\n $about->title=$request->title;\n $about->description=$request->description;\n \n if($about->save()){\n return redirect()->action('Blog\\AboutController@index');\n } \n else{\n return redirect()->back();\n }\n}", "public function update(Request $request, MainArticle $mainArticle)\n {\n //\n }", "public function update(Request $request, Article $article)\n {\n $authCheck = Gate::allows('update-post', $article);\n\n if (!$authCheck) {\n return $this->failedAccessArticle();\n }\n \n $article->update($this->validateArticle());\n return redirect()->route('article.show', $article->id);\n }", "public function updateArticle($request)\n {\n $slug = $request->input('slug');\n $article = Article::where('slug', '=', $slug)->first();\n\n $article->title = $request->input('title');\n $article->article_category = $request->input('article_category');\n $article->content = $request->input('content');\n $article->description = $request->input('description');\n $article->est_time = $request->input('est_time');\n $article->status = $request->input('status');\n\n $tags = explode(\",\", $request->input('tags'));\n $tags = array_map(function ($tag) {\n return trim($tag);\n }, $tags);\n\n $article->tags = strtolower(json_encode($tags));\n\n $image = $request->file('main_image');\n\n if ($image) {\n $imageName = $this->uploadMainImage($image, $slug, $article->main_image);\n if ($imageName[\"success\"]) {\n $article->main_image = $imageName[\"result\"];\n $article->save();\n\n return [\n \"result\" => $article,\n \"success\" => true,\n ];\n }\n\n return [\n \"result\" => $imageName[\"result\"],\n \"success\" => false,\n ];\n }\n\n $article->save();\n\n return [\n \"result\" => $article,\n \"success\" => true,\n ];\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'title' => 'required',\n 'html_content' => 'required',\n 'all_pages' => 'required',\n 'page_id' => 'required',\n 'contentarea_id' => 'required',\n ]);\n\n $article = Article::findOrFail($id);\n\n $input = $request->all();\n\n $article->fill($input)->save();\n\n return redirect('articles');\n }", "public function update(Request $request, $id)\n {\n $article = new Article();\n $data = $this->validate($request, [\n 'content' => 'required',\n 'title' => 'required'\n ]);\n $data['id'] = $id;\n $article->updateArticle($data);\n\n return redirect('/home')->with('success', 'Updated');\n }", "public function update(Article $article, Request $request)\n {\n $article->updated_by_user_id = $request->user()->id;\n $this->article->update($article, $request->all());\n\n flash()->success(trans('core::core.messages.resource updated', ['name' => trans('pearlskin::articles.title.articles')]));\n\n return redirect()->route('admin.pearlskin.article.index');\n }", "public function update(Request $request,$id)\n {\n\n $article = Article::find($id);\n //获取提交的数据\n $input = $request->except('_token','file_upload');\n \n // return $input;\n //到数据库执行修改\n $article->art_title = $input['art_title'];\n $article->art_tag = $input['art_tag'];\n $article->art_thumb = $input['art_thumb'];\n //return($input['file_upload']); \n $article->art_description = $input['art_description'];\n $article->art_content = $input['art_content'];\n \n $res = $article->save();\n\n if ($res) {\n $data = [\n 'status'=>0,\n 'msg'=>'修改成功'\n ];\n } else {\n $data = [\n 'status'=>1,\n 'msg'=>'修改失败'\n ];\n }\n\n return $data;\n }", "function update($uid=null)\n { \n $data['title'] = $this->properti['name'].' | Administrator '.ucwords($this->modul['title']);\n $data['h2title'] = 'Edit '.$this->modul['title'];\n $data['main_view'] = 'article_form';\n\t$data['form_action'] = site_url($this->title.'/update_process');\n $data['link'] = array('link_back' => anchor($this->title,'Back', array('class' => 'btn btn-danger')));\n\n $data['language'] = $this->language->combo();\n $data['category'] = $this->category->combo();\n $data['source'] = site_url($this->title.'/getdatatable');\n \n $article = $this->Orders_model->get_by_id($uid)->row();\n\t$this->session->set_userdata('langid', $article->id);\n \n $data['default']['category'] = $article->category_id;\n $data['default']['language'] = $article->lang;\n $data['default']['title'] = $article->title;\n $data['default']['date'] = $article->dates;\n $data['default']['coment'] = $article->comment;\n $data['default']['front'] = $article->front;\n $data['default']['image'] = base_url().'images/article/'.$article->image;\n $data['default']['desc'] = $article->text;\n \n echo $article->title;\n \n $this->load->helper('editor');\n editor();\n \n $this->load->view('template', $data);\n }", "public function update(Requests\\AdminArticleCreate $article, $id)\n {\n $this->dispatch(new UpdateArticle($id, \\Input::get('title'), \\Input::get('text')));\n\n return \\Redirect::route('admin.article.index');\n }", "public function update($content);", "function update(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$cr = $_POST['creator'];\n\t\t\t\t$ti = $_POST['title'];\n\t\t\t\t$ty = $_POST['type'];\n\t\t\t\t$id = $_POST['identifier'];\n\t\t\t\t$da = $_POST['date'];\n\t\t\t\t$la = $_POST['language'];\n\t\t\t\t$de = $_POST['description'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\t\tif($conn){\n\t\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE eBook_MetaData SET creator='$cr', title='$ti', type='$ty', identifier='$id', date='$da', language='$la', description='$de' WHERE id='$i'\";\n\t\t\t\t\t$data = mysqli_query($conn, $sql);\n\n\t\t\t\t\tif(!$data){\n\t\t\t\t\t\techo \"error\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"data updated\";\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$conn = null;\n\t\t\t\t}", "public function update(Request $request, Articles $articles)\n {\n $request->validate([\n 'titre' => 'required|string|',\n 'color' => 'required|string|',\n 'contenu' => 'required|string|',\n 'photo' => 'required|image|',\n\n \n ]);\n \n $input = [];\n $input['titre'] = $request->input('titre');\n $input['color'] = $request->input('color');\n $input['contenu'] = $request->input('contenu');\n $input['last_article'] = $request->input('last_article');\n \n if ($image = $request->file('photo')) {\n $destinationPath = 'image/';\n $picture = date('YmdHis') . \".\" . $image->getClientOriginalExtension();\n $image->move($destinationPath, $picture);\n $input['photo'] = $picture;\n }else{\n unset($input['photo']);\n }\n \n $articles->where('id', $request->input('articleId'))->update($input);\n\n return redirect()->intended('articles')->with('success', 'La modification a été effectué avec succes');\n }" ]
[ "0.8498326", "0.8342315", "0.7180239", "0.7176034", "0.7151485", "0.71408445", "0.7139443", "0.7111768", "0.71114546", "0.71114546", "0.71114546", "0.71114546", "0.71114546", "0.7097515", "0.7096269", "0.7094928", "0.7038525", "0.70033896", "0.69610935", "0.6949009", "0.69428104", "0.69251186", "0.69251186", "0.69251186", "0.69251186", "0.69251186", "0.6908989", "0.689016", "0.6883778", "0.6883329", "0.683895", "0.6836565", "0.6826774", "0.67997634", "0.6797403", "0.67906207", "0.67838365", "0.6774727", "0.6756521", "0.67543566", "0.67246103", "0.67118555", "0.6707732", "0.66996026", "0.6678152", "0.6676352", "0.6674284", "0.6669928", "0.6663747", "0.6646898", "0.6644814", "0.66337115", "0.66019887", "0.6599363", "0.6597137", "0.6595233", "0.65894806", "0.65795845", "0.6578216", "0.6576307", "0.6574198", "0.65666", "0.6565718", "0.6564559", "0.6564131", "0.6558584", "0.6557804", "0.6535724", "0.65317214", "0.65248394", "0.65004236", "0.6499872", "0.649549", "0.6488685", "0.64775646", "0.6474963", "0.647191", "0.64661235", "0.64459205", "0.6445757", "0.6438383", "0.64313316", "0.6426459", "0.6416541", "0.6411928", "0.64106864", "0.64018", "0.6381457", "0.63787484", "0.637673", "0.63516414", "0.63508517", "0.63433844", "0.63422024", "0.6338442", "0.63363475", "0.63299245", "0.6321795", "0.6321638", "0.6316329", "0.6315576" ]
0.0
-1
/ Deletes existing article and all relations
public function delete_article() { if($this->categories->isEmpty()){ return $this->delete(); } else { /* * Deleting comments */ $this->comments()->delete(); if($this->categories()->detach()){ $msg = new Article_Reject_Messages; if(!is_null($msg->all()->where('article_id', $this->id)->first())) $msg->all()->where('article_id', $this->id)->first()->delete(); return $this->delete(); } else return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n // Deleting microarticles.\n $microarticles = $this->getMicroarticles();\n if (!empty($microarticles)) {\n foreach ($microarticles as $microarticle) {\n $microarticle->delete();\n }\n }\n\n // Deleting selfservices.\n $selfServices = $this->getSelfservices();\n if (!empty($selfServices)) {\n foreach ($selfServices as $selfService) {\n $selfService->delete();\n }\n }\n\n parent::delete();\n }", "public function delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}", "public function deleteArticle(int $id);", "public function deleteArticle(): void\n {\n $this->articleId = $_GET['deleteId'];\n\n $this->articleModel->deleteArticle($this->articleId);\n // Redirect to the articles list page\n Router::redirectTo('listArticles');\n exit();\n }", "public function deleted(Article $article)\n {\n //\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleted(Article $article)\n {\n $article->articles()->detach();\n }", "public function destroy(Article $article)\n {\n try{\n $article->delete();\n }catch(\\Exception $e){\n error_info($e->getMessage());\n }\n success_info();\n }", "public function delete($oneOrManyEntities): void;", "public function DeleteArticleRevisions() {\n\t\t\t$this->objArticleRevisions->Delete();\n\t\t}", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function destroy(Article $article)\n {\n //\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function deleteAction($id)\n{\n $em=$this->getDoctrine()->getManager();\n $Articles_especes=$em->getRepository(Articles_especes::class)->find($id);\n //the remove() method notifies Doctrine that you'd like to remove the given object from the database\n $em->remove($Articles_especes);\n //The flush() method execute the DELETE query.\n $em->flush();\n //redirect our function to the read page to show our table\n return $this->redirectToRoute('articles_afficher');\n\n}", "public function deleteAction()\n {\n if (!Auth::loggedIn()) {\n return redirect('auth/login');\n }\n\n // Get first parameter from URL as comment $id.($this->params are from Controller)\n // $id = $this->params[0];\n $id = $this->getParam();\n\n // Call static function from Model which return comment object or null.\n $article = Article::findById($id);\n\n if (!$article) {\n return redirect();\n }\n\n if (!$article->canDelete()) {\n return redirect('articles/details/' . $article->id);\n }\n\n $comments = $article->getComments();\n\n // Delete each comment in the loop\n foreach ($comments as $comment) {\n $comment->delete();\n }\n\n // Delete article on the end\n $article->delete();\n\n set_alert('info', '<b>Success!</b> Your article has been deleted!');\n\n return redirect('articles');\n }", "public function delete($id){\n $this->db->where('id', $id);\n $this->db->delete('articles'); // Untuk mengeksekusi perintah delete data\n }", "public function deleteMyPanier($article_id)\n\n { \n\n }", "function delete_article(PDO $dbh, $article_id)\n{\n\n// On supprime d'abord les tags eventuellement associés à cet article\n$query1 = \"DELETE FROM article_has_tag\nWHERE article_has_tag.article_id = :id\";\n$request = $dbh->prepare($query1);\n$request->execute([\"id\" => $article_id]);\n\n// Puis on supprime l'article concerné\n$query2 = \"DELETE FROM article\nWHERE id = :id\";\n$request = $dbh->prepare($query2);\n$request->execute([\"id\" => $article_id]);\nreturn $request;\n}", "public function deleting(Knowledgebase $article)\n {\n $article->comments->each(\n function ($comment) {\n $comment->delete();\n }\n );\n $issue->detag();\n }", "public function destroy(Article $article)\n {\n $article->delete();\n session()->flash('msg_success',__('messages.modelDeleted', ['modelname' => 'Article'] ));\n //$article->addToRecycleBin();\n\n return redirect()->action('ArticleController@index');\n }", "public function destroy(Article $article)\n {\n $tagsId = $this->extractIds($article->tags);\n //dd($tagsId);\n $article->tags()->detach($tagsId); // Rimuovo i record nella tabella article_tag inerenti all'articolo che sto per cancellare\n $article->delete(); // Cancello l'articolo dal database\n return redirect()->route('articles.index');\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t//print_r ($_POST);\n\t\t\t\n\t\t\tif (isset($_POST[\"articleCheckbox\"]) && !empty($_POST[\"articleCheckbox\"]) && $_POST[\"command\"] == \"deleteSelected\"){\n\t\t\t\tforeach($_POST[\"articleCheckbox\"] as $record)\n\t\t\t\t{\n\t\t\t\t\tArticles::model()->deleteByPk($record);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t// we only allow deletion via POST request\n\t\t\t\t$this->loadarticles()->delete();\n\t\t\t}\n\t\t\t$this->redirect(array('admin'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function destroy(Article $article)\n {\n $article->delete();\n }", "public function destroy($id)\n {\n $target = $this->article->find($id);\n\n // delete cascade manually.\n $pinned = $target->pinned()->first();\n if($pinned) {\n $pinned->delete();\n }\n\n // delete the chat messages too.\n $chat_messages = $target->chat_messages();\n if ($chat_messages) {\n $chat_messages->delete();\n }\n\n // delete attachments\n $article_attachments = $target->article_attachments();\n if ($article_attachments) {\n $directory = 'article_attachment/'.$target->id;\n $article_attachments->delete();\n\n // Delete all real files too.\n Storage::deleteDirectory($directory);\n }\n\n $deleted = $target->delete();\n\n if($deleted) {\n Log::Info(\"The article: $id is deleted.\");\n return response()->json(['_code' => 0]);\n } else {\n return response()->json(['_code' => 1]);\n }\n }", "public function destroy(Article $article)\n {\n $article->delete();\n \n return redirect()->route('manage')\n ->with('success','Article deleted successfully');\n }", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "public function delete_article_by_article_id($id)\n {\n $sql = \"DELETE FROM {$this->db->GOSPEL_MAGAZINE} WHERE id={$id}\";\n $this->db->query($sql);\n }", "public function deleteAction()\n {\n $entity = \\Zend_Registry::get('doctrine')->getEntityManager()->getRepository('\\ZF\\Entities\\News');\n $relation = \\Zend_Registry::get('doctrine')->getEntityManager()->getRepository('\\ZF\\Entities\\NewsTagRel');\n return parent::delete($entity, $relation);\n }", "public function remove(Article $article);", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public\n function destroy(Article $article)\n {\n $article->delete();\n Cache::forget('article:'.$article->id);\n Cache::forget('article:all');\n return redirect(route('article.index'));\n }", "protected function afterDelete()\n\t{\n\t\tparent::afterDelete();\n\t\tComment::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tBookmark::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoCategory::model()->deleteAll( 'howto_id=' . $this->id );\n \t\tSlide::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tStep::model()->deleteAll( 'howto_id=' . $this->id );\n\t\tHowtoTag::model()->deleteAll( 'howto_id=' . $this->id );\n\t}", "protected function prepareDeleteArticle(){\n $this->deleteComment();\n $this->deleteArticle();\n header('Location: index.php');\n }", "public function AdminDeleteArticleProcess(Request $request) {\n\n $article = Article::find($request->article_id);\n $article->delete();\n return redirect()->route('admin-article');\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function deleteAction($id){\n $article = Article::findFirst($id);\n if($article !== false){\n if($article->delete()){\n\n //let the user know the article was removed successfully\n $this->flashSession->message('message', 'The article has successfully been removed');\n\n //success, just redirect to the article overview\n $this->response->redirect(\"/article\");\n }else{\n //something went wrong\n }\n }\n }", "public function clear()\n {\n if (null !== $this->aCakeType) {\n $this->aCakeType->removeArticle($this);\n }\n if (null !== $this->aShape) {\n $this->aShape->removeArticle($this);\n }\n $this->article_id = null;\n $this->description = null;\n $this->price = null;\n $this->creation = null;\n $this->visible = null;\n $this->shape_id = null;\n $this->cake_type_id = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function delArticle($params): void\n {\n // On vérifie si on est logué et si on a les droits administrateur\n if(!\\Session::isLogged() || \\Session::get('role') != 'admin') {\n \\FlashMessage::setMessage('warning', 'Vous n’avez pas les droits pour accéder à cette page, veuillez vous connecter et réessayer.');\n \\Http::redirectTo('home');\n }\n \n extract($params);\n\n // On récupère le nom du fichier à supprimer\n $nameFile = $this->model->getNameFile($id);\n\n // On supprime l'image avec pour nom $nameFile\n unlink('assets/images/' . $nameFile);\n\n // On supprime les commentaires associés à l'article d'identifiant id\n $commentManager = new Comment();\n $commentManager->deleteFromArticle($id);\n\n // On supprime l'article d'identifiant id\n $this->model->delete($id);\n\n // On affiche un message flash pour confirmer la suppression de l'article\n \\FlashMessage::setMessage('warning', 'Votre article a été supprimé');\n\n // On se redirige vers le tableau d'administration\n \\Http::redirectTo('show_admin_board');\n }", "public static function deleteCreatedEntities() {\n global $entities;\n\n if (!empty($entities)) {\n foreach ($entities as $key => $val) {\n foreach ($val as $entity_id => $object) {\n if ($object->deleteProgrammatically()) {\n unset($entities[$key][$entity_id]);\n }\n }\n }\n }\n\n /*self::deleteEntities('node', 1);\n self::deleteEntities('taxonomy_term', 0);\n self::deleteEntities('user', 30);\n self::deleteEntities('comment', 0);*/\n }", "public function destroy($id)\n {\n try{\n $img_data = Image::where('article_id',$id)->get();\n if ($img_data != null) {\n foreach ($img_data as $img) {\n File::delete($img->image);\n }\n Image::where('article_id',$id)->delete();\n }\n\n Article::destroy($id);\n Session::flash(\"notice\",\"Article Deleted\");\n return redirect()->route('articles.index');\n }\n catch(\\Exception $e) {\n Session::flash(\"error\",\"Whoops something went wrong, failed to delete!!\");\n return redirect()->route('articles.index');\n }\n\n \n }", "public function deleteArticle($id){\n //TODO Verification du rôle (admin ou redacteut\n Blog::deleteArticle($id);\n header('Location: /Blog/index');\n\n }", "public function destroy(Article $article)\n {\n $response = Gate::inspect('delete', $article);\n if ($response->allowed()) {\n $contentImages = $this->findImageOfString($article->content);\n\n if(count($contentImages) > 0){\n foreach($contentImages as $img){\n $imagePath = public_path($img);\n if (file_exists($imagePath)) {\n unlink($imagePath);\n }\n }\n }\n\n if($article->image){\n $imagePath = public_path($article->image);\n if (file_exists($imagePath)) {\n unlink($imagePath);\n }\n }\n if($article->file){\n $filePath = public_path($article->file);\n if (file_exists($filePath)) {\n unlink($filePath);\n }\n }\n $article->delete();\n return redirect()->route('articles.index');\n\n }else{\n\n return redirect()->back()->withErrors(['error' => $response->message()]);\n\n }\n }", "public function forceDeleted(Article $article)\n {\n //\n }", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public function delete()\n {\n DB::beginTransaction();\n $res=parent::delete();\n \n if($res==true)\n {\n $relations=$this->morphMany('App\\Models\\Image', 'imageable');\n\n \n $relations->delete(); \n }\n\n DB::commit(); \n }", "public function deleteArticle(ArticleModel $articleModel, DataContainer $dataContainer): void\n {\n $delete = [\n ArticleModel::getTable() => [(int) $articleModel->id],\n ];\n\n $this->collectChildren(ArticleModel::getTable(), (int) $articleModel->id, $delete);\n $this->deleteRecords($delete, (int) $articleModel->id, $dataContainer);\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete($entity)\n {\n \n }", "public function delete($entity);", "public function detachArticles()\n {\n $this->model->articles()->detach();\n }", "public function deleteArticle(Article $idArticle)\n {\n $deleteArticle= $this->getDoctrine()->getManager();\n $deleteArticle->remove($idArticle);\n $deleteArticle->flush();\n \n $this->addFlash('message','Article à bien été supprimé!');\n \n return $this->redirectToRoute('admin');\n }", "function deleteArticle($id, $db)\n{\n mysqli_begin_transaction($db, MYSQLI_TRANS_START_READ_WRITE);\n\n $img = mysqli_query($db, \"DELETE FROM `catalog.img` WHERE `fkey_id_article` = '$id'\");\n $manyArticle = mysqli_query($db, \"DELETE FROM `catalog.category_has_article` WHERE `fkey_id_article` = '$id'\");\n $article = mysqli_query($db, \"DELETE FROM `catalog.article` WHERE `id_article` = '$id'\");\n\n if ($article && $img && $manyArticle) {\n mysqli_commit($db);\n return true;\n } else {\n mysqli_rollback($db);\n return false;\n }\n}", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public abstract function delete();", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function deleteAction($id)\n {\n// Si l'$id est définie alors :\n if ($id) {\n $em = $this->getDoctrine()->getManager();\n // Recherche L'ARTICLE à supprimer parmi LES ARTICLES\n $article = $em->getRepository('RuralisBundle:Article')->findOneById($id);\n // Recherche L'IMAGE DE L'ARTICLE visé\n $image = $em->getRepository('RuralisBundle:Image')->findOneById($article->getImage()->getId());\n // Supprime L'ARTICLE et SON IMAGE associée\n $em->remove($article);\n $em->remove($image);\n // Envoie la requête à la BDD\n $em->flush();\n return $this->redirectToRoute('article_index');\n } else\n return $this->redirectToRoute('article_index');\n }", "function delete( )\n {\n $this->dbInit();\n $this->Database->query( \"DELETE FROM eZLink_Hit WHERE Link='$this->ID'\" ); \n $this->Database->query( \"DELETE FROM eZLink_Link WHERE ID='$this->ID'\" );\n }", "public function destroy($id)\n {\n \tArticle::find($id)->delete();\n \treturn redirect('article');\n }", "function deletes($id) {\n\t\n\tglobal $link;\n\t\n\tdelete (array ('table' => 'articles', 'link' => $link, 'id' => $id));\n\theader(\"location:\".BASE_URL.\"/articles/backoffice_index\");\t\n\n}", "public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "function cms_delete($id) {\n GLOBAL $db;\n// удаление данных о статье\n $db -> query(\"DELETE FROM content WHERE id='$id'\");\n $db -> query(\"DELETE FROM content WHERE pid = '$id'\");\n// удаление информации о статьях из \"связанных\" таблиц\n $db -> query(\"UPDATE items SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n $db -> query(\"UPDATE spec SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n\n}", "public function destroy(Article $article)\n {\n $article->delete();\n return redirect(route('article.index'));\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function multidestroy(request $request){\n $input=$request->all();\n var_dump($input[\"ArticleBorrar\"]);\n\n if(isset($input[\"ArticleBorrar\"])) {\n foreach($input[\"ArticleBorrar\"] as $idArticle) {\n $article = $this->articleRepository->findWithoutFail($idArticle);\n foreach($article->imatges as $imatge) {\n $imatge->delete();\n }\n $this->articleRepository->delete($idArticle);\n }\n }\n\n Flash::success('Articles eliminats correctament.');\n\n return redirect(route('articles.index'));\n }", "public function delete($id)\n {\n echo $this->blog_articles_model->delete($id);\n }", "public function destroy($id)\n {\n \n Article::where('id_article',$id)->delete();\n // Article::destroy(\"id_article\",$id);\n\n return back();\n }", "public function destroy($id) {\n\n //\n $model = Article::find($id);\n $refArticle = $model->langRef;\n Article::destroy($id);\n Article::destroy($refArticle);\n }", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function delete(){\n global $db;\n $delete = $db->prepare('DELETE FROM posts WHERE id = :id');\n $delete->bindValue(':id', $this->_id, PDO::PARAM_INT);\n $delete->execute();\n }", "public function destroy($id)\n {\n /*// Get article\n $article = Article::findOrFail($id);\n\n if($article->delete()) {\n return new ArticleResource($article);\n }*/ \n }", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public final function delete() {\n }", "public function destroy($id)\n {\n $article = Article::find($id);\n $images = $article->articleimages;\n $features = $article->features;\n // dd($features);\n //odpidam zależne cechy produktu\n $article->features()->detach($features);\n \n // uswam pliki obrazków\n foreach($images as $img) {\n $file1 = '../../../../storage/app/public/produkty/'.$img.'.webp';\n $file2 = '../../../../storage/app/public/produkty/'.$img.'.jpg';\n if(Storage::exists($file1) || Storage::exists($file2)) {\n Storage::delete($file1);\n Storage::delete($file2);\n }\n //usuwam z bazy\n $img->delete();\n }\n $article->delete();\n return redirect()->route('farmer.article.index')->with('status','Pozycja została usunięta !!');\n }", "public function delete(IndexableEntity $entity);" ]
[ "0.72907406", "0.7285264", "0.7181469", "0.7126309", "0.70493895", "0.70306027", "0.6930753", "0.69273025", "0.68916404", "0.68880725", "0.68768567", "0.68768567", "0.68768567", "0.68768567", "0.68768567", "0.68768567", "0.68768567", "0.6787631", "0.67793363", "0.674818", "0.67159563", "0.6697519", "0.66834503", "0.6642835", "0.66235656", "0.65936726", "0.65934414", "0.6569873", "0.65607524", "0.65590924", "0.6556054", "0.6535574", "0.6518806", "0.6470798", "0.6451615", "0.64487356", "0.6448609", "0.64404124", "0.64371663", "0.64313895", "0.642917", "0.64234084", "0.6420473", "0.63929504", "0.6389808", "0.63872874", "0.638554", "0.637948", "0.6379191", "0.63639665", "0.63639665", "0.63639665", "0.63639665", "0.63572025", "0.6353696", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6351245", "0.6347264", "0.6347038", "0.63461447", "0.6334394", "0.6326799", "0.63266414", "0.63214904", "0.6316909", "0.6314242", "0.63115656", "0.62983257", "0.629597", "0.62842757", "0.62737924", "0.6261266", "0.62573946", "0.62551737", "0.6233884", "0.62335163", "0.6232717", "0.62314665", "0.6220275", "0.6220241", "0.6215247", "0.6214954", "0.6203511", "0.6198877", "0.61957496", "0.6194124", "0.6186519" ]
0.6494538
33
/ Relation with reject messages
public function reject_message() { return $this->hasOne('App\Models\Article_Reject_Messages', 'article_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reject() {\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 function handleRejectEvent(object $message): void;", "public static function reject() {\n return new Reject('Not match Reference');\n }", "public function reject(array $messages);", "public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\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 }", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "function getReject(){\n //check for the requested invitation available or not\n // $get_invite_id=$this->validateInvitationSecret();\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n \n if(!empty($invitation)){\n foreach($invitation as $inv){\n $inv->status=\"REJECTED\";\n $inv->active=0;\n $inv->updated_on=time();\n $inv->save();\n }\n return TRUE;\n }\n else{\n return FALSE;\n }\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 reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\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 rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function reject_article($request)\n {\n $this->status_id = 4;\n\n if($this->update()) {\n $message = new Article_Reject_Messages;\n $message->article_id = $this->id;\n $message->text = $request['reason'];\n if($message->save()){\n Session::flash('flash_message_text', 'Статья была успешно отклонена');\n Session::flash('flash_message_class', 'success');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n else {\n Session::flash('flash_message_text', 'Ошибка создания сообщения');\n Session::flash('flash_message_class', 'danger');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n\n }\n else {\n Session::flash('flash_message_text', 'Ошибка отклонения статьи');\n Session::flash('flash_message_class', 'danger');\n return back();\n }\n }", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "public static function reject() {\n return new Reject('Not match Organic Subset');\n }", "function reject(Transaction $transaction, $description)\n {\n return $this->addStatus($transaction,TransactionStatus::STATUS_REJECTED,$description);\n }", "private function warnForThroughRelations()\n {\n $this->warn(\"| Make sure that the \\\"{$this->parent}\\\" model has the foreign key \\\"\".Str::lower($this->farParent).\"_id\\\" and the \\\"{$this->throughChild}\\\" model has the foreign key \\\"\".Str::lower($this->parent).\"_id\\\"\\n\");\n }", "private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "public function getRejected();", "public function reject(...$arguments): self {\n return $this->end(self::STATE_REJECTED, $this->_failed, $arguments);\n }", "public static function rejectMessage($id) {\n $que = \"UPDATE message SET is_approved = 'N' where id = '{$id}'\";\n $gets = mysql_query($que);\n return $gets;\n }", "public function getRejectReason() {\n\t\tif(isset($this->reviewInfo->rejectReason)) {\n\t\t\treturn $this->reviewInfo->rejectReason;\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public function getReason();", "public function getReason();", "protected function addReject(Builder $builder)\n {\n $builder->macro('reject', function (Builder $builder, $id = null) {\n $builder->withAnyStatus();\n return $this->updateModerationStatus($builder, $id, Status::REJECTED);\n\n });\n }", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function rejected() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), 2); // Rejected\n $data['title'] = \"Rejected Properties\";\n \n $this->render('admin/property/rejected', $data);\n }", "function getRejectPath() {\n\t\treturn $this->_rejectPath;\n\t}", "public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "public function createRejected($reason);", "function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}", "function getDenyReasons() {\n return $this->denied_reasons;\n }", "private function warnForPolimorphicRelations()\n {\n $this->warn(\"| Make sure that the \\\"{$this->polymorphicName}\\\" table model has the foreign keys \\\"\".Str::lower($this->polymorphicName).\"able_id\\\" and \\\"\".Str::lower($this->polymorphicName).\"able_type\\\"\\n\");\n }", "private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }", "public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"hr@primera-africa.com\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function relatedMessages(){\n return $this->hasMany(Message::class,'messages_resources','resource','message');\n }", "private function newAcceptRejectMessageBody() {\n echo 'Implement newAcceptRejectMessageBody() based on generateAccRejEmail() in curationAccRejEmailText.php' . \"<br>\\r\\n\";\n }", "public function nonLeaveAbsences()\n {\n return $this->hasMany('App\\Models\\Absence', 'personnel_no', 'personnel_no')\n ->excludeLeaves();\n }", "public function testInboundDocumentReject()\n {\n }", "public function reject_invite($user_id, $group_id)\n {\n\n if (!ctype_digit($group_id)) {\n abort(404);\n }\n if (!ctype_digit($user_id)) {\n abort(404);\n }\n $group = Group::find($group_id);\n $user = User::find($user_id);\n\n $this->authorize('reject_invite', [$group, $user]);\n\n $group->members()->updateExistingPivot($user_id, [\n 'membership_state' => 'rejected',\n ]);\n\n $notification = User::find($user_id)->notifications()->where('group_id', $group_id);\n $notification->delete();\n\n return back();\n }", "protected function _checkForeignKeysRestrict() {}", "function deny($reason) {\n $this->denied_reasons[] = $reason;\n }", "public function getIsReject()\n\t{\n\t return $this->isReject;\n\t}", "public function getDenyMessage()\n {\n return $this->denyMessage;\n }", "public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function rejected()\n {\n $spare_parts_orders_id = Input::get('spare_parts_orders_id');\n $data = SparePartsOrderModel::where('spare_parts_orders_id', $spare_parts_orders_id)->first();\n $data->confirmation = 'rejected';\n if ($data->save()) {\n $notification = array(\n 'message' => 'Successfully Rejected this Order.',\n 'alert-type' => 'success'\n );\n return redirect()->back()->with($notification);\n }\n }", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "protected function _checkForeignKeysReverseRestrict() {}", "public static function rejected()\n {\n return (new static )->newQueryWithoutScope(new ContentPublishingScope())->rejected();\n }", "public function reject($requests) {\n foreach ($requests as $teacher_id) {\n $this->deleteFromRequest($teacher_id);\n }\n}", "public function message()\n {\n return __('message.foreign.not_belong', [\n 'foreign' => $this->foreignAttribute,\n 'primary' => $this->primaryAttribute\n ]);\n }", "public function actionDeletemsg(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $result = true;\n if(isset($_GET['id'])){\n $id = (int) $_GET['id'];\n foreach (Message::find()->where('thread_id = ' . $id . ' AND (from_user = ' . $user_id . ' OR to_user = ' . $user_id . ') AND status != 0')->each() as $message) {\n if($message->status == 1){\n $message->status = $user_id;\n }else{\n $message->status = 0;\n }\n if($message->save()){\n $result = $result || true;\n }\n }\n if($result){\n echo \"true\";\n }else{\n echo \"false\";\n }\n }\n }", "function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}", "public function testInvalidVirtualForeignKeys()\n {\n $this->specify(\n 'The Model::save with multiple virtual foreign keys and invalid entity',\n function () {\n $body = new Body();\n\n $body->head_1_id = null;\n $body->head_2_id = 999;\n\n // PDOException should'n be thrown\n expect($body->save())->equals(false);\n\n expect($body->getMessages())->count(1);\n expect($body->getMessages()[0]->getMessage())->equals('Second head does not exists');\n }\n );\n }", "public function reject_suggested_deal($id,&$msg){\n $q = \"delete from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"'\";\n $result = mysql_query($q);\n if(!$result){\n return false;\n }\n\t\t\n\t\t$q = \"delete from \".TP.\"transaction_suggestions where id='\".$id.\"'\";\n $result = mysql_query($q);\n if(!$result){\n return false;\n }\n $msg = \"deleted\";\n return true;\n }", "public function getReason()\n {\n }", "public function getReason()\n {\n }", "public function actionToreject()\n {\n $reject = new ClientReject;\n if ($reject->load(Yii::$app->request->post())) {\n $client = $this->findModel($reject->client_id);\n if (!\\Yii::$app->user->can('updateClient', ['client' => $client])) {\n throw new ForbiddenHttpException('Нет разрешения на редактирование клиента\"' . $client->name . '\"');\n }\n $client->status = Client::STATUS_REJECT;\n\n $valid = $client->validate();\n $valid = $reject->validate() && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if (! ($flag = $client->save(false))) {\n $transaction->rollBack();\n }\n if (! ($flag = $reject->save(false))) {\n $transaction->rollBack();\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['client/reject']);\n }\n } catch (Exception $e) {\n $transaction->rolBack();\n }\n }\n }\n }", "public function friendsAccept()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'friend_id', 'user_id')->where('accept','=',0);\n\t }", "public function reason() {\n return $this->hasOne('App\\Models\\Legacy\\SupportTicketReason', 'RID', 'RID');\n }", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function message()\n {\n return 'This :attribute is conflicted by another salesman!';\n }", "public function friendsPending()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'user_id', 'friend_id')->where('accept','=',0);\n\t }", "function lobby_membersapi_reject($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$group = $args['group'];\r\n\t$gid = (int)$group['id'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_REJECT_MEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$table \t\t= pnDBGetTables();\r\n\t \t$column\t\t= $table['lobby_members_pending_column'];\r\n\t \t$where\t\t= $column['uid'].\" = \".$uid.\" AND \".$column['gid'].\" = \".$gid;\r\n\t\t$result\t\t= DBUtil::selectObjectArray('lobby_members_pending',$where);\r\n\t\t$obj = $result[0];\r\n\t\t$result = DBUtil::deleteObject($obj,'lobby_members_pending');\r\n\t\tif ($result) {\r\n\t\t\tLogUtil::registerStatus(_LOBBY_MEMBERSHIP_REQUEST_REJECTED);\r\n\t\t\t// send Mail\r\n\t\t\tLoader::includeOnce('modules/lobby/includes/common_email.php');\r\n\t\t\tlobby_notify_rejectmembershiprequest($group,$uid);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t \tLogUtil::registerError(_LOBBY_MEMBERSHIP_REJECT_ERROR);\r\n\t\t \treturn false;\r\n\t\t}\r\n\t}\r\n}", "public function adjustingMmRelationWithTablesnameAndFieldnameFieldDoNotTouchOtherRelations() {}", "function rejectOrder() {\n\t\t$sql = \"SELECT FROM \";\n\t\t$this -> db -> select(\"id, user_name, contact, addr1, addr2, pin, city, email, DATE_FORMAT(order_date, '%b %d %Y') AS order_date, DATE_FORMAT(order_date, '%h:%i %p') AS order_time, CASE WHEN DATEDIFF(order_date, now()) > 0 THEN 1 ELSE 0 END AS isnew, order_status, quantity\");\n\t\t$query = $this -> db -> get('registrations');\n\t\t$result = $query -> result();\n\t\treturn $result;\n\t}", "protected function setRejectedReason(array $data)\n {\n $this->rejectedReason = PaymentRejectionReason::fromArray($data);\n }", "public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function reject(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'aula_id' => 'required',\n 'aluno_id' => 'required',\n 'mensagem' => 'required'\n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors()); \n }\n \n $aula = Aula::find($request->aula_id);\n $aluno = Aluno::find($request->aluno_id);\n\n if(auth()->user()->roles->pluck('name')[0] == 'Professor' && auth()->user()->professor->id == $aula->professor_id) {\n DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->update([\n 'status' => 'Rejeitado',\n 'mensagem' => $request->mensagem,\n 'visualizado' => 0,\n ]);\n\n $inscricao = DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->first();\n $aula->inscricoes = $inscricao;\n\n return $this->sendResponse(new AulaResource($aula), 'Participation accept successfully.');\n }\n\n return $this->sendError('You cannot reject the selected participation.');\n }", "public function reject(Request $request, $id)\n {\n $leave_record = LeaveRecord::find($id);\n $staff_id = $leave_record->staff_id;\n $user = DB::table('users')->where('username',$staff_id)->first();\n\n $data = [\n 'staff_name' => $user->full_name,\n 'man_name' => Auth::user()->full_name,\n 'staff_email' => $user->email,\n 'man_email' => Auth::user()->email,\n ];\n Mail::send(new LeaveRejectMail($data));\n\n /**\n * Check if the leave_record is not the\n * current authenticated leave_record\n */\n $date_current = Carbon::now()->toDateTimeString();\n\n $leave_record->status = $request->input('status');\n $leave_record->status_date = $date_current;\n $leave_record->save();\n return redirect('/my_leave_tasks')->with('info','Selected Leave Request has been Rejected!');\n }", "public function rejectInvite($inviterID) {\n\t\treturn ConnectionFactory::DeleteRowFromTable(\"agencies\", array('user_one_id'=>$inviterID, \n\t\t\t\t'user_two_id'=>$this->id));\n\t}", "public function getXsiTypeName() {\n return \"RejectedError.Reason\";\n }", "public function actionRejectByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-reject oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }", "function hook_commerce_adyen_refund_rejected(\\Commerce\\Adyen\\Payment\\Transaction\\Refund $transaction, \\stdClass $order) {\n\n}", "public function reject($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'rejected'\n ]);\n }", "public function getXsiTypeName() {\n return \"RejectedError\";\n }", "public function message()\n {\n return 'Rejected candidates cannot be changed to accepted candidates and vice versa.';\n }", "protected function reason()\n {\n }", "function invite_reject($from, $to, $togcm, $type, $message, $sender_name, $event_refrence){\n$arr = array(\"host\" => $from,\n\t \"to_id\" => $to,\n\t \"sender_name\" => $sender_name,\n\t \"event_reference\" => $event_refrence,\n\t \"payload_type\" => \"invite_reject\",\n \"payload_message\" => $message);\n$new_payload = json_encode($arr);\nsend_gcm_notify($togcm, $new_payload);\n}", "public function denyLink()\n {\n }", "public function message()\n {\n return ':attribute permite solo letras';\n }", "public function friendsAccepted()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'user_id', 'friend_id')->where('accept','=',1);\n\t }", "public function getValidationErrorMessages() {}", "public function reject_doc($id)\n {\n $countDoc = ProviderDocument::where('provider_id', $id)->count();\n if ($countDoc > 0) {\n ProviderDocument::where('provider_id', $id)->update(['verification_status' => 2]);\n Provider::where('id', $id)->update(['status' => 'banned', 'admin_verified' => 0]);\n } else {\n Provider::where('id', $id)->update(['admin_verified' => 1]);\n }\n return back()->with('flash_success', \"Provider Document Disapproved\");\n }", "public function reject($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.RejectRegistrationInterface', compact(\"data\"));\n }", "final public static function transactionWasRejectedByTheFraudGateway()\n {\n return self::get(2055);\n }", "public function actionReject($campaign_id, $channel_id)\n {\n if (Yii::$app->request->isAjax) {\n $model = $this->findModel($campaign_id, $channel_id);\n $model->status = 3;\n if ($model->save()) {\n return 'success';\n }\n// return $campaign_id.$channel_id;\n }\n\n }", "public function isRemoveFromRelationship();", "public function invalidConfirmation() {\n\t\t$this->messages[] = \"Lösenorden matchar inte.\";\n\t}", "public function reject(callable $callback);", "public function reject($PropertyID) {\n try {\n $result = $this->property_model->reject($PropertyID);\n if ($result) {\n setNotification('success', 'Record updated successfully');\n redirect(base_url('admin/dashboard'));\n }\n } catch (Exception $e) {\n setNotification('error', 'Error in updating record');\n redirect(base_url('admin/dashboard'));\n }\n }", "public function saveRejection($model, $foreignKey, $reason) {\n\t\tif (!in_array($model, array('Workorder', 'TasksWorkorder'))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->save(array(\n\t\t\t'id' => null,\n\t\t\t'model' => $model,\n\t\t\t'foreign_key' => $foreignKey,\n\t\t\t'editor_id' => AuthComponent::user('id'),\n\t\t\t'comment' => ($model == 'Workorder' ? 'Workorder' : 'Task') . ' rejected. Reason: ' . $reason,\n\t\t\t'flag_status' => 1,\n\t\t));\n\t}", "function hook_commerce_adyen_capture_rejected(\\Commerce\\Adyen\\Payment\\Transaction\\Payment $transaction, \\stdClass $order) {\n\n}", "public function rejectExpiredRequests()\n {\n try {\n $expiredRequests = CustomRequest::where('status', RequestStatus::Verification)\n ->whereDate('expiry_date', Carbon::today())\n ->where('type', CreationType::KP)\n ->get();\n\n foreach ($expiredRequests as $key => $expiredRequest) {\n $expiredRequest->status = RequestStatus::RejectBySistem;\n $expiredRequest->expiry_date = null;\n $expiredRequest->save();\n Log::info('Sedang menolak pendaftaran '. CreationType::getString($expiredRequest->type) .' : '. $expiredRequest->student()->first()->npm . ' | '. $expiredRequest->student()->first()->name);\n }\n } catch(\\Exception $e) {\n $errorStr = method_exists($e, 'getMessage') ? json_decode($e->getMessage()) : json_encode($e);\n Log::info($errorStr);\n }\n }", "public function testCreateUnsuccessfulReason()\n {\n }", "public function disableForeignKeyConstraints()\n {\n return $this->getConnection()->statement(\n $this->grammar->compileDisableForeignKeyConstraints()\n );\n }", "public function getReason()\r\n {\r\n return $this->message;\r\n }" ]
[ "0.63372856", "0.630351", "0.6272447", "0.6189741", "0.61692756", "0.6114349", "0.60072917", "0.59626585", "0.59321016", "0.5882223", "0.58609533", "0.58577615", "0.5787248", "0.5784197", "0.57802767", "0.5684261", "0.5682665", "0.56401587", "0.5610326", "0.56046206", "0.56019014", "0.5589218", "0.55684745", "0.5520942", "0.5459516", "0.5445808", "0.5445808", "0.54353476", "0.5433386", "0.5395315", "0.5350453", "0.5345308", "0.53251016", "0.5303858", "0.52834654", "0.5251798", "0.52387655", "0.522211", "0.52118284", "0.51913184", "0.5144119", "0.513798", "0.51197183", "0.51067024", "0.5105424", "0.5092915", "0.5081409", "0.5073567", "0.506158", "0.50501484", "0.5040977", "0.50311685", "0.5014011", "0.50093234", "0.5000978", "0.49998128", "0.49737614", "0.4966359", "0.49656892", "0.49656892", "0.4961443", "0.49423304", "0.49376678", "0.4927824", "0.49236724", "0.49185663", "0.49100497", "0.49023008", "0.49010602", "0.49007788", "0.48999783", "0.48910984", "0.48904148", "0.48866066", "0.48811212", "0.48707598", "0.48514885", "0.48468864", "0.4846662", "0.48395473", "0.4836057", "0.48266363", "0.48262477", "0.4821048", "0.48198664", "0.48166335", "0.4801188", "0.48004493", "0.47976193", "0.4784897", "0.47828895", "0.47747797", "0.47738212", "0.47697636", "0.47695056", "0.47646978", "0.4760336", "0.47523072", "0.47436622", "0.47429055" ]
0.6766557
0
/ Return list of all articles that need moderation for current moderator
public function need_moderation_list($administrator = false) { $articles = []; if($administrator){ $articles = $this->where('status_id', 3)->get(); if($articles->isEmpty()) $articles = []; } else { foreach (Auth::user()->moderated_categories as $category){ foreach ($category->articles->where('status_id', 3) as $article){ $save = true; foreach ($articles as $existing){ if(($existing['id'] == $article->id) || ($existing['user_id'] == Auth::user()->id)) $save = false; } if($save){ $new_article = [ 'id' => $article->id, 'title' => $article->title, 'author' => (is_null($article->user)) ? "Velosophers" : $article->user->name, ]; array_push($articles, $new_article); } } } } return $articles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModeraciones()\n {\n return $this->hasMany(Post::className(), ['moderated_by' => 'id'])->inverseOf('moderadoPor');\n }", "public function getAdminArticles()\n\t{\n\t\t$articles = [];\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC LIMIT 0, 5');\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\t\t\n\t\treturn $articles;\n\t}", "public function moderators(): MorphToMany\r\n {\r\n return $this->_moderators()->where('status', 'accepted');\r\n }", "function _get_moderators () {\n\t\tif (!is_array(module('forum')->_forum_moderators)) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ((array)module('forum')->_forum_moderators as $moderator_info) {\n\t\t\t$replace = array(\n\t\t\t\t'user_profile_link'\t=> module('forum')->_user_profile_link($moderator_info['member_id']),\n\t\t\t\t'user_name'\t\t\t=> _prepare_html($moderator_info['member_name']),\n\t\t\t);\n\t\t\tforeach (explode(',', $moderator_info['forums_list']) as $_forum_id) {\n\t\t\t\t$mods_array[$_forum_id][$moderator_info['member_id']] = tpl()->parse('forum'.'/view_home_moderator_item', $replace);\n\t\t\t}\n\t\t}\n\t\tforeach ((array)$mods_array as $forum_id => $moderators_infos) {\n\t\t\t$moderators_by_forums[$forum_id] = implode(', ', $moderators_infos);\n\t\t}\n\t\treturn $moderators_by_forums;\n\t}", "public function getModerators()\n\t{\n\t\tglobal $rbacreview;\n\n\t\treturn $this->_getModerators($this->getForumRefId());\n\t}", "public function showModerations()\n {\n $moderationRepo = $this->getDoctrine()->getRepository(Moderation::class);\n $moderations = $moderationRepo->findAll();\n\n return $this->render('admin/list-of-moderations.html.twig', [\n 'moderations' => $moderations\n ]);\n }", "public function getModerations($user_id) {\n return $this->find('list', array(\n 'conditions' => array('Moderator.user_id' => $user_id),\n 'fields' => array('Moderator.forum_id')\n ));\n }", "public function moderatorRequests(): MorphToMany\r\n {\r\n return $this->_moderators()->where('status', 'request');\r\n }", "public function getArticles()\n\t{\n\t$qb = $this ->createQueryBuilder(\"a\")\n\t\t\t\t->leftJoin('a.image','i')\n\t\t\t\t->addSelect('i')\n\n\t\t\t\t->leftJoin('a.categories','c')\n\t\t\t\t->addSelect('c')\n\n\t\t\t\t->where('a.publication = :val')\n\t\t\t\t->setParameter('val', 1)\n\n\t\t\t\t->orderBy('a.datecreation', 'DESC');\n\t$query = $qb->getQuery();\n\treturn $query->getResult();\n\t}", "public function getAllArticles()\n {\n $user = \\BackendUser::getInstance();\n $pids = array();\n $articles = array();\n\n // Limit pages to the user's pagemounts\n if ($user->isAdmin) {\n $objArticle = \\Database::getInstance()->execute(\n 'SELECT a.id, a.pid, a.title, a.inColumn, p.title AS parent FROM tl_article a\n LEFT JOIN tl_page p ON p.id=a.pid ORDER BY parent, a.sorting'\n );\n } else {\n foreach ($user->pagemounts as $id) {\n $pids[] = $id;\n $pids = array_merge($pids, \\Database::getInstance()->getChildRecords($id, 'tl_page'));\n }\n\n if (empty($pids)) {\n return $articles;\n }\n\n $pids = implode(',', array_map('intval', array_unique($pids)));\n\n $objArticle = \\Database::getInstance()->execute(\n 'SELECT a.id, a.pid, a.title, a.inColumn, p.title AS parent\n FROM tl_article a LEFT JOIN tl_page p ON p.id=a.pid WHERE a.pid IN(' . $pids . ')\n ORDER BY parent, a.sorting'\n );\n }\n\n // Edit the result\n if ($objArticle->numRows) {\n \\Controller::loadLanguageFile('tl_article');\n\n while ($objArticle->next()) {\n $key = $objArticle->parent . ' (ID ' . $objArticle->pid . ')';\n $articles[$key][$objArticle->id] = $objArticle->title\n . ' (' . ($GLOBALS['TL_LANG']['tl_article'][$objArticle->inColumn] ?: $objArticle->inColumn)\n . ', ID ' . $objArticle->id . ')';\n }\n }\n\n return $articles;\n }", "function _getModerators($a_ref_id)\n\t{\n\t\tglobal $rbacreview;\n\n\t\t$rolf \t = $rbacreview->getRoleFolderOfObject($a_ref_id);\n\t\t$role_arr = $rbacreview->getRolesOfRoleFolder($rolf[\"ref_id\"]);\n\n\t\tforeach ($role_arr as $role_id)\n\t\t{\n\t\t\t//$roleObj = $this->ilias->obj_factory->getInstanceByObjId($role_id);\n\t\t\t$title = ilObject::_lookupTitle($role_id);\n\t\t\tif ($title == \"il_frm_moderator_\".$a_ref_id)\t\t\t\n\t\t\t{\n\t\t\t\t#return $rbacreview->assignedUsers($roleObj->getId());\n\t\t\t\treturn $title = $rbacreview->assignedUsers($role_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array();\n\t}", "function _site_ws_all_articles($nid) {\n /*return array(\n \"hello\" => 'test',\n \"goodbye\" => \"forever\",\n \"php_cms\" => array(\n \"wordpress\",\n \"joomla\",\n \"drupal\",\n )\n );*/\n\n $data = array();\n if (isset($nid) && is_numeric($nid)) {\n $query = db_select('node', 'n');\n $query->leftJoin('field_data_body', 'b', 'n.nid = b.entity_id');\n $query->leftJoin('field_data_field_article_image', 'im', 'n.nid = im.entity_id');\n $query->leftJoin('field_data_field_article_attachments', 'a', 'n.nid = a.entity_id');\n\n $article = $query->fields('n')\n ->fields('b', array('body_value'))\n ->fields('im', array('field_article_image_fid'))\n ->fields('a', array('field_article_attachments_fid'))\n ->condition('n.type', 'article', '=')\n ->condition('n.nid', $nid, '=')\n ->condition('n.status', 0, '>')\n ->execute();\n while($result = $article->fetchAssoc()) {\n $result['url'] = '/'.drupal_get_path_alias('node/'.$result['nid']); // add url.\n $result['created'] = date ('Y-m-d', $result['created']); // format date.\n $data[] = $result;\n }\n return $data;\n }\n\n $query = db_select('node', 'n');\n $query->leftJoin('field_data_body', 'b', 'n.nid = b.entity_id');\n $query->leftJoin('field_data_field_article_image', 'im', 'n.nid = im.entity_id');\n $query->leftJoin('field_data_field_article_attachments', 'a', 'n.nid = a.entity_id');\n\n $articles = $query->fields('n')\n ->fields('b', array('body_value'))\n ->fields('im', array('field_article_image_fid'))\n ->fields('a', array('field_article_attachments_fid'))\n ->condition('n.type', 'article', '=')\n ->condition('n.status', 0, '>')\n ->execute();\n\n while($result = $articles->fetchAssoc()) {\n $result['url'] = '/'.drupal_get_path_alias('node/'.$result['nid']); // add url.\n $result['created'] = date ('Y-m-d', $result['created']); // format date.\n $data[] = $result;\n }\n\n return $data;\n}", "public function getArticles();", "public function getAllActiveArticleByDeevonaute()\n\t{\n\t\t$q = Doctrine_Query::create()\n\t\t\t\t->from('tdArticle td_a')\n\t\t\t\t->where('td_a.active = false')\n\t\t\t\t->leftJoin('td_a.Author a')\n\t\t\t\t->where('a.id = ?', $this->getId());\n\t\t\t\t\n\t\t// return Doctrine_Core::getTable('tdArticle')->listAllArticles($q);\n\t\treturn $q->execute();\n\t}", "public function getAllCurationModerators()\n {\n // get all users that are admin\n $userModel = MidasLoader::loadModel('User');\n $adminDaos = $userModel->findBy('admin', '1');\n\n $moderators = array();\n foreach ($adminDaos as $admin) {\n $moderators[$admin->getUserId()] = $admin;\n }\n\n // combine with all admins with those that are moderators\n $curationModeratorDaos = $this->getAll();\n foreach ($curationModeratorDaos as $curationModerator) {\n $moderatorUser = $curationModerator->getUser();\n $moderators[$moderatorUser->getUserId()] = $moderatorUser;\n }\n\n return $moderators;\n }", "private function getLocks()\n {\n $row = 0;\n \n foreach($this->tplVar['articles'] as $article)\n {\n // lock the user to edit\n $result = $this->model->action('article','lock',\n array('job' => 'is_locked',\n 'id_article' => (int)$article['id_article'],\n 'by_id_user' => (int)$this->viewVar['loggedUserId']) );\n \n if(($result !== TRUE) && ($result !== FALSE))\n {\n $this->tplVar['articles'][$row]['lock'] = TRUE; \n } \n else\n {\n $this->tplVar['articles'][$row]['lock'] = FALSE; \n }\n \n $row++;\n } \n }", "public function getAll()\n {\n $query = $this->dc->qb()\n ->select('*')\n ->from($this->dc->p('plugin_ff_articles'), 'a');\n\n if (!$this->getAuth()->hasAccess('maccess.mod')) {\n $query->where('hidden = 0');\n }\n\n $result = $query->orderBy('title', 'asc')\n ->execute()\n ->fetchAll();\n\n return $result;\n }", "function getArticleObjects() \t{\n \t\treturn $this->articles;\n \t}", "function getArticles() \t{\n \t\treturn $this->getArticleUids();\n \t}", "public function get_allowed_article_ids_query() {\n\t\tif ($this->is_current_user_admin() || apply_filters('minerva_restrict_access_allowed', false)) {\n\t\t\treturn null; // admins can watch all content\n\t\t}\n\n\t\t$allowed_ids = $this->get_allowed_article_ids_for_user();\n\n\t\treturn !empty($allowed_ids) ? $allowed_ids : array(-1);\n\t}", "public function getModeratorEmails() {\n $moderatorNames = $this->get('moderators');\n $moderatorNames = explode(',',$moderatorNames);\n $moderators = array();\n foreach ($moderatorNames as $name) {\n $c = $this->xpdo->newQuery('modUser');\n $c->innerJoin('modUserProfile','Profile');\n $c->select(array('modUser.id','Profile.email'));\n $c->where(array('username' => $name));\n $user = $this->xpdo->getObject('modUser',$c);\n if ($user) {\n $moderators[] = $user->get('email');\n }\n }\n\n /* now get usergroup moderators */\n $moderatorGroup = $this->get('moderator_group');\n $c = $this->xpdo->newQuery('modUserProfile');\n $c->innerJoin('modUser','User');\n $c->innerJoin('modUserGroupMember','UserGroupMembers','User.id = UserGroupMembers.member');\n $c->innerJoin('modUserGroup','UserGroup','UserGroup.id = UserGroupMembers.user_group');\n $c->where(array(\n 'UserGroup.name' => $moderatorGroup,\n ));\n $members = $this->xpdo->getCollection('modUserProfile',$c);\n foreach ($members as $member) {\n $email = $member->get('email');\n if (!empty($email)) array_push($moderators,$email);\n }\n $moderators = array_unique($moderators);\n\n return $moderators;\n }", "public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }", "public function getAllMiscellaneous() : array {\n $query='SELECT * FROM Publication WHERE categorie_id=5 ORDER BY ID;';\n $this->connection->executeQuery($query);\n \n return $this->connection->getResults();\n }", "function getModules(){\n global $adb;\n $query=\"select vtiger_tab.tabid,vtiger_tab.tablabel as modulename,linklabel from vtiger_tab left join vtiger_links on vtiger_tab.tabid=vtiger_links.tabid and linklabel='WYSIWYG'\nwhere isentitytype=1 and tablabel!='Comments'\";\n $result=$adb->pquery($query,array());\n while($resultrow = $adb->fetch_array($result)) {\n $modulelist[$resultrow['modulename']]=array('enabled'=>$resultrow['linklabel']==\"WYSIWYG\",'tabid'=>$resultrow['tabid']);\n }\n return $modulelist;\n }", "public function articles()\n\t{\n\t\treturn $this->morphedByMany(Article::class, 'taggable');\n\t}", "public function get_allowed_article_ids($roles = null) {\n\t\t$allowed_articles = array();\n\t\t$user_roles = $roles ? $roles : $this->get_current_roles();\n\n\t\t$query_args = array(\n\t\t\t'post_type' => MKB_Options::option( 'article_cpt' ),\n\t\t\t'ignore_sticky_posts' => 1,\n\t\t\t'suppress_filters' => 1,\n\t\t\t'posts_per_page' => -1\n\t\t);\n\n\t\t$articles_loop = new WP_Query( $query_args );\n\n\t\tif ($articles_loop->have_posts()):\n\t\t\twhile ( $articles_loop->have_posts() ) : $articles_loop->the_post();\n\t\t\t\t$article_id = get_the_ID();\n\n\t\t\t\t// topic restriction check\n\t\t\t\tif (!$this->check_if_article_allowed_by_topics($user_roles)) {\n\t\t\t\t\tif ($this->is_debug) {\n\t\t\t\t\t\techo $article_id . ' - <strong>' . get_the_title() . '</strong>: topic restriction <span style=\"color:red;\">failed</span></br>';\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// article restriction check\n\t\t\t\tif (!$this->check_if_user_in_allowed_roles($user_roles, $this->get_article_allowed_roles($article_id))) {\n\t\t\t\t\tif ($this->is_debug) {\n\t\t\t\t\t\techo $article_id . ' - <strong>' . get_the_title() . '</strong>: article restriction <span style=\"color:red;\">failed</span></br>';\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tarray_push($allowed_articles, $article_id);\n\n\t\t\tendwhile;\n\t\tendif;\n\n\t\twp_reset_postdata();\n\n\t\treturn $allowed_articles;\n\t}", "function get_all_knowledge_base_articles_grouped($only_clients = true, $where = array())\n{\n $CI =& get_instance();\n $CI->load->model('knowledge_base_model');\n $groups = $CI->knowledge_base_model->get_kbg('', 1);\n $i = 0;\n foreach ($groups as $group) {\n $CI->db->select('slug,subject,description,tblknowledgebase.active as active_article,articlegroup,articleid,staff_article');\n $CI->db->from('tblknowledgebase');\n $CI->db->where('articlegroup', $group['groupid']);\n $CI->db->where('active', 1);\n if ($only_clients == true) {\n $CI->db->where('staff_article', 0);\n }\n $CI->db->where($where);\n $CI->db->order_by('article_order', 'asc');\n $articles = $CI->db->get()->result_array();\n if (count($articles) == 0) {\n unset($groups[$i]);\n $i++;\n continue;\n }\n $groups[$i]['articles'] = $articles;\n $i++;\n }\n\n return $groups;\n}", "public function entryAdvancedList() {\n $content = [];\n\n $content['message'] = [\n '#markup' => $this->t('A more complex list of entries in the database. Only the entries with name = \"John\" and age older than 18 years are shown, the username of the person who created the entry is also shown.'),\n ];\n\n $headers = [\n $this->t('pid'),\n $this->t('uid'),\n $this->t('studentname'),\n $this->t('studentno'),\n $this->t('chapter'),\n\t $this->t('status'),\n ];\n\n $rows = [];\n foreach ($entries = $this->repository->advancedLoad() as $entry) {\n // Sanitize each entry.\n $rows[] = array_map('Drupal\\Component\\Utility\\Html::escape', $entries);\n }\n $content['table'] = [\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#attributes' => ['id' => 'dbtng-example-advanced-list'],\n '#empty' => $this->t('No entries available.'),\n ];\n // Don't cache this page.\n //$content['#cache']['max-age'] = 0;\n return $content;\n }", "public function moderation()\n {\n return $this->belongsTo('App\\Models\\Ticket\\MultiMod', 'multi_mod');\n }", "public function actionArticles()\n\t{\n\t\t$this -> layout = 'mainLayout';\n\t\t/*$stack = $this -> human_verbiages;\n\t\t$arts = Articles::GiveArticlesById(0, true);*/\n\t\t\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria -> compare('level',0);\n\t\t$criteria -> compare('parent_id',0);\n\t\t$criteria -> compare('id_type',ArticleType::model() -> getNumber('bibl'));\n\t\t$articles = Articles::model() -> findAll($criteria);\n\t\t\n\t\t$arts = array();\n\t\tforeach ($articles as $art) {\n\t\t\t$arr = array();\n\t\t\t$arr['name'] = $art -> name;\n\t\t\t$arr['verbiage'] = $art -> verbiage;\n\t\t\t$arr['id'] = $art -> id;\n\t\t\t$arr['text'] = $art -> text;\n\t\t\t\n\t\t\t$arts[] = $arr;\n\t\t}\n\t\t\n\t\t/*$arts = array_filter($arts,function ($art) use ($stack){\n\t\t\treturn (!in_array($art [\"verbiage\"], $stack));\n\t\t});*/\n\t\t$this->render('//articles/show_all', array(\n\t\t\t//'articles' => Articles::GiveArticlesById(0, true)\n\t\t\t'articles' => $arts\n\t\t));\n\t}", "function forum_mod_status ($forum_id)\n{\n\tglobal $db;\n\t// Gather list of moderators for this forums and store them in an array\n\t// that then can be searched for while displaying posts. This will only need\n\t// to be called once per viewtopic ;-)\n\t//\n\n\t$sql = \"SELECT u.user_id, u.username \n\t FROM \" . AUTH_ACCESS_TABLE . \" aa, \" . USER_GROUP_TABLE . \" ug, \" . GROUPS_TABLE . \" g, \" . USERS_TABLE . \" u\n\t\tWHERE aa.forum_id = $forum_id \n\t\t AND aa.auth_mod = \" . TRUE . \" \n\t\t \tAND g.group_single_user = 1\n\t\t \tAND ug.group_id = aa.group_id \n\t\t\tAND g.group_id = aa.group_id \n\t\t\tAND u.user_id = ug.user_id \n\t GROUP BY u.user_id, u.username \n\t\tORDER BY u.user_id\";\n\tif ( !($result = $db->sql_query($sql)) )\n\t{\n\t message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);\n\t}\n\n\t$moderators = array();\n\twhile( $row = $db->sql_fetchrow($result) )\n\t{\n\t $moderators[] = $row['user_id'];\n\t}\n\treturn $moderators;\n}", "public static function showModeratedTopics()\n {\n \t$ini = eZINI::instance('site.ini.append.php');\n \tif ( !$ini->variable('SiteAccessSettings', 'ShowModeratedForumItems') )\n \t{\n \t\treturn false;\n \t}\n \t\n \treturn true;\n }", "public function getRecommendations();", "function fetchArticleComments()\r\n\t{\r\n\t\t$comments = array();\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_artikel_kommentare WHERE Publik = '1' AND ArtId = '\" . (int)$_REQUEST['product_id'] . \"' ORDER BY Id DESC\");\r\n\t\twhile($row = $sql->fetchrow())\r\n\t\t{\r\n\t\t\t$sql_u = $GLOBALS['db']->Query(\"SELECT Vorname,Nachname FROM \" . PREFIX . \"_users WHERE Id = '$row->Benutzer'\");\r\n\t\t\t$row_u = $sql_u->fetchrow();\r\n\r\n\t\t\t$row->Titel = htmlspecialchars($row->Titel);\r\n\t\t\t$row->Kommentar = nl2br(htmlspecialchars($row->Kommentar));\r\n\t\t\t$row->Autor = substr($row_u->Vorname,0,1) . '. ' . $row_u->Nachname;\r\n\t\t\tarray_push($comments, $row);\r\n\t\t}\r\n\t\treturn $comments;\r\n\t}", "function ocf_perform_multi_moderation($id,$topic_id,$reason,$post_text='',$is_emphasised=1,$skip_sig=0)\n{\n\t$topic_details=$GLOBALS['FORUM_DB']->query_select('f_topics',array('t_forum_id','t_cache_first_title','t_cache_first_post_id'),array('id'=>$topic_id),'',1);\n\tif (!array_key_exists(0,$topic_details)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\t$from=$topic_details[0]['t_forum_id'];\n\tif (!ocf_may_perform_multi_moderation($from)) access_denied('I_ERROR');\n\n\t$mm=$GLOBALS['FORUM_DB']->query_select('f_multi_moderations',array('*'),array('id'=>$id));\n\tif (!array_key_exists(0,$mm)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\trequire_code('ocfiltering');\n\t$idlist=ocfilter_to_idlist_using_db($mm[0]['mm_forum_multi_code'],'id','f_forums','f_forums','f_parent_forum','f_parent_forum','id',true,true,$GLOBALS['FORUM_DB']);\n\tif (!in_array($from,$idlist)) warn_exit(do_lang_tempcode('MM_APPLY_TWICE'));\n\n\t$pin_state=$mm[0]['mm_pin_state'];\n\t$open_state=$mm[0]['mm_open_state'];\n\t$sink_state=$mm[0]['mm_sink_state'];\n\t$move_to=$mm[0]['mm_move_to'];\n\t$title_suffix=$mm[0]['mm_title_suffix'];\n\t//$post_text=$mm[0]['mm_post_text']; We'll allow user to specify the post_text, with this as a default\n\t$update_array=array();\n\tif (!is_null($pin_state)) $update_array['t_pinned']=$pin_state;\n\tif (!is_null($sink_state)) $update_array['t_sunk']=$sink_state;\n\tif (!is_null($open_state)) $update_array['t_is_open']=$open_state;\n\tif ($title_suffix!='')\n\t{\n\t\t$new_title=$topic_details[0]['t_cache_first_title'].' ['.$title_suffix.']';\n\t\t$update_array['t_cache_first_title']=$new_title;\n\t\t$GLOBALS['FORUM_DB']->query_update('f_posts',array('p_title'=>$new_title),array('id'=>$topic_details[0]['t_cache_first_post_id']),'',1);\n\t}\n\n\tif (count($update_array)!=0)\n\t\t$GLOBALS['FORUM_DB']->query_update('f_topics',$update_array,array('id'=>$topic_id),'',1);\n\n\tif (!is_null($move_to))\n\t{\n\t\trequire_code('ocf_topics_action');\n\t\trequire_code('ocf_topics_action2');\n\t\tocf_move_topics($from,$move_to,array($topic_id));\n\t}\n\n\tif ($post_text!='')\n\t{\n\t\trequire_code('ocf_posts_action');\n\t\trequire_code('ocf_posts_action2');\n\t\trequire_code('ocf_topics_action');\n\t\trequire_code('ocf_topics_action2');\n\t\tocf_make_post($topic_id,'',$post_text,$skip_sig,false,1,$is_emphasised);\n\n\t\t$forum_id=is_null($move_to)?$from:$move_to;\n\t\thandle_topic_ticket_reply($forum_id,$topic_id,$topic_details[0]['t_cache_first_title'],$post_text);\n\t}\n\n\trequire_code('ocf_general_action2');\n\tocf_mod_log_it('PERFORM_MULTI_MODERATION',strval($id),strval($topic_id),$reason);\n}", "function course_announcements() {\r\n global $course_id, $course_code, $langNoAnnounce, $urlAppend, $dateFormatLong;\r\n\r\n if (visible_module(MODULE_ID_ANNOUNCE)) {\r\n $q = Database::get()->queryArray(\"SELECT title, `date`, id\r\n FROM announcement\r\n WHERE course_id = ?d AND\r\n visible = 1\r\n ORDER BY `date` DESC LIMIT 5\", $course_id);\r\n if ($q) { // if announcements exist\r\n $ann_content = '';\r\n foreach ($q as $ann) {\r\n $ann_url = $urlAppend . \"modules/announcements/?course=$course_code&amp;an_id=\" . $ann->id;\r\n $ann_date = claro_format_locale_date($dateFormatLong, strtotime($ann->date));\r\n $ann_content .= \"<li class='list-item'>\r\n <span class='item-wholeline'><div class='text-title'><a href='$ann_url'>\" . q(ellipsize($ann->title, 60)) .\"</a></div>$ann_date</span>\r\n </li>\";\r\n }\r\n return $ann_content;\r\n }\r\n }\r\n return \"<li class='list-item'><span class='item-wholeline'><div class='text-title not_visible'> - $langNoAnnounce - </div></span></li>\";\r\n}", "public function getModerator()\n {\n $mod = false;\n\n if (\\Auth::check() && \\Auth::user()->isCommunity()) {\n $mod = true;\n }\n\n return json_encode(['mod' => $mod]);\n }", "public function list_cites_mod_presupuestaria(){\n $sql = 'select *\n from modificacion_presupuestaria mp\n Inner Join _distritales as ds On ds.dist_id=mp.dist_id\n Inner Join _departamentos as d On d.dep_id=ds.dep_id\n where mp.g_id='.$this->gestion.'\n order by mp_id asc';\n\n $query = $this->db->query($sql);\n return $query->result_array();\n }", "public function getAllArticles()\r\n\t{\r\n\t\t$bdd\t=\tmyConnection();\r\n\r\n\t\t$sqlSelect\t=\t$bdd\t->\tprepare(\"SELECT * FROM article ORDER BY designation\");\r\n\r\n\r\n\t\t$sqlSelect\t->\texecute();\r\n\r\n\t\t$resultat\t=\t$sqlSelect->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\treturn $resultat;\r\n\t}", "function getAllVisibleAuthors()\r\n {\r\n $CI = &get_instance();\r\n $userlogin=getUserLogin();\r\n \r\n if ($userlogin->hasRights('read_all_override'))\r\n return $this->getAllAuthors();\r\n \r\n if ($userlogin->isAnonymous()) //get only public authors\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE \".AIGAION_DB_PREFIX.\"publication.derived_read_access_level = 'public'\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n else //get all non-private authors and authors for publications that belong to the user\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE (\".AIGAION_DB_PREFIX.\"publication.derived_read_access_level != 'private' \r\n OR \".AIGAION_DB_PREFIX.\"publication.user_id = \".$userlogin->userId().\")\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n \r\n //retrieve results or fail \r\n foreach ($Q->result() as $row)\r\n {\r\n $next = $this->getFromRow($row);\r\n if ($next != null)\r\n {\r\n $result[] = $next;\r\n }\r\n }\r\n return $result;\r\n \r\n }", "public function getArticles()\n\t{\n\t\treturn $this->getOptionData('tl_article');\n\t}", "private function getArticles() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $articles = $this->bankReg->gets($param);\n\n return $articles;\n }", "function getMailList_moderator($exclude='')\r\n\t{\r\n\t\t/* exclude must be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t */\r\n\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t if (is_array($exclude)) {\r\n\t $exclude = implode(',', $exclude);\r\n\t }\r\n\r\n /* Moderators(if requested) */\r\n\r\n $moderator_maillist = array();\r\n\r\n if ($this->_notify_moderator && $this->_moderator) {\r\n $usertype = '';\r\n foreach($this->_moderator as $moderator) {\r\n $usertype .= ($usertype ? ',':'') . \"'\" . JOSC_utils::getJoomlaUserType($moderator) . \"'\";\r\n }\r\n\t\t\t$query \t= \"SELECT DISTINCT email \"\r\n\t\t\t\t\t. \"\\n FROM `#__users` \"\r\n\t\t\t\t\t. \"\\n WHERE email <> '' \"\r\n\t\t\t\t\t. \"\\n AND usertype IN ($usertype)\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$moderator_maillist = $database->loadResultArray(); //tableau\r\n\t\t\t//echo implode(';' , $moderator_maillist); // liste s�par� par des ;\r\n } elseif ($this->_notify_admin && $this->_notify_email <> '') {\r\n $moderator_maillist[] = $this->_notify_email;\r\n }\r\n return $moderator_maillist;\r\n\t}", "public function getArticles()\n {\n return $this->articles;\n }", "function afficher_derniers_articles(){\n\t\tglobal $logger;\n\t\tif($logger){// si connecté, affiche article public et privé\n\t\t\t$requete = 'SELECT * FROM articles ORDER BY date DESC';\n\t\t}else{// sinon que public\n\t\t\t$requete = 'SELECT * FROM articles WHERE statut=\"0\" ORDER BY date DESC';\n\t\t}\n\t\t$donnees = connexion( $requete);\n\t\t$res = \"\";\n\t\t\n\t\tif(mysql_num_rows($donnees) < 1){\n\t\t\treturn \"<div>Aucun article récent trouvé</div>\";\n\t\t}else{\n\t\t\tfor($i =1; $i <= 4; $i++){\n\t\t\t\tif($ligne = mysql_fetch_assoc($donnees)){\n\t\t\t\t\t$res .= \"<article>\n\t\t\t\t\t\t\t\t<a href='index.php?where=article&amp;id={$ligne['id']}'><header>{$ligne['titre']}</header></a>\n\t\t\t\t\t\t\t\t<div class='article_auteur'>\n\t\t\t\t\t\t\t\t\t<img src='ressources/auteur.png' title='Auteur' alt='Auteur'>\n\t\t\t\t\t\t\t\t\tAuteur: <a href='index.php?where=profil&amp;id={$ligne['auteur']}'>\";\n\t\t\t\t\t$res .= \t\tnom_auteur($ligne[\"auteur\"]);\t\n\t\t\t\t\t$res .= \t'</a></div>\n\t\t\t\t\t\t\t<div class=\"article_date\">Le '.conversion_date($ligne['date']).'</div>\n\t\t\t\t\t\t\t<p>'.taille_description($ligne['text'], $ligne['id']).'</p>';\n\t\t\t\t\t$res .= \tarticle_statut($ligne['statut']);\n\t\t\t\t\t$res .= \"</article>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public function getArticles() {\n return $this->articles;\n }", "public static function getAllMiscellaneous() :array {\n \tglobal $base, $login, $password;\n\n $publicationGW = new PublicationGateway(new Connection($base, $login, $password));\n $results = $publicationGW->getAllMiscellaneous(); \n $data = array();\n foreach ($results as $row){\n $data[]=new Publication ($row['ID'], $row['reference'], $row['authors'], $row['title'], $row['date'], $row['journal'], $row['volume'], $row['number'], $row['pages'], $row['note'], $row['abstract'], $row['keywords'], $row['series'], $row['localite'], $row['publisher'], $row['editor'], $row['pdf'], $row['date_display'], $row['categorie_id']);\n }\n \n return $data;\n }", "private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}", "public static function articlesList()\n {\n\n $files = scandir(Yii::getAlias(self::ARTICLES_DIR)); // all files in dir\n\n $files = array_filter($files,function($filename) {\n return preg_match('/\\.md$/', $filename); // only .md files\n });\n\n $files = str_replace('.md','',$files); // file names without ext\n\n // replace keys with url to files\n foreach ($files as $index => $filename) {\n if (is_numeric($index)) {\n unset ($files[$index]);\n $url = static::makeUrl($filename);\n $files[$url] = $filename;\n }\n }\n\n return $files;\n\n }", "public function getElevatedStorys(){\n\t\t$currentDate = Carbon::now();\n\t\tif(\\Auth::check()){\n\n\t\t\t$user = \\Auth::user();\n\t\t\tif($user->hasRole('contributor_1')){\n\t\t\t\treturn $this->setStatusCode(401)->respondWithError('You do not have sufficient privileges to see elevated stories.');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$stories = Story::where([['priority', '>', 0]])->orderBy('priority', 'desc')->get();\n\t\t\t}\n\n\t\t\t$fractal = new Manager();\n\t\t\t$resource = new Fractal\\Resource\\Collection($stories->all(), new FractalStoryTransformerModel);\n\t\t\t// Turn all of that into a Array string\n\t\t\treturn $fractal->createData($resource)->toArray();\n\n\t\t}\n\t\telse{\n\t\t\treturn $this->setStatusCode(501)->respondWithError('Error');\n\t\t}\n\t}", "function isModerated()\r\n {\r\n $ret = false;\r\n if ( $this->IsModerated == 1 )\r\n $ret = true;\r\n\r\n return $ret;\r\n }", "public function get_articles() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/articles.json\");\n }", "function get_all_gradable_items() {\n\n global $CFG;\n \n $sql = \"SELECT a.id, a.name, a.description as summary, a.course, c.id as cmid\n FROM {$CFG->prefix}assignment a\n INNER JOIN {$CFG->prefix}course_modules c\n ON a.id = c.instance\n WHERE c.module = {$this->mainobject->modulesettings['assignment']->id}\n AND c.visible = 1\n AND a.course IN ({$this->mainobject->course_ids})\n ORDER BY a.id\";\n\n $assignments = get_records_sql($sql);\n $this->assessments = $assignments;\n \n }", "function get_modules(){\n\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/libs/database.php\");\n\t// consulta obtener los modulos con acceso\n\t$sql=\"select m.nombre from modulos m,permiso_modulo mp where mp.id_modulo=m.id_modulo and mp.id_permiso=(select id_permiso from personal where id_personal=?)\";\n\n\t// toma la pk del usuario y obtiene los datos\n\t$params = array($_SESSION[\"id_personal\"]);\n\t$data = Database::getRows($sql, $params);\n\t// inicia todos los modulos en false\n\t$_modules = array();\n\t// recorre los modulos a los que tiene acceso\n\tforeach($data as $row)\n\t{\n\t\t// cambia a true el elemento de array que le corresponde al modulo\n\t\t$_modules[$row[\"nombre\"]] = true;\t\n\t}\n\treturn $_modules;\n}", "public function allArticles(){\n\t\t$articles = $this->all(); \n\t\tforeach ($articles as $key => $value) {\n\t\t\tif (array_key_exists(\"content\",$value)){\n\t\t\t\t($articles[$key]['content'] = htmlspecialchars_decode($value['content'])); \n\t\t\t}\n\t\t}\n\t\treturn $articles; \n\t}", "public function showArticles()\n\t{\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation DESC');\n\n\t\t$req->execute();\n\n\t\t$values = $req->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach ($values as $value)\n\t\t{\n\t\t\t$articles[] = new Article($value);\n\t\t}\n\n\t\treturn $articles;\n\t}", "public function isModerator()\n {\n }", "public function index()\n {\n // Educator: group_id = 2\n\n if(auth()->user()->group_id == 2)\n {\n // Show lessons of a particular subject\n if(isset($_GET['subject']) && !empty($_GET['subject']))\n {\n $subject_id = urlencode($_GET['subject']);\n\n $get_subject = Subject::where('id', $subject_id)->first();\n\n // Show all lessons to admin\n $user_id = auth()->user()->id;\n\n if(auth()->user()->role_id == 2)\n {\n $lessons = Lesson::where('subject_id', $subject_id)->orderBy('id', 'asc')->paginate(10)->appends(request()->query());\n }\n else\n {\n // Show only lessons created by non-admins\n $lessons = Lesson::where('subject_id', $subject_id)->where('user_id', $user_id)->orderBy('id', 'asc')->paginate(10)->appends(request()->query());\n }\n \n\n return view('educators.lessons.index', compact('lessons', 'get_subject'));\n }\n // Show lessons of a particular package (class)\n if(isset($_GET['package']) && !empty($_GET['package']))\n {\n $package_id = urlencode($_GET['package']);\n\n $get_package = Package::where('id', $package_id)->first();\n\n // Show all lessons to admin\n $user_id = auth()->user()->id;\n\n if(auth()->user()->role_id == 2)\n {\n $lessons = Lesson::where('package_id', $package_id)->orderBy('id', 'asc')->paginate(10)->appends(request()->query());\n }\n else\n {\n // Show only lessons created by non-admins\n $lessons = Lesson::where('package_id', $package_id)->where('user_id', $user_id)->orderBy('id', 'asc')->paginate(10)->appends(request()->query());\n }\n\n return view('educators.lessons.index', compact('lessons', 'get_package'));\n }\n else\n {\n // Show all lessons to admin\n $user_id = auth()->user()->id;\n\n if(auth()->user()->role_id == 2)\n {\n $lessons = Lesson::orderBy('id', 'asc')->paginate(10);\n }\n else\n {\n $lessons = Lesson::orderBy('id', 'asc')->where('user_id', $user_id)->paginate(10);\n }\n\n return view('educators.lessons.index', compact('lessons'));\n }\n\n }\n else\n {\n return redirect('/')->with('error', 'Something went wrong. Access denied.');\n }\n }", "public function getLimitedChapters(): array\n {\n $sql = \"\n SELECT posts.id,\n posts.title,\n posts.image_posts,\n posts.date_posts,\n posts.content,\n admins.name\n FROM posts\n JOIN admins\n WHERE posted='1'\n ORDER BY date_posts DESC\n LIMIT 0,1\n \";\n\n $query = Database::getDb()->query($sql);\n $results = $query->fetchAll(PDO::FETCH_OBJ);\n return $results;\n }", "public function getListeArticles()\n {\n $rowset = $this->tableGateway->select(array('type'=> 'article'));\n return $rowset;\n }", "public function getArticles()\n {\n return NewsArticle::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}", "public function getListItems()\n {\n return $this->getArticles();\n }", "public function getModulos() {\n $iduser = Yii::$app->session->get('PB_iduser', FALSE);\n \n $sql = \"SELECT \n DISTINCT(modu.mod_id),modu.*\n FROM \n grupo_rol as grol \n JOIN usuario as usu on grol.usu_id=usu.usu_id \n JOIN grup_obmo_grup_rol as gogr on grol.grol_id=gogr.grol_id \n JOIN grup_obmo as gob on gogr.gmod_id=gob.gmod_id \n JOIN objeto_modulo as omod on gob.omod_id=omod.omod_id \n JOIN modulo as modu on omod.mod_id=modu.mod_id \n WHERE \n usu.usu_id=$iduser AND \n usu.usu_estado_logico=1 AND \n usu.usu_estado_activo=1 AND \n grol.grol_estado_logico=1 AND \n grol.grol_estado_activo=1 AND \n gogr.gogr_estado_logico=1 AND \n gogr.gogr_estado_activo=1 AND \n gob.gmod_estado_logico=1 AND \n gob.gmod_estado_activo=1 AND \n omod.omod_estado_logico=1 AND \n omod.omod_estado_activo=1 AND \n modu.mod_estado_logico=1 AND \n modu.mod_estado_activo=1 \n ORDER BY modu.mod_orden;\";\n $res = Yii::$app->db->createCommand($sql)->queryAll();\n return $res;\n }", "public function getItems() {\n\t\t$public = true;\t\t\n\n\t\t$userAccessLevels = '(1)';\n\t\t$displayAccess = JoaktreeHelper::getDisplayAccess($public);\n\t\t\t\t\t\t\n\t\t// retrieve persons\n\t\t$db\t\t\t\t= $this->getDbo();\n\t\t$query\t\t\t= $db->getQuery(true);\n\t\t\n\t\t// select the basics\n\t\t$query->select(' jpn.app_id ');\n\t\t$query->select(' jpn.id ');\n\t\t$query->select(JoaktreeHelper::getSelectFirstName().' AS firstName ');\n\t\t$query->select(JoaktreeHelper::getConcatenatedFamilyName().' AS familyName ');\n\t\t$query->from( ' #__joaktree_persons jpn ');\n\t\t\n\t\t// privacy filter\n\t\t$query->select(' jan.default_tree_id AS treeId ');\n\t\t$query->innerJoin(JoaktreeHelper::getJoinAdminPersons(false));\n\t\t$query->innerJoin(' #__joaktree_trees jte '\n\t\t\t\t\t\t .' ON ( jte.app_id = jan.app_id '\n\t\t\t\t\t\t .' AND jte.id = jan.default_tree_id '\n\t\t\t\t\t\t .' AND jte.published = true '\n\t\t\t\t\t\t .' AND jte.access IN '.$userAccessLevels.' '\n\t\t\t\t\t\t // only trees with Gendex = yes (=2)\n\t\t\t\t\t\t .' AND jte.indGendex = 2 '\n\t\t\t\t\t\t .' ) '\n\t\t\t\t\t\t );\n\t\t\n\t\t// birth info\n\t\t$query->select(' birth.eventDate AS birthDate ');\n\t\t$query->select(' birth.location AS birthPlace ');\n\t\t$query->leftJoin(' #__joaktree_person_events birth '\n\t\t\t\t\t\t.' ON ( birth.app_id = jpn.app_id '\n\t\t\t\t\t\t.' AND birth.person_id = jpn.id '\n\t\t\t\t\t\t.' AND birth.code = '.$this->_db->Quote('BIRT').' '\n\t\t\t\t\t\t// no alternative text is shown \n\t\t\t\t\t\t.' AND ( (jan.living = false AND '.$displayAccess['BIRTperson']->notLiving.' = 2 ) '\n\t\t\t\t\t\t.' OR (jan.living = true AND '.$displayAccess['BIRTperson']->living.' = 2 ) '\n\t\t\t\t\t\t.' ) '\n\t\t\t\t\t\t.' ) '\n\t\t\t\t\t\t);\n\t\t\n\t\t// death info\n\t\t$query->select(' death.eventDate AS deathDate ');\n\t\t$query->select(' death.location AS deathPlace ');\n\t\t$query->leftJoin(' #__joaktree_person_events death '\n\t\t\t\t\t\t.' ON ( death.app_id = jpn.app_id '\n\t\t\t\t\t\t.' AND death.person_id = jpn.id '\n\t\t\t\t\t\t.' AND death.code = '.$this->_db->Quote('DEAT').' '\n\t\t\t\t\t\t// no alternative text is shown \n\t\t\t\t\t\t.' AND ( (jan.living = false AND '.$displayAccess['DEATperson']->notLiving.' = 2 ) '\n\t\t\t\t\t\t.' OR (jan.living = true AND '.$displayAccess['DEATperson']->living.' = 2 ) '\n\t\t\t\t\t\t.' ) '\n\t\t\t\t\t\t.' ) '\n\t\t\t\t\t\t);\n\t\t\n\t\t\t\t\t\t \n\t\t//$query = 'SELECT jpn.app_id '\n\t\t//\t\t.', jpn.id '\n\t\t//\t\t.', jan.default_tree_id AS treeId '\n\t\t//\t\t.', jpn.firstName '\n\t\t//\t\t.', CONCAT_WS('.$this->_db->quote(' ').' '\n\t\t//\t\t.' , jpn.namePreposition '\n\t\t//\t\t.' , jpn.familyName '\n\t\t//\t\t.' ) AS familyName '\n\t\t//\t\t// no alternative text is shown \n\t\t//\t\t.', birth.eventDate AS birthDate '\n\t\t//\t\t.', birth.location AS birthPlace '\n\t\t//\t\t.', death.eventDate AS deathDate '\n\t\t//\t\t.', death.location AS deathPlace '\t\t\t\t\n\t\t//\t\t.'FROM #__joaktree_persons jpn '\n\t\t//\t\t.'JOIN #__joaktree_admin_persons jan '\n\t\t//\t\t.'ON ( jan.app_id = jpn.app_id '\n\t\t//\t\t.' AND jan.id = jpn.id '\n\t\t//\t\t.' AND jan.published = true '\n\t // // privacy filter\n\t\t//\t\t.' AND ( (jan.living = false AND '.$displayAccess['NAMEname']->notLiving.' = 2 ) '\n\t\t//\t\t.' OR (jan.living = true AND '.$displayAccess['NAMEname']->living.' = 2 ) '\n\t\t//\t\t.' ) '\n\t\t//\t\t.' ) '\n\t\t//\t\t.'JOIN #__joaktree_trees jte '\n\t\t//\t\t.'ON ( jte.app_id = jan.app_id '\n\t\t//\t\t.' AND jte.id = jan.default_tree_id '\n\t\t//\t\t.' AND jte.published = true '\n\t\t//\t\t.' AND jte.access IN '.$userAccessLevels.' '\n\t\t//\t\t// only trees with Gendex = yes (=2)\n\t\t//\t\t.' AND jte.indGendex = 2 '\n\t\t//\t\t.' ) '\n\t\t//\t\t.'LEFT JOIN #__joaktree_person_events birth '\n\t\t//\t\t.'ON ( birth.app_id = jpn.app_id '\n\t\t//\t\t.' AND birth.person_id = jpn.id '\n\t\t//\t\t.' AND birth.code = '.$this->_db->Quote('BIRT').' '\n\t\t//\t\t// no alternative text is shown \n\t\t//\t\t.' AND ( (jan.living = false AND '.$displayAccess['BIRTperson']->notLiving.' = 2 ) '\n\t\t//\t\t.' OR (jan.living = true AND '.$displayAccess['BIRTperson']->living.' = 2 ) '\n\t\t//\t\t.' ) '\n\t\t//\t\t.' ) '\n\t\t//\t\t.'LEFT JOIN #__joaktree_person_events death '\n\t\t//\t\t.'ON ( death.app_id = jpn.app_id '\n\t\t//\t\t.' AND death.person_id = jpn.id '\n\t\t//\t\t.' AND death.code = '.$this->_db->Quote('DEAT').' '\n\t\t//\t\t// no alternative text is shown \n\t\t//\t\t.' AND ( (jan.living = false AND '.$displayAccess['DEATperson']->notLiving.' = 2 ) '\n\t\t//\t\t.' OR (jan.living = true AND '.$displayAccess['DEATperson']->living.' = 2 ) '\n\t\t//\t\t.' ) '\n\t\t//\t\t.' ) ';\n\n\t\t$this->_db->setQuery($query);\n\t\t$result = $this->_db->loadObjectList();\n\t\t\n\t\treturn $result;\n\t}", "public function getRecommendations()\n {\n return $this->recommendations()->pluck( 'related_post_id');\n }", "function getModules()\n\t{\n\t\t $this->loadModel('Module'); \n\n\t\t $sections = $this->Module->query(\"SELECT * FROM modules WHERE enable = '1'\");\n\t\t return $sections;\n\t}", "public function findArticles() : Collection\n {\n return $this->model->articles;\n }", "function getArticleList($search_content, $nbArticles) {\r\n $query1 = createQuery($search_content, '%20');\r\n $query2 = 'http://lemoteur.orange.fr/?module=lemoteur&bhv=actu&kw='.$query1;\r\n // The DOM variable contains the DOM of the search result\r\n $dom = getPageContent($query2);\r\n\r\n $articles = array();\r\n $cursor = 0;\r\n foreach ($dom->find('div.entry') as $articleContent) {\r\n $articleText = $articleContent->plaintext;\r\n $articleLink = $articleContent->find('a')[0];\r\n $articleTitle = $articleLink->plaintext;\r\n $articleUrl = $articleContent->find('a')[0]->href;\r\n\r\n $articleArray = [\r\n \"text\" => $articleText,\r\n \"link\" => $articleLink,\r\n \"title\" => $articleTitle,\r\n \"url\" => $articleUrl,\r\n ];\r\n\r\n array_push($articles, $articleArray);\r\n $cursor++;\r\n if ($cursor > $nbArticles) {\r\n break;\r\n }\r\n }\r\n\r\n return $articles;\r\n\r\n}", "function getElectedRepresentativeComments($er_id, $limit=\"\")\n\t\t{ \n\t\t\tif($limit != \"\") {\n\t\t\t\t\n\t\t\t\t$query = \"SELECT * FROM tbl_elected_officials_comments \n\t\t\t\twhere elected_officer_id='\".$er_id.\"' and article_type='article' limit 0, $limit\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$query = \"SELECT * FROM tbl_elected_officials_comments \n\t\t\t\twhere elected_officer_id='\".$er_id.\"' and article_type='article'\";\n\t\t\t}\t\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $this->_getPageArray($rs, 'ElectoralDistrictComments');\n\t\t}", "public function isModerated()\n {\n return $this->attribute('state') == self::STATUS_MODERATED;\n }", "function _getAnnouncementsEnabled($request) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "function getItems()\n\t{\n\t\t$limit = $this->getState('list.limit');\n\n\t\tif ($this->_articles === null && $category = $this->getCategory())\n\t\t{\n\t\t\t$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));\n\t\t\t$model->setState('params', JFactory::getApplication()->getParams());\n\t\t\t$model->setState('filter.category_id', $category->id);\n\t\t\t$model->setState('filter.published', $this->getState('filter.published'));\n\t\t\t$model->setState('filter.access', $this->getState('filter.access'));\n\t\t\t$model->setState('filter.language', $this->getState('filter.language'));\n\t\t\t$model->setState('list.ordering', $this->_buildContentOrderBy());\n\t\t\t$model->setState('list.start', $this->getState('list.start'));\n\t\t\t$model->setState('list.limit', $limit);\n\t\t\t$model->setState('list.direction', $this->getState('list.direction'));\n\t\t\t$model->setState('list.filter', $this->getState('list.filter'));\n\t\t\t// filter.subcategories indicates whether to include articles from subcategories in the list or blog\n\t\t\t$model->setState('filter.subcategories', $this->getState('filter.subcategories'));\n\t\t\t$model->setState('filter.max_category_levels', $this->getState('filter.max_category_levels'));\n\t\t\t$model->setState('list.links', $this->getState('list.links'));\n\n\t\t\tif ($limit >= 0)\n\t\t\t{\n\t\t\t\t$this->_articles = $model->getItems();\n\n\t\t\t\tif ($this->_articles === false)\n\t\t\t\t{\n\t\t\t\t\t$this->setError($model->getError());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_articles = array();\n\t\t\t}\n\n\t\t\t$this->_pagination = $model->getPagination();\n\t\t}\n\n\t\treturn $this->_articles;\n\t}", "public function countNotModerated(){\n $count = ORM::factory($this->object_name())->where('moderate', '=', 0)->count_all();\n return $count;\n }", "public function isModerador(){ return false; }", "function smarty_function_listforummods($params, &$smarty)\n{\n extract($params);\n\tunset($params);\n\n $out = \"\";\n foreach($moderators as $mod_id=>$mod_name) {\n if($count > 0) {\n\t $out .= \", \";\n\t }\n\t if($mod_id < 1000000) {\n\t $out .= '<a title=\"'. pnVarPrepForDisplay(_PNFORUM_PROFILE) . ': ' . pnVarPrepForDisplay($mod_name) . '\" href=\"user.php?op=userinfo&amp;uname='.pnVarPrepForDisplay($mod_name).'\">'.pnVarPrepForDisplay($mod_name).'</a>';\n\t } else {\n\t $out .= pnVarPrepForDisplay($mod_name);\n\t }\n\t $count++;\n }\n return $out;\n}", "function findAllAdministrators() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM admins;'));\r\n\r\n\t}", "public function oldLimitedChapter(): array\n {\n $sql = \"\n SELECT posts.id,\n posts.title,\n posts.image_posts,\n posts.date_posts,\n posts.content,\n admins.name\n FROM posts\n JOIN admins\n WHERE posts.id=1\n AND posts.posted = 1\n \";\n\n $query = Database::getDb()->query($sql);\n $results = $query->fetchAll(PDO::FETCH_OBJ);\n return $results;\n }", "public function getReaderModules()\n {\n $arrModules = [];\n $objModules = $this->Database->execute(\n \"SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type LIKE 'newsreader%' ORDER BY t.name, m.name\"\n );\n\n while ($objModules->next())\n {\n $arrModules[$objModules->theme][$objModules->id] = $objModules->name . ' (ID ' . $objModules->id . ')';\n }\n\n return $arrModules;\n }", "protected function computeModerationFieldItemList() {\n // Compute the value of the moderation state.\n $index = 0;\n if (!isset($this->list[$index]) || $this->list[$index]->isEmpty()) {\n\n $moderation_state = $this->getModerationStateId();\n // Do not store NULL values in the static cache.\n if ($moderation_state) {\n $this->list[$index] = $this->createItem($index, $moderation_state);\n }\n }\n }", "public function getContextSpecificModules() {\n\t\t$modules = [];\n\t\t$user = $this->getUser();\n\t\t$req = $this->getRequest();\n\t\t$action = $req->getVal( 'article_action' );\n\t\t$campaign = $req->getVal( 'campaign' );\n\t\t$title = $this->getTitle();\n\n\t\tif ( !$title->isSpecialPage() ) {\n\t\t\tif ( $this->isAllowedPageAction( 'watch' ) ) {\n\t\t\t\t// Explicitly add the mobile watchstar code.\n\t\t\t\t$modules[] = 'skins.minerva.watchstar';\n\t\t\t}\n\t\t\tif ( $this->isCurrentPageContentModelEditable() ) {\n\t\t\t\t$modules[] = 'skins.minerva.editor';\n\t\t\t}\n\t\t}\n\n\t\tif ( $user->isLoggedIn() ) {\n\t\t\tif ( $this->useEcho() ) {\n\t\t\t\t$modules[] = 'skins.minerva.notifications';\n\t\t\t}\n\n\t\t\tif ( $this->isCurrentPageEditableByUser() ) {\n\t\t\t\tif ( $action === 'signup-edit' || $campaign === 'leftNavSignup' ) {\n\t\t\t\t\t$modules[] = 'skins.minerva.newusers';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// TalkOverlay feature\n\t\tif (\n\t\t\t$this->isUserPage ||\n\t\t\t( $this->isTalkAllowed() || $title->isTalkPage() ) &&\n\t\t\t$this->isWikiTextTalkPage()\n\t\t) {\n\t\t\t$modules[] = 'skins.minerva.talk';\n\t\t}\n\n\t\tif ( $this->hasCategoryLinks() ) {\n\t\t\t$modules[] = 'skins.minerva.categories';\n\t\t}\n\n\t\tif ( $this->getSkinOption( self::OPTION_FONT_CHANGER ) ) {\n\t\t\t$modules[] = 'skins.minerva.fontchanger';\n\t\t}\n\n\t\tif ( $this->getSkinOption( self::OPTION_BACK_TO_TOP ) ) {\n\t\t\t$modules[] = 'skins.minerva.backtotop';\n\t\t}\n\n\t\treturn $modules;\n\t}", "function _getPublishedArticles($submissionIds, $context) {\n\t\t$publishedArticles = array();\n\t\t$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');\n\t\tforeach ($submissionIds as $submissionId) {\n\t\t\t$publishedArticle = $publishedArticleDao->getPublishedArticleByArticleId($submissionId, $context->getId());\n\t\t\tif ($publishedArticle) $publishedArticles[] = $publishedArticle;\n\t\t}\n\t\treturn $publishedArticles;\n\t}", "function &getSectionItems(&$params)\n\t{\n\t\t$db\t\t= &JFactory::getDBO();\n\t\t$user\t= &JFactory::getUser();\n\t\t$aid\t= $user->get('aid');\n\n\t\t// get some date values for the query\n\t\t$date\t\t= &JFactory::getDate();\n\t\t$now\t\t= $date->toMySQL();\n\t\t$nullDate\t= $db->getNullDate();\n\t\t\n\t\t//JXComments integration\n\t\t$jxcomments = (int)$params->get('jxcomments');\n\n\t\t// get and sanitize the category ids\n\t\tjimport('joomla.utilities.arrayhelper');\n\t\t$section_ids = (array)$params->get('sec_ids');\n\t\tJArrayHelper::toInteger($section_ids);\n\n\t\t// build the query to get article information\n\t\t$db->setQuery(\n\t\t\t'SELECT a.*, cc.description as catdesc, cc.title as cattitle, s.description as secdesc, s.title as sectitle,'.\n\t\t\t' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\":\", a.id, a.alias) ELSE a.id END as slug,'.\n\t\t\t' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(\":\", cc.id, cc.alias) ELSE cc.id END as catslug,'.\n\t\t\t' CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(\":\", s.id, s.alias) ELSE s.id END as secslug'.\n\t\t\t' FROM #__content AS a'.\n\t\t\t' INNER JOIN #__categories AS cc ON cc.id = a.catid'.\n\t\t\t' INNER JOIN #__sections AS s ON s.id = a.sectionid'.\n\t\t\t' WHERE a.state = 1'.\n\t\t\t' AND a.access <= '.(int) $aid.' AND cc.access <= '.(int) $aid.' AND s.access <= '.(int) $aid .\n\t\t\t' AND (a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' ) '.\n\t\t\t' AND (a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'.\n\t\t\t' AND (a.sectionid = '.implode(' OR a.sectionid = ', $section_ids).' )' .\n\t\t\t' AND cc.section = s.id'.\n\t\t\t' AND cc.published = 1'.\n\t\t\t' AND s.published = 1'.\n\t\t\t' ORDER BY a.created DESC',\n\t\t\t0, (int)$params->get('num_items')\n\t\t);\n\t\t$rows = $db->loadObjectList();\n\n\t\t// import library dependencies\n\t\trequire_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');\n\n\t\tfor ($i=0,$n=count($rows); $i < $n; $i++)\n\t\t{\n\t\t\t$rows[$i]->article_link = JRoute::_(ContentHelperRoute::getArticleRoute($rows[$i]->slug, $rows[$i]->catslug, $rows[$i]->sectionid));\n\t\t\t$rows[$i]->category_link = JRoute::_(ContentHelperRoute::getCategoryRoute($rows[$i]->catslug, $rows[$i]->sectionid));\n\t\t\t$rows[$i]->section_link = JRoute::_(ContentHelperRoute::getSectionRoute($rows[$i]->sectionid));\n\t\t\t$rows[$i]->date = $rows[$i]->created;\n\t\t\t$rows[$i]->text = modAnnouncmentHelper::processText($rows[$i], $params);\n\t\t\tif($jxcomments)\n\t\t\t{\n\t\t\t\t$rows[$i]->num_comments = modAnnouncmentHelper::getNumComments($rows[$i]->id);\n\t\t\t}\n\t\t}\n\n\t\treturn $rows;\n\t}", "public function articles(){ //establece la relacion entre modelos, en este caso 1 a muchos\n return $this -> hasMany('App\\Article');\n }", "public function getNews($onlyForMe = false) {\n \tif($onlyForMe)\n \t\treturn $this->posts;\n \t\n \t$news = [];\n \t$p = $this;\n \twhile($p)\n \t{\n \t\t$news = array_merge($news, $p->posts);\n \t\t$p = $p->getParent();\n \t}\n \treturn $news;\n }", "public function news() {\n return $this->morphedByMany(News::class, 'taggable');\n }", "public function getAllArticlesWithReviews()\n {\n return Db::queryAll('SELECT `article`.`id`, `article`.`title`, `user`.`username`, `review`.`id` AS `review`, `review`.`user_id`,\n `reviewer`.`username` AS `reviewer`, `review`.`article_id`, \n `review`.`rating_originality`, `review`.`rating_theme`, `review`.`rating_language`, \n `review`.`rating_awesomeness`, `review`.`rating_style`, `article`.`state`,\n FORMAT(`review`.`rating_originality` + `review`.`rating_theme` + `review`.`rating_language` + `review`.`rating_awesomeness` +`review`.`rating_style`, \"N2\") / 5 AS `rating`,\n (SELECT COUNT(*) FROM `review` WHERE `article`.`id` = `review`.`article_id`) AS `count`\n FROM `article` LEFT JOIN `review` ON `article`.`id` = `review`.`article_id` \n INNER JOIN `user` ON `user`.`id` = `article`.`author`\n LEFT JOIN `user` `reviewer` ON `reviewer`.`id` = `review`.`user_id`');\n }", "function get_multimod($fid)\n\t{\n\t\t$mm_array = array();\n\t\t\n\t\t$pass_go = FALSE;\n\t\t\n\t\tif ( $this->member['id'] )\n\t\t{\n\t\t\tif ( $this->member['g_is_supmod'] )\n\t\t\t{\n\t\t\t\t$pass_go = TRUE;\n\t\t\t}\n\t\t\telse if ( isset($this->member['_moderator'][ $fid ]['can_mm']) AND $this->member['_moderator'][ $fid ]['can_mm'] == 1 )\n\t\t\t{\n\t\t\t\t$pass_go = TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $pass_go != TRUE )\n\t\t{\n\t\t\treturn $mm_array;\n\t\t}\n\t\t\n\t\tif ( ! array_key_exists( 'multimod', $this->cache ) )\n {\n \t$this->cache['multimod'] = array();\n \t\n\t\t\t$this->DB->simple_construct( array(\n\t\t\t\t\t\t\t\t\t\t\t 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t 'from' => 'topic_mmod',\n\t\t\t\t\t\t\t\t\t\t\t 'order' => 'mm_title'\n\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t\t\n\t\t\t$this->DB->simple_exec();\n\t\t\t\t\t\t\n\t\t\twhile ($i = $this->DB->fetch_row())\n\t\t\t{\n\t\t\t\t$this->cache['multimod'][ $i['mm_id'] ] = $i;\n\t\t\t}\n\t\t\t\n\t\t\t$this->update_cache( array( 'name' => 'multimod', 'array' => 1, 'deletefirst' => 1 ) );\n }\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the topic mod thingies\n\t\t//-----------------------------------------\n\t\t\n\t\tif( count( $this->cache['multimod'] ) AND is_array( $this->cache['multimod'] ) )\n\t\t{\n\t\t\tforeach( $this->cache['multimod'] as $r )\n\t\t\t{\n\t\t\t\tif ( $r['mm_forums'] == '*' OR strstr( \",\".$r['mm_forums'].\",\", \",\".$fid.\",\" ) )\n\t\t\t\t{\n\t\t\t\t\t$mm_array[] = array( $r['mm_id'], $r['mm_title'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $mm_array;\n\t}", "public function getArticles()\n {\n // TODO: prepare the database connection\n // Note: you might want to use a re-usable databaseManager class - the choice is yours\n // obtain the passed params from array in the config file\n // TODO: fetch all articles as $rawArticles (as a simple array)\n $sql = \"SELECT * FROM articles\";\n $result = $this->databaseManager->connection->query($sql)->fetchAll();\n $rawArticles = $result;\n\n $articles = [];\n foreach ($rawArticles as $rawArticle) {\n // We are converting an article from a \"dumb\" array to a much more flexible class\n\n $articles[] = new Article($rawArticle['title'], $rawArticle['description'], $rawArticle['publish_date']);\n\n }\n\n return $articles;\n }", "public static function getAuthorisedFeeds($action)\n\t{\n\t\t$user = JFactory::getUser();\n\t\t$db = JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->select($db->quoteName(array('f.id', 'a.name'), array('id', 'asset_name')));\n\t\t$query->from($db->quoteName('#__podcastmanager_feeds', 'f'));\n\t\t$query->innerJoin($db->quoteName('#__assets', 'a') . ' ON f.asset_id = a.id');\n\t\t$query->where($db->quoteName('f.published') . ' = 1');\n\t\t$db->setQuery($query);\n\t\t$allFeeds = $db->loadObjectList('id');\n\t\t$allowedFeeds = array();\n\n\t\tforeach ($allFeeds as $feed)\n\t\t{\n\t\t\tif ($user->authorise($action, $feed->asset_name))\n\t\t\t{\n\t\t\t\t$allowedFeeds[] = (int) $feed->id;\n\t\t\t}\n\t\t}\n\n\t\treturn $allowedFeeds;\n\t}", "protected function _get_moderator_groups()\n {\n $moderator_group = $this->connection->query('SELECT gid FROM ' . $this->connection->get_table_prefix() . 'usergroups WHERE title LIKE \\'' . db_encode_like('%Moderator%') . '\\'');\n\n if (is_null($moderator_group)) {\n return array();\n }\n\n $return_moderator_group = array();\n foreach ($moderator_group as $key => $value) {\n if (!empty($value['gid'])) {\n $return_moderator_group[] = $value['gid'];\n }\n }\n\n return $return_moderator_group;\n }", "function getArticles() {\n global $db;\n $query = $db->query('SELECT * FROM article, auteur\n WHERE article.auteur_id = auteur.id ORDER BY article.id DESC');\n return $query->fetchAll();\n \n}", "function getElectedRepresentativePolls($er_id,$limit = \"\")\n\t\t{ \n\t\t\tif($limit != \"\") {\n\t\t\t\t\n\t\t\t\t$query = \"SELECT * FROM tbl_elected_officials_comments \n\t\t\t\twhere elected_officer_id='\".$er_id.\"' and article_type='poll' limit 0, $limit\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$query = \"SELECT * FROM tbl_elected_officials_comments \n\t\t\t\twhere elected_officer_id='\".$er_id.\"' and article_type='poll'\";\n\t\t\t}\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $this->_getPageArray($rs, 'ElectoralDistrictComments');\n\t\t}", "public function getReaderModules()\n\t{\n\t\t$arrModules = array();\n\t\t$objModules = $this->Database->execute(\"SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type='newsreader' ORDER BY t.name, m.name\");\n\n\t\twhile ($objModules->next())\n\t\t{\n\t\t\t$arrModules[$objModules->theme][$objModules->id] = $objModules->name . ' (ID ' . $objModules->id . ')';\n\t\t}\n\n\t\treturn $arrModules;\n\t}", "public function articles()\n {\n return Board::where('news', 1)->first()->threads;\n }", "public function getAllModularInfo()\n {\n $modularInfo = new Collection();\n foreach ($this->getAllValidModular() as $modularName => $modular) {\n $modularInfo[$modularName] = $this->getModularInformation($modularName);\n }\n\n return $modularInfo;\n }", "public function getList(){\r\n $listArticles =[]; ///on creer une liste vide ou ont mettra tous les articles\r\n\r\n\r\n //prepare une requete de type select\r\n $sql='SELECT * FROM articles';\r\n $req = $this->bdd->prepare($sql);\r\n\r\n//////execution de la requete avec attribution des valeurs\r\n$req->execute();\r\n\r\n/////on stocke les données obtenues dans un tableau\r\nwhile ($donnees = $req->fetch(PDO::FETCH_ASSOC)){///tant que il y a des article alors on boucle\r\n ////on cree des objets avec les données issue de la bdd\r\n $articles = new articles();\r\n $articles->hydrate($donnees);\r\n $listArticles[] = $articles;\r\n}\r\n///print_r2($listArticles)\r\nreturn $listArticles;\r\n\r\n}", "public function publishedArticles()\n {\n return Courses::loadAllPublished();\n }", "public function articles() {\n //hasMany representa la relacion de un a muchos\n return $this->hasMany(\"App\\Article\");\n }", "function get_data($deep_search = false)\n {\n $content = $this->get_content();\n\n // Get article links form the main website\n $links = $this->get_article_links($content, $deep_search);\n $articles_by_author = [];\n $ignore_list = ['directories'];\n\n foreach ($links as $link) {\n // Skip blog entries for now\n if (preg_match('/.*' . join('|', $ignore_list) . '.*/', $link)) {\n continue;\n }\n\n if (preg_match('/.*article.*/', $link)) {\n $article = $this->scrape_article($link);\n }\n if (preg_match('/.*blog.*/', $link)) {\n $article = $this->scrape_blog($link);\n }\n\n $author = $article['author']['name'];\n if (empty($author))\n continue;\n\n if (!array_key_exists($author, $articles_by_author))\n $articles_by_author[$author] = [];\n $articles_by_author[$author][] = $article;\n }\n\n return $articles_by_author;\n }" ]
[ "0.66169465", "0.6291017", "0.62382805", "0.6228295", "0.61747533", "0.6164168", "0.59646636", "0.5956839", "0.5868439", "0.5835457", "0.57375443", "0.5704518", "0.5686709", "0.56681216", "0.56649727", "0.56300044", "0.5625015", "0.5615906", "0.5600036", "0.5590634", "0.5579171", "0.5575683", "0.5564634", "0.55414194", "0.5540075", "0.5531543", "0.55199844", "0.5517115", "0.5511598", "0.54757434", "0.54483837", "0.5424262", "0.54113674", "0.53945327", "0.5391819", "0.5381683", "0.5376722", "0.5359956", "0.53476", "0.53401697", "0.53153574", "0.53130156", "0.53122276", "0.5302154", "0.52989554", "0.52903545", "0.52871287", "0.52417165", "0.5239773", "0.52380896", "0.5225534", "0.5220507", "0.52195096", "0.5215516", "0.5200751", "0.51977926", "0.5194527", "0.517447", "0.5166818", "0.5164015", "0.5154203", "0.51515484", "0.51414883", "0.51411414", "0.5127503", "0.5115672", "0.51150393", "0.510825", "0.5105551", "0.5103143", "0.51017237", "0.5095988", "0.5090118", "0.5085196", "0.50701344", "0.50691926", "0.50523657", "0.5044135", "0.50439036", "0.50196624", "0.5012218", "0.50042486", "0.49967024", "0.49961406", "0.49948514", "0.4986716", "0.49857718", "0.49788532", "0.49760434", "0.497509", "0.4970416", "0.49682462", "0.49679515", "0.49640146", "0.49617687", "0.4960849", "0.4953659", "0.4951128", "0.4948889", "0.4947365" ]
0.75576675
0
/ Reject article publishing Return redirect
public function reject_article($request) { $this->status_id = 4; if($this->update()) { $message = new Article_Reject_Messages; $message->article_id = $this->id; $message->text = $request['reason']; if($message->save()){ Session::flash('flash_message_text', 'Статья была успешно отклонена'); Session::flash('flash_message_class', 'success'); if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list'); return redirect('/dashboard/moderator/moderation_list'); } else { Session::flash('flash_message_text', 'Ошибка создания сообщения'); Session::flash('flash_message_class', 'danger'); if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list'); return redirect('/dashboard/moderator/moderation_list'); } } else { Session::flash('flash_message_text', 'Ошибка отклонения статьи'); Session::flash('flash_message_class', 'danger'); return back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unpublish()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\n\t\tif (count( $cid ) < 1) {\n\t\t\tJError::raiseError(500, JText::_( 'Select an item to unpublish' ) );\n\t\t}\n\n\t\t$model = $this->getModel('weblink');\n\t\tif(!$model->publish($cid, 0)) {\n\t\t\techo \"<script> alert('\".$model->getError(true).\"'); window.history.go(-1); </script>\\n\";\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "function publish()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\n\t\tif (count( $cid ) < 1) {\n\t\t\tJError::raiseError(500, JText::_( 'Select an item to publish' ) );\n\t\t}\n\n\t\t$model = $this->getModel('weblink');\n\t\tif(!$model->publish($cid, 1)) {\n\t\t\techo \"<script> alert('\".$model->getError(true).\"'); window.history.go(-1); </script>\\n\";\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "public function intendedReply($article_id)\n {\n // if user is authenticated, redirect to the previous page\n return redirect('article/p/' . $article_id);\n }", "public function adRedirectAction() {\n\t$adId = $this->_getParam('adId');\n\t$adId = Engine_Api::_()->communityad()->getEncodeToDecode($adId);\n\t$redirect = Engine_Api::_()->communityad()->ad_clickcount($adId);\n\tif ($redirect == 'false') {\n\t return $this->_forward('notfound', 'error', 'core');\n\t}\n }", "protected function checkRedirect() {}", "public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public function denyLink()\n {\n }", "public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }", "public function postAction() {\n return $this->getResponse()->setHttpResponseCode(403);\n }", "function publish()\n\t{\n\t\t// Check for request forgeries.\n\t\tJRequest::checkToken() or jexit(JText::_('Invalid_Token'));\n\n\t\t// Get and sanitize the items to delete.\n\t\t$cid = JRequest::getVar('cid', null, 'post', 'array');\n\t\tJArrayHelper::toInteger($cid);\n\n\t\t// Get the model.\n\t\t$model = &$this->getModel('Link', 'RedirectModel');\n\n\t\t// Attempt to set the publishing state for the links.\n\t\tswitch ($this->_task)\n\t\t{\n\t\t\tcase 'publish':\n\t\t\t\t$result = $model->publish($cid);\n\t\t\t\tbreak;\n\n\t\t\tcase 'unpublish':\n\t\t\t\t$result = $model->unpublish($cid);\n\t\t\t\tbreak;\n\n\t\t\tcase 'archive':\n\t\t\t\t$result = $model->archive($cid);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// If there is a problem, set the error message.\n\t\tif (!$result) {\n\t\t\t$this->setMessage($model->getError());\n\t\t}\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "public function unpublish()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->reporting->name}!\");\n $message->line(\"The post {$this->post->titile} has been unpublished successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}", "public function mustRedirect();", "function cancel()\n\t{\n\t\t// Initialize some variables\n\t\t$db = & JFactory::getDBO();\n\t\t$user = & JFactory::getUser();\n\n\t\t// Get an article table object and bind post variabes to it [We don't need a full model here]\n\t\t$article = & JTable::getInstance( 'content' );\n\t\t$article->bind( JRequest::get( 'post' ) );\n\n\t\tif ( $user->authorize( 'com_content', 'edit', 'content', 'all' ) || ($user->authorize( 'com_content', 'edit', 'content', 'own' ) && $article->created_by == $user->get( 'id' )) )\n\t\t{\n\t\t\t$article->checkin();\n\t\t}\n\n\t\t// If the task was edit or cancel, we go back to the content item\n\t\t$referer = JRequest::getString( 'ret', base64_encode( JURI::base() ), 'get' );\n\t\t$referer = base64_decode( $referer );\n\t\tif ( !JURI::isInternal( $referer ) )\n\t\t{\n\t\t\t$referer = '';\n\t\t}\n\t\t$this->setRedirect( $referer );\n\n\t}", "public function postUnpublish(Post $post)\n {\n $this->postRepository->postUnpublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "protected function _overview() {\n return Helper::redirectTo('/errors/403');\n }", "function pw_redirect_ecpt_version_check() {\n\n\tif( empty( $_REQUEST['edd_action'] ) ) {\n\t\treturn;\n\t}\n\n\tif( 'get_version' !== $_REQUEST['edd_action'] ) {\n\t\treturn;\n\t}\n\n\tif( empty( $_REQUEST['item_name'] ) ) {\n\t\treturn;\n\t}\n\n\tif( 'Easy Content Types' !== urldecode( $_REQUEST['item_name'] ) ) {\n\t\treturn;\n\t}\n\n\t$license = ! empty( $_REQUEST['license'] ) ? $_REQUEST['license'] : '';\n\n\twp_redirect( 'http://themeisle.com/?edd_action=get_version&item_name=Easy+Content+Types&license=' . $license ); exit;\n\n}", "public function forbiddenResponse()\n {\n // (default is to just redirect to initial page with errors)\n // \n // Can return a response, a view, a redirect, or whatever else\n flash()->error('Please verify your email first');\n return $this->redirector->back();\n }", "function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}", "function pw_redirect_rcp_version_check() {\n\n\tif( empty( $_REQUEST['edd_action'] ) ) {\n\t\treturn;\n\t}\n\n\t$actions = array(\n\t\t'get_version',\n\t\t'check_license',\n\t\t'package_download',\n\t\t'activate_license',\n\t\t'deactivate_license',\n\t);\n\n\tif( ! in_array( $_REQUEST['edd_action'], $actions ) ) {\n\t\treturn;\n\t}\n\n\tif( empty( $_REQUEST['item_name'] ) && empty( $_REQUEST['item_id'] ) ) {\n\t\treturn;\n\t}\n\n\t$item_id = isset( $_REQUEST['item_id'] ) ? (int) $_REQUEST['item_id'] : 0;\n\t$item_name = isset( $_REQUEST['item_name'] ) ? urldecode( $_REQUEST['item_name'] ) : '';\n\n\tif( 'Restrict Content Pro' !== $item_name && 7460 !== $item_id ) {\n\t\treturn;\n\t}\n\n\t$license = ! empty( $_REQUEST['license'] ) ? $_REQUEST['license'] : '';\n\t$url = ! empty( $_REQUEST['url '] ) ? $_REQUEST['url '] : '';\n\n\twp_redirect( 'https://restrictcontentpro.com/?edd_action=' . $_REQUEST['edd_action'] . '&item_id=479&license=' . $license . '&url=' . $url ); exit;\n\n}", "public function forbiddenResponse()\n {\n flash('Você não tem permissão para acessar a página solicitada.', 'danger');\n\n return $this->redirector->back();\n }", "function unpublish() {\n\t\t$option = JRequest::getCmd('option');\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se obtienen los ids de los registros a publicar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n\t\tJArrayHelper::toInteger($cids);\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a despublicar\n\t\tif (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_UNPUBLISH'));\n\t\t}\n\n\t\tif ($model->publish($cids, false, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.ROWS_UNPUBLISHED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_UNPUBLISHED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}", "function dynamo_support_block_ticket_access() {\n $url = trim(substr($_SERVER['REQUEST_URI'],0,-1)); \n $url = explode('/',$url);\n if(end($url) == 'ticket') {\n wp_redirect(get_bloginfo('home'));\n }\n }", "public function ajax_deny_approval()\n {\n if (empty($_POST)) return;\n\n ee()->load->model('publisher_approval');\n $msg = ee()->publisher_approval->deny();\n ee()->publisher_helper->send_ajax_response($msg);\n }", "function maybe_prevent_deletion( $post_id ) {\r\n\t\r\n\tglobal $sendback;\r\n\t\r\n\t$post = get_post( $post_id );\r\n\t\r\n\tif( $post->post_type === 'wpass_status' ) {\r\n\t\t\r\n\t\tif( true === is_status_assigned_to_open_ticket( $post ) ) {\r\n\t\t\twp_redirect( add_query_arg( array( 'deleted' => 0, 'ids' => $post_id, 'status_delete' => 'failed' ), $sendback ) );\r\n\t\t\texit;\r\n\t\t}\r\n\t}\r\n}", "function publish( )\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$db\t\t= &JFactory::getDBO();\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid, array(0));\n\n\t\t$publish = ( $this->getTask() == 'publish' ? 1 : 0 );\n\t\t$client = JRequest::getWord( 'filter_client', 'site' );\n\n\t\tif (count( $cid ) < 1)\n\t\t{\n\t\t\t$action = $publish ? JText::_( 'publish' ) : JText::_( 'unpublish' );\n\t\t\tJError::raiseError(500, JText::_( 'Selecione um evento para '.$action ) );\n\t\t}\n\n\t\t$cids = implode( ',' , $cid );\n\n\t\t$query = 'UPDATE #__p22eventos_palestras SET aprovado = '.(int) $publish\n\t\t. ' WHERE id IN ( '.$cids.' )'\n\t\t;\n\t\t$db->setQuery( $query );\n\n\t\tif ( !$db->query() )\n\t\t{\n\t\t\tJError::raiseError(500, $db->getErrorMsg() );\n\t\t}\n\n\t\t$idevento = JRequest::getInt( 'idevento' );\n\n\t\t$link = 'index.php?option=com_p22evento&task=avaliacao&idevento=' . intval( $idevento ) . '#div_palestra_' . $cid[0];\n\t\t$this->setRedirect( $link );\n\t}", "abstract protected function redirect();", "public function handleErrorRelateArticle()\n { \n $this->getResponse()->setStatusCode(500);\n $this->forward('articles', 'articleRelations');\n }", "protected function redirectNotAuthorized(){\r\n if(!$this->auth()->isAuthorized()){\r\n header(\"Location: \".BASE_URI.Routes::getUri('access_denied_authorization'));\r\n }\r\n }", "function onUnknownAction($action, $article) {\n\t\tglobal $wgOut, $wgUser, $wgTitle, $wgParser, $wgRequest;\n\t\tglobal $wgServer, $wgArticlePath, $wgScriptPath, $wgUploadPath, $wgUploadDirectory, $wgScript, $wgStylePath;\n\n\t\t// We don't do any processing unless it's zipmanual\n\t\tif ($action != 'zipmanual') {\n\t\t\treturn true;\n\t\t}\n\n\t\t$zipAllowed = false;\n\t\tPonyDocsExtension::onUserCan( $wgTitle, $wgUser, 'zipmanual', &$zipAllowed );\n\t\tif ( !$zipAllowed ) {\n\t\t\terror_log(\"WARNING [\" . __METHOD__ . \"] User attempted to perform a ZIP Export without permission.\");\n\t\t\t$defaultRedirect = str_replace( '$1', PONYDOCS_DOCUMENTATION_NAMESPACE_NAME, $wgArticlePath );\n\t\t\theader( \"Location: \" . $defaultRedirect );\n\t\t\texit;\n\t\t}\n\t\n\t\t// Get the title and make sure we're in Documentation namespace\n\t\t$title = $article->getTitle();\n\t\tif($title->getNamespace() != PONYDOCS_DOCUMENTATION_NAMESPACE_ID) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Grab parser options for the logged in user.\n\t\t$opt = ParserOptions::newFromUser($wgUser);\n\n\t\t// Any potential titles to exclude\n\t\t$exclude = array();\n\n\t\t// Determine articles to gather\n\t\t$articles = array();\n\t\t$pieces = explode(\":\", $wgTitle->__toString());\n\n\t\t// Try and get rid of the TOC portion of the title\n\t\tif (strpos($pieces[2], \"TOC\") && count($pieces) == 3) {\n\t\t\t$pieces[2] = substr($pieces[2], 0, strpos($pieces[2], \"TOC\"));\n\t\t} else if (count($pieces) != 5) {\n\t\t\t// something is wrong, let's get out of here\n\t\t\t$defaultRedirect = str_replace( '$1', PONYDOCS_DOCUMENTATION_NAMESPACE_NAME, $wgArticlePath );\n\t\t\tif (PONYDOCS_REDIRECT_DEBUG) {\n\t\t\t\terror_log(\"DEBUG [\" . __METHOD__ . \":\" . __LINE__ . \"] redirecting to $defaultRedirect\");\n\t\t\t}\n\t\t\theader( \"Location: \" . $defaultRedirect );\n\t\t\texit;\n\t\t}\n\n\t\t$productName = $pieces[1];\n\t\t$ponydocs = PonyDocsWiki::getInstance($productName);\n\t\t$pProduct = PonyDocsProduct::GetProductByShortName($productName);\n\t\tif ($pProduct === NULL) { // product wasn't valid\n\t\t\twfProfileOut( __METHOD__ );\n\t\t\t$wgOut->setStatusCode(404);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$productLongName = $pProduct->getLongName();\n\t\t\n\t\tif (PonyDocsProductManual::isManual($productName, $pieces[2])) {\n\t\t\t$pManual = PonyDocsProductManual::GetManualByShortName($productName, $pieces[2]);\n\t\t}\n\n\t\t$versionText = PonyDocsProductVersion::GetSelectedVersion($productName);\n\n\t\tif (!empty($pManual)) {\n\t\t\t// We should always have a pManual, if we're printing \n\t\t\t// from a TOC\n\t\t\t$v = PonyDocsProductVersion::GetVersionByName($productName, $versionText);\n\n\t\t\t$toc = new PonyDocsTOC($pManual, $v, $pProduct);\n\t\t\tlist($manualtoc, $tocprev, $tocnext, $tocstart) = $toc->loadContent();\n\n\t\t\t// We successfully got our table of contents. It's \n\t\t\t// stored in $manualtoc\n\t\t\tforeach($manualtoc as $tocEntry) {\n\t\t\t\tif($tocEntry['level'] > 0 && strlen($tocEntry['title']) > 0) {\n\t\t\t\t\t$title = Title::newFromText($tocEntry['title']);\n\t\t\t\t\t$articles[$tocEntry['section']][] = array('title' => $title, 'text' => $tocEntry['text']);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\terror_log(\"WARNING [\" . __METHOD__ . \"] \" . php_uname('n')\n\t\t\t\t. \": User attempted to export ZIP from a non TOC page with path:\" . $wgTitle->__toString());\n\t\t}\n\n\t\t$html = self::getManualHTML($pProduct, $pManual, $v);\n\n\t\t$coverPageHTML = self::getCoverPageHTML($pProduct, $pManual, $v, false);\n\n\n\t\t// Make a temporary directory to store our archive contents.\n\t\t$tempDirPath = sys_get_temp_dir() . '/ponydocs-zip-export-' . time();\n\t\t$success = @mkdir($tempDirPath);\n\t\tif (!$success) {\n\t\t\terror_log(\"FATAL [\" . __METHOD__ . \"] Failed to create temporary directory \" . $tempDirPath . \" for Zip Export.\");\n\t\t\tthrow new Exception('Failed to create temporary directory for Zip Export.');\n\t\t}\n\n\t\t// Now, let's fetch all the img elements for both and grab them all in \n\t\t// parallel.\n\t\t$imgData = array();\n\n\t\t// Initialize our RollingCurl instance\n\t\t$rollingCurl = new \\RollingCurl\\RollingCurl();\n\n\t\t$mh = curl_multi_init();\n\n\t\t$manualDoc = new DOMDocument();\n\t\t@$manualDoc->loadHTML($html);\n\t\t$coverPageDoc = new DOMDocument();\n\t\t@$coverPageDoc->loadHTML($coverPageHTML);\n\n\t\tself::prepareImageRequests($manualDoc, $rollingCurl, $tempDirPath, &$imgData);\n\t\tself::prepareImageRequests($coverPageDoc, $rollingCurl, $tempDirPath, &$imgData);\n\n\t\t// Execute the RollingCurl requests\n\t\t$rollingCurl->execute();\n\n\t\t// Now update all our image elements in our appropriate DOMDocs.\n\t\tforeach($imgData as $img) {\n\t\t\t// Put the data into it.\n\t\t\tfile_put_contents($img['local_path'], $img['request']->getResponseText());\n\t\t\t// Modify element\n\t\t\t$img['element']->setAttribute('src', $img['new_path']);\n\t\t\t// Do curl cleanup\n\t\t}\n\n\t\t$html = $manualDoc->saveHTML();\n\t\t$coverPageHTML = $coverPageDoc->saveHTML();\n\n\t\t// Write the HTML to a tmp file\n\t\t$file = tempnam($tempDirPath, \"zipexport-\");\n\t\t$fh = fopen($file, 'w+');\n\t\tfwrite($fh, $html);\n\t\tfclose($fh);\n\n\t\t// Okay, write the title page\n\t\t$titlepagefile = tempnam($tempDirPath, \"zipexport-\");\n\t\t$fh = fopen($titlepagefile, 'w+');\n\t\tfwrite($fh, $coverPageHTML);\n\t\tfclose($fh);\n\n\n\n\t\t// Disable output of our standard mediawiki output. We will be outputting a zip file instead.\n\t\t$wgOut->disable();\n\n\t\t// Create ZIP Archive which contains a cover and manual html\n\t\t$zip = new ZipArchive();\n\t\t$tempZipFilePath = tempnam($tempDirPath, \"zipexport-\");\n\t\t$zipFileName = $productName . '-' . $versionText . '-' . $pManual->getShortName() . '.zip';\n\t\t$zip->open($tempZipFilePath, ZipArchive::OVERWRITE);\n\t\t$zip->addFile($titlepagefile, 'cover.html');\n\t\t$zip->addFile($file, 'manual.html');\n\t\t// Iterate through all the images\n\t\tforeach($imgData as $img) {\n\t\t\t$zip->addFile($img['local_path'], $img['new_path']);\n\t\t}\n\t\t$zip->close();\n\t\theader(\"Content-Type: application/zip\"); \n\t\theader(\"Content-Length: \" . filesize($tempZipFilePath)); \n\t\theader(\"Content-Disposition: attachment; filename=\\\"\" . $zipFileName . \"\\\"\"); \n\t\treadfile($tempZipFilePath);\n\n\t\t// Now remove all temp files\n\t\tself::rrmdir($tempDirPath);\n\n\t\t\n\t\t// Okay, let's add an entry to the error log to dictate someone requested a pdf\n\t\terror_log(\"INFO [\" . __METHOD__ . \"] \" . php_uname('n') . \": zip export serve username=\\\"\"\n\t\t\t. $wgUser->getName() . \"\\\" version=\\\"$versionText\\\" \" . \" manual=\\\"\" . $pManual->getShortName() . \"\\\"\");\n\t\t// No more processing\n\t\treturn false;\n\t}", "public function linkAction() {\n\n\t\t$hasPassed = FALSE;\n\n\t\ttry {\n\t\t\t$questionnaire = $this->questionnaireRepository->findByUid($this->settings['questionnaire']);\n\t\t} catch (Exception $e) {\n\t\t\t$questionnaire = FALSE;\n\t\t}\n\n\t\tif ($questionnaire !== FALSE) {\n\n\t\t\ttry {\n\t\t\t\t$existingResults = $this->resultRepository->findByFeuserAndQuestionnaire($GLOBALS['TSFE']->fe_user->user['uid'], $questionnaire);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$existingResults = FALSE;\n\t\t\t}\n\n\t\t\tif ($existingResults !== FALSE) {\n\t\t\t\tforeach ($existingResults AS $existingResult) {\n\t\t\t\t\tif ($existingResult->getStatus()->getIsPassed()) {\n\t\t\t\t\t\t$hasPassed = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$GLOBALS['TSFE']->clearPageCacheContent_pidList($GLOBALS['TSFE']->id);\n\t\t\t$GLOBALS['TSFE']->clearPageCacheContent_pidList($this->config['redirect_page']);\n\n\t\t\tif (!$hasPassed) {\n\t\t\t\t$this->view->assign('showdownload', '1');\n\t\t\t} else {\n\t\t\t\t$this->view->assign('showdownload', '0');\n\t\t\t}\n\n\t\t\t$pageId = (int) $this->settings['certificate']['detailPid'];\n\n\t\t\tif (!$pageId) {\n\t\t\t\tthrow new Exception('No Page found! Please check your configuration.');\n\t\t\t}\n\n\t\t\t$this->view->assign('page', $pageId);\n\t\t\t$this->view->assign('questionnaire', $questionnaire);\n\t\t}\n\t}", "function post_publish_handling( $eZ_object, $force_exit = false )\r\n\t{\r\n\t\t// in case it is necessary\r\n\t\t//echo \"no post-handling today\\n\\n\";\r\n\t\treturn true;\r\n\t}", "function invalidationHandler($message){\n\n global $noRedirect;\n\n if ($noRedirect){\n echo '{\n \"success\": false,\n \"reason\": \"'.$message.'\"\n }';\n } else {\n header(\"Location: ../pages/addGroupPage.php?message=\".$message);\n }\n}", "public function sendRedirect() {}", "public function published()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n if (isset($_GET['id']) && $_GET['id'] > 0) {\n\n $commentManager = new CommentManager;\n $unpublished = $commentManager->published($_GET['id']);\n $resetReport = $commentManager->resetReport($_GET['id']);\n header('Location: administration');\n } else {\n throw new Exception('Impossible de trouvé le commentaire');\n }\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "function rex_com_mediaaccess_EP()\n{\n global $REX;\n\n $file = rex_request($REX['ADDON']['community']['plugin_mediaaccess']['request']['file'], 'string');\n\n if($file)\n {\n $media = rex_com_mediaaccess::getMediaByFilename($file);\n\n if($media->checkPerm())\n $media->send();\n else\n header('Location: '.rex_getUrl($REX['ADDON']['community']['plugin_auth']['article_withoutperm'],'',array($REX['ADDON']['community']['plugin_auth']['request']['ref'] => urlencode($_SERVER['REQUEST_URI'])),'&'));\n //echo rex_getUrl($REX['ADDON']['community']['plugin_auth']['article_withoutperm'],'',array($REX['ADDON']['community']['plugin_auth']['request']['ref'] => urlencode($_SERVER['REQUEST_URI'])) );\n\n exit;\n }\n}", "function redirect_post($post_id = '')\n {\n }", "protected function sendNewArticle(){\n if (!empty($_POST['title'] && !empty($_POST['article']))) {\n $this->sendArticle();\n header('Location: index.php');\n }\n else {\n $this->prepareCreateArticle();\n }\n }", "public function usecases_publish(Request $request){\n $articleIdx = $request->articleIdx;\n $article = Article::where('articleIdx', $articleIdx)->get()->first();\n $new['active'] = 1 - $article->active;\n if($new['active'] == 0 && $article->top_use_case == 1){\n Session::flash('flash_success', 'Usecase cannot be Unpublish, please remove from the homepage first'); \n return \"success\"; exit;\n }\n Article::where('articleIdx', $articleIdx)->update($new);\n \n if($new['active'] == 1) {\n Session::flash('flash_success', 'Usecase has been Published successfully'); \n }else {\n Session::flash('flash_success', 'Usecase has been Unpublished successfully'); \n } \n echo \"success\";\n }", "public function redirectCheck ()\n {\n if ( !request()->is('/p4cda_e-learning_scholarship_success') && url()->previous() != url('/p4cda_e-learning_scholarship') ) {\n return redirect()->to('/p4cda_e-learning_scholarship');\n }\n else{\n return view('scholarship_response');\n }\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function isRejected()\n {\n return ($this->slug == \"afgekeurd\");\n }", "function unpublish() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "function check_and_publish_future_post($post)\n {\n }", "function unpublish() {\n\t\tif (! $this->id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->saveField('is_published', 0);\n\t}", "function cancel()\n\t{\n\t\t// Get some objects from the JApplication\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Must be logged in\n\t\tif ($user->get('id') < 1) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\t// Checkin the weblink\n\t\t$model = $this->getModel('weblink');\n\t\t$model->checkin();\n\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=categories', false));\n\t}", "function maybe_redirect_404()\n {\n }", "public function rejectedits() {\n\t\t\tglobal $db, $user;\n\t\t\t$query = \"delete from content where parent = '\".$this->guid.\"' and revision_id=1\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\tif ($db->query($query)) {\n\n\t\t\t\t// We have rejected edits to the page\n\t\t\t\taddHistory($user->id, \"\", $this->guid, \"Changes rejected\", $this->template_type.\"s\");\n\n\t\t\t\t// Update this page in the history table also\n\t\t\t\t$query = \"UPDATE history \n\t\t\t\t\tSET completed_action='CHANGES REJECTED', completed_date=now(), completed_by=\".$user->id.\" \n\t\t\t\t\tWHERE action='publish' \n\t\t\t\t\tAND completed_action is null\n\t\t\t\t\tAND (info='Page saved' OR info='Panel saved')\n\t\t\t\t\tAND guid='\".$this->guid.\"'\";\n\t\t\t\tif (!$db->query($query)) {\n\t\t\t\t\t//print \"failed($query)<br>\\n\";\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function generateRedirectResponse();", "function printFallback(){\n // Redirect\n header(\"Location: /fallback/youngs_all_offers_fallback.php\");\n die();\n}", "function disable_feeds() {\n wp_redirect(home_url());\n die;\n}", "public function authorize() {\n\t\treturn false;\n }", "public function redirectOnLastIssue() {\n $issue = $this->i_rep->oneLastByStatus('public');\n // dump($request);\n // dump($issue);\n if ($issue) {\n // dump(route('articles', [\n // 'year' => $issue->year,\n // 'no' => $issue->no,\n // 'tom' => $issue->tom,\n // ]));\n return redirect()->route('articles', [\n 'year' => $issue->year,\n 'no' => $issue->no,\n 'tom' => $issue->tom,\n ]);\n } else {\n return die('Записей нет');\n }\n }", "function external_redirect($url){\n header('Location:' . $url);\n //Detiene el flujo\n exit;\n }", "function verifiedComment($commentId){\n\tComment::unflag($commentId);\n\theader(\"Location: \".getenv('HOSTNAME').\"/index.php?action=adminGetArticle&id=\" . $_GET['articleId']);\n}", "protected function processRedirect() {}", "public function postPublish(Post $post)\n {\n $this->postRepository->postPublished($post);\n return redirect(config('blog.prefix', 'admin/blog') . '/' . 'post');\n }", "private function returnToArticle(int $article_id, FormStateInterface $form_state) {\n $route = 'ebms_article.article';\n $parameters = ['article' => $article_id];\n $options = ['query' => $this->getRequest()->query->all()];\n $form_state->setRedirect($route, $parameters, $options);\n }", "public function unpublish($id = null)\n {\n $this->request->allowMethod(['post', 'delete']);\n $slide = $this->Slides->get($id);\n $slide->is_publish = 0;\n $this->Slides->save($slide);\n $this->Flash->success(__('The slide has been unpublished.')); \n return $this->redirect(['action' => 'index']);\n }", "public function unsubscribePostCommentsMessageAction()\r\n\t{\r\n\t\t$success = $this->_request->get('success');\r\n\r\n\t\tif (!v::optional(v::intVal()->equals(1))->validate($success))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect success parameter value');\r\n\t\t}\r\n\r\n\t\t$this->view->layout()->setLayout('login');\r\n\t\t$this->view->success = $success;\r\n\t}", "public function redirect();", "public function redirect();", "public function redirect();", "public function editArticleSave(Request $request) //called when the user has finished editing article\n {\n $article = \\App\\Article::where('id', $request->articleID)->first();\n if ($article == null) // || Gate::denies('editArticle', $article))\n {\n $value = 'article not found';\n return '{ \"error\":\"'.$value.'\"}'; //view('authorizationError');\n }\n $article->name = $request->name;\n $article->teaser = $request->teaser;\n $article->content = $request->content;\n $article->save();\n $value = 'article saved';\n return '{ \"result\":\"'.$value.'\"}';\n }", "public function forbiddenError() {\n sfContext::getInstance()->getController()->redirect('errores/forbidden');\n\t}", "public function discard() {\n\t\t$this->DispositionManager->discard();\n\t\t$this->autoRender = false;\n\t\t$this->redirect($this->refererStack(SYSTEM_CONSUME_REFERER));\n\t}", "function redirect_to_post(){\n global $wp_query;\n if( is_archive() && $wp_query->post_count == 1 ){\n the_post();\n $post_url = get_permalink();\n wp_redirect( $post_url );\n }\n }", "public function redirectToExternalUrl() {}", "public function no_post_author_cannot_see_button_accept_answer()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $this->actingAs(factory(\\App\\User::class)->create());\n\n $this->visit($comment->post->url);\n\n $this->dontSee('Aceptar respuesta');\n\n }", "private function authorize()\n {\n $authorized = FALSE;\n\n if ( in_array(ee()->session->userdata['group_id'], ee()->publisher_setting->can_admin_publisher()))\n {\n $authorized = TRUE;\n }\n\n if (ee()->session->userdata['group_id'] == 1)\n {\n $authorized = TRUE;\n }\n\n if ( !$authorized)\n {\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('view_unauthorized'));\n }\n }", "public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "protected function prepareDeleteArticle(){\n $this->deleteComment();\n $this->deleteArticle();\n header('Location: index.php');\n }", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function destroy(Article $article)\n {\n $authCheck = Gate::allows('update-post', $article);\n\n if (!$authCheck) {\n return $this->failedAccessArticle();\n }\n\n $article->delete();\n return redirect()->route('article.index');\n }", "function ds_attach_redirect() {\n global $wpdb, $current_user;\n $attach = $wpdb->prefix.'sd_attachments';\n //Look if accessed url is 1 level i.e. domain/xxxxx\n if(preg_match('#/([a-z0-9_-]+)($|\\?)#i', $_SERVER['REQUEST_URI'], $matches)) {\n //Get top level dir slug\n $slug = trim($matches[1]);\n //Check if slug = view attachments and $_GET a is set.\n if($slug == 'view-attachments' && $_GET['a']) {\n $randkey = $_GET['a'];\n $sql = \"SELECT url, user_id FROM $attach WHERE randkey = '$randkey'\";\n //Search database for random key\n $link = $wpdb->get_row($sql);\n if($link) {\n $target = $link->url;\n $author = $link->user_id;\n //Is Logged\n if(is_user_logged_in()) {\n //Only redirect to attachment if is Admin or Post Author(ticket owner)\n if(current_user_can('manage_options') || $current_user->ID == $author) {\n wp_redirect($target);\n die();\n } else {\n wp_die('You do not have permission to access this file');\n }\n } else {\n wp_die('You do not have permission to access this file');\n }\n }\n }\n }\n return;\t\n\n }", "public function reject_doc($id)\n {\n $countDoc = ProviderDocument::where('provider_id', $id)->count();\n if ($countDoc > 0) {\n ProviderDocument::where('provider_id', $id)->update(['verification_status' => 2]);\n Provider::where('id', $id)->update(['status' => 'banned', 'admin_verified' => 0]);\n } else {\n Provider::where('id', $id)->update(['admin_verified' => 1]);\n }\n return back()->with('flash_success', \"Provider Document Disapproved\");\n }", "function am2_redirect_empty_page(){\n\tif(is_404()){\n $paged = get_query_var('paged');\n if(!empty($paged) && $paged > 1){\n $uri = $_SERVER['REQUEST_URI'];\n $has_page_pos = strpos($uri,'page');\n $final = substr($uri,0,$has_page_pos);\n $link = get_bloginfo('url').$final;\n wp_redirect($link, '302'); //-> OVO RIJEŠITI$target_id->post_id);\n }\n }\n\t$vanity_urls = get_option('am2_vanity_urls');\n\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\n\tforeach($vanity_urls as $vanity):\n\t\t$construct_check_uri = '/'.$vanity['context'].'/'.$vanity['original_slug'].'/';\n\t\tif($uri == $construct_check_uri){\n\t\t\t$link = site_url().'/'.$vanity['url'].'/';;\n\t\t\twp_redirect($link, '302');\n\t\t}\n\t\t\n\tendforeach;\n\t\n}", "function mu_disable_feed_comments() { \n\twp_redirect( esc_url( home_url( '/' ) ), 301 );\n\tdie();\n}", "abstract protected function redirectTo();", "public function publishadmin(){\n $post = Products::where('id', \\request(\"id\"))->first();\n $post->published = $post->published==\"unpublished\"?\"Publish\":\"unpublished\";\n $post->save();\n return redirect(route('voyager.h-products.index'));\n }", "public function approveLink() \n {\n }", "function si_redirect_if_expired() {\n\tif ( current_user_can( 'edit_sprout_invoices' ) ) {\n\t\treturn;\n\t}\n\n\t$expiration = ( 'invoice' === si_get_doc_context() ) ? si_get_invoice_due_date() : si_get_estimate_expiration_date();\n\n\tif ( ! $expiration ) {\n\t\treturn;\n\t}\n\n\tif ( $expiration < current_time( 'timestamp' ) ) {\n\t\t$redirect_url = home_url();\n\t\twp_redirect( $redirect_url );\n\t\texit();\n\t}\n}", "function redirectToReferer($alternative) {\r\n redirect_to_referer($alternative);\r\n }", "public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "public function onBeforeDelivery() {\n if($this->owner->onlyDownloadable()) {\n return $this\n ->owner\n ->redirect($this->owner->Link('finish'));\n }\n }", "function cancel()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t// Checkin the weblink\n\t\t$model = $this->getModel('weblink');\n\t\t$model->checkin();\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "public function unpublished($id) {\n $affected_row = Property::where('id', $id)\n ->update(['publication_status' => 0]);\n\n if (!empty($affected_row)) {\n return redirect('/setting/properties')->with('message', 'Unpublished successfully.');\n }\n return redirect('/setting/properties')->with('exception', 'Operation failed !');\n }", "public function publish() {\n // Check for request forgeries.\n JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n // Initialise variables.\n $app = JFactory::getApplication();\n $model = $this->getModel('Link', 'LinksModel');\n\n // Get the user data.\n $data = JFactory::getApplication()->input->get('jform', array(), 'array');\n\n // Attempt to save the data.\n $return = $model->publish($data['id'], $data['state']);\n\n // Check for errors.\n if ($return === false) {\n $this->setMessage(JText::sprintf('Save failed', $model->getError()), 'warning');\n } else {\n // Check in the profile.\n if ($return) {\n $model->checkin($return);\n }\n\n // Clear the profile id from the session.\n $app->setUserState('com_entrusters.edit.bid.id', null);\n\n // Redirect to the list screen.\n $this->setMessage(JText::_('COM_ENTRUSTERS_ITEM_SAVED_SUCCESSFULLY'));\n }\n\n // Clear the profile id from the session.\n $app->setUserState('com_links.edit.link.id', null);\n\n // Flush the data from the session.\n $app->setUserState('com_links.edit.link.data', null);\n\n // Redirect to the list screen.\n $this->setMessage(JText::_('COM_LINKS_ITEM_SAVED_SUCCESSFULLY'));\n $menu = & JSite::getMenu();\n $item = $menu->getActive();\n $this->setRedirect(JRoute::_($item->link, false));\n }", "private function setNotFoundPage()\n {\n $this->design->setRedirect(\n Uri::get(\n 'newsletter',\n 'admin',\n 'browse'\n ),\n null,\n null,\n self::REDIRECTION_DELAY_IN_SEC\n );\n $this->displayPageNotFound(t('Sorry, Your search returned no results!'));\n }", "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}", "function wbcRedirect(){\n if ( ! defined('DOING_AJAX') && ! current_user_can('edit_posts') && DOING_AJAX) {\n wp_redirect( site_url() );\n exit; \n }\n}", "public static function redirect_to_next_post_after_moderation( $location, $post_id ) {\n\t\t$is_rejection = isset( $_POST[ Rejection::$action ] );\n\n\t\tif (\n\t\t\t( isset( $_POST['publish'] ) || $is_rejection )\n\t\t&&\n\t\t\tRegistrations::get_post_type() === get_post_type( $post_id )\n\t\t) {\n\t\t\t$action = $is_rejection ? 'rejection' : 'approval';\n\t\t\t$next_post = Posts::get_next_post_in_queue();\n\t\t\tif ( $next_post ) {\n\t\t\t\t$location = add_query_arg( 'photomoderated', $post_id, get_edit_post_link( $next_post, 'url' ) );\n\t\t\t\t$location = add_query_arg( 'photoaction', $action, $location );\n\t\t\t}\n\t\t}\n\n\t\treturn $location;\n\t}", "public function authorize()\r\n {\r\n return false;\r\n }", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function handle_redirection()\n {\n }", "public function handleFutureToPublish($post) {\n if (\"publish\" == $post->post_status) {\n $this->indexPost($post->ID);\n }\n }", "function action_editer_annonce() {\n\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\n\t// Teste si autorisation pour les actions d'editions\n\t$arg = $securiser_action();\n/*\n\t// Envoi depuis les boutons \"publier/supprimer cette annonce\"\n\t\tif (preg_match(',^(\\d+)\\Wstatut\\W(\\w+)$,', $arg, $r)) {\n\t\t$id_annonce = $r[1];\n\t\tset_request('statut', $r[2]);\n\t\trevisions_annonces($id_annonce);\n\t} \t\n*/\n\t// Envoi depuis le formulaire d'edition d'une annonce existante \t\n\tif ($id_annonce = intval($arg)) { \t\n\t\t// Si cette annonce possede un 'id', alors elle n'est pas nouvelle\n\t\t// Effectuons donc une revision plutot qu'une edition.\n\t\trevisions_annonces($id_annonce);\n\t}\n\n\t// Envoi depuis le formulaire de creation d'une annonce\t\n\telse if ($arg == 'oui') {\n\t\t$id_annonce = insert_annonce();\n\t\tif ($id_annonce) revisions_annonces($id_annonce);\n\t}\n\t// Erreur\n\telse{\n\t\t// Si nous sommes dans aucun des cas precedent, alors on \n\t\t// a un probleme : renvoyons une erreur.\n\t\tinclude_spip('inc/headers');\n\t\tredirige_url_ecrire();\n\t}\n\n\t// A ce stade, il ne nous reste plus a choisir quelle page s'affiche a l'issue du processus\n\tif (_request('redirect')) {\n\t\t// Si une information de redirection existe on la recupere, et on redirige\n\t\t$redirect = parametre_url(urldecode(_request('redirect')),\n\t\t\t'id_annonce', $id_annonce, '&');\n\t\tinclude_spip('inc/headers');\n\t\tredirige_par_entete($redirect);\n\t}\n\telse \n\t\t// Sinon on se contente de renvoyer l'id de l'objet\n\t\t// (Utile par exemple pour une creation, ou la redirection est geree en amont)\n\t\treturn array($id_annonce,'');\n\n}", "function redirectViews() {\n if( is_author() ) {\n wp_redirect( home_url() );\n exit;\n }\n}", "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 }", "function cancel()\n\t{\n\t\t// Initialize variables.\n\t\t$app = & JFactory::getApplication();\n\n\t\t// Clear the link id from the session.\n\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}" ]
[ "0.64135635", "0.6319322", "0.6295032", "0.58144915", "0.57693326", "0.5761784", "0.5742363", "0.5729238", "0.5718732", "0.5717326", "0.5706351", "0.5700057", "0.56702924", "0.5655716", "0.5653262", "0.56475365", "0.5632197", "0.5622983", "0.556156", "0.55562717", "0.55560505", "0.55442697", "0.5540888", "0.55333203", "0.55324066", "0.55245227", "0.5516742", "0.5511444", "0.5504073", "0.5489747", "0.5481406", "0.5472235", "0.5470756", "0.5451641", "0.5438365", "0.5438178", "0.54362273", "0.5434883", "0.5429305", "0.5404358", "0.53988916", "0.5392316", "0.5380029", "0.53745323", "0.5372126", "0.5366346", "0.5357041", "0.5340268", "0.53248054", "0.5316396", "0.53039294", "0.53029203", "0.52973855", "0.52865535", "0.5286534", "0.5281864", "0.5274273", "0.5268335", "0.52543277", "0.5253627", "0.5249673", "0.5249673", "0.5249673", "0.5242009", "0.5236657", "0.5235177", "0.52314407", "0.5230723", "0.5229873", "0.52295136", "0.5218411", "0.52135944", "0.52105755", "0.52073616", "0.52043724", "0.5192388", "0.51830703", "0.5182044", "0.51810443", "0.5179681", "0.5178561", "0.51773787", "0.5154189", "0.5153035", "0.51496685", "0.51490307", "0.5148736", "0.51477", "0.51429015", "0.51392514", "0.51237386", "0.51203406", "0.51155835", "0.51137936", "0.511074", "0.5109329", "0.5107656", "0.5103664", "0.5100315", "0.5099351" ]
0.5646277
16
Attaches connection object to the wrapper, or call retrieve() directly.
public function __construct() { $args = func_get_args(); $argc = count($args); /** * Attaches MySQLi object to the wrapper. * @param mysqli $mysqli (optional; defaults to global $mysqli) */ if ($argc == 1) { $this->setConnection($args[0]); } else { if (isset($GLOBALS['mysqli'])) { $this->setConnection($GLOBALS['mysqli']); } elseif (isset($GLOBALS['sqlite'])) { $this->setConnection($GLOBALS['sqlite']); } call_user_func_array(array('parent', '__construct'), $args); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}", "public function get(): ConnectionInterface;", "public function connect()\n {\n return $this->adapter->attach();\n }", "private function _set_connection()\n {\n isset($this->_database_connection) ? $this->load->database($this->_database_connection) : $this->load->database();\n $this->_database = $this->db;\n }", "public function __wakeup()\n {\n $this->connect();\n }", "public function getConnection()\n {\n return parent::getConnection();\n }", "public function connection(){ return $this->connection; }", "public function _getConnection(){\n return $this->_connection;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "public function get() {\n if($this->connected) {\n return $this->conn;\n }\n else {\n return $this->connect();\n }\n }", "public function setConnection( $v ){ if( $this->connection != $v ){ $this->dirty = true; } $this->connection = $v; }", "public function __wakeup()\n {\n if ($this->_isConnected) $this->connect();\n }", "function _getConnection()\n {\n $this->_con = Pluf::db();\n }", "public function getConnect()\n {\n $this->conn = Registry::get('db');\n }", "protected function getConnection()\n {\n return $this->_connection;\n }", "public static function get() {\n if (null === static::$conn) {\n static::$conn = new static();\n }\n \n return static::$conn;\n }", "public function get_connection() {\n return $this->_connection;\n }", "public function get_connection() {\n return $this->_connection;\n }", "public function connection()\n {\n $this->connection or $this->connect();\n\n return $this->connection;\n }", "protected function _getConnection()\n {\n if (is_null($this->_connection)) {\n /** @var $coreResource \\Magento\\Framework\\App\\ResourceConnection */\n $coreResource = \\Magento\\TestFramework\\Helper\\Bootstrap::getObjectManager()\n ->get('Magento\\Framework\\App\\ResourceConnection');\n $this->_connection = $coreResource->getConnection();\n }\n return $this->_connection;\n }", "public function get_connection()\n {\n return $this->connection;\n }", "public function setConnection(Connection $connection);", "public function get_connection()\n {\n }", "public function getConnection()\n {\n if($this->connection === null) {\n $this->connect();\n }\n return parent::getConnection();\n }", "public function wrapConnection()\n {\n return new MemcachedCachePool($this->getDb());\n }", "public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }", "function getConnection() {\r\n\r\n\t\treturn $this->connection;\r\n\r\n\t}", "public function connect()\n {\n if ($this->getOptions()->isPersistent()) {\n $this->getResource()->pconnect();\n } else {\n $this->getResource()->connect();\n }\n\n return $this;\n }", "public function __construct()\r\n\t{\r\n\t\t$conn= new connection();\r\n return $this->conn;\r\n }", "public function getConnection(){\n\t\treturn $this->_connection;\n\t}", "public function getConnection()\n {\n return($this->connx);\n }", "public function _connection($connection) {\n $this->_connection = $connection;\n return $this;\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 setConnection($connection);", "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 get_connection()\n {\n return $this->connection();\n }", "public function getConnection(){\n\t\treturn $this->connection;\n\t}", "public function getConnection()\n {\n return $this->__connection;\n }", "public function getConnection() {\n\t\treturn $this->_connection;\n\t}", "public function getConn(){\n return $this->conn;\n }", "public function GetConn(){\r\n\t\tif(! $this->_conn){\r\n\t\t\t $this->SetConn();\r\n\t }\r\n\r\n\t\treturn $this->_conn;\r\n\t}", "public function useSpecificConnection(AphrontDatabaseConnection $conn) {\n $this->conn = $conn;\n $this->isExternalConnection = true;\n return $this;\n }", "public function __construct(){\r\n $this->conn = $this->getConnection();\r\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection(): AdapterInterface;", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public function getConn(){\n\t\treturn $this->conn;\n\t}", "public function getConnection()\n {\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 getConn()\n {\n return $this->conn;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConnection(): Connection;", "abstract protected function getActiveConnection();", "private static function getConnection(){\n\t\tself::$cnx = Connect::conn();\n\n\t}", "protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public function getConnection()\r\n\t{\r\n\t\treturn $this->connection;\r\n\t}", "public function getConnection(){\r\n return $this->memcache;\r\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function setConnection()\n {\n $db = new Mysqli($this->db_host, $this->db_user, $this->db_pass, $this->db_name, $this->db_port);\n \n return $this->connection = $db;\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 getConnection()\n {\n return $this->connection;\n }", "public static function conn()\n {\n return (static::inst())::$_db;\n }", "protected static function setConnection(){\n static::$conn = connection\\DBconnect::makeInstance();\n }", "public function getConnection(): Connection\n {\n return $this->_connection;\n }", "public function refreshConnection()\n {\n $this->connection->close();\n \n return $this->establishConnection();\n }", "public static function getConnection()\n {\n return static::getInstance();\n }", "protected static function getConn() {\n return self::Conectar();\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}", "protected function buildRememberConnection()\r\n\t{\r\n\t\t$config = $this->config;\r\n\t\t$this->persistentStorage = new PersistentStorage($config['persistence.table']);\r\n\r\n\t\t$pdo = Capsule::connection()->getPdo();\r\n\r\n\t\t$this->persistentStorage->setConnection($pdo);\r\n\r\n\t\tparent::__construct($this->persistentStorage);\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function getConn() {\n\n return $this->conn;\n }", "public final function getConnection() {\n\t\t//If the connection has not been established yet, create it\n\t\tif($this->connection === null) {\n\t\t\t//connect to mySQL and provide the interface to PHPUnit\n\n\t\t\t$config = readConfig(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$pdo = connectToEncryptedMySQL(\"/etc/apache2/capstone-mysql/jpegery.ini\");\n\t\t\t$this->connection = $this->createDefaultDBConnection($pdo, $config[\"database\"]);\n\t\t}\n\t\treturn($this->connection);\n\t}", "public function connect()\n {\n if ( ! $this->_connection) {\n $this->_connection = _class('pubsub_driver_' . $this->driver, 'classes/pubsub/');\n $this->_connection->connect();\n }\n return $this->_connection;\n }", "public function getConn()\n\t{\n\t\treturn $this->conn;\n\t}" ]
[ "0.5800478", "0.5746876", "0.57289255", "0.5562067", "0.5512281", "0.54860216", "0.5469249", "0.54653144", "0.5465296", "0.5465296", "0.5421456", "0.5406263", "0.5406217", "0.53848106", "0.5382378", "0.53796226", "0.53741884", "0.53721935", "0.53721935", "0.5366547", "0.53655195", "0.53627855", "0.53594387", "0.5348139", "0.53465366", "0.53413343", "0.53293294", "0.53226286", "0.5314256", "0.5312635", "0.5309779", "0.52995896", "0.5289602", "0.5283333", "0.52817017", "0.52817017", "0.5269485", "0.52476585", "0.52476585", "0.52476585", "0.5246162", "0.5242026", "0.52415526", "0.5237244", "0.52361053", "0.522586", "0.5225224", "0.52238727", "0.52159107", "0.52159107", "0.52142733", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.52027035", "0.520263", "0.51949394", "0.51947695", "0.5178928", "0.5173217", "0.5173073", "0.5173073", "0.51712435", "0.51607263", "0.51506734", "0.5145078", "0.51399344", "0.5137578", "0.5117107", "0.51130736", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.5112272", "0.51089406", "0.5097068", "0.5095186", "0.50854933", "0.50817835", "0.507104", "0.5070848", "0.5070848", "0.50655955", "0.5062062", "0.5061871", "0.5058088", "0.50419843" ]
0.0
-1
Set the connection for this object to use
public function setConnection($conn) { $this->conn = $conn; if ($this->conn instanceof SQLite3) { $this->connObj = new SQLite3Connection($this->conn); } elseif ($this->conn instanceof PDO) { $this->connObj = new PDOConnection($this->conn); } elseif ($this->conn instanceof mysqli) { $this->connObj = new MysqlConnection($this->conn); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }", "private function _set_connection()\n {\n isset($this->_database_connection) ? $this->load->database($this->_database_connection) : $this->load->database();\n $this->_database = $this->db;\n }", "public function setConnection(Connection $connection);", "protected static function setConnection(){\n static::$conn = connection\\DBconnect::makeInstance();\n }", "public function setConnection($connection);", "private function setConnection() {\n if( $this->_connection ) { # prevent creation of additional connection\n $this->_connection;\n }\n $db_dsn = \"mysql:host=\".$this->db_host.\";port=\".$this->db_port.\";dbname=\".$this->db_name.\";charset=\".$this->db_char;\n $this->_connection = new PDO($db_dsn,$this->db_user,$this->db_pass,$this->db_opts);\n }", "private function setConnection(){\n\t\t$this->_connection = new mysqli($this->_host, $this->_username, \n\t\t\t$this->_password, $this->_database);\n\t\n\t\t// Error handling\n\t\tif(mysqli_connect_error()) {\n\t\t\ttrigger_error(\"Failed to conencto to MySQL: \" . mysqli_connect_error(),\n\t\t\t\t E_USER_ERROR);\n\t\t}\n\n\t}", "public function setConnection($name);", "public function setConnection()\n {\n $db = new Mysqli($this->db_host, $this->db_user, $this->db_pass, $this->db_name, $this->db_port);\n \n return $this->connection = $db;\n }", "function setConnection( $connId )\n\t{\n\t\tglobal $cman;\n\t\t$this->_connection = $cman->byId( $connId );\n\t}", "public function setConnection() {\n\t\t$con = Config::get('librarydirectory::database.default');\n\t\tif ( $con && $con !== 'default' ) {\n\t\t\t$config = Config::get('librarydirectory::database.connections.'.$con);\n\t\t} else {\n\t\t\t$con = Config::get('database.default');\n\t\t\t$config = Config::get('database.connections.'.$con);\n\t\t}\n\t\tConfig::set('database.connections.'.$con, $config);\n\t}", "protected function setConnection () : void\n {\n $this->connection = new PDO(\"mysql:host=\" . $this->db_host, $this->db_user, $this->db_password , self::PDO_OPTIONS);\n }", "public function setConnection($connection) {\n }", "public function setConn($conn){\n\t\t$this->conn = $conn;\n\t}", "private function setConnection(){\n try {\n $this->connection = new PDO('mysql:host='.self::HOST.';dbname='.self::NAME.';', self::USER, self::PASS);\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n die('ERROR: '.$e->getMessage());\n }\n }", "public function setConnection(Connection $connection) {\n $this->connection = $connection;\n }", "public function setConnection(Connection $connection) {\n $this->connection = $connection;\n }", "public function setConnection($connection)\n\t{\n\t\t$this->_connection = $connection;\n\t}", "public function setConnection($connection)\n\t{\n\t\t$this->_connection = $connection;\n\t}", "public function setConnection ($connection)\n {\n $this->db = $connection;\n }", "public function setConnection(Connection $conn)\n {\n $this->conn = $conn;\n $this->conn->initialize();\n }", "public function setConnection( $v ){ if( $this->connection != $v ){ $this->dirty = true; } $this->connection = $v; }", "public function setConnection( $connection )\n\t{\n\t\t$this->connection = $connection;\n\t}", "protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public function setConnection(ConnectionInterface $connection);", "public function setConnection($connection) {\n\t\t$this->connection = &$connection;\n\t}", "private function setConnection()\n {\n //load db array from config file\n $params = require __DIR__ . \"/../config/db_pdo.php\";\n\n $db_dsn = $params['pdo_dsn'] . ':dbname=' . $params['name'] . ';host=' . $params['host']\n . ';charset=' . $params['charset'];\n $db_pdo = null;\n\n try {\n $db_pdo = new \\PDO($db_dsn, $params['user'], $params['password']);\n $db_pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n } catch (\\PDOException $e) {\n throw new \\Exception('Database connection failed.' . $e->getMessage());\n }\n\n $this->connection = $db_pdo;\n }", "protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }", "public function setConnection($connection)\n {\n $this->connection = $this->processConnectionArgument($connection);\n }", "public static function _setConnection(Connection $connection) {\n self::$connection = $connection;\n }", "function _getConnection()\n {\n $this->_con = Pluf::db();\n }", "public function setConnection(Connection $connection)\n {\n $this->connection = $connection;\n }", "public function setDataConnection(){\n \n \n }", "public function __construct() {\n $this->connection = $this->create_connection();\n }", "function SetConnString($strConn) {\n $this->_strConn = $strConn;\n }", "public function setConnection(Connection $connection): void\n {\n $this->connection = $connection;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n return $this;\n }", "public function getConnect()\n {\n $this->conn = Registry::get('db');\n }", "private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}", "public function __construct(){\r\n $this->conn = $this->getConnection();\r\n }", "public function setDbConnection($value)\n {\n $this->_db = $value;\n }", "public function setConnection(PDO $con = null);", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function setConnection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "public function connect()\n {\n $this->connection->connect();\n }", "public function setDbConnection($conn)\n {\n $this->dbConn = $conn;\n }", "private function setConnection(){\n\n\n\t\t\t$this->apiKey = Settings::get( 'apiKey' );\n\n\t\t\tif( $this->apiKey ){\n\n\t\t\t\t$this->gateway = new MailChimp( $this->apiKey );\n\n\t\t\t}else{\n\n\t\t\t\t//log an error\n\n\t\t\t}\n\n\t\t}", "function __construct()\n\t\t{\n\t\t\t$this->conn = $this->connect();\n\t\t}", "public function connection($name)\n {\n $this->connection = $name;\n\n return $this;\n }", "protected function connect() {\n $this->connection = 'resource';\n echo $this->name . ' connected '.\"<br>\" ;\n }", "public function __construct() {\r\n $this->conn = PersistentManager::getInstance()->get_connection();\r\n }", "public function __construct()\n\t{\n\t\t$this->conn = 'connected';\n\t}", "public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n \n $this->conn = $db;\n }", "public function connect() {\n $this->connection = AMQPStreamConnection($this->server_ip, $this->server_port, $this->username, $this->password);\n }", "public function setActiveConnection( $conn ){\r\n $this->_activeConnection = $conn;\r\n $this->_driver = $this->_connections[$this->_activeConnection];\r\n }", "protected function setConn() {\n try {\n // Connect and create the PDO object\n self::$conn = new PDO(\"mysql:host=\".DBHOST.\"; dbname=\".DBNAME, DBUSER, DBPASS);\n\n // Sets to handle the errors in the ERRMODE_EXCEPTION mode\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n self::$conn->exec('SET character_set_client=\"utf8\",character_set_connection=\"utf8\",character_set_results=\"utf8\";'); // Sets encoding UTF-8\n \n }\n catch(PDOException $e) {\n $this->eror = 'Unable to connect to MySQL: '. $e->getMessage();\n }\n }", "public function setConnection(HttpURLConnection $connection)\n {\n $this->connection = $connection;\n }", "public static function setConn(/*SforcePartnerClient*/ $conn) {\n self::$_conn = $conn;\n }", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "private function setConexion()\r\n\t\t{\r\n\t\t\t$this->_conexion = New ConexionController();\r\n\t\t\t$this->_conn = $this->_conexion->initConectar('db');\r\n\t\t}", "function __construct() {\n $this->open_connection();\n }", "public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }", "function __construct() {\n $connection= new Connection;\n $this->link = $connection->conect();\n }", "private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}", "public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }", "public function setConn($conn)\n {\n $this->conn = $conn;\n\n return $this;\n }", "public function setConn($conn)\n {\n $this->conn = $conn;\n\n return $this;\n }", "public function _connection($connection) {\n $this->_connection = $connection;\n return $this;\n }", "private static function getConnection(){\n\t\tself::$cnx = Connect::conn();\n\n\t}", "public static function setConnection() {\n\n\t\t$connectionName\t= \"\";\n\t\t$settingName\t= \"\";\n\t\t$settingValue\t= \"\";\n\n\t\tif( func_num_args() < 2 || func_num_args() > 3 ) {\n\t\t\tthrow new Exception( \"Kwerry::setConnection() requires the following arguments: \".\n\t\t\t\t\"connectionName [\\\"default\\\"], settingName, settingValue.\" );\n\t\t}\n\n\t\tif( func_num_args() == 2 ) {\n\t\t\t$connectionName\t= \"default\";\n\t\t\t$settingName\t= func_get_arg( 0 );\n\t\t\t$settingValue\t= func_get_arg( 1 );\n\t\t} else {\n\t\t\t$connectionName\t= func_get_arg( 0 );\n\t\t\t$settingName\t= func_get_arg( 1 );\n\t\t\t$settingValue\t= func_get_arg( 2 );\n\t\t}\n\n\t\tif( ! array_key_exists( $connectionName, Kwerry::$_connectionDetails ) ) {\n\t\t\tKwerry::$_connectionDetails[ $connectionName ] = new stdClass();\n\t\t}\n\n\t\tKwerry::$_connectionDetails[ $connectionName ]->$settingName = $settingValue;\n\t}", "public function setConnection($connection)\r\n {\r\n $this->connection = $connection;\r\n if($this->class)\r\n {\r\n $this->initialize($connection, $this->class, $this->alias);\r\n }\r\n \r\n return $this;\r\n }", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function getConnection();", "public function __construct(){\n $this->connection = new Connection();\n\t}", "function setCONN($ConnNewValue){\n $this->CONN=$ConnNewValue;\n }", "function __construct()\n {\n $con_obj = new ConnectionClass();\n $this->con = $con_obj->getConnection();\n }", "public function get_connection()\n {\n }", "function __construct()\n\t{\n\t\t// Set connection and store it in self::$link\n\t\tself::$link = Connection::setConnect();\n\t}", "public function setConnection($connection){\n\t\t$this->_connection = $connection;\n\n\t\treturn $this;\n\t}", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConn(){\n return $this->conn;\n }", "public function get_connection()\n {\n return $this->connection;\n }", "private function setConnection(Connection $connection)\n\t{\n\t\t$p = new \\ReflectionProperty(DoctrineQueryBuilder::class, 'connection');\n\t\t$p->setAccessible(true);\n\t\t$p->setValue($this, $connection);\n\t\t$p->setAccessible(false);\n\t}", "public function setConnection(Db_Connection $conn)\n\t{\n\t\t$this->db_conn = $conn;\n\t\t\n\t\treturn $this;\n\t}", "public function __construct( )\n {\n $this->openConnection();\n }", "function __construct() {\n $this->createConnection();\n }", "public function getConnection() {\n return $this->connection;\n }", "private function __connection()\n {\n include 'src/Config/database.php';\n try {\n $dns = \"mysql:host={$databaseConfig['host']};dbname={$databaseConfig['database']}\";\n $this->__connection = new PDO(\n $dns,\n $databaseConfig['username'],\n $databaseConfig['password']\n );\n } catch (PDOException $e) {\n echo $e->getMessage();\n die;\n }\n }" ]
[ "0.81307787", "0.7728693", "0.7625577", "0.7593358", "0.74393654", "0.7352053", "0.7349471", "0.73240435", "0.7291874", "0.7284437", "0.7281786", "0.7273408", "0.7260892", "0.72591835", "0.724257", "0.7232065", "0.7232065", "0.72116673", "0.72116673", "0.72030765", "0.7200668", "0.71792", "0.7173279", "0.7089752", "0.7061548", "0.70510566", "0.70462126", "0.701615", "0.7006746", "0.69783616", "0.69645065", "0.69594395", "0.6904096", "0.68627167", "0.68284", "0.6818403", "0.6809837", "0.6788302", "0.6779929", "0.6772834", "0.6717268", "0.6691849", "0.66913617", "0.66913617", "0.66913617", "0.6653055", "0.6652853", "0.6583022", "0.65828663", "0.65646106", "0.65603834", "0.653587", "0.65346956", "0.65282965", "0.65274966", "0.650161", "0.6494262", "0.6489966", "0.64438444", "0.6442256", "0.6442256", "0.6438883", "0.6423695", "0.6422964", "0.6415003", "0.63992053", "0.638287", "0.638287", "0.6380598", "0.63771904", "0.637552", "0.6374697", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.6361415", "0.63583875", "0.6348567", "0.63274604", "0.6326695", "0.6326009", "0.6315924", "0.631084", "0.631084", "0.6310744", "0.6306215", "0.62946945", "0.62862223", "0.6276784", "0.6275419", "0.6270368", "0.6249731" ]
0.7008799
28
Clears the alreadyset info array.
public function clearInfo() { $this->info = array(); $this->retrieved = false; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear() {\n\t\t$this->array = array();\n\t}", "public function reset()\n {\n $this->values[self::_INFO] = null;\n }", "public static function __clearSetArray(){\r\n self::$_units = array();\r\n self::$_totalGrade = array();\r\n self::$_totalUnitsFail = array();\r\n self::$_totalUnitsPass = array();\r\n self::$_remarks = array();\r\n }", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function reset()\n {\n $this->values[self::_ACTIVITY_INFO] = array();\n }", "public function clear()\n {\n $this->_data = [];\n }", "public function clear() {\n $this->_data = [];\n }", "public function clear(){\n\t\t$this->pile = array();\n\t}", "public static function clear()\n {\n self::$map = array();\n }", "public function clear()\n {\n $this->data = [];\n }", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_ADDR] = null;\n }", "public static function clear()\n\t\t{\n\t\t\tself::$data = [];\n\t\t\tself::$file = [];\n\t\t}", "private function clearData()\n {\n $this->_data=array();\n }", "public function clearGearInfos()\n\t{\n\t\t$this->collGearInfos = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear()\n {\n $this->fromArray(array());\n }", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "public function clear()\r\n\t{\r\n\t\t$this->isLoaded = false;\r\n\t\t$this->elements = array();\r\n\t\t$this->keyAssocation = array();\r\n\t\t$this->i = 0;\r\n\t\t$this->count = 0;\r\n\t}", "protected function clear() {}", "function clear()\n {\n $this->tags = [];\n $this->extra = [];\n $this->user = null;\n }", "public function clearData() {\n $this->viewData = array();\n }", "public function clearCheckInformations()\n\t{\n\t\t$this->collCheckInformations = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function reset()\n {\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "function clear()\r\n {\r\n $this->items=array();\r\n }", "public function clear()\n {\n $this->dataStorage = [];\n }", "public function clear()\n {\n $this->items = array();\n }", "public function reset()\n {\n $this->values[self::_MONSTER_INFO] = null;\n $this->values[self::_LOOTS] = array();\n }", "public function reset()\n {\n $this->values[self::_ITEM_IDS] = array();\n $this->values[self::_NEW_HEROES] = array();\n $this->values[self::_SMASH_IDX] = array();\n }", "public function Clear()\n {\n $this->items = array();\n }", "public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }", "public function reset()\n {\n $this->values[self::contractorstatics] = null;\n $this->values[self::stores] = array();\n $this->values[self::visited] = array();\n $this->values[self::review_info] = array();\n $this->values[self::customer_info] = array();\n $this->values[self::mark_price_info] = array();\n $this->values[self::more_url] = null;\n $this->values[self::order_tracking] = array();\n }", "private function clear()\n {\n $this->files = [];\n $this->cdr_ofs = 0;\n $this->cdr_len = 0;\n $this->opt = [];\n }", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "public function clear() {\n $this->elements = array();\n }", "protected function reset() {\n\t\t$this->data = array();\n\t}", "public function clear(): void\n {\n $this->collectionStatsById = [];\n $this->proxyStatsByClass = [];\n }", "public function clearAll() {\n $this->param = array();\n $this->method_map = array();\n $this->response = NULL;\n $this->query = '';\n }", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function reset()\n {\n $this->values[self::OPERATIONINFO] = null;\n $this->values[self::TRANSFERDATE] = null;\n $this->values[self::CREATEDTHINGTRANSFERDATE] = null;\n $this->values[self::CREATEDTHINGINFO] = null;\n $this->values[self::ADDITIONALINFOS] = array();\n }", "function clear()\n {\n $this->meta_name = \"\";\n $this->vocab = \"\";\n $this->text = \"\";\n $this->lang = \"\";\n $this->attrs = array();\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_WORSHIP] = null;\n $this->values[self::_DROP_INFO] = null;\n $this->values[self::_TO_CHAIRMAN] = null;\n }", "public function clear(): void\n {\n $this->transactionsByUserAndType = [];\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "function clear()\n {\n $this->p_size = '';\n $this->p_bidList = array();\n\n }", "public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}", "public function clear( );", "public function reset()\n {\n $this->values[self::EQUIPMENTING_ITEM] = array();\n $this->values[self::HAVING_ITEM] = array();\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_APPLIERS] = array();\n $this->values[self::_VITALITY] = null;\n $this->values[self::_SELF_VITALITY] = null;\n $this->values[self::_LEFT_DISTRIBUTE_TIME] = null;\n }", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}", "function clear()\n {\n # files\n $this->file_objs = array(); # list of file objects\n # params\n $this->name = null;\n $this->meta_updated = null;\n $this->yt_id = null;\n $this->tags = array(); # list of tag strings\n $this->meta_objs = array(); # list of meta objects\n # file_params\n $this->thumb_used = \"\";\n $this->update_files = 0;\n # chapters & comments\n $this->chapters = array();\n $this->comments = array();\n }", "public function Clear()\n {\n unset($this->_keyValPairs);\n $this->_keyValPairs = array();\n }", "function Clear()\r\n {\r\n $this->_items = array();\r\n }", "public function clear()\n\t{\n\t\t$this->items = [];\n\t}", "public function clear()\n {\n $this->log = [];\n }", "public function clearData() {\n unset($this->data);\n }", "public function reset()\n {\n $this->values[self::_HEROES] = array();\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function reset()\n {\n $this->data = array();\n }", "public function reset()\n {\n $this->values[self::_RAID_ID] = null;\n $this->values[self::_DPS_LIST] = array();\n $this->values[self::_ITEM_INFO] = array();\n }", "public static function clear()\n {\n self::$config = array();\n }", "function Reset()\n\t{\t$this->details = array();\n\t\t$this->courses = array();\n\t\t$this->id = 0;\n\t}", "function clear()\n {\n $this->id = \"\";\n $this->offset = \"\";\n $this->title = \"\";\n $this->description = \"\";\n }", "public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }", "public function clear()\n {\n $this->map->clear();\n }", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function clear()\n\t{\n\t\t$this->uniqid = '';\n\t\t$this->base_url = '';\n\t\t$this->no_result = '';\n\t\t$this->pagination_tmpl = '';\n\n\t\t$this->sort = array();\n\t\t$this->column_config = array();\n\n\t\t$this->jq_template = FALSE;\n\n\t\t$this->rows\t\t\t\t= array();\n\t\t$this->heading\t\t\t= array();\n\t\t$this->auto_heading\t\t= TRUE;\n\t}", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "public function reset()\n {\n $this->values[self::_ITEMS] = array();\n $this->values[self::_GOLD] = null;\n $this->values[self::_SKILL_POINT] = null;\n }", "public function clearState()\n {\n $this->fields = array();\n }", "protected function clear()\n {\n $this->optionManager->clear();\n $this->headerManager->clear();\n $this->cookies = [];\n $this->files = [];\n }", "public static function clear(){\n self::$answers = [];\n }" ]
[ "0.75062376", "0.7455464", "0.7358909", "0.7299339", "0.7251714", "0.72307175", "0.72217333", "0.7177086", "0.7141579", "0.7137657", "0.71283835", "0.7104576", "0.70968914", "0.7083553", "0.70645523", "0.6919252", "0.69101626", "0.6890611", "0.68821234", "0.6879528", "0.6870216", "0.6869397", "0.6840314", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.6820992", "0.681039", "0.68040043", "0.6800447", "0.6798587", "0.67859435", "0.6771993", "0.67692184", "0.67608315", "0.6753401", "0.6745658", "0.67431945", "0.67386436", "0.6732833", "0.6732123", "0.6727895", "0.6727895", "0.6717724", "0.6707998", "0.6688407", "0.66832954", "0.66786057", "0.6677054", "0.6666539", "0.6661709", "0.6651602", "0.6641278", "0.6635258", "0.6633567", "0.66260546", "0.6614169", "0.6613091", "0.66116494", "0.6607733", "0.6594938", "0.6590481", "0.65805364", "0.65805364", "0.65805364", "0.65805364", "0.6577932", "0.65609825", "0.6554615", "0.6552694", "0.65471977", "0.65403765", "0.6539406", "0.6534826", "0.653445", "0.6534165", "0.65178764", "0.65177006", "0.6515999", "0.6515837" ]
0.7205776
7
Sets columns to retrieve, with additional check that keys are part of the set of retrieved columns.
public function setColumns($columns) { parent::setColumns($columns); if (is_array($this->selectColumns)) { $this->selectColumns = array_unique(array_merge($this->selectColumns, $this->keys)); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _get_columns($only_keys,$extra_cols)\n\t{\n\t\t//echo \"_get_columns() only_keys=\"; _debug_array($only_keys); echo \"extra_cols=\"; _debug_array($extra_cols);\n\t\tif ($only_keys === true)\t// only primary key\n\t\t{\n\t\t\t$cols = $this->db_key_cols;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cols = array();\n\t\t\t$distinct_checked = false;\n\t\t\tforeach(is_array($only_keys) ? $only_keys : explode(',', $only_keys) as $col)\n\t\t\t{\n\t\t\t\tif (!$distinct_checked)\n\t\t\t\t{\n\t\t\t\t\tif (stripos($col, 'DISTINCT ') === 0) $col = substr($col, 9);\n\t\t\t\t\t$distinct_checked = true;\n\t\t\t\t}\n\t\t\t\tif (!$col || $col == '*' || $col == $this->table_name.'.*')\t// all columns\n\t\t\t\t{\n\t\t\t\t\t$cols = array_merge($cols,$this->db_cols);\n\t\t\t\t}\n\t\t\t\telse\t// only the specified columns\n\t\t\t\t{\n\t\t\t\t\tif (stripos($col,'as'))\t// if there's already an explicit naming of the column, just use it\n\t\t\t\t\t{\n\t\t\t\t\t\t$col = preg_replace('/^.*as +([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\t\t\t$cols[$col] = $col;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (($db_col = array_search($col,$this->db_cols)) !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$cols[$db_col] = $col;\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$cols[$col] = isset($this->db_cols[$col]) ? $this->db_cols[$col] : $col;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($extra_cols)\t// extra columns to report\n\t\t{\n\t\t\tforeach(is_array($extra_cols) ? $extra_cols : explode(',',$extra_cols) as $col)\n\t\t\t{\n\t\t\t\tif (stripos($col,'as ')!==false) $col = preg_replace('/^.*as +([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\tif (($db_col = array_search($col,$this->db_cols)) !== false)\n\t\t\t\t{\n\t\t\t\t\t$cols[$db_col] = $col;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cols[$col] = isset($this->db_cols[$col]) ? $this->db_cols[$col] : $col;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $cols;\n\t}", "protected function getAllColumns(){\n\t\t\treturn array_merge($this->columns, $this->keys);\n\t\t}", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "protected function _configureColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n $this->_sourceColumns = $this->columns;;\n\n $columnsByKey = [];\n foreach ($this->columns as $column) {\n $columnKey = $this->_getColumnKey($column);\n for ($j = 0; true; $j++) {\n $suffix = ($j) ? '_' . $j : '';\n $columnKey .= $suffix;\n if (!array_key_exists($columnKey, $columnsByKey)) {\n break;\n }\n }\n $columnsByKey[$columnKey] = $column;\n }\n\n $this->columns = $columnsByKey;\n }", "abstract public function loadColumns();", "function read($keys,$extra_cols='',$join='')\n\t{\n\t\tif (!is_array($keys))\n\t\t{\n\t\t\t$pk = array_values($this->db_key_cols);\n\t\t\tif ($pk) $keys = array($pk[0] => $keys);\n\t\t}\n\n\t\t$this->init($keys);\n\t\t$this->data2db();\n\n\t\t$query = false;\n\t\tforeach ($this->db_key_cols as $db_col => $col)\n\t\t{\n\t\t\tif ($this->data[$col] != '')\n\t\t\t{\n\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// no primary key in keys, lets try the data_cols for a unique key\n\t\t{\n\t\t\tforeach($this->db_uni_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\tif (!is_array($col) && $this->data[$col] != '')\n\t\t\t\t{\n\t\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t\t}\n\t\t\t\telseif(is_array($col))\n\t\t\t\t{\n\t\t\t\t\t$q = array();\n\t\t\t\t\tforeach($col as $db_c => $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->data[$col] == '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$q = null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$q[$db_c] = $this->data[$c];\n\t\t\t\t\t}\n\t\t\t\t\tif ($q) $query += $q;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// no unique key in keys, lets try everything else\n\t\t{\n\t\t\tforeach($this->db_data_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\tif ($this->data[$col] != '')\n\t\t\t\t{\n\t\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// keys has no cols\n\t\t{\n\t\t\t$this->db2data();\n\n\t\t\treturn False;\n\t\t}\n\t\tif ($join)\t// Prefix the columns with the table-name, as they might exist in the join\n\t\t{\n\t\t\tforeach($query as $col => $val)\n\t\t\t{\n\t\t\t\tif (is_int($col) || strpos($join,$col) === false) continue;\n\t\t\t\t$query[] = $this->db->expression($this->table_name,$this->table_name.'.',array($col=>$val));\n\t\t\t\tunset($query[$col]);\n\t\t\t}\n\t\t}\n\t\tforeach($this->db->select($this->table_name,'*'.($extra_cols?','.(is_array($extra_cols)?implode(',',$extra_cols):$extra_cols):''),\n\t\t\t$query,__LINE__,__FILE__,False,'',$this->app,0,$join) as $row)\n\t\t{\n\t\t\t$cols = $this->db_cols;\n\t\t\tif ($extra_cols)\t// extra columns to report\n\t\t\t{\n\t\t\t\tforeach(is_array($extra_cols) ? $extra_cols : array($extra_cols) as $col)\n\t\t\t\t{\n\t\t\t\t\tif (FALSE!==stripos($col,' as ')) $col = preg_replace('/^.* as *([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\t\t$cols[$col] = $col;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($cols as $db_col => $col)\n\t\t\t{\n\t\t\t\t$this->data[$col] = $row[$db_col];\n\t\t\t}\n\t\t\t$this->db2data();\n\n\t\t\t// store user timezone used for reading\n\t\t\t$this->data[self::USER_TIMEZONE_READ] = egw_time::$user_timezone->getName();\n\n\t\t\tif ((int) $this->debug >= 4)\n\t\t\t{\n\t\t\t\techo \"data =\\n\"; _debug_array($this->data);\n\t\t\t}\n\t\t\treturn $this->data;\n\t\t}\n\t\tif ($this->autoinc_id)\n\t\t{\n\t\t\tunset($this->data[$this->db_key_cols[$this->autoinc_id]]);\n\t\t}\n\t\tif ((int) $this->debug >= 4) echo \"nothing found !!!</p>\\n\";\n\n\t\t$this->db2data();\n\n\t\treturn False;\n\t}", "public function getColumns($cache = true);", "function getColumns (array $keys)\n {\n $this->A = array_getColumns ($this->A, $keys);\n return $this;\n }", "abstract protected function columns();", "private function prepareColumns()\n {\n // start with the tableName and the primary key e.g. 'fos_user' and 'id'\n $this->addSelectColumn($this->metadata, $this->rootEntityIdentifier);\n\n foreach ($this->datatable->getColumns() as $column) {\n // association delimiter found (e.g. 'posts.comments.title')?\n if (strstr($column->getProperty(), '.') !== false) {\n $array = explode('.', $column->getProperty());\n $this->setAssociations($array, $this->metadata);\n } else {\n // no association found\n if ($column !== $this->rootEntityIdentifier) {\n $this->addSelectColumn($this->metadata, $column->getProperty());\n }\n\n $this->allColumns[] = $this->metadata->getTableName().'.'.$column->getProperty();\n }\n }\n\n return $this;\n }", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "function update_columns_cache()\n {\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n global $wpdb;\n $this->_table_columns = array();\n $sql = \"SHOW COLUMNS FROM `{$this->get_table_name()}`\";\n foreach ($wpdb->get_results($sql) as $row) {\n $this->_table_columns[] = $row->Field;\n }\n C_Photocrati_Transient_Manager::update($key, $this->_table_columns);\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public abstract function get_columns($table);", "public function getColumns()\n {\n if (! is_null($this->columns)) {\n return collect($this->columns);\n }\n\n return $this->columns = collect($this->rows->first())\n ->except(['created_at', 'updated_at', 'deleted_at', 'id'])\n ->keys();\n }", "abstract protected function fetchColumnDefsDb(string $table);", "public function setColumns(array $columns);", "public function getSpecificColumns()\n {\n return $this->_specificColumns;\n }", "abstract public function tableColumns();", "public function getValidColumns(array $columns);", "public function setColumns(array $columns);", "public function getAll($columns);", "private function load_columns_information() {\n $query = \"SELECT ordinal_position,\n column_name,\n data_type,\n is_nullable::boolean::integer\n FROM information_schema.columns\n WHERE table_schema = 'public'\n AND table_name = '{$this->get_table_name()}';\";\n $this->columns_information = DB::fetch_all($query);\n\n // Cria os campos da tabela no objeto corrente\n foreach($this->columns_information as $column) {\n $this->$column['column_name'] = null;\n $this->{'_' . $column['column_name']} = null;\n }\n }", "protected function initializeColumnMapping() {\n\t\t// add always available cols for filemetadata\n\t\tforeach ($this->metaColMapping as $damColName => $metaColName) {\n\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t}\n\n\t\t// add additional cols if ext:for filemetadata is installed\n\t\tif (ExtensionManagementUtility::isLoaded('filemetadata')) {\n\t\t\tforeach ($this->additionalMetaColMapping as $damColName => $metaColName) {\n\t\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t\t}\n\t\t}\n\t}", "public function testSetColumns() {\n\n $obj = new DataTablesRequest();\n\n $obj->setColumns([\"columns\"]);\n $this->assertEquals([\"columns\"], $obj->getColumns());\n }", "public function setSearchColumns(array $columns);", "public static function setColumns($columns) {\n\t\tself::$columns = $columns;\n\t}", "function readColumns() { return $this->_columns; }", "function getColumns() {return $this->_columns;}", "public function select(...$columns)\n {\n // code...\n $this->__COLUMNS__ = array_unique(array_merge($this->__COLUMNS__ ?? [], $this->flatten($columns)));\n\n return $this;\n }", "protected static function modifyAvailableColumns(Collection $columns)\n {\n return $columns;\n }", "function read($keys,$extra_cols='',$join='')\n\t{\n\t\tif (!parent::read($keys,$extra_cols,$join))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (($id = (int)$this->data[$this->db_key_cols[$this->autoinc_id]]) && $this->customfields &&\n\t\t\t($cfs = $this->read_customfields($id)))\n\t\t{\n\t\t\t$this->data = array_merge($this->data,$cfs[$id]);\n\t\t}\n\t\treturn $this->data;\n\t}", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "public function setColumns($columns)\n {\n $this->columns = $columns;\n return $this;\n }", "public function setColumns($columns)\n {\n $columns = MySQLParser::Columns($columns);\n if($columns) $this->columns = $columns;\n return (bool)($columns);\n }", "public function set_columns( $columns ) {\n\n\t\t$date_column = $columns['date'];\n\t\t$author_column = $columns['author'];\n\n\t\tunset( $columns['date'] );\n\t\tunset( $columns['author'] );\n\n\t\t$columns['type'] = esc_html__( 'Type', 'elementskit' );\n\t\t$columns['condition'] = esc_html__( 'Conditions', 'elementskit' );\n\t\t$columns['date'] = $date_column;\n\t\t$columns['author'] = $author_column;\n\n\t\treturn $columns;\n\t}", "private function getColumns() {\n\t\t$cols = $this->connection->fetchAll(\"DESCRIBE `\".$this->connection->database.\"`.`$this->table`\");\n\t\tif (!$cols) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tself::$primaryKey[$this->table]=FALSE;\n\t\tforeach ($cols as $col) {\n\t\t\tself::$tables[$this->table][ $col['Field']] = $col['Type'];\n\t\t\tif ($col['Key']=='PRI') {\n\t\t\t\tself::$primaryKey[$this->table] = $col['Field'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function admin_table_columns($_columns)\n {\n }", "public function testGetFromTableWithAllFields()\n {\n $db = 'PMA_db';\n $table = 'PMA_table';\n\n $GLOBALS['dbi']->expects($this->once())\n ->method('fetchResult')\n ->with(\n \"SELECT * FROM `pma_central_columns` \"\n . \"WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');\",\n null, null, DatabaseInterface::CONNECT_CONTROL\n )\n ->will(\n $this->returnValue(array_slice($this->columnData, 0, 2))\n );\n $this->assertEquals(\n array_slice($this->modifiedColumnData, 0, 2),\n $this->centralColumns->getFromTable(\n $db,\n $table,\n true\n )\n );\n }", "public function setColumns($columns) {\n\t\t$this->columns = $columns;\n\t}", "abstract protected function getColumns(): array;", "public abstract function getColumns($table);", "function MetaColumns($table,$normalize=true)\n\t{\n\t\tglobal $ADODB_FETCH_MODE;\n\n\t\t$schema = false;\n\t\t$false = false;\n\t\t$this->_findschema($table,$schema);\n\n\t\tif ($normalize) $table = strtolower($table);\n\n\t\t$save = $ADODB_FETCH_MODE;\n\t\t$ADODB_FETCH_MODE = ADODB_FETCH_NUM;\n\t\tif ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);\n\n\t\t$rs = $this->Execute($this->_generateMetaColumnsSQL($table, $schema));\n\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t$ADODB_FETCH_MODE = $save;\n\n\t\tif ($rs === false) {\n\t\t\treturn $false;\n\t\t}\n\t\tif (!empty($this->metaKeySQL)) {\n\t\t\t// If we want the primary keys, we have to issue a separate query\n\t\t\t// Of course, a modified version of the metaColumnsSQL query using a\n\t\t\t// LEFT JOIN would have been much more elegant, but postgres does\n\t\t\t// not support OUTER JOINS. So here is the clumsy way.\n\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\n\t\t\t$rskey = $this->Execute(sprintf($this->metaKeySQL,($table)));\n\t\t\t// fetch all result in once for performance.\n\t\t\t$keys = $rskey->GetArray();\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\t$rskey->Close();\n\t\t\tunset($rskey);\n\t\t}\n\n\t\t$rsdefa = array();\n\t\tif (!empty($this->metaDefaultsSQL)) {\n\t\t\t$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;\n\t\t\t$sql = sprintf($this->metaDefaultsSQL, ($table));\n\t\t\t$rsdef = $this->Execute($sql);\n\t\t\tif (isset($savem)) $this->SetFetchMode($savem);\n\t\t\t$ADODB_FETCH_MODE = $save;\n\n\t\t\tif ($rsdef) {\n\t\t\t\twhile (!$rsdef->EOF) {\n\t\t\t\t\t$num = $rsdef->fields['num'];\n\t\t\t\t\t$s = $rsdef->fields['def'];\n\t\t\t\t\tif (strpos($s,'::')===false && substr($s, 0, 1) == \"'\") { /* quoted strings hack... for now... fixme */\n\t\t\t\t\t\t$s = substr($s, 1);\n\t\t\t\t\t\t$s = substr($s, 0, strlen($s) - 1);\n\t\t\t\t\t}\n\n\t\t\t\t\t$rsdefa[$num] = $s;\n\t\t\t\t\t$rsdef->MoveNext();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tADOConnection::outp( \"==> SQL => \" . $sql);\n\t\t\t}\n\t\t\tunset($rsdef);\n\t\t}\n\n\t\t$retarr = array();\n\t\twhile (!$rs->EOF) {\n\t\t\t$fld = new ADOFieldObject();\n\t\t\t$fld->name = $rs->fields[0];\n\t\t\t$fld->type = $rs->fields[1];\n\t\t\t$fld->max_length = $rs->fields[2];\n\t\t\t$fld->attnum = $rs->fields[6];\n\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = $rs->fields[3]-4;\n\t\t\tif ($fld->max_length <= 0) $fld->max_length = -1;\n\t\t\tif ($fld->type == 'numeric') {\n\t\t\t\t$fld->scale = $fld->max_length & 0xFFFF;\n\t\t\t\t$fld->max_length >>= 16;\n\t\t\t}\n\t\t\t// dannym\n\t\t\t// 5 hasdefault; 6 num-of-column\n\t\t\t$fld->has_default = ($rs->fields[5] == 't');\n\t\t\tif ($fld->has_default) {\n\t\t\t\t$fld->default_value = $rsdefa[$rs->fields[6]];\n\t\t\t}\n\n\t\t\t//Freek\n\t\t\t$fld->not_null = $rs->fields[4] == 't';\n\n\n\t\t\t// Freek\n\t\t\tif (is_array($keys)) {\n\t\t\t\tforeach($keys as $key) {\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['primary_key'] == 't')\n\t\t\t\t\t\t$fld->primary_key = true;\n\t\t\t\t\tif ($fld->name == $key['column_name'] AND $key['unique_key'] == 't')\n\t\t\t\t\t\t$fld->unique = true; // What name is more compatible?\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($ADODB_FETCH_MODE == ADODB_FETCH_NUM) $retarr[] = $fld;\n\t\t\telse $retarr[($normalize) ? strtoupper($fld->name) : $fld->name] = $fld;\n\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\t$rs->Close();\n\t\tif (empty($retarr))\n\t\t\treturn $false;\n\t\telse\n\t\t\treturn $retarr;\n\n\t}", "public function get_columns_to_keep( $keep_keys = false ) {\n\t\tif ( false === $keep_keys ) {\n\t\t\t$count = 0;\n\t\t\tforeach ( $columns_to_keep as $key => $value ) {\n\t\t\t\t$new_columns_to_keep[$count] = $value;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\treturn $new_columns_to_keep;\n\t\t}\n\n\t\treturn $columns_to_keep;\n\t}", "protected function _prepareColumns()\n {\n \tparent::_prepareColumns();\n \tunset($this->_columns['actionColumn']);\n }", "public function getWithMeta($columns = ['*'])\n {\n $original = $this->columns;\n\n if (is_null($original)) {\n $this->columns = $columns;\n }\n\n /** @var Processor $processor */\n $processor = $this->processor;\n $results = $processor->processSelectWithMeta($this, $this->runSelectWithMeta());\n\n $this->columns = $original;\n\n if (isset($results->rows)) {\n $results->rows = collect($results->rows);\n } else {\n $reflection = new \\ReflectionProperty($results, 'rows');\n $reflection->setAccessible(true);\n $reflection->setValue($results, collect());\n }\n\n return $results;\n }", "public static function getColumns ()\n {\n if (isset(static::$tableColumns)) {\n return self::$tableColumns;\n }\n\n $class = new static();\n\n return static::$tableColumns = \\Cache::remember(\n static::class . '::columns',\n $class->rememberColumnsDuration,\n function () use ($class) {\n $table = is_callable([$class, 'getTable']) ? $class->getTable() : $class->table;\n return Schema::getColumnListing($table);\n }\n );\n }", "protected function parseColumns($searchable, $columns, $localKeys = [], $not = false)\n {\n $results = [[], [], [], []];\n\n foreach ($columns as $column) {\n if (($column = trim($column)) === '') {\n // Skip space.\n } elseif ($column === '*') {\n $results[0] = ['*'];\n } elseif (\n mb_substr($column, -6) === '_count' &&\n $searchable->isRelationAttribute(\n $relation = static::camel(mb_substr($column, 0, -6))\n )\n ) {\n if ($searchable->isVisible($relation)) {\n $results[3][] = $relation;\n }\n } elseif (mb_strpos($column, '.') !== false) {\n [$relation, $name] = explode('.', $column, 2);\n\n if (\n $searchable->isVisible($relation) &&\n $searchable->isRelationAttribute($relation)\n ) {\n $results[2][$relation][] = $name;\n }\n } elseif (!$searchable->isVisible($column)) {\n // Skip hidden attribute.\n } elseif ($searchable->isRelationAttribute($column)) {\n $results[2][$column] = ['*'];\n } else {\n if (!$not && $searchable->hasGetMutator($column)) {\n $results[1][] = $column;\n $dependents = $searchable->getMutatorDependents($column);\n\n if (!empty($dependents) && $results[0] !== ['*']) {\n array_push($results[0], ...$dependents);\n }\n }\n\n if ($results[0] !== ['*']) {\n $results[0][] = $column;\n }\n }\n }\n\n $results[2] = $this->createWithRelations($searchable, $results[2], $localKeys, $not);\n\n if ($results[0] !== ['*']) {\n $fn = $not ? 'array_diff' : 'array_intersect';\n $results[0] = $fn(\n $searchable->getGuardableColumns(),\n array_merge($results[0], $localKeys)\n );\n\n if ($not && !empty($localKeys)) {\n array_push($results[0], ...$localKeys);\n }\n }\n\n // 追加属性必须排除掉表中的列以防止访问器无法正确获得源值\n if (!empty($results[1])) {\n $results[1] = array_diff($results[1], $searchable->getGuardableColumns());\n }\n\n return $results;\n }", "public function returning($columns);", "public function getColumns()\n {\n return $this->allColumns ?: $this->defineListColumns();\n }", "public function setColumns($columns)\n {\n $this->columns = $columns;\n }", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "public function setColumns($columns)\n {\n $this->columns = array();\n $this->aliases = array();\n $this->customColumns = array();\n foreach ($columns as $columnIndex => $column) {\n // Is custom Column\n if (array_key_exists($column, $this->builtInCustomColumns) ||\n isset($this->columnProperties[$column]['callback'])) {\n if (array_key_exists($column, $this->builtInCustomColumns)) {\n $column = $this->builtInCustomColumns[$column];\n } elseif (isset($this->columnProperties[$column]['callback'])) {\n $column = $this->columnProperties[$column];\n unset($column['width']);\n }\n $this->addCustomColumn($column);\n } else {\n $alias = $this->getAliasColumn($column);\n // Check column alias or not\n if ($alias) {\n // Set alias columns\n $this->aliases[$alias] = $column;\n $columnIdentifier = $alias;\n } else {\n // Add prefix entity or table name to column name ( support column name only )\n $columnIdentifier = $this->addPrefixEntity($column);\n }\n $this->columns[] = $columnIdentifier;\n }\n }\n }", "public function updateColumns()\n\t{\n\t\treturn $this->updateColumns;\n\t}", "public function multiget($keys,\n $columns = null,\n $columnStart = \"\",\n $columnFinish = \"\",\n $columnReversed = false,\n $columnCount = ColumnFamily::DEFAULT_COLUMN_COUNT,\n $superColumn = null,\n $readConsistencyLevel = null,\n $bufferSize=16)\n\t{\n\t\tif (empty($this->_columnFamily))\n\t\t\t$this->init();\n\t\treturn $this->_columnFamily->multiget($keys, $columns, $columnStart, $columnFinish,\n\t\t\t\t\t\t\t\t\t\t$columnReversed, $columnCount, $superColumn, $readConsistencyLevel, $bufferSize);\n }", "public function select($columns);", "protected function setDbColumns()\n {\n $connection = $this->model()->eloquent()->getConnectionName();\n\n $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));\n }", "public function setColumns($columns = \"*\")\n {\n //$sql = '';\n if ($columns == \"*\") {\n $this->select_list = '*';\n } elseif (!empty($columns)) {\n foreach ($columns as $item) {\n\n $this->select_list .= $item . ',';\n }\n $this->select_list = rtrim($this->select_list, ',');\n }\n// echo \"column set to \".$this->getColumns(); die;\n\n }", "public function all($columns = ['*']);", "public function columns(/* ... */)\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as $name)\n\t\t{\n\t\t\t$this->setColumnData($name,\n\t\t\t\tContainer::keyValue($this->columnValues, $name, null),\n\t\t\t\tfalse);\n\t\t}\n\t\treturn $this;\n\t}", "static function getColumns()\n {\n }", "public function setColumns( $columns )\n\t{\n\t\t$this->columns = $columns;\n\t\treturn $this;\n\t}", "public function columnMaps();", "protected function _getColumnsToFetch($_cols, Tinebase_Model_Filter_FilterGroup $_filter = NULL, Tinebase_Model_Pagination $_pagination = NULL)\n {\n $result = parent::_getColumnsToFetch($_cols, $_filter, $_pagination);\n \n // sanitize sorting fields\n $foreignTableSortFields = array(\n 'size' => 'tree_filerevisions',\n 'creation_time' => 'tree_fileobjects',\n 'created_by' => 'tree_fileobjects',\n 'last_modified_time' => 'tree_fileobjects',\n 'last_modified_by' => 'tree_fileobjects',\n 'type' => 'tree_fileobjects',\n 'contenttype' => 'tree_fileobjects',\n 'revision' => 'tree_fileobjects',\n );\n \n foreach ($foreignTableSortFields as $field => $table) {\n if (isset($result[0][$field])) {\n $result[0][$field] = $table . '.' . $field;\n }\n }\n \n return $result;\n }", "public function setColumns($columns)\n {\n $this->columns = $columns;\n\n return $this;\n }", "abstract public function getColsFields();", "public function all(array $columns = ['*']): Collection;", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "public static function all($columns = ['*']);", "private static function _getColumns()\n\t{\n\t\tstatic $arrColumns;\n\t\tif (!isset($arrColumns))\n\t\t{\n\t\t\t$arrTableDefine = DataAccess::getDataAccess()->FetchTableDefine(self::$_strStaticTableName);\n\t\t\t\n\t\t\tforeach ($arrTableDefine['Column'] as $strName=>$arrColumn)\n\t\t\t{\n\t\t\t\t$arrColumns[self::tidyName($strName)] = $strName;\n\t\t\t}\n\t\t\t$arrColumns[self::tidyName($arrTableDefine['Id'])] = $arrTableDefine['Id'];\n\t\t}\n\t\t\n\t\treturn $arrColumns;\n\t}", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function columns($columns = '*'): self\n {\n return $this->select($columns);\n }", "public function setColumns()\r\n\t{\r\n\t\t$columns = array_filter($this->getRules(), function($rule) {\r\n\t\t\tif($rule instanceof ColumnInterface) {\r\n\t\t\t\treturn $rule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$columns = array_map(function(ColumnInterface $rule) {\r\n\t\t\treturn $rule->getTitle();\r\n\t\t}, $columns);\r\n\r\n\t\t$this->columns = $columns;\r\n\t}", "public function getColumns()\r\n {\r\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns()\n {\n if (null === $this->columns) {\n $this->columns = new Collection;\n }\n return $this->columns;\n }", "public function getColumns(){\n $url = $this->urlWrapper() . URLResources::COLUMN;\n return $this->makeRequest($url, \"GET\", 2);\n }", "public function getColumns()\r\n\t{\r\n\t\tif($this->dirty) {\r\n\t\t\t$this->setColumns();\r\n\t\t\t$this->dirty = false;\r\n\t\t}\r\n\r\n\t\treturn $this->columns;\r\n\t}", "public function arrGetTableColumns() {\n if(is_array($this->_arrTableColumns)) return $this->_arrTableColumns;\n $this->XaoThrow(\n \"_EntBase->arrGetTableColumns(): A valid list of columns has not\" .\n \" been supplied using _EntBase->SetTableColumns().\"\n );\n }", "public function getColumns()\n {\n // code...\n return $this->__COLUMNS__ ?? [];\n }", "public static function availableColumnData()\n {\n return static::columnData()->pipe(function ($columns) {\n return static::modifyAvailableColumns($columns);\n });\n }", "public function columns($columns)\n {\n $this->columns = $columns;\n\n return $this;\n }", "protected function getColumnsAttribute()\n {\n return $this->fetchData[self::COLUMNS];\n }", "public function getColumns() {\n\n\n if (!$this->columns) {\n $this->columns = array();\n for ($i = 0; $i < $this->statement->columnCount(); $i++) {\n try {\n $columnMeta = $this->statement->getColumnMeta($i);\n\n if ($columnMeta) {\n\n // Fall back to varchar\n $columnType = self::NATIVE_SQL_MAPPINGS[$columnMeta[\"native_type\"]] ?? TableColumn::SQL_VARCHAR;\n $lengthDivisor = self::LENGTH_COLUMN_DIVISORS[$columnMeta[\"native_type\"]] ?? null;\n\n if ($columnType == TableColumn::SQL_BLOB && $columnMeta[\"len\"] > 300000)\n $columnType = TableColumn::SQL_LONGBLOB;\n\n // Record decimal types for later\n if ($columnType == TableColumn::SQL_REAL || $columnType == TableColumn::SQL_DOUBLE || $columnType == TableColumn::SQL_DECIMAL || $columnType == TableColumn::SQL_FLOAT) {\n $this->decimalColumns[] = $columnMeta[\"name\"];\n }\n\n\n $this->columns[] = new ResultSetColumn($columnMeta[\"name\"], $columnType,\n $lengthDivisor ? $columnMeta[\"len\"] / $lengthDivisor : null, $lengthDivisor ? $columnMeta[\"precision\"] : null);\n\n } else {\n $this->columns[] = new ResultSetColumn(\"column\" . ($i + 1), TableColumn::SQL_VARCHAR);\n }\n\n } catch (\\PDOException $e) {\n }\n }\n }\n return $this->columns;\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->oneId = OneABBR::columns()->id;\n $columns->createdAt = Column::TIMESTAMP;\n $columns->updatedAt = Column::TIMESTAMP;\n $columns->info = Column::create(Column::STRING)->setIndexed();\n }", "protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }", "public function set_columns($cols) { $this->cols = $cols + 0; }" ]
[ "0.6563748", "0.64228535", "0.6401598", "0.6235417", "0.6161879", "0.6071656", "0.6028114", "0.59489137", "0.5892505", "0.5814198", "0.58135206", "0.5799113", "0.57969916", "0.5789532", "0.5789532", "0.5789532", "0.5789532", "0.57889557", "0.5788431", "0.5788431", "0.5757461", "0.5739676", "0.56763893", "0.5674322", "0.5672252", "0.5660884", "0.5634243", "0.56292206", "0.5625048", "0.560157", "0.5585531", "0.55728406", "0.55720234", "0.5516646", "0.551474", "0.551393", "0.5512478", "0.5511667", "0.5506953", "0.5506338", "0.54934907", "0.54885197", "0.54693645", "0.546048", "0.5455924", "0.545221", "0.5451628", "0.54464346", "0.54388535", "0.5435305", "0.5434321", "0.54312575", "0.5429561", "0.5427678", "0.5426493", "0.54230237", "0.54190826", "0.5418476", "0.54144573", "0.5405305", "0.54027593", "0.5392059", "0.53894275", "0.538792", "0.53803337", "0.53749174", "0.5374503", "0.53702295", "0.5355133", "0.5346153", "0.53335005", "0.53215295", "0.531912", "0.5317115", "0.5315598", "0.53111345", "0.53056866", "0.53041154", "0.5300699", "0.5293263", "0.5281634", "0.52793825", "0.52793825", "0.52793825", "0.52793825", "0.52793825", "0.52793825", "0.52793825", "0.5266073", "0.5258164", "0.52569956", "0.5255886", "0.52542335", "0.5249906", "0.5233721", "0.52323943", "0.5225803", "0.52247", "0.52186024", "0.5217897" ]
0.60472864
6
Prefix the table name to the column specified, and do alias translation
protected function canonicalizeColumn( $column, $aliasColumns = false, &$tablesUsed = null, $includeTableName = true ) { // First, map onto alias if needed $asString = ''; if (isset($this->columnAliases[$column])) { if ($aliasColumns) { $asString = ' AS ' . $this->connObj->escapeIdent($column); } list($table, $column) = $this->columnAliases[$column]; } else { $table = $this->tableName; } if (isset($tablesUsed)) { if (!in_array($table, $tablesUsed)) { $tablesUsed[] = $table; } } if ($includeTableName) { return $this->connObj->escapeIdent($table) . '.' . $this->connObj->escapeIdent($column) . $asString; } else { return $this->connObj->escapeIdent($column) . $asString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function alias($alias, $column)\n {\n return str_replace(SertifikasiPdPeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "public function aliasField(string $field): string;", "public static function alias($alias, $column)\n {\n return str_replace(CastleTypePeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "public static function alias($alias, $column)\n {\n return str_replace(GsDailyDefinedDosePeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "public static function alias($alias, $column)\n {\n return str_replace(RuangLongitudinalPeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(TbprofessorPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}", "public function asAlias() {\n\t\treturn ($this->alias ? $this->alias : ($this->table ? $this->table->asAlias() .'__': ''/*null*/).$this->name);\n\t}", "public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(MissionPhotoPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}", "public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(AsignacionScPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}", "public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(RpMissionSummaryPeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}", "public static function alias($alias, $column)\n\t{\n\t\treturn str_replace(CoursePeer::TABLE_NAME.'.', $alias.'.', $column);\n\t}", "public static function alias($alias, $column)\n {\n return str_replace(GsGeneriekeProductenPeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "function map($column){\n //\n //Get the entity name\n $entity=$column->get_parent();\n $ename=$entity->name;\n //\n //Get the cname\n $cname=$column->name;\n //\n //Get the referenced table name \n $ref=$column->ref_table_name;\n //\n //Return a string version of the on clause\n return\"\\t{$ename}.{$cname}={$ref}.{$ref}\\t\";\n }", "public function alias($field = NULL, $join = NULL)\n\t{\t\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Return the model's alias if nothing is passed\n\t\tif (!$field)\n\t\t{\n\t\t\treturn $meta->table;\n\t\t}\n\t\t\n\t\t// Split off the table name; we already know that\n\t\tif (strpos($field, '.') !== FALSE)\n\t\t{\t\t\t\n\t\t\tlist(, $field) = explode('.', $field);\n\t\t}\n\t\t\n\t\t// Check and concatenate\n\t\tif ($this->field($field))\n\t\t{\n\t\t\t$field = $this->field($field)->column;\n\t\t}\n\t\t\n\t\tif ($join)\n\t\t{\n\t\t\treturn $meta->table.'.'.$field;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $field;\n\t\t}\n\t}", "function prefixed_table_fields_wildcard($table, $alias, $field)\n{\n $CI =& get_instance();\n $columns = $CI->db->query(\"SHOW COLUMNS FROM $table\")->result_array();\n $field_names = array();\n foreach ($columns as $column) {\n $field_names[] = $column[\"Field\"];\n }\n $prefixed = array();\n foreach ($field_names as $field_name) {\n if ($field == $field_name) {\n $prefixed[] = \"`{$alias}`.`{$field_name}` AS `{$alias}.{$field_name}`\";\n }\n }\n\n return implode(\", \", $prefixed);\n}", "public function getTableAlias($case, $table) {\n switch ($case) {\n # HelloWorld => hw\n case 'InitialLowerCase';\n $words = $this->unCamelCase($table);\n foreach ($words as $k => $v) {\n $words[$k] = strtolower($v[0]);\n }\n $alias = implode('', $words);\n break;\n # HelloWorld => h\n case 'InitialLower';\n $alias = strtolower($table[0]);\n break;\n default:\n throw new SalamaBuildException('_meta value tableAliasFormat not set in Model');\n }\n return $alias;\n }", "public static function alias($alias, $column)\n {\n return str_replace(ReportPeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "protected function resolveTable() {\r\n\r\n\t\t$tableName = $this->_salt_obj->MODEL()->getTableName();\r\n\r\n\t\tif ($this->_salt_database !== NULL) {\r\n\t\t\t$tableName = SqlBindField::escapeName($this->_salt_database).'.'.$tableName;\r\n\t\t}\r\n\r\n\t\tif ($this->_salt_noAlias) {\r\n\t\t\treturn $tableName;\r\n\t\t}\r\n\t\treturn $tableName.' '.$this->_salt_alias;\r\n\t}", "public function aliased($field)\n {\n return \"{$this->getAlias()}.{$field}\";\n }", "public function getTableTranslation()\n {\n return DATABASE_PREFIX . '_' . $this->translation . '_' . $this->_tableSurfix;\n }", "public function getTableAlias() ;", "public function getTranslationOriginColumnName() {}", "private function alias($tableName)\r\n\t{\r\n\t\tif (!isset($this->tableAliases[$tableName])) {\r\n\t\t\t$this->tableAliases[$tableName] = 'tbl' . count($this->tableAliases);\r\n\t\t}\r\n\t\treturn $this->tableAliases[$tableName];\r\n\t}", "function getTableAlias()\r\n\t{\r\n\t\tif ( is_null( $this->table ) ) return (null );\r\n\r\n\t\t$alias =$this->table->getTableAlias();\r\n\t\tif ( is_null( $alias ) ) $alias = $this->table->table_name();\r\n\t\treturn( $alias );\r\n\t}", "public function aliasField(string $field): string\n {\n return $this->getAlias() . '.' . $field;\n }", "function TableAlias($tableAlias = null);", "public function prefixColumnsForJoin()\n {\n if (!$columns = $this->query->columns) {\n return $this->select($this->model->getTable().'.*');\n }\n\n foreach ($columns as $key => $column) {\n if ($this->model->hasColumn($column)) {\n $columns[$key] = $this->model->getTable().'.'.$column;\n }\n }\n\n $this->query->columns = $columns;\n }", "protected function _qb_alias($field, $join = NULL)\n\t{\n\t\t$model = NULL;\n\t\t\n\t\t// Check for functions\n\t\tif (strpos($field, '\"') !== FALSE)\n\t\t{\n\t\t\t// Quote the column in FUNC(\"ident\") identifiers\n\t\t\treturn preg_replace('/\"(.+?)\"/e', '\"\\\\\"\".$this->_qb_alias(\"$1\").\"\\\\\"\"', $field);\n\t\t}\n\t\t\n\t\t// with() call, aliasing is already completed\n\t\tif (strpos($field, ':') !== FALSE)\n\t\t{\t\t\t\n\t\t\treturn $field;\n\t\t}\n\t\t\n\t\tif (strpos($field, '.') !== FALSE)\n\t\t{\t\t\t\n\t\t\tlist($model, $field) = explode('.', $field);\n\t\t\t\n\t\t\t// If $join is NULL, the column is returned as it came\n\t\t\t// If it was joined when it came in, it returns joined\n\t\t\tif ($join === NULL)\n\t\t\t{\n\t\t\t\t$join = TRUE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($join === NULL)\n\t\t\t{\n\t\t\t\t$join = FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If the model is NULL, $this's table name or model name\n\t\t// We just replace if with the current model's name\n\t\tif ($model === NULL || $model == $this->_table)\n\t\t{\n\t\t\t$model = Jelly_Meta::model_name($this);\n\t\t}\n\t\t\n\t\treturn Jelly_Meta::column($model.'.'.$field, $join);\n\t}", "public static function alias($alias, $column)\n {\n return str_replace(GsSupplementaireProductenHistoriePeer::TABLE_NAME.'.', $alias.'.', $column);\n }", "public function getColumnPrefix();", "protected function getColumnName($alias)\n {\n return $this->aliases[$alias] ?? $alias;\n }", "public function getTableAlias($bIncludeSeparator = false)\n {\n // @todo (Pablo - 2019-04-15) - Deprecate $this->tableAlias\n $sOut = static::TABLE_ALIAS ?? $this->tableAlias ?? '';\n\n if (empty($sOut)) {\n\n $sTable = strtolower($this->getTableName());\n $sTable = preg_replace('/[^a-z_]/', '', $sTable);\n $sTable = preg_replace('/_/', ' ', $sTable);\n $aTable = explode(' ', $sTable);\n\n foreach ($aTable as $sWord) {\n $sOut .= $sWord[0];\n }\n }\n\n return !empty($sOut) && $bIncludeSeparator\n ? $sOut . '.'\n : $sOut;\n }", "public function quoteColumnAlias($name)\n\t{\n\t\treturn parent::quoteColumnAlias($name, '\"', '\"');\n\t}", "function getTranslatedLabelFromReportLabel($column) {\n\t\t$columnLabelInfo = explode('_', trim($column, '`'));\n\t\t$columnLabelInfo = array_diff($columnLabelInfo, array('SUM','MIN','MAX','AVG')); // added to remove aggregate functions from the graph labels\n\t\treturn vtranslate(implode(' ', array_slice($columnLabelInfo, 1)), $columnLabelInfo[0]);\n\t}", "protected function resolveTableColumn(string $column): string\n {\n return sprintf(\n '%s.%s',\n $this->schema->columns()->get($column)->ownerTable,\n $column\n );\n }", "private function columnLabel($field, $column)\n {\n if (! is_array($field) && ! in_array($field, $this->columnTypes)) {\n return ucfirst($field);\n }\n\n return (isset($field['alt_name'])) ? $field['alt_name'] : ucfirst($column);\n }", "public function selectAliasColumn($column, $alias, array $mapping = array())\n {\n if (isset($mapping['id']) && $mapping['id']) {\n $mapping['id'] = false;\n\n $dbType = Type::getType($mapping['type'])->getSQLDeclaration($mapping, $this);\n\n if ($dbType !== null) {\n return 'CONVERT(' . $dbType . ', ' . $column . ') AS ' . $alias;\n }\n }\n\n return $column . ' AS ' . $alias;\n }", "public function joinColumnName($propertyName);", "public function tableByName($alias) {\n\t}", "public function prefix_table($table)\n\t{\n\t\t// Add the prefix to the table name\n\t\t// before quoting it\n\t\tif ( ! empty($this->table_prefix))\n\t\t{\n\t\t\t// Split indentifier by period, will split into:\n\t\t\t// database.schema.table OR\n\t\t\t// schema.table OR\n\t\t\t// database.table OR\n\t\t\t// table\n\t\t\t$idents = explode('.', $table);\n\t\t\t$segments = count($idents);\n\n\t\t\t// Quote the last item, and add the database prefix\n\t\t\t$idents[$segments - 1] = $this->_prefix(end($idents));\n\n\t\t\t// Rejoin\n\t\t\t$table = implode('.', $idents);\n\t\t}\n\n\t\treturn $table;\n\t}", "public function aliasToLabel($alias)\n {\n $alias = preg_replace('/-/', '_', $alias);\n $alias = preg_replace('/^(ic_[^_]+_[^_]+)_/', '$1.', $alias);\n $alias = preg_replace('/(_field)_/', '$1.', $alias);\n\n return $alias;\n }", "function getTableFullName()\n {\n return implode(' ', [$this->table_prefix . $this->table_name, $this->table_alias]);\n }", "protected function translateField($field)\n {\n switch ($field) {\n case Rate::KEY_REGION_NAME:\n return 'region_table.code';\n default:\n return \"main_table.\" . $field;\n }\n }", "public function table( $alias = null ) {\n return $alias ? $alias.'.'.$this->table_name : $this->table_name;\n }", "public function setColumnPrefix($solumnPrefix);", "public function addPrefixEntity($column)\n {\n $columnId = $this->table . \".\" . $column;\n if (in_array($columnId, $this->defaultColumns)) {\n return $columnId;\n }\n return $column;\n }", "public function referenceColumnName();", "protected function alias($property, $suffix = '', $prefix = null)\n {\n return ($prefix !== null ? $prefix : $this->getAlias()) . '.' . $property . ' ' .$suffix;\n }", "private function getColumnPropertyName( Column $column ) : string\n {\n\n return lcfirst(str_replace( '_', '', ucwords( $column->getName(), '_' )));\n\n }", "private function resolveBindName()\n {\n $table = (self::$plural) ? Inflector::singularize($this->table) : $this->table;\n return $table . '_' . $this->key;\n }", "function DisplayNameSQL( $table_alias = '' )\n{\n\t$display_name = Config( 'DISPLAY_NAME' );\n\n\t// Values have %s. placeholders for table alias.\n\t$display_names = array(\n\t\t\"FIRST_NAME||' '||LAST_NAME\" => \"%s.FIRST_NAME||' '||%s.LAST_NAME\",\n\t\t\"FIRST_NAME||' '||LAST_NAME||coalesce(' '||NAME_SUFFIX,' ')\" => \"%s.FIRST_NAME||' '||%s.LAST_NAME||coalesce(' '||%s.NAME_SUFFIX,' ')\",\n\t\t\"FIRST_NAME||coalesce(' '||MIDDLE_NAME||' ',' ')||LAST_NAME\" => \"%s.FIRST_NAME||coalesce(' '||%s.MIDDLE_NAME||' ',' ')||%s.LAST_NAME\",\n\t\t\"FIRST_NAME||', '||LAST_NAME||coalesce(' '||MIDDLE_NAME,' ')\" => \"%s.FIRST_NAME||', '||%s.LAST_NAME||coalesce(' '||%s.MIDDLE_NAME,' ')\",\n\t\t\"LAST_NAME||' '||FIRST_NAME\" => \"%s.LAST_NAME||' '||%s.FIRST_NAME\",\n\t\t\"LAST_NAME||', '||FIRST_NAME\" => \"%s.LAST_NAME||', '||%s.FIRST_NAME\",\n\t\t\"LAST_NAME||', '||FIRST_NAME||' '||COALESCE(MIDDLE_NAME,' ')\" => \"%s.LAST_NAME||', '||%s.FIRST_NAME||' '||COALESCE(%s.MIDDLE_NAME,' ')\",\n\t\t\"LAST_NAME||coalesce(' '||MIDDLE_NAME||' ',' ')||FIRST_NAME\" => \"%s.LAST_NAME||coalesce(' '||%s.MIDDLE_NAME||' ',' ')||%s.FIRST_NAME\",\n\t);\n\n\tif ( ! isset( $display_names[ $display_name ] ) )\n\t{\n\t\t$display_name = key( $display_names );\n\t}\n\n\tif ( $table_alias )\n\t{\n\t\t$display_name = $display_names[ $display_name ];\n\n\t\t$display_name = str_replace( '%s', $table_alias, $display_name );\n\t}\n\n\treturn $display_name;\n}", "private function columnName($column)\n {\n // Select all\n if ($column == '*') {\n return \"`{$this->query['table']}`.*\";\n }\n\n if (strpos($column, '.') === false) {\n $column = $this->query['table'] . \".{$column}\";\n }\n\n // Regular column name\n if (strpos($column, '(') === false) {\n return str_replace(array('.'), array('`.`'), \"`{$column}`\");\n } else {\n return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');\n }\n }", "function aliasFields($sql, $should_alias) {\n\t\tif($should_alias) return str_replace('<@', '', str_replace('@>', '', $sql));\n\t\treturn preg_replace('/<@.*?@>/', '', $sql);\n\t}", "public function getDbTableName(string $drupal_prefix, string $drupal_table_name): string;", "public function getDbAlias($alias);", "public function col($column)\n {\n $lang = config('app.locale');\n $column = \"$column\".\"_\".\"$lang\";\n return $this->$column;\n }", "function to_str(){\n \n //Include the alias\n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n return \"`{$this->entity->name}`.`{$this->entity->name}`$alias \";\n }", "public function tableNameWithAlias( $name, $alias = false ) {\n\t\tif ( !$alias || $alias == $name ) {\n\t\t\treturn $this->tableName( $name );\n\t\t} else {\n\t\t\treturn $this->tableName( $name ) . ' ' . $this->addIdentifierQuotes( $alias );\n\t\t}\n\t}", "public function getColumnLabel($column)\n {\n if ($this->resource === '') {\n return trans(\"resources.${str_singular(get_class())}.{$column}\");\n }\n return trans(\"resources.{$this->resource}.{$column}\");\n }", "public function quoteColumnName($columnName);", "function getReferencingColumn($name, $table);", "function name_from_id($nfi_table, $nfi_id, $nfi_id_col, $nfi_name_col){\r\n\t\tglobal $conn;\r\n\t\t$sql_quary = \"SELECT * FROM \".$nfi_table.\" WHERE \".$nfi_id_col.\"='\".$nfi_id.\"';\";\r\n\t\t$sql = $conn->prepare($sql_quary);\r\n\t\t$sql->execute();\r\n\t\t\t\r\n\t\t$numRows = $sql->fetchAll();\r\n\t\t\tif(count($numRows)>0){\r\n\t\t\t\tforeach($numRows as $row){\r\n\t\t\t\t\treturn $row[$nfi_name_col];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}", "function getColumnSetter($column, $value, $singleQuotes = false, $prefix = 'this->')\n {\n if ($singleQuotes)\n {\n $value = sprintf(\"'%s'\", $value);\n }\n\n return sprintf('$%s%s->set(\\'%s\\', %s)', $prefix, $this->getSingularName(), $column->getName(), $value);\n }", "public function getBaseTableAlias()\n {\n return 'KEYWORD';\n }", "private static function genFullyQualifiedTableName($database_name, $table_name) {\n return \"{$database_name}.{$table_name}\";\n }", "private function qualifiedTablename($table, $database= NULL) {\n $database= $this->database($database);\n if (NULL !== $database) return $database.'.'.$table;\n return $table;\n }", "protected function _create_alias_from_table($item)\n\t{\n\t\tif (strpos($item, '.') !== FALSE)\n\t\t{\n\t\t\t$item = explode('.', $item);\n\t\t\treturn end($item);\n\t\t}\n\n\t\treturn $item;\n\t}", "protected function _aliasing($name, $alias, $map = [])\n\t{\n\t\tlist($first, $second) = $this->_splitFieldname($name);\n\t\tif (!$first && preg_match('/^[a-z0-9_-]+$/i', $second)) {\n\t\t\treturn $alias . \".\" . $second;\n\t\t} elseif (isset($map[$first])) {\n\t\t\treturn $map[$first] . \".\" . $second;\n\t\t}\n\t\treturn $name;\n\t}", "function get_table_name()\n {\n global $table_prefix;\n global $wpdb;\n $prefix = $table_prefix;\n if ($wpdb != null && $wpdb->prefix != null) {\n $prefix = $wpdb->prefix;\n }\n return apply_filters('ngg_datamapper_table_name', $prefix . $this->_object_name, $this->_object_name);\n }", "private static function forgeMethodName($node, $prefix, $column)\n {\n $method_name = sprintf('%s%s', $prefix,\n $node->getPeer()->translateFieldName(self::getColumnConstant(get_class($node), $column),\n BasePeer::TYPE_COLNAME,\n BasePeer::TYPE_PHPNAME));\n return $method_name;\n }", "function checkAlias($table, $field, $value, $where = array()) {\n $ci = & get_instance();\n $alias = strtolower(preg_replace(\"![^a-z0-9]+!i\", \"-\", $value));\n $j = 1;\n for ($i = 0; $i < $j; $i++) {\n $cond = array($field => $alias);\n if (count($where) > 0) {\n array_merge($cond, $where);\n }\n $row = $ci->crud->getAll($table, $cond);\n if (count($row) == 0) {\n $newAlias = $alias;\n } else {\n $alias = $alias . '-' . $i;\n $j++;\n }\n }\n return $newAlias;\n}", "function alias($name = '')\n {\n }", "function language_sql($table, $prefix = '', $sql = 'WHERE')\n{\n $language = language_current();\n if ($language == '') {\n return '';\n } else {\n return \" $sql \" . $pntable[\"{$table}_column\"][\"{$prefix}language\"] . \"='$language'\";\n } \n}", "function to_str(){\n //\n //Get the entity name using the magic function get parent since the \n //parent entity is protected \n $e = $this->column->get_parent();\n //\n //Include the alias\n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //compile the complete string version of the \n return \"`{$e->name}`.`{$this->column->name}` $alias\";\n }", "function _getAlias($increment = false)\n {\n static $seen = array();\n\n if ($increment && !empty($seen[$this->_table_count])) {\n $this->_table_count++;\n }\n\n $seen[$this->_table_count] = true;\n return 'a' . $this->_table_count;\n }", "public function quoteSimpleColumnName(string $name): string;", "protected function getJoinTable(): string\n {\n return \"{$this->define(SchemaInterface::TABLE)} AS {$this->getAlias()}\";\n }", "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "protected function convertFieldNameOrAlias($field) {\n // Field names are case-insensitive\n $field = strtolower($field);\n \n $indexAliases = $this->getIndexAliasList();\n if (isset($indexAliases[$field]))\n $field = $indexAliases[$field];\n \n return $field;\n }", "public function to_str() {\n //\n //Get the parent of this column using\n $e= $this->column->get_parent();\n //\n //Include the alias\n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n return \"`$e->name`.`{$this->column->name}` $alias\";\n }", "private function get_column_name($field, $format1 = '%s.%s', $format2 = '%s.%s') {\n $column = '';\n if (str_contains($field, '.')) {\n list($table_name, $column_name) = explode('.', $field);\n $column = sprintf($format1, $table_name, $column_name);\n } else {\n $column = sprintf($format2, $this->table, $field);\n }\n return $column;\n }", "public function quote_table($value)\n {\n // Assign the table by reference from the value\n if (is_array($value))\n {\n $table =& $value[0];\n\n // Attach table prefix to alias\n $value[1] = $this->table_prefix($value[1]);\n }\n else\n {\n $table =& $value;\n }\n\n // deal with the sub-query objects first\n //if ($table instanceof Database_Query)\n //{\n //// Create a sub-query\n //$table = '('.$table->compile($this).')';\n //}\n if (is_string($table))\n {\n if (strpos($table, '.') === false)\n {\n // Add the table prefix for tables\n $table = $this->quote_identifier($this->table_prefix($table));\n }\n else\n {\n // Split the identifier into the individual parts\n $parts = explode('.', $table);\n\n if ($prefix = $this->table_prefix())\n {\n // Get the offset of the table name, 2nd-to-last part\n // This works for databases that can have 3 identifiers (Postgre)\n if (($offset = count($parts)) == 2)\n {\n $offset = 1;\n }\n else\n {\n $offset = $offset - 2;\n }\n\n // Add the table prefix to the table name\n $parts[$offset] = $this->table_prefix($parts[$offset]);\n }\n\n // Quote each of the parts\n $table = implode('.', array_map(array($this, 'quote_identifier'), $parts));\n }\n }\n\n // process the alias if present\n if (is_array($value))\n {\n // Separate the column and alias\n list($value, $alias) = $value;\n\n return $value.' AS '.$this->quote_identifier($alias);\n }\n else\n {\n // return the value\n return $value;\n }\n }", "function get_table_name($table_name)\n{\n\tglobal $project_vars;\n\treturn $project_vars['mysql_table_prefix'] . $table_name;\n}", "private function getColumnUniqueName($columnName, $tableName, $schemaName, $databaseId) {\n\t\treturn $databaseId.'_'.$schemaName.'_'.$tableName.'_'.$columnName;\n\t}", "private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }", "public function getTablePrefix();", "public function getDbFullQualifiedTableName($drupal_table_name);", "public function fieldNameWithAlias( $name, $alias = false ) {\n\t\tif ( !$alias || (string)$alias === (string)$name ) {\n\t\t\treturn $name;\n\t\t} else {\n\t\t\treturn $name . ' AS ' . $alias; //PostgreSQL needs AS\n\t\t}\n\t}", "function fromexp(){\n //\n //Throw an expection if the alias is not set\n if(is_null($this->alias)){\n throw new Exception(\"Your root sql does not have an alias\");\n }\n return \n \"({$this->to_str()})as {$this->elias}\";\n }", "abstract public static function get_column_name(): string;", "public function baseTableIdColumn($prefix = '');", "function guessColumnTableName($fieldname){\n\t\tif ( isset($this->_cache[__FUNCTION__][$fieldname] ) ) return $this->_cache[__FUNCTION__][$fieldname];\n\t\t$data = $this->_parseSQL();\n\t\t$this->_expandGlobs($data);\n\t\t\n\t\t$numTables = count($data['tables']);\n\t\tfor ($i=$numTables-1; $i>=0; $i--){\n\t\t\t$curr = $data['tables'][$i];\n\t\t\tif ( $curr['type'] == 'ident' ){\n\t\t\t\t// This table is an actual table -- not a subselect\n\t\t\t\t$table =& Dataface_Table::loadTable($curr['value']);\n\t\t\t\tif ( $table->hasField($fieldname) ){\n\t\t\t\t\tif ( @$curr['alias'] ) return $curr['alias'];\n\t\t\t\t\telse return $curr['value'];\n\t\t\t\t}\n\t\t\t\tunset($table);\n\t\t\t\t\n\t\t\t} else if ($curr['type'] == 'subselect' ){\n\t\t\t\t// The table is a subselect\n\t\t\t\t$subview = new Dataface_View($curr['value'], $curr['value']);\n\t\t\t\t$field = $subview->getField($fieldname);\n\t\t\t\tif ( isset($field) ) return $curr['value'];\n\t\t\t\tunset($subview);\n\t\t\t\tunset($field);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\ttrigger_error('Unspecified table type');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public function getAlias()\n {\n return 'lsw_gettext_translation';\n }", "public function addColumn($column,$table = \"\", $as = \"\");", "public function quoteIdentifier(string $columnName): string;", "public function qualifyColumn($column)\n {\n $tableReferer = Str::singular($this->getTable()) . 'Doc';\n\n if (Str::startsWith($column, $tableReferer . '.')) {\n return $column;\n }\n\n return $tableReferer . '.' . $column;\n }", "function get_table_annexe_suffix($name) {\r\n\t\t$arr = @split(\"_\",$name);\r\n\r\n\t\treturn $arr[count($arr)-1];\r\n}", "function sql_table($name) {\n global $MYSQL_PREFIX;\n\n if ($MYSQL_PREFIX) {\n return $MYSQL_PREFIX . 'nucleus_' . $name;\n } else {\n return 'nucleus_' . $name;\n }\n}", "public function getQualifiedLocalizableColumn()\n {\n return $this->getTable() . '.' . $this->getLocalizableColumn();\n }", "function _getAlias($n) {\n}" ]
[ "0.66430295", "0.6591502", "0.6586721", "0.6570665", "0.65458643", "0.65041214", "0.64803475", "0.6474383", "0.6458743", "0.6457322", "0.64524275", "0.64266765", "0.6400523", "0.6371099", "0.63673437", "0.6365226", "0.63522375", "0.6331265", "0.62766504", "0.6257134", "0.62044334", "0.6195479", "0.61538434", "0.614569", "0.613833", "0.61115104", "0.6086344", "0.60732543", "0.6037104", "0.5985283", "0.5973544", "0.5962296", "0.59467924", "0.5936998", "0.59293467", "0.5900065", "0.5860146", "0.58554715", "0.58525866", "0.5850319", "0.5814868", "0.5792177", "0.5777405", "0.5772952", "0.57391346", "0.5732928", "0.57321477", "0.57250446", "0.5721239", "0.5718043", "0.57135785", "0.57035005", "0.5700252", "0.5690619", "0.5683667", "0.5679714", "0.567157", "0.5659935", "0.56545895", "0.5649011", "0.5623616", "0.5620624", "0.56147873", "0.559099", "0.55884206", "0.55858433", "0.5584251", "0.55705273", "0.55678976", "0.5548236", "0.5539179", "0.5538554", "0.5533601", "0.5530114", "0.5504795", "0.54924506", "0.54781896", "0.5475443", "0.5456182", "0.545082", "0.54466826", "0.5435983", "0.5434952", "0.5429816", "0.5428219", "0.54277265", "0.5418234", "0.54110324", "0.54043555", "0.5394313", "0.539408", "0.5388477", "0.5381892", "0.5375887", "0.53726065", "0.5371242", "0.5366737", "0.53592616", "0.53587407", "0.53585" ]
0.5590044
64
Add conditions corresponding to each of the keys in the table. Should always be implemented with a more readable name in a child class (e.g. addCourseCond($subject, $number, $section))
protected function addKeyCond() { $args = func_get_args(); $keyCount = count($this->keys); $argCount = count($args); for ($i = 0; $i < $keyCount && $i < $argCount; $i++) { $this->addCond($this->keys[i], $args[$i]); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function constructKeyConds()\n {\n $conds = array();\n // Make a similar $conds array based out of $this->info\n foreach ($this->keys as $column) {\n if (!isset($this->info[$column])) {\n echo \"{$column} not set\\n\";\n return false;\n }\n\n $conds[0][] = array($column, $this->info[$column], '=');\n }\n return $conds;\n }", "public function constructKeyCondString()\n {\n $tablesUsedBlackHole = array();\n return $this->constructCondStringStatic($tablesUsedBlackHole, $this->constructKeyConds());\n }", "private function makeConstraintSQL($conditions) {\n $keytext = \"\";\n $all_keytext = array();\n $key_conditions = array();\n if (is_array($conditions)) {\n if ($this->is_assoc($conditions)){\n foreach ($conditions as $column_name => $value) {\n\t$final_value = \"\";\n\t$operator = ' = ';\n\tif (is_array($value)) {\n\t $operator = ' IN ';\n\t $final_value .= '(';\n\t foreach ($value as $item)\n\t {\n\t if (is_string($item)) {\n\t\t$item = $this->conn->quote($item);\n\t }\n\t $final_value .= $item . ', ';\n\t }\n\t $final_value = rtrim($final_value, ', ');\n\t $final_value .= ')';\n\t}\n\telse {\n\t if (is_string($value)) {\n\t $value = $this->conn->quote($value);\n\t }\n\t $final_value = $value;\n\t}\n\t$key_conditions[] = strtolower($column_name) . $operator . $final_value;\n }\n }\n else {\n foreach ($conditions as $cond) {\n\tif (is_array($cond)) {\n\t /* create OR clauses for multiple \n\t * arrays of column=>value */\n\t $all_keytext[] = $this->makeConstraintSQL($cond);\n\t}\n }\n }\n \n }\n $keytext = implode(\" AND \", $key_conditions);\n if(count($all_keytext) > 0) {\n $keytext = implode(\" OR \", $all_keytext);\n }\n return $keytext;\n}", "public function addConditions(array $conditions);", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\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}", "protected function addWhere(&$conditions, $key, $extraValue) {\n if ($extraValue === 'NULL') {\n $conditions[$key] = null;\n } elseif ($extraValue === 'NOT_NULL') {\n $conditions[$key . '!='] = null;\n } else {\n $conditions[$key] = $extraValue;\n }\n }", "private function addCriteriaCondition(\n array $criteria,\n array &$columns,\n array &$values,\n array &$conditions\n ): void {\n $platform = $this->getDatabasePlatform();\n\n foreach ($criteria as $columnName => $value) {\n if ($value === null) {\n $conditions[] = $platform->getIsNullExpression($columnName);\n continue;\n }\n\n $columns[] = $columnName;\n $values[] = $value;\n $conditions[] = $columnName . ' = ?';\n }\n }", "public function addConstraints()\n {\n $this->setJoin ()->setWhere ();\n }", "public function prepare($parameters)\n\t{\n\t\t// echo (\"Parameter support: Free Trial, Country, City, Location, Activity Type, Activity Classification, Activity,<br>\");\n\t\t// echo (\"Event Type, Facility, Campus, Arena, Provider, Instructor, Program, Day, Start Time, End Time, Gender, Generation, Age, Keyword\");\n\t\t$conditions = array();\n\n\t\tforeach ($parameters as $name => $value) {\n\t\t\tswitch ($name) {\n\t\t\t\tcase 'sortBy': {\n\t\t\t\t\tif ($value === 'day') {\n\t\t\t\t\t\t$strCondition = \"course.day_of_week ASC, course.course_id DESC\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($value === 'location') {\n\t\t\t\t\t\t$strCondition = \"location.location_id ASC, entity.name ASC, course.course_id DESC\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($value === 'timing') {\n\t\t\t\t\t\t$strCondition = \"course.time_start ASC, course.course_id DESC\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['sort'] = $strCondition;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'freeTrial': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\t$data=[];\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\tif (strtolower($item) == 'yes' && strtolower($item) !== 'any') {\n\t\t\t\t\t\t\t\t$data[] = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (strtolower($item) == 'no' && strtolower($item) !== 'any') {\n\n\t\t\t\t\t\t\t\t$data[] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strtolower($value) == 'yes' && strtolower($value) == 'any') {\n\t\t\t\t\t\t\t$data[] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (strtolower($value) == 'no' && strtolower($value) == 'any') {\n\t\t\t\t\t\t\t$data[] = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['is_free_trial'] = $data;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'country': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$countries = DB::table('country')->whereRaw( join(\" OR \", $strCondition))->pluck('country_id');\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$countries = DB::table('country')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('country_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\n\t\t\t\t\tforeach ($countries as $country) {\n\t\t\t\t\t\t$data[] = $country;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['country_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'city': {\n\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cities = DB::table('city')->whereRaw( join(\" OR \", $strCondition))->pluck('city_id');\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$cities = DB::table('city')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('city_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\n\t\t\t\t\tforeach ($cities as $city) {\n\t\t\t\t\t\t$data[] = $city;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['city_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'location' : {\n\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$locations = DB::table('location')->whereRaw( join(\" OR \", $strCondition))->pluck('location_id');\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$locations = DB::table('location')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('location_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\n\t\t\t\t\tforeach ($locations as $location) {\n\t\t\t\t\t\t$data[] = $location;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['location_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'activityType': {\n\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$activitiesType = DB::table('activity_type')->whereRaw( join(\" OR \", $strCondition))->pluck('activity_type_id');\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$activitiesType = DB::table('activity_type')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('activity_type_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\n\t\t\t\t\tforeach ($activitiesType as $activityType) {\n\t\t\t\t\t\t$data[] = $activityType;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['activity_type_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'activityClassification': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$activitiesClassification = DB::table('activity_classification')->whereRaw( join(\" OR \", $strCondition))->pluck('activity_classification_id');\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$activitiesClassification = DB::table('activity_classification')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('activity_classification_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\n\t\t\t\t\tforeach ($activitiesClassification as $activityClassification) {\n\t\t\t\t\t\t$data[] = $activityClassification;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['activity_classification_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'activity': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$activities = DB::table('activity')->whereRaw( join(\" OR \", $strCondition))->pluck('activity_id');\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$activities = DB::table('activity')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('activity_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t\t$data[] = $activity;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['activity_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'eventType': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$eventsTypes = DB::table('event_type')->whereRaw( join(\" OR \", $strCondition))->pluck('event_type_id');\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$eventsTypes = DB::table('event_type')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('event_type_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($eventsTypes as $eventType) {\n\t\t\t\t\t\t$data[] = $eventType;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['event_type_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'facility': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%' \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$facilities = DB::table('facility')\n\t\t\t\t\t\t\t->whereRaw(join(\" OR \", $strCondition))\n\t\t\t\t\t\t\t->where(\"facility.status\",\"=\",\"1\")->pluck('facility_id');\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$facilities = DB::table('facility')->whereRaw(\n\t\t\t\t\t\t\t(isset($value) && $value !== null ? \"facility.name like \" . DB::Raw(\"'%\" . strtolower($value) . \"%' \") : \"\")\n\t\t\t\t\t\t)->where(\"facility.status\",\"=\",\"1\")->pluck('facility_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($facilities as $facility) {\n\t\t\t\t\t\t$data[] = $facility;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['facility_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'campus': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$campuses = DB::table('campus')->whereRaw( join(\" OR \", $strCondition))->pluck('campus_id');\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$campuses = DB::table('campus')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('campus_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($campuses as $campus) {\n\t\t\t\t\t\t$data[] = $campus;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['campus_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'arena': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arenas = DB::table('arena')->whereRaw( join(\" OR \", $strCondition))->pluck('arena_id');\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$arenas = DB::table('arena')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('arena_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($arenas as $arena) {\n\t\t\t\t\t\t$data[] = $arena;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['arena_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'provider': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$providers = DB::table('provider')->whereRaw( join(\" OR \", $strCondition))->pluck('provider_id');\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$providers = DB::table('provider')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('provider_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($providers as $provider) {\n\t\t\t\t\t\t$data[] = $provider;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['provider_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'instructor': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"(lower(concat(trim(first_name), ' ', trim(last_name))) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%')\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$instructors = DB::table('user')->whereRaw( join(\" OR \", $strCondition))->where('is_instructor','=','1')->where('status','=','2')->pluck('user_id');\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$instructors = DB::table('user')->whereRaw(\n\t\t\t\t\t\t\"lower(concat(trim(first_name), ' ', trim(last_name))) like \" . DB::Raw(\"'%\" . strtolower($value) . \"%'\")\n\t\t\t\t\t)->where('is_instructor','=','1')->where('status','=','2')->pluck('user_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($instructors as $instructor) {\n\t\t\t\t\t\t$data[] = $instructor;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['user_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'program': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$programs = DB::table('program')->whereRaw( join(\" OR \", $strCondition))->pluck('program_id');\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$programs = DB::table('program')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('program_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($programs as $program) {\n\t\t\t\t\t\t$data[] = $program;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['program_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'day': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$days = DB::table('day_of_week')->whereRaw( join(\" OR \", $strCondition))->pluck('day_of_week_id');\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$days = DB::table('day_of_week')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('day_of_week_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($days as $day) {\n\t\t\t\t\t\t$data[] = $day;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['day_of_week'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'timeStart': {\n\t\t\t\t\t$conditions['time_start'] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'timeEnd': {\n\t\t\t\t\t$conditions['time_end'] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'gender': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$genders = DB::table('audience_gender')->whereRaw( join(\" OR \", $strCondition))->pluck('audience_gender_id');\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$genders = DB::table('audience_gender')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('audience_gender_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($genders as $gender) {\n\t\t\t\t\t\t$data[] = $gender;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['audience_gender_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'generation': {\n\t\t\t\t\t$items = explode(\",\",$value);\n\t\t\t\t\tif (sizeof($items) > 0){\n\t\t\t\t\t\t$strCondition = [];\n\t\t\t\t\t\tforeach ($items as $item) {\n\t\t\t\t\t\t\t$strCondition[] = \"lower(name) like \" . DB::Raw(\"'%\" . strtolower($item) . \"%'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$generations = DB::table('audience_generation')->whereRaw( join(\" OR \", $strCondition))->pluck('audience_generation_id');\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$generations = DB::table('audience_generation')->whereRaw('lower(name) like ' . DB::Raw(\"'%\" . strtolower($value) . \"%'\"))->pluck('audience_generation_id');\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = null;\n\t\t\t\t\tforeach ($generations as $generation) {\n\t\t\t\t\t\t$data[] = $generation;\n\t\t\t\t\t}\n\t\t\t\t\t$conditions['audience_generation_id'] = $data;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'ageFrom': {\n\t\t\t\t\t$conditions['age_range_top'] = (strtolower($value) !== 'any' ? $value : 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'ageTo': {\n\t\t\t\t\t$conditions['age_range_bottom'] = (strtolower($value) !== 'any' ? $value : 100);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'alphabet': {\n\t\t\t\t\t$conditions['alphabet'] = explode(\",\",$value);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'searchKeywordBy': {\n\n\t\t\t\t\t$searches =[];\n\t\t\t\t\t$settingKeyWord = $this->getSetting();\n\n\t\t\t\t\tif (isset($parameters['searchKeywordBy']) && $parameters['searchKeywordBy'] !== null && isset($parameters['keyword']) && $parameters['keyword'] !== null) {\n\n\t\t\t\t\t\tif ($parameters['searchKeywordBy'] === 'match') {\n\t\t\t\t\t\t\t/* (field1 like %yo% and field1 like %go%) or (field2 like %yo% and field2 like %go%) */\n\t\t\t\t\t\t\t$keywords = explode(\" \", $parameters['keyword']);\n\n\t\t\t\t\t\t\tforeach ($settingKeyWord as $setting) {\n\n\t\t\t\t\t\t\t\t$match = [];\n\t\t\t\t\t\t\t\tforeach ($keywords as $keyword) {\n\t\t\t\t\t\t\t\t\t$match[] = $setting->table_name . '.' . $setting->column_name . \" like '%\" . $keyword . \"%'\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$searches[] = '( ' . implode(\" AND \" , $match) . ')';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($parameters['searchKeywordBy'] === 'exact') {\n\t\t\t\t\t\t\t/* (field1 like %yo go% or field2 like %yo go%) */\n\t\t\t\t\t\t\tforeach ($settingKeyWord as $setting) {\n\t\t\t\t\t\t\t\t$searches[] = $setting->table_name . '.' . $setting->column_name . \" like '%\" . $parameters['keyword'] . \"%'\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} elseif ($parameters['searchKeywordBy'] === 'contain') {\n\t\t\t\t\t\t\t/* (field1 like %yo% or field1 like %go% or field2 like %yo% or field2 like %go%) */\n\t\t\t\t\t\t\t$keywords = explode(\" \", $parameters['keyword']);\n\n\t\t\t\t\t\t\tforeach ($keywords as $keyword) {\n\t\t\t\t\t\t\t\tforeach ($settingKeyWord as $setting) {\n\t\t\t\t\t\t\t\t\t$searches[] = $setting->table_name . '.' . $setting->column_name . \" like '%\" . $keyword . \"%'\";\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\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions['searchKeywordBy'] = $parameters['searchKeywordBy'];\n\t\t\t\t\t$conditions['keyword'] = $searches;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'page': {\n\t\t\t\t\t$conditions['page'] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'perPage': {\n\t\t\t\t\t$conditions['limit'] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'user_id':\n\t\t\t\t{\n\t\t\t\t\t$conditions['user_id'][] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $conditions;\n\t}", "protected function getWhereKeys(){\n\t\t\t$whereKeys = \"1\";\n\t\t\tif($this->keys){\n\t\t\t\t$whereKeys = array();\n\t\t\t\tforeach ($this->keys as $key) {\n\t\t\t\t\t$whereKeys[] = \"$key = :$key\";\n\t\t\t\t}\n\t\t\t\t$whereKeys = implode(\" AND \", $whereKeys);\n\t\t\t}\n\t\t\treturn $whereKeys;\n\t\t}", "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 KeyWhere(&$keys, $table = \"\")\n{\n\tglobal $strTableName, $cman;\n\t\n\tif( !$table )\n\t\t$table = $strTableName;\n\t$strWhere=\"\";\n\t\n\t$pSet = new ProjectSettings($table);\n\t$cipherer = new RunnerCipherer($table);\n\t$connection = $cman->byTable( $table );\n\t\n\t$keyFields = $pSet->getTableKeys();\n\tforeach($keyFields as $kf)\n\t{\n\t\tif( strlen($strWhere) )\n\t\t\t$strWhere.= \" and \";\n\t\t\t\n\t\t$value = $cipherer->MakeDBValue($kf, $keys[ $kf ], \"\", true);\n\t\t\n\t\tif( $connection->dbType == nDATABASE_Oracle )\n\t\t\t$valueisnull = $value === \"null\" || $value == \"''\";\n\t\telse\n\t\t\t$valueisnull = $value === \"null\";\n\t\t\n\t\tif( $valueisnull )\n\t\t\t$strWhere.= RunnerPage::_getFieldSQL($kf, $connection, $pSet).\" is null\";\n\t\telse\n\t\t\t$strWhere.= RunnerPage::_getFieldSQLDecrypt($kf, $connection, $pSet, $cipherer).\"=\".$cipherer->MakeDBValue($kf, $keys[ $kf ], \"\", true);\n\t}\n\treturn $strWhere;\n}", "public static function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\n\t\t$conditions['select'] = '`id`, `id` AS sid, `title`, \\'\\' AS `alias`, 1 AS parent_id, `section` AS extension, `description`, `published`, `checked_out`, `checked_out_time`, `access`, `params`, `section`';\n\n\t\t$where_or = array();\n\t\t$where_or[] = \"section REGEXP '^[\\\\-\\\\+]?[[:digit:]]*\\\\.?[[:digit:]]*$'\";\n\t\t$where_or[] = \"section IN ('com_banner', 'com_contact', 'com_contact_details', 'com_content', 'com_newsfeeds', 'com_sections', 'com_weblinks' )\";\n\t\t$conditions['where_or'] = $where_or;\n\n\t\t$conditions['order'] = \"id ASC, section ASC, ordering ASC\";\t\n\n\t\treturn $conditions;\n\t}", "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 }", "public function compileTerms($constraint)\n {\n $condition = array();\n $condition[$constraint->field] = $constraint->condition;\n return $condition;\n }", "function where( ...$getwherekeys) { \n $whereorhaving = ($this->iswhere) ? 'WHERE' : 'HAVING';\n $this->iswhere = true;\n \n\t\tif (!empty($getwherekeys)){\n\t\t\tif (is_string($getwherekeys[0])) {\n\t\t\t\tforeach ($getwherekeys as $makearray) \n\t\t\t\t\t$wherekeys[] = explode(' ',$makearray);\t\n\t\t\t} else \n\t\t\t\t$wherekeys = $getwherekeys;\t\t\t\n\t\t} else \n\t\t\treturn '';\n\t\t\n\t\tforeach ($wherekeys as $values) {\n\t\t\t$operator[] = (isset($values[1])) ? $values[1]: '';\n\t\t\tif (!empty($values[1])){\n\t\t\t\tif (strtoupper($values[1]) == 'IN') {\n\t\t\t\t\t$wherekey[ $values[0] ] = array_slice($values,2);\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$wherekey[ (isset($values[0])) ? $values[0] : '1' ] = (isset($values[2])) ? $values[2] : '' ;\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n $this->setParamaters();\n\t\t\t\treturn false;\n } \n\t\t}\n \n $where='1'; \n if (! isset($wherekey['1'])) {\n $where='';\n $i=0;\n $needtoskip=false;\n foreach($wherekey as $key=>$val) {\n $iscondition = strtoupper($operator[$i]);\n\t\t\t\t$combine = $combiner[$i];\n\t\t\t\tif ( in_array(strtoupper($combine), array( 'AND', 'OR', 'NOT', 'AND NOT' )) || isset($extra[$i])) \n\t\t\t\t\t$combinewith = (isset($extra[$i])) ? $combine : strtoupper($combine);\n\t\t\t\telse \n\t\t\t\t\t$combinewith = _AND;\n if (! in_array( $iscondition, array( '<', '>', '=', '!=', '>=', '<=', '<>', 'IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT' ) )) {\n $this->setParamaters();\n return false;\n } else {\n if (($iscondition=='BETWEEN') || ($iscondition=='NOT BETWEEN')) {\n\t\t\t\t\t\t$value = $this->escape($combinewith);\n\t\t\t\t\t\tif (in_array(strtoupper($extra[$i]), array( 'AND', 'OR', 'NOT', 'AND NOT' ))) \n\t\t\t\t\t\t\t$mycombinewith = strtoupper($extra[$i]);\n\t\t\t\t\t\telse \n $mycombinewith = _AND;\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" AND \"._TAG.\" $mycombinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t\t$this->setParamaters($combinewith);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' AND '\".$value.\"' $mycombinewith \";\n\t\t\t\t\t\t$combinewith = $mycombinewith;\n\t\t\t\t\t} elseif ($iscondition=='IN') {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\tforeach ($val as $invalues) {\n\t\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t\t$value .= _TAG.', ';\n\t\t\t\t\t\t\t\t$this->setParamaters($invalues);\n\t\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t\t$value .= \"'\".$this->escape($invalues).\"', \";\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" ( \".rtrim($value, ', ').\" ) $combinewith \";\n\t\t\t\t\t} elseif(((strtolower($val)=='null') || ($iscondition=='IS') || ($iscondition=='IS NOT'))) {\n $iscondition = (($iscondition=='IS') || ($iscondition=='IS NOT')) ? $iscondition : 'IS';\n $where.= \"$key \".$iscondition.\" NULL $combinewith \";\n } elseif((($iscondition=='LIKE') || ($iscondition=='NOT LIKE')) && ! preg_match('/[_%?]/',$val)) return false;\n else {\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" $combinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' $combinewith \";\n\t\t\t\t\t}\n $i++;\n }\n }\n $where = rtrim($where, \" $combinewith \");\n }\n\t\t\n if (($this->getPrepare()) && !empty($this->getParamaters()) && ($where!='1'))\n\t\t\treturn \" $whereorhaving \".$where.' ';\n\t\telse\n\t\t\treturn ($where!='1') ? \" $whereorhaving \".$where.' ' : ' ' ;\n }", "protected function conditionsContainIndexKey()\n {\n if (empty($this->where)) {\n return false;\n }\n\n foreach ($this->model->getDynamoDbIndexKeys() as $name => $keysInfo) {\n $conditionKeys = array_keys($this->where);\n $keys = array_values($keysInfo);\n if (count(array_intersect($conditionKeys, $keys)) === count($keys)) {\n return [\n 'name' => $name,\n 'keysInfo' => $keysInfo\n ];\n }\n }\n\n return false;\n }", "function where($keys, $data) {\n\n $WHERE = array();\n\n foreach ($keys as $key) {\n $index = $key;\n $value = $data[$key];\n $WHERE[] = \"`$index` = '\" . str_replace(\"'\", \"\\'\", $value) . \"'\";\n }\n\n return implode(' AND ', $WHERE);\n}", "public function insertConditionsInfo($user_id, $conditions) {\n\n//\t\t$user_id = '1';\n//\t\tConverting the object into array\n $arr = (array) $conditions;\n\n//\t\tGetting the condition names \n $names = (array_keys($arr));\n $loop_count = count($names);\n\n// INSERTING INTO THE TABLES WITH THE CONDITION NUMBER , HENCE THE LOGIC AS BELOW :\n\n $connection = Yii::app()->db3;\n foreach ($names as $name) {\n\n $parts = explode(\"_\", $name);\n $condition_id = $parts[1];\n //echo $condition_id;echo \" $arr[$name]\";echo '<br>';\n $insertConditionsInfoSql = \"INSERT into conditions_score VALUES ('',$user_id,$condition_id,'$arr[$name]','')\";\n $command = $connection->createCommand($insertConditionsInfoSql)->execute();\n //echo \"Result=\".$insertConditionsInfoSql.\"<BR>\";\n }\n return 1;\n }", "public function setConditions(array $conditions);", "Private function where($tableName,array $conditions,array $options = array()){\n\t\tif(empty ($options))$options = array('prepend' => true ,'join' => ' AND ');\n\t\tif(!isset($options['join'])) $options['join'] = ' AND ';\n\t\t$ops = $this->_operators;\n\t\t$schema = $this->schema[$tableName];\n\t\t$conditions = $this->addSlashesDeep($conditions);\n\t\tswitch (true) {\n\t\t\tcase empty($conditions):\n\t\t\t\treturn '';\n\t\t\tcase is_string($conditions):\n\t\t\t\treturn ($options['prepend']) ? \" WHERE {$conditions}\" : $conditions;\n\t\t\tcase !is_array($conditions):\n\t\t\t\treturn '';\n\t\t}\n\t\t$result = array();\n\n if(count($conditions) > 0 && count($schema) > 0){\n foreach ($conditions as $key => $value) {\n $schema[$key] = isset($schema[$key]) ? $schema[$key] : array();\n switch (true) {\n case strtolower($key) == 'or':\n case strtolower($key) == 'and':\n $result[] = $this->where($tableName,$value,array('prepend' => FALSE,'join' => \" {$key} \"));\n break;\n case (is_numeric($key) && is_array($value)):\n $result[] = $this->where($tableName,$value,array('prepend' => FALSE));\n break;\n case (is_numeric($key) && is_string($value)):\n $result[] = $value;\n break;\n case (is_string($key) && is_array($value) && isset($ops[key($value)])):\n foreach ($value as $op => $val) {\n $result[] = $this->_operator($tableName,$key, array($op => $val), $schema[$key]);\n }\n break;\n case (is_string($key) && is_array($value)):\n $value = join(', ', $this->value($value, $schema[$key]));\n $result[] = \"{$tableName}.{$key} IN ({$value})\";\n break;\n case (is_string($key) && is_string($value) && strpos($value,'%') !== FALSE):\n if(array_key_exists ($key,$this->schema[$tableName])){\n $result[] = \"{$tableName}.{$key} LIKE '{$value}'\";\n }\n else{\n $result[] = \"{$key} LIKE '{$value}'\";\n }\n //$result[] = \"{$tableName}.{$key} LIKE '{$value}'\";\n break;\n default:\n $value = $this->value($value, $schema[$key]);\n $result[] = $tableName.\".\".$key.\" = \".$value;\n break;\n }\n }\n }\n\n\t\tif(count($result)>1){\n\t\t\t$result = \"(\".join($options['join'], $result).\")\";\n\t\t}else{\n\t\t\t$result = join($options['join'], $result);\n\t\t}\n\t\treturn ($options['prepend'] && !empty($result)) ? \"WHERE {$result}\" : $result;\n\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 conditionsContainKey()\n {\n if (empty($this->where)) {\n return false;\n }\n\n $conditionKeys = array_keys($this->where);\n\n $model = $this->model;\n\n $keys = $model->hasCompositeKey() ? $model->getCompositeKey() : [$model->getKeyName()];\n\n $conditionsContainKey = count(array_intersect($conditionKeys, $keys)) === count($keys);\n\n if (!$conditionsContainKey) {\n return false;\n }\n\n $conditionValue = [];\n\n foreach ($keys as $key) {\n $condition = $this->where[$key];\n\n $value = $model->unmarshalItem(array_get($condition, 'AttributeValueList'))[0];\n\n $conditionValue[$key] = $value;\n }\n\n return $conditionValue;\n }", "function _prepareConditions($conditions, $pExtendingModuleID = null)\n{\n $debug_prefix = debug_indent(\"Module-_prepareConditions() {$this->ModuleID}:\");\n print \"$debug_prefix\\n\";\n $parentRecordConditions = array();\n $whereConditions = array();\n $protectJoinAliases = array();\n $SQL = '';\n\n $use_parent = true;\n if(empty($parentModuleID)){\n if(empty($this->parentModuleID)){\n $use_parent = false;\n } else {\n $parentModuleID = $this->parentModuleID;\n }\n }\n\n if($use_parent){\n $parentModule =& GetModule($parentModuleID);\n $parentPK = end($parentModule->PKFields);\n }\n\n if(! empty($pExtendingModuleID )){\n print \"extending module conditions: $pExtendingModuleID, {$this->ModuleID}\\n\";\n $extendingModule = GetModule($pExtendingModuleID);\n if(!empty( $extendingModule->extendsModuleFilterField )){\n $conditions[$extendingModule->extendsModuleFilterField] = $extendingModule->extendsModuleFilterValue;\n print \"added extended condition:\\n\";\n print_r($conditions);\n }\n }\n\n if(count($conditions) > 0){\n foreach($conditions as $conditionField => $conditionValue){\n print \"$debug_prefix Condition $conditionField => $conditionValue\\n\";\n\n $conditionModuleField = $this->ModuleFields[$conditionField];\n if(empty($conditionModuleField)){\n die(\"field {$this->ModuleID}.$conditionModuleField is empty\\n\");\n }\n $qualConditionField = $conditionModuleField->getQualifiedName($this->ModuleID);\n $conditionJoins = $conditionModuleField->makeJoinDef($this->ModuleID);\n if(count($conditionJoins) > 0){\n foreach(array_keys($conditionJoins) as $conditionJoinAlias){\n $protectJoinAliases[] = $conditionJoinAlias;\n }\n }\n\n if($use_parent){\n if(preg_match('/\\[\\*([\\w]+)\\*\\]/', $conditionValue, $match[1])){\n if($match[1][1] == $parentPK){\n $whereConditions[$qualConditionField] = '/**RecordID**/';\n } else {\n print \"SM found match $match[1][0]\\n\";\n $parentRecordConditions[$qualConditionField] = $match[1][1];\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n } else {\n $whereConditions[$qualConditionField] = $conditionValue;\n }\n }\n }\n\n if($use_parent){\n $needParentSubselect = false;\n if(count($parentRecordConditions) > 0){\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n if(empty($parentModuleField)){\n die(\"field {$this->parentModuleID}.$parentConditionField is empty\\n\");\n }\n if(strtolower(get_class($parentModuleField)) != 'tablefield'){\n $needParentSubselect = true;\n }\n }\n if($needParentSubselect){\n $parentJoins = array();\n $parentSelects = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $parentSelects[] = $parentModuleField->makeSelectDef('iparent');\n $parentJoins = array_merge($parentJoins, $parentModuleField->makeJoinDef('iparent'));\n }\n\n $subSQL = 'SELECT ';\n $subSQL .= implode(\",\\n\", $parentSelects);\n $subSQL .= \"\\nFROM `{$this->parentModuleID}` AS `iparent`\\n\";\n $parentJoins = SortJoins($parentJoins);\n $subSQL .= implode(\"\\n \", $parentJoins);\n $subSQL .= \"\\nWHERE `iparent`.$parentPK = '/**RecordID**/' \\n\";\n\n $SQL = \"\\n INNER JOIN ($subSQL) AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentConditionStrings[] = \"`parent`.$parentConditionField = $localConditionField\";\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n } else {\n $SQL = \"\\n INNER JOIN `{$this->parentModuleID}` AS `parent` ON (\\n\";\n $parentConditionStrings = array();\n foreach($parentRecordConditions as $localConditionField => $parentConditionField){\n $parentModuleField = $parentModule->ModuleFields[$parentConditionField];\n $qualParentConditionField = $parentModuleField->getQualifiedName('parent');\n $parentConditionStrings[] = \"$localConditionField = $qualParentConditionField\";;\n }\n $SQL .= implode(\"\\n AND \", $parentConditionStrings);\n $SQL .= \")\\n\";\n\n $whereConditions[\"`parent`.$parentPK\"] = '/**RecordID**/';\n }\n\n }\n }\n\n debug_unindent();\n return array(\n 'parentJoinSQL' => $SQL,\n 'whereConditions' => $whereConditions,\n 'protectJoinAliases' => $protectJoinAliases\n );\n}", "public function addConstraints()\n {\n $throughValue = $this->farChild[$this->secondKey];\n\n $this->performJoin();\n\n if (static::$constraints) {\n $this->query->where($this->getQualifiedSecondOwnerKeyName(), '=', $throughValue);\n }\n\n }", "public function addCond($cond, $vals) {\n $this->sql .= \" WHERE $cond\";\n // Parse the parameters out of the condition string\n preg_match_all(\"/(?<!\\w):\\w+/\", $cond, $params);\n $param = $params[0];\n $i = 0;\n while($i < count($param)) {\n $this->params[] = $param[$i];\n $this->cols[] = null; // Would break an INSERT or UPDATE query\n $this->types[] = $this->setParamType($vals[$i]);\n $this->vals[] = $vals[$i];\n $i++;\n }\n }", "function assoc($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_assoc($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}", "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "public function sectionTableWhere() {}", "public function sectionTableWhere() {}", "public function getConditions();", "public function getConditions();", "public function getConditions();", "public final function addCondition($k,$v){\n $this->defaultMatchCondition[$k]=$v;\n }", "abstract public function getRow($cond_vars);", "public function addConstraints()\n {\n if (static::$constraints)\n {\n $this->query->where($this->foreignKey, '=', $this->getParentKey());\n\n $this->query->whereNotNull($this->foreignKey);\n\n $this->query->where($this->rootKey, '=', $this->getRootKey());\n\n $this->query->whereNotNull($this->rootKey);\n\n }\n }", "protected static function buildConditionByPk($primary_key)\n {\n if (!is_array($primary_key)) {\n throw new InvalidParameterException(\n _s('Primary Key is no array, maybe you wanted to use AbstractModelWithId instead?')\n );\n }\n\n $sql = \" (\";\n\n // add each column to query\n foreach (array_keys($primary_key) as $i => $key) {\n if ($i > 0) {\n $sql .= \" AND \";\n }\n $sql .= \"\\\"\".$key.\"\\\" = :\".$key;\n }\n $sql .= \") \";\n\n return [\n 'sql' => $sql,\n 'params' => $primary_key\n ];\n }", "private function constructCondStringStatic(&$tablesUsed, $conds)\n {\n $groupStrings = array();\n $andGroupStrings = array();\n\n foreach ($conds as $group => $conditions) {\n foreach ($conditions as &$condition) {\n $column = $this->canonicalizeColumn($condition[COND_COLUMN], false, $tablesUsed);\n $before = $after = '';\n if ($condition[COND_OPERATOR] == 'LIKE') {\n $before = '%';\n $after = '%';\n } elseif ($condition[COND_OPERATOR] == 'STARTSWITH') {\n $condition[COND_OPERATOR] = 'LIKE';\n $after = '%';\n }\n\n $condition = $column . ' ' . $condition[COND_OPERATOR] . \" '\" .\n $before . $this->connObj->escapeString($condition[1]) . $after . \"'\";\n }\n\n if ($group === 0) {\n $groupStrings[$group] = implode(' AND ', $conditions);\n } elseif (is_string($group) && substr($group, 0, 3) === 'AND') {\n // 'AND1', 'AND2' are a special type of groups\n $andGroupStrings[$group] = '(' . implode(' AND ', $conditions) . ')';\n } else {\n $groupStrings[$group] = '(' . implode(' OR ', $conditions) . ')';\n }\n }\n\n if (!empty($andGroupStrings)) {\n $groupStrings[] = '(' . implode(' OR ', $andGroupStrings) . ')';\n }\n\n $groupStrings = array_merge($groupStrings, $this->constructJoinString($tablesUsed));\n\n return implode(' AND ', $groupStrings);\n }", "public function addConstraints()\n {\n $this->performJoins();\n\n if (static::$constraints) {\n $local_value = $this->parent->{$this->getFirstForeignKeyName()};\n\n $this->query->where($this->getQualifiedFirstLocalKeyName(), '=', $local_value);\n }\n }", "function read($keys,$extra_cols='',$join='')\n\t{\n\t\tif (!is_array($keys))\n\t\t{\n\t\t\t$pk = array_values($this->db_key_cols);\n\t\t\tif ($pk) $keys = array($pk[0] => $keys);\n\t\t}\n\n\t\t$this->init($keys);\n\t\t$this->data2db();\n\n\t\t$query = false;\n\t\tforeach ($this->db_key_cols as $db_col => $col)\n\t\t{\n\t\t\tif ($this->data[$col] != '')\n\t\t\t{\n\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// no primary key in keys, lets try the data_cols for a unique key\n\t\t{\n\t\t\tforeach($this->db_uni_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\tif (!is_array($col) && $this->data[$col] != '')\n\t\t\t\t{\n\t\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t\t}\n\t\t\t\telseif(is_array($col))\n\t\t\t\t{\n\t\t\t\t\t$q = array();\n\t\t\t\t\tforeach($col as $db_c => $c)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->data[$col] == '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$q = null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$q[$db_c] = $this->data[$c];\n\t\t\t\t\t}\n\t\t\t\t\tif ($q) $query += $q;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// no unique key in keys, lets try everything else\n\t\t{\n\t\t\tforeach($this->db_data_cols as $db_col => $col)\n\t\t\t{\n\t\t\t\tif ($this->data[$col] != '')\n\t\t\t\t{\n\t\t\t\t\t$query[$db_col] = $this->data[$col];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!$query)\t// keys has no cols\n\t\t{\n\t\t\t$this->db2data();\n\n\t\t\treturn False;\n\t\t}\n\t\tif ($join)\t// Prefix the columns with the table-name, as they might exist in the join\n\t\t{\n\t\t\tforeach($query as $col => $val)\n\t\t\t{\n\t\t\t\tif (is_int($col) || strpos($join,$col) === false) continue;\n\t\t\t\t$query[] = $this->db->expression($this->table_name,$this->table_name.'.',array($col=>$val));\n\t\t\t\tunset($query[$col]);\n\t\t\t}\n\t\t}\n\t\tforeach($this->db->select($this->table_name,'*'.($extra_cols?','.(is_array($extra_cols)?implode(',',$extra_cols):$extra_cols):''),\n\t\t\t$query,__LINE__,__FILE__,False,'',$this->app,0,$join) as $row)\n\t\t{\n\t\t\t$cols = $this->db_cols;\n\t\t\tif ($extra_cols)\t// extra columns to report\n\t\t\t{\n\t\t\t\tforeach(is_array($extra_cols) ? $extra_cols : array($extra_cols) as $col)\n\t\t\t\t{\n\t\t\t\t\tif (FALSE!==stripos($col,' as ')) $col = preg_replace('/^.* as *([a-z0-9_]+) *$/i','\\\\1',$col);\n\t\t\t\t\t$cols[$col] = $col;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($cols as $db_col => $col)\n\t\t\t{\n\t\t\t\t$this->data[$col] = $row[$db_col];\n\t\t\t}\n\t\t\t$this->db2data();\n\n\t\t\t// store user timezone used for reading\n\t\t\t$this->data[self::USER_TIMEZONE_READ] = egw_time::$user_timezone->getName();\n\n\t\t\tif ((int) $this->debug >= 4)\n\t\t\t{\n\t\t\t\techo \"data =\\n\"; _debug_array($this->data);\n\t\t\t}\n\t\t\treturn $this->data;\n\t\t}\n\t\tif ($this->autoinc_id)\n\t\t{\n\t\t\tunset($this->data[$this->db_key_cols[$this->autoinc_id]]);\n\t\t}\n\t\tif ((int) $this->debug >= 4) echo \"nothing found !!!</p>\\n\";\n\n\t\t$this->db2data();\n\n\t\treturn False;\n\t}", "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}", "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 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 _compile_wh($qb_key)\n\t{\n\t\tif (count($this->$qb_key) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->$qb_key); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t// Is this condition already compiled?\n\t\t\t\tif (is_string($this->{$qb_key}[$i]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telseif ($this->{$qb_key}[$i]['escape'] === FALSE)\n\t\t\t\t{\n\t\t\t\t\t$this->{$qb_key}[$i] = $this->{$qb_key}[$i]['condition'];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Split multiple conditions\n\t\t\t\t$conditions = preg_split(\n\t\t\t\t\t'/((?:^|\\s+)AND\\s+|(?:^|\\s+)OR\\s+)/i',\n\t\t\t\t\t$this->{$qb_key}[$i]['condition'],\n\t\t\t\t\t-1,\n\t\t\t\t\tPREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n\t\t\t\t);\n\n\t\t\t\tfor ($ci = 0, $cc = count($conditions); $ci < $cc; $ci++)\n\t\t\t\t{\n\t\t\t\t\tif (($op = $this->_get_operator($conditions[$ci])) === FALSE\n\t\t\t\t\t\tOR ! preg_match('/^(\\(?)(.*)('.preg_quote($op, '/').')\\s*(.*(?<!\\)))?(\\)?)$/i', $conditions[$ci], $matches))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// $matches = array(\n\t\t\t\t\t//\t0 => '(test <= foo)',\t/* the whole thing */\n\t\t\t\t\t//\t1 => '(',\t\t/* optional */\n\t\t\t\t\t//\t2 => 'test',\t\t/* the field name */\n\t\t\t\t\t//\t3 => ' <= ',\t\t/* $op */\n\t\t\t\t\t//\t4 => 'foo',\t\t/* optional, if $op is e.g. 'IS NULL' */\n\t\t\t\t\t//\t5 => ')'\t\t/* optional */\n\t\t\t\t\t// );\n\n\t\t\t\t\tif ( ! empty($matches[4]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_is_literal($matches[4]) OR $matches[4] = $this->protect_identifiers(trim($matches[4]));\n\t\t\t\t\t\t$matches[4] = ' '.$matches[4];\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions[$ci] = $matches[1].$this->protect_identifiers(trim($matches[2]))\n\t\t\t\t\t\t.' '.trim($matches[3]).$matches[4].$matches[5];\n\t\t\t\t}\n\n\t\t\t\t$this->{$qb_key}[$i] = implode('', $conditions);\n\t\t\t}\n\n\t\t\treturn ($qb_key === 'qb_having' ? \"\\nHAVING \" : \"\\nWHERE \")\n\t\t\t\t.implode(\"\\n\", $this->$qb_key);\n\t\t}\n\n\t\treturn '';\n\t}", "private function Gen_rules($rid,$rname) {\n\t\t\t$query = \"SELECT * FROM SHM_CONDITIONS \";\n\t\t\t$query .= \" WHERE NAME='$rname' ORDER BY C_ID asc\";\n\t\t\t$result = $this -> DBH -> query($query);\n\t\t\twhile ($row = $result -> fetchArray(SQLITE3_ASSOC)) {\n\t\t\t\t$con_1 = ($row['CON_1'] == \"none\") ? \"\":$row['CON_1'];\n\t\t\t\t// for condition ([HEADER|SIP METHOD|MIME|]\n\t\t\t\tif(($row['CON_1'] == \"none\")) {\n\t\t\t\t\t$headercon = \"\";\n\t\t\t\t} else if(($row['CON_1'] == \"eq\") || ($row['CON_1'] == \"ne\")) {\n\t\t\t\t\t$headercon = $row['CON_11_HD'];\n\t\t\t\t} else {\n\t\t\t\t\t$headercon = $row['CON_12_OTHER1'];\n\t\t\t\t}\n\t\t\t\t$con_11_hd_params = ($row['CON_11_HD_PARAMS'] == \"none\")? \"\":$row['CON_11_HD_PARAMS'];\n\t\t\t\t$d_str = $rid.\"|\".$row['C_ID'].\"|\".$con_1;\n\t\t\t\t$d_str .= \"|\".$headercon.\"|\".$row['CON_11_PATTERN'];\n\t\t\t\t$d_str .= \"|\".$this->ACTION_a[$row['ACTION']].\"|\";\n\t\t\t\t$d_str .= $row['ACT_P1'];\n\t\t\t\t$d_str .= \"|\".$row['ACT_P2'];\n\t\t\t\tarray_push($this->F_Data, $d_str);\n\t\t\t}\n\t\t}", "public function compileMultiMatch($constraint)\n {\n $condition = array();\n $condition['fields'] = $constraint->field;\n $condition['query'] = $constraint->condition;\n $condition['type'] = $constraint->search_clause_type;\n return $condition;\n }", "public function run()\n {\n $kriteria = [\n ['name' => 'umur'],\n ['name' => 'berat'],\n ['name' => 'warna'],\n ['name' => 'harga'],\n ['name' => 'ukuran']\n ];\n\n foreach ($kriteria as $k) {\n Criteria::insert($k);\n }\n }", "public function checkConditions( $criteria, array $condition )\n {\n\n\n if( isset($condition['free']) && trim( $condition['free'] ) != '' )\n {\n\n if( ctype_digit( $condition['free'] ) )\n {\n $criteria->where\n (\n '(\n project_task.rowid = \\''.$condition['free'].'\\'\n )'\n );\n }\n\n }//end if\n\n // search conditions for project_task\n if( isset ($condition['project_task']) )\n {\n $whereCond = $condition['project_task'];\n\n if( isset($whereCond['name']) && trim($whereCond['name']) != '' )\n $criteria->where( ' project_task.name = \\''.$whereCond['name'].'\\' ');\n\n if( isset($whereCond['id_develop_status']) && count($whereCond['id_develop_status']) )\n $criteria->where( \" project_task.id_develop_status IN( '\".implode(\"','\",$whereCond['id_develop_status']).\"' ) \" );\n\n if( isset($whereCond['id_status']) && count($whereCond['id_status']) )\n $criteria->where( \" project_task.id_status IN( '\".implode(\"','\",$whereCond['id_status']).\"' ) \" );\n\n if( isset($whereCond['id_type']) && count($whereCond['id_type']) )\n $criteria->where( \" project_task.id_type IN( '\".implode(\"','\",$whereCond['id_type']).\"' ) \" );\n\n if( isset($whereCond['id_relevance']) && count($whereCond['id_relevance']) )\n $criteria->where( \" project_task.id_relevance IN( '\".implode(\"','\",$whereCond['id_relevance']).\"' ) \" );\n\n // append meta information\n if( isset($whereCond['m_role_create']) && trim($whereCond['m_role_create']) != '' )\n $criteria->where( ' project_task.m_role_create = '.$whereCond['m_role_create'].' ');\n\n if( isset($whereCond['m_role_change']) && trim($whereCond['m_role_change']) != '' )\n $criteria->where( ' project_task.m_role_change = '.$whereCond['m_role_change'].' ');\n\n if( isset($whereCond['m_time_created_before']) && trim($whereCond['m_time_created_before']) != '' )\n $criteria->where( ' project_task.m_time_created <= \\''.$whereCond['m_time_created_before'].'\\' ');\n\n if( isset($whereCond['m_time_created_after']) && trim($whereCond['m_time_created_after']) != '' )\n $criteria->where( ' project_task.m_time_created => \\''.$whereCond['m_time_created_after'].'\\' ');\n\n if( isset($whereCond['m_time_changed_before']) && trim($whereCond['m_time_changed_before']) != '' )\n $criteria->where( ' project_task.m_time_changed <= \\''.$whereCond['m_time_changed_before'].'\\' ');\n\n if( isset($whereCond['m_time_changed_after']) && trim($whereCond['m_time_changed_after']) != '' )\n $criteria->where( ' project_task.m_time_changed => \\''.$whereCond['m_time_changed_after'].'\\' ');\n\n if( isset($whereCond['m_rowid']) && trim($whereCond['m_rowid']) != '' )\n $criteria->where( ' project_task.rowid => \\''.$whereCond['m_rowid'].'\\' ');\n\n if( isset($whereCond['m_uuid']) && trim($whereCond['m_uuid']) != '' )\n $criteria->where( ' project_task.m_uuid => \\''.$whereCond['m_uuid'].'\\' ');\n\n }//end if( isset ($condition['project_task']) )\n\n\n }", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "public function\r\n add_conditions_to_where_clause(\r\n $conditions\r\n );", "abstract protected function prepareKeys($models);", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "protected function getPrimaryKeyCondition($primaryKeyValue) {\n return array(\n 'where' => \"{$this->_primaryKeyElement} = ?\",\n 'bindings' => array($primaryKeyValue)\n );\n }", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "private function internal_get_restrictions() {\n global $DB;\n $where = '';\n $wherearray = array();\n if ($this->courseid) {\n $where .= \"\\nAND d.courseid = ?\";\n $wherearray[] = $this->courseid;\n }\n if ($this->plugin) {\n $where .= \"\\nAND d.plugin = ?\";\n $wherearray[] = $this->plugin;\n }\n $cmrestrictions = false;\n if ($this->coursemoduleid) {\n $where .= \"\\nAND d.coursemoduleid = ?\";\n $wherearray[] = $this->coursemoduleid;\n $cmrestrictions = array($this->coursemoduleid => true);\n }\n if ($this->cmarray) {\n // The courses restriction is technically unnecessary except\n // that we don't have index on coursemoduleid alone, so\n // it is probably better to use course.\n $uniquecourses = array();\n $cmrestrictions = array();\n foreach ($this->cmarray as $cm) {\n $cmrestrictions[$cm->id] = true;\n $uniquecourses[$cm->course] = true;\n }\n list ($cmwhere, $cmwherearray) =\n $DB->get_in_or_equal(array_keys($cmrestrictions));\n list ($coursewhere, $coursewherearray) =\n $DB->get_in_or_equal(array_keys($uniquecourses));\n $where .= \"\\nAND d.coursemoduleid \" . $cmwhere .\n \"\\nAND d.courseid \" . $coursewhere;\n $wherearray = array_merge($wherearray, $cmwherearray, $coursewherearray);\n }\n if (is_array($this->groupids)) {\n if ($this->groupids === self::NONE) {\n $where .= \"\\nAND d.groupid IS NULL\";\n } else {\n $where .= \"\\nAND\";\n if ($this->groupexceptions) {\n $gxcourses = array();\n $gxcms = array();\n foreach ($this->groupexceptions as $cm) {\n // If we are restricting to CMs, don't bother including\n // group exceptions for CMs that are not in that list.\n if ($cmrestrictions) {\n if (!array_key_exists($cm->id, $cmrestrictions)) {\n continue;\n }\n }\n $gxcms[$cm->id] = true;\n $gxcourses[$cm->course] = true;\n }\n if (!empty($gxcms)) {\n list ($cmwhere, $cmwherearray) =\n $DB->get_in_or_equal(array_keys($gxcms));\n list ($coursewhere, $coursewherearray) =\n $DB->get_in_or_equal(array_keys($gxcourses));\n\n $where .= \"\\n(\\n (\\n d.coursemoduleid \" . $cmwhere .\n \"\\n AND d.courseid \" . $coursewhere .\n \"\\n )\\n OR\";\n $wherearray = array_merge($wherearray, $cmwherearray, $coursewherearray);\n }\n }\n if (count($this->groupids) == 0) {\n $where .= \"\\n (\\n FALSE\";\n } else {\n list ($groupwhere, $groupwherearray) =\n $DB->get_in_or_equal($this->groupids);\n $where .= \"\\n (\\n d.groupid \" . $groupwhere;\n $wherearray = array_merge($wherearray, $groupwherearray);\n }\n if ($this->allownogroup) {\n $where .= ' OR d.groupid IS NULL';\n }\n if ($this->groupexceptions && !empty($gxcms)) {\n $where .= \"\\n )\\n)\";\n } else {\n $where .= \"\\n)\";\n }\n }\n }\n if (is_array($this->userids) && !empty($this->userids)) {\n if (reset($this->userids) == self::NONE) {\n $where .= \"\\nAND d.userid IS NULL\";\n } else {\n list ($userwhere, $userwherearray) = $DB->get_in_or_equal($this->userids);\n $where .= \"\\nAND (d.userid \" . $userwhere;\n $wherearray = array_merge($wherearray, $userwherearray);\n if ($this->allownouser) {\n $where .= ' OR d.userid IS NULL';\n }\n $where .= ')';\n }\n }\n return array($where, $wherearray);\n }", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "public function getConditionsHook()\n\t{\n\t\t$conditions = array();\n\t\t\n\t\t$conditions['select'] = '`bid` AS id, `cid`, `type`, `name`, `alias`, `imptotal`, `impmade`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`clicks`, `imageurl`, `clickurl`, `date`, `showBanner` AS state, `checked_out`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`checked_out_time`, `editor`, `custombannercode`, `catid`, `description`, '\n\t\t\t\t\t\t\t\t\t\t\t\t\t.'`sticky`, `ordering`, `publish_up`, `publish_down`, `tags`, `params`'\t;\n\t\t\n\t\t$conditions['where'] = array();\n\t\t\n\t\treturn $conditions;\n\t}", "public function appendConditions( $criteria, $condition, $params )\n {\n\n if( isset($condition['free']) && trim( $condition['free'] ) != '' )\n {\n\n if( ctype_digit( $condition['free'] ) )\n {\n $criteria->where\n (\n '( wbfsys_group_users.rowid = \\''.$condition['free'].'\\' )'\n );\n }\n else\n {\n $criteria->where\n (\n '(\n ( upper(wbfsys_role_group.name) like upper(\\''.$condition['free'].'%\\') )\n OR\n ( upper(wbfsys_role_user.name) like upper(\\''.$condition['free'].'%\\') )\n OR\n ( upper(enterprise_employee.name) like upper(\\''.$condition['free'].'%\\') )\n\n )\n '\n );\n }\n\n }//end if\n\n\n if( $params->begin )\n {\n $this->checkCharBegin( $criteria, $params );\n }\n\n }", "protected function _entityConditions() {\n\t\tif (!$this->_entity || !($model = $this->_config['model'])) {\n\t\t\treturn [];\n\t\t}\n\t\t$key = $model::key($this->_entity->data());\n\n\t\tif (!$key && $this->type() !== 'create') {\n\t\t\tthrow new ConfigException('No matching primary key found.');\n\t\t}\n\t\tif (is_array($key)) {\n\t\t\treturn $key;\n\t\t}\n\n\t\t$key = $model::meta('key');\n\t\t$val = $this->_entity->{$key};\n\t\treturn $val ? [$key => $val] : [];\n\t}", "public function update(){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"UPDATE \".$table.\" SET \";\n foreach($this as $k=>$v){\n $sql .= $k.\" = '\".$v.\"',\";\n }\n $sql = trim($sql, ',');\n $sql .= \" WHERE \".$keyColumn.\" = \".$this->keyColumn;\n mysqli_query(static::$conn, $sql);\n }", "public function compileMatch($constraint)\n {\n $condition = array();\n $condition[$constraint->field] = $constraint->condition;\n return $condition;\n }", "protected function compileWhereHavingStatement($cacheKey)\n {\n if (count($this->builderCache->{$cacheKey}) > 0) {\n for ($i = 0, $c = count($this->builderCache->{$cacheKey}); $i < $c; $i++) {\n // Is this condition already compiled?\n if (is_string($this->builderCache->{$cacheKey}[ $i ])) {\n continue;\n } elseif ($this->builderCache->{$cacheKey}[ $i ][ 'escape' ] === false) {\n $this->builderCache->{$cacheKey}[ $i ]\n = $this->builderCache->{$cacheKey}[ $i ][ 'condition' ];\n continue;\n }\n\n // Split multiple conditions\n $conditions = preg_split(\n '/((?:^|\\s+)AND\\s+|(?:^|\\s+)OR\\s+)/i',\n $this->builderCache->{$cacheKey}[ $i ][ 'condition' ],\n -1,\n PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY\n );\n\n for ($ci = 0, $cc = count($conditions); $ci < $cc; $ci++) {\n if (($op = $this->getOperator($conditions[ $ci ])) === false\n OR\n ! preg_match(\n '/^(\\(?)(.*)(' . preg_quote($op, '/') . ')\\s*(.*(?<!\\)))?(\\)?)$/i',\n $conditions[ $ci ],\n $matches\n )\n ) {\n continue;\n }\n\n // $matches = array(\n // 0 => '(test <= foo)', /* the whole thing */\n // 1 => '(', /* optional */\n // 2 => 'test', /* the field name */\n // 3 => ' <= ', /* $op */\n // 4 => 'foo', /* optional, if $op is e.g. 'IS NULL' */\n // 5 => ')' /* optional */\n // );\n\n if ( ! empty($matches[ 4 ])) {\n //$this->isLiteral($matches[4]) OR $matches[4] = $this->protectIdentifiers(trim($matches[4]));\n $matches[ 4 ] = ' ' . $matches[ 4 ];\n }\n\n $conditions[ $ci ] = $matches[ 1 ] . $this->conn->protectIdentifiers(trim($matches[ 2 ]))\n . ' ' . trim($matches[ 3 ]) . $matches[ 4 ] . $matches[ 5 ];\n }\n\n $this->builderCache->{$cacheKey}[ $i ] = implode('', $conditions);\n }\n\n if ($cacheKey === 'having') {\n return \"\\n\" . sprintf(\n 'HAVING %s',\n implode(\"\\n\", $this->builderCache->having)\n );\n }\n\n return \"\\n\" . sprintf(\n 'WHERE %s',\n implode(\"\\n\", $this->builderCache->{$cacheKey})\n );\n }\n\n return '';\n }", "function BuildKeyFilter() {\r\n\t\tglobal $objForm, $rekeningju;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $rekeningju->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "public function update_table (array $data, array $condition){\n\n $value = \"\";\n $cvalue = \"\";\n if ($data){\n // shell array $data\n foreach($data as $key => $val){\n\n if (count($data)> 1){\n\n $value .= \"$key = '$val' AND \";\n }else {\n\n $value .= \"$key = '$val'\";\n }\n }\n \n // // remove the last AND\n $words = explode( \" \", $value );\n $cnt = count($words);\n if($words[$cnt-2] == \"AND\") {\n\n array_splice( $words, -2 );\n }\n \n $value = implode( \" \", $words );\n }\n\n if ($condition){\n // shell array $data\n foreach($condition as $ckey => $cval){\n\n if (count($condition)> 1){\n\n $cvalue .= \"$ckey = '$cval' AND \";\n }else {\n\n $cvalue .= \"$ckey = '$cval'\";\n }\n }\n \n // // remove the last AND\n $cwords = explode( \" \", $cvalue );\n $ccnt = count($cwords);\n if($cwords[$ccnt-2] == \"AND\") {\n\n array_splice( $cwords, -2 );\n }\n \n $cvalue = implode( \" \", $cwords );\n }\n \n $sql =\"UPDATE \".$this->_table.\" SET \".$value.\" WHERE \".$cvalue;\n //echo $sql; die();\n // send $sql to function sql to executate\n $res = $this->_pdo->exec($sql); //or var_dump($this->_pdo->errorInfo());;\n }", "protected function _compile_conditions(array $conditions)\n {\n $last_condition = NULL;\n\n $sql = '';\n foreach ($conditions as $group)\n {\n // Process groups of conditions\n foreach ($group as $logic => $condition)\n {\n if ($condition === '(')\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Include logic operator\n $sql .= ' '.$logic.' ';\n }\n\n $sql .= '(';\n }\n elseif ($condition === ')')\n {\n $sql .= ')';\n }\n else\n {\n if ( ! empty($sql) AND $last_condition !== '(')\n {\n // Add the logic operator\n $sql .= ' '.$logic.' ';\n }\n\n // Split the condition\n list($column, $op, $value) = $condition;\n // Support db::expr() as where clause\n if ($column instanceOf db_expression and $op === null and $value === null)\n {\n $sql .= (string) $column;\n }\n else\n {\n if ($value === NULL)\n {\n if ($op === '=')\n {\n // Convert \"val = NULL\" to \"val IS NULL\"\n $op = 'IS';\n }\n elseif ($op === '!=')\n {\n // Convert \"val != NULL\" to \"valu IS NOT NULL\"\n $op = 'IS NOT';\n }\n }\n\n // Database operators are always uppercase\n $op = strtoupper($op);\n if (($op === 'BETWEEN' OR $op === 'NOT BETWEEN') AND is_array($value))\n {\n // BETWEEN always has exactly two arguments\n list($min, $max) = $value;\n\n if (is_string($min) AND array_key_exists($min, $this->_parameters))\n {\n // Set the parameter as the minimum\n $min = $this->_parameters[$min];\n }\n\n if (is_string($max) AND array_key_exists($max, $this->_parameters))\n {\n // Set the parameter as the maximum\n $max = $this->_parameters[$max];\n }\n\n // Quote the min and max value\n $value = $this->quote($min).' AND '.$this->quote($max);\n }\n elseif ($op === 'FIND_IN_SET' || strstr($column, '->') )\n {\n }\n else\n {\n if (is_string($value) AND array_key_exists($value, $this->_parameters))\n {\n // Set the parameter as the value\n $value = $this->_parameters[$value];\n }\n\n // Quote the entire value normally\n $value = $this->quote($value);\n \n }\n\n //json字段查询\n if ( strstr($column, '->') ) \n {\n $value = is_string($value) ? $this->quote($value) : $value;\n list($column, $json_field) = explode('->', $column, 2);\n\n $column = $this->quote_field($column, false);\n $sql .= $column.'->\\'$.' . $json_field . '\\' '.$op.' '.$value;\n }\n else\n {\n // Append the statement to the query\n $column = $this->quote_field($column, false);\n if ($op === 'FIND_IN_SET') \n {\n $sql .= $op.\"( '{$value}', {$column} )\";\n }\n else \n {\n $sql .= $column.' '.$op.' '.$value;\n }\n }\n }\n }\n\n $last_condition = $condition;\n }\n }\n\n return $sql;\n }", "public function getConditions(): array\n\t{\n\t\treturn $this->conditions;\n\t}", "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 }", "public function buildPkeyCriteria()\n\t{\n\t\t$criteria = new Criteria(C060InventarioPeer::DATABASE_NAME);\n\n\t\t$criteria->add(C060InventarioPeer::CO_NUM_INVENTARIO, $this->co_num_inventario);\n\n\t\treturn $criteria;\n\t}", "public function setKey($keys = null){\n\t\t\t$otherClass=$this->class;\n\t\t\tif(is_array($keys)){//multiple primary keys\n\t\t\t\t$this->keys = $keys;\n\t\t\t}elseif(is_string($keys)){//single primary key\n\t\t\t\t$this->keys = array(\"$keys\");\n\t\t\t}elseif(is_numeric($keys) && count($this->columns) >= $keys){\n\t\t\t\t$this->keys = array_slice($this->columns, 0, $keys);\n\t\t\t}elseif(isset($otherClass::$primaryKeys) && is_array($otherClass::$primaryKeys)){//else if static primaryKeys is defined, those are the keys\n\t\t\t\t$this->keys = $otherClass::$primaryKeys;\n\t\t\t}elseif(isset($this->columns[0])){//default is the first property of the class\n\t\t\t\t$this->keys = array($this->columns[0]);\n\t\t\t}else{//else no primary key is given\n\t\t\t\t$this->keys = false;\n\t\t\t}\n\t\t\t$this->loadColumns();//update columns by removing the keys\n\t\t}", "public function get_course_conditions($courseid) {\n return $this->get_conditions($courseid);\n }", "public function get_conditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n\t{\n\t\treturn $this->conditions;\n\t}", "public function getConditions()\n\t{\n\t\treturn $this->conditions;\n\t}", "protected function where($data, $conditional = false) {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\t$this->_where = ' WHERE ';\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\tif ( $fields == 1) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tif ( $i+1 == $fields) {\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cond = ($conditional) ? $conditional[$i] : 'AND';\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' ' . $cond . ' ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t }", "public function &havingConditions();", "protected function sqlKeyFilter()\n\t{\n\t\treturn \"`IncomeCode` = @IncomeCode@\";\n\t}", "function Select_Record_By_Two_Filter($data, $table_name) {\r\n global $con;\r\n $key = array_keys($data);\r\n $value = array_values($data);\r\n $sql = \"select * from $table_name where $key[0] = '$value[0]' AND $key[1] = '$value[1]'\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}", "function tabledata_Cde_select($table , $field,$trisens,$trival, $key, $idWhere = false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n //echo \"table : $table , field : $field, trisens : $trisens, trival $trival, key $key, Where $idWhere\";\r\n //echo \"<br/>field : \";print_r($field);\r\n //echo \"<br/>key : \";print_r($key);\r\n //echo \"<br/>Where : \";print_r($idWhere);\r\n\r\n //$boolCleMultiple = (is_array($key['PRIMARY KEY']))?true:false;\r\n\r\n $leschamps = array();\r\n $lestables = $table;\r\n $clauseWhere = array();\r\n $clauseGroupby = array();\r\n $clauseOrderby = array();\r\n $clauseLimit = array();\r\n $clauseHaving = array();\r\n\r\n // Dans la suite : Le nombre de champs à afficher est dynamique.\r\n // Et : l'Identifiant (Id Ligne) doit être le premier champ retourné par SELECT\r\n\r\n foreach ($field as $cle=>$txtChamp)\r\n {\r\n $leschamps [] = $cle;\r\n } // foreach ($field as $cle=>$txtChamp)\r\n\r\n if ($idWhere!=false)\r\n {\r\n $clauseWhere[] = ($idWhere) ; // Limitation1\r\n } // if ($idWhere)\r\n else\r\n {\r\n if ( isset($trival) && $trival!=\"\")\r\n {\r\n $clauseOrderby[] = $trival.($trisens==\"D\"?\" DESC\":\"\");\r\n }\r\n else if ( is_array($key['PRIMARY KEY']) && isset($key['PRIMARY KEY']) )\r\n {\r\n $clauseOrderby[] = implode(\" , \",$key['PRIMARY KEY']) ; // Limitation1\r\n } //if ( isset($key['PRIMARY KEY']))\r\n } // if ($idWhere)\r\n\r\n $Rselect = sql_select( $leschamps,$table,$clauseWhere\r\n ,$clauseGroupby,$clauseOrderby\r\n ,$clauseLimit,$clauseHaving);\r\n\r\n $nbenreg = sql_count($Rselect) ;\r\n\r\n //-------- Voir le code de la requête\r\n //echo \"<hr/>\",sql_get_select( $leschamps,$table,$clauseWhere,$clauseGroupby,$clauseOrderby,$clauseLimit,$clauseHaving),\"<br/> ressource : \";\r\n\r\n echo ($nbenreg==1)?\"\":\" Nb enreg. dans la s&#233;lection : \".$nbenreg.\"<hr/>\";\r\n\r\n return $Rselect;\r\n\r\n}", "public function configurableConditions($search, $params) {\n\t\t\t$conditions = array();\n\t\t\t\n\t\t\t$hasPrestation = (array)Configure::read($params['searchKeyPrefix'].'.common.filters.has_prestation');\n\t\t\tif (empty($hasPrestation)) {\n\t\t\t\t$hasPrestation = (array)Configure::read(\n\t\t\t\t\t\"{$params['searchKeyPrefix']}.{$params['configurableQueryFieldsKey']}.filters.has_prestation\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$filterRolepers = Hash::get($search, 'Prestation.rolepers');\n\t\t\t\n\t\t\tif (!empty($hasPrestation) && $filterRolepers !== null && in_array($filterRolepers, $hasPrestation)) {\n\t\t\t\tif ((string)$filterRolepers === '0') {\n\t\t\t\t\t$conditions[] = 'Prestation.id IS NULL';\n\t\t\t\t} elseif ((string)$filterRolepers === '1') {\n\t\t\t\t\t$conditions['Prestation.rolepers'] = array('DEM', 'CJT');\n\t\t\t\t} else {\n\t\t\t\t\t$conditions['Prestation.rolepers'] = $filterRolepers;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $conditions;\n\t\t}", "public function append($conditions, $glue=null)\n\t{\n\t\t// If no explicit glue is set use the object glue.\n\t\tif ($glue === null) {\n\t\t\t$glue = $this->_glue;\n\t\t}\n\n\t\t// Sanitize the glue.\n\t\t$glue = strtoupper($glue);\n\n\t\tif ($conditions) {\n\t\t\t$this->_conditions[] = array('c'=>$conditions, 'g'=>$glue);\n\t\t}\n\t}", "public function buildPkeyCriteria()\n {\n $criteria = new Criteria(JadwalPeer::DATABASE_NAME);\n $criteria->add(JadwalPeer::SEKOLAH_ID, $this->sekolah_id);\n $criteria->add(JadwalPeer::SEMESTER_ID, $this->semester_id);\n $criteria->add(JadwalPeer::ID_RUANG, $this->id_ruang);\n $criteria->add(JadwalPeer::HARI, $this->hari);\n\n return $criteria;\n }", "protected function getConditions()\n {\n $entityPk = (array)$this->mapper->getConfig()->getPrimaryKey();\n $conditions = [];\n foreach ($entityPk as $col) {\n $val = $this->entityHydrator->get($this->entity, $col);\n if ($val) {\n $conditions[$col] = $val;\n }\n }\n\n // not enough columns? reset\n if (count($conditions) != count($entityPk)) {\n return [];\n }\n\n return $conditions;\n }", "function pk_where($binded=false) {\r\n\t\t$in = $this->session_vars;\r\n\t\t$pk_key = $this->pk_key ();\r\n\t\tfor($i = 0; $i < count ( $pk_key ); $i ++) {\r\n\t\t\tif ($in [$pk_key [$i]] != 'next') {\r\n\t\t\t\tif ($where != '')\r\n\t\t\t\t$where .= ' and ';\r\n\t\t\t\tif(!$binded) $where .= $pk_key [$i] . \"='\" . $in [$pk_key [$i]] . \"'\";\r\n\t\t\t\telse $where .= $pk_key [$i] . \"=:\" .$pk_key [$i] ;\r\n\t\t\t\t$bind[$pk_key [$i]]= $in [$pk_key [$i]];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$return['WHERE']=$where;\r\n\t\t$return['BIND']=$bind;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(!$binded) return $return['WHERE'];\r\n\t\telse return $return;\r\n\t}", "public function getPrimaryKey()\n\t\t{\n\t\t\treturn array('cfe_rule_condition_id');\n\t\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 buildPkeyCriteria()\n {\n $criteria = new Criteria(SanitasiPeer::DATABASE_NAME);\n $criteria->add(SanitasiPeer::SEKOLAH_ID, $this->sekolah_id);\n $criteria->add(SanitasiPeer::SEMESTER_ID, $this->semester_id);\n\n return $criteria;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }", "public function getConditions()\n {\n return $this->conditions;\n }" ]
[ "0.6259118", "0.6145938", "0.6108746", "0.5661521", "0.5530836", "0.5362587", "0.5295799", "0.5234841", "0.5222603", "0.5221521", "0.5176632", "0.51736736", "0.5166585", "0.5146636", "0.51118505", "0.5089437", "0.5087187", "0.5085602", "0.5083408", "0.5080196", "0.50686234", "0.5022305", "0.4989667", "0.49674395", "0.4944696", "0.49339685", "0.49268204", "0.49256143", "0.4920789", "0.49018136", "0.49018136", "0.4880502", "0.4880502", "0.4880502", "0.48636046", "0.48495734", "0.48134056", "0.48122743", "0.48079315", "0.48001513", "0.47947922", "0.47846884", "0.47791925", "0.47789055", "0.4772965", "0.4763648", "0.4749045", "0.4747465", "0.47443134", "0.47437835", "0.47404775", "0.47366235", "0.4735655", "0.47247198", "0.47092563", "0.47092563", "0.47092563", "0.47089666", "0.4690392", "0.4690392", "0.4690392", "0.4690392", "0.4690392", "0.4690392", "0.46759072", "0.46750644", "0.46725592", "0.46654698", "0.46578133", "0.46562988", "0.46485987", "0.46441272", "0.4638409", "0.46333048", "0.46258944", "0.46258944", "0.46258944", "0.46168807", "0.46121815", "0.4610235", "0.46016797", "0.45951387", "0.45951387", "0.45864892", "0.457833", "0.45761573", "0.45727184", "0.45708993", "0.45611012", "0.45588082", "0.4550606", "0.45454192", "0.45309317", "0.45290864", "0.45212305", "0.45203105", "0.451941", "0.451941", "0.451941", "0.451941" ]
0.6521527
0
Perform canonicalization on each element of an array of column names
protected function canonicalizeColumns( $columns, $aliasColumns = false, &$tablesUsed = null, $includeTableName = true ) { $canonical = array(); foreach ($columns as $column) { $canonical[] = $this->canonicalizeColumn($column, $aliasColumns, $tablesUsed, $includeTableName); } return $canonical; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function formatColumns(array $columns): array\n {\n return array_map(function ($item) {\n return array_change_key_case($item, CASE_LOWER);\n }, $columns);\n }", "protected final function prepareCols(&$array)\n {\n\n foreach ($array as $index => $value)\n {\n if ((array_key_exists(\"table\", $array)))\n {\n unset($array[\"table\"]);\n }\n elseif ($value == null || $value == \"\")\n {\n unset($array[$index]);\n }\n }\n return implode(\",\", array_keys($array));\n\n }", "protected function camelCaseMetaFields(&$array)\n {\n $filter = new \\Zend\\Filter\\Word\\UnderscoreToCamelCase();\n foreach ($array as $field => $value) {\n if (strstr($field, '_')) {\n $newField = lcfirst($filter->filter($field));\n\n if (array_key_exists($newField, $array)) {\n // don't override existing fields if they've already been populated by a join!\n unset($array[$field]);\n continue;\n }\n\n $array[$newField] = $value;\n unset($array[$field]);\n }\n }\n }", "private function calculateColumnNameTranslations(array $column_names): ?array\n {\n $keys = array_values($column_names);\n $values = array_keys($column_names);\n\n if (!$this->strict_source_names) {\n array_walk($keys, function(&$value) {\n $value = mb_strtolower(preg_replace('/_+$/', '', preg_replace('/^_+/', '', preg_replace('/[\\s\\.\\(\\)]+/', '_', $value))));\n $value = str_replace(NABU_ARRAY_CHARACTER_WITH_TILDE, NABU_ARRAY_CHARACTER_CANONICAL, $value);\n });\n }\n\n $new_keys = array_intersect_key($this->matrix_fields, array_combine($keys, $values));\n $new_values = array_intersect_key(array_combine($keys, $values), $this->matrix_fields);\n\n $translated_columns = array();\n foreach ($new_keys as $key => $value) {\n $translated_columns[$value] = $new_values[$key];\n }\n\n return $translated_columns;\n }", "public static function sanitize_entry_array(&$entry) {\n /* attributes whose values will be lower-cased: */\n $attrs = array('edupersonorgunitdn', 'edupersonprimaryorgunitdn',\n 'uoauserapps', 'edupersonorgdn', 'edupersonprimaryaffiliation',\n 'edupersonaffiliation', 'eduorgsuperioruri');\n\n for($i=0; $i<$entry['count']; $i++) {\n $entry[$i]['dn'] = strtolower($entry[$i]['dn']);\n foreach($attrs as $attr) {\n if(isset($entry[$i][$attr]['count']) && $entry[$i][$attr]['count'] > 0 ) {\n for($j=0; $j<$entry[$i][$attr]['count']; $j++) {\n $entry[$i][$attr][$j] = strtolower($entry[$i][$attr][$j]);\n }\n }\n }\n }\n }", "function rectifyNames($names){\r\n return array_map(\"rectifyName\",$names);\r\n}", "protected function normalizeKeys(array $arr)\n {\n return array_change_key_case($arr, CASE_UPPER);\n }", "public static function arrayToLower($array) {\r\n foreach ($array AS $key => $value) {\r\n if (is_string($value)) {\r\n $array[$key] = strtolower(trim($value));\r\n }\r\n }\r\n return $array;\r\n}", "function array_keys_to_lower($array) {\n $rr = [];\n foreach ($array as $k => $v) {\n $rr[strtolower($k)] = $v;\n }\n return $rr;\n}", "function capMe(array $arrayToHandle): array\n{\n return array_map(\n fn($item) => ucfirst(strtolower($item)),\n $arrayToHandle\n );\n}", "function array_iunique($array) {\n return array_intersect_key($array,array_unique(\n array_map(strtolower,$array)));\n }", "private function normalizeHeader(array $header): array\n {\n if ($this->isNormalizeHeader()) {\n return array_map('strtolower', $this->normalizer->normalizeHeader($header));\n }\n\n return $header;\n }", "function array_sort_by(&$array_initial, $col, $order = SORT_ASC){\n\n $arrAux = array();\n\n foreach ($array_initial as $key=> $row){\n $arrAux[$key] = is_object($row) ? $arrAux[$key] = $row->$col : $row[$col];\n $arrAux[$key] = strtolower($arrAux[$key]);\n }\n\n array_multisort($arrAux, $order, $array_initial);\n }", "public function slugify_headers($array, $case=1, $custom_mappings=array()) {\n // A counter for empty field names. If any nonempty column doesn't\n // have a header, we will call it UNKNOWN_FIELD_N.\n $empty_counter = 0;\n\n // Loop through and slugify each element of the first row of $array.\n for ($i=0; $i<count($array[0]); $i++) {\n $slug = self::slugify($array[0][$i], $case, $custom_mappings);\n if (empty($slug)) {\n $slug = \"UNKNOWN_FIELD_\" . ($empty_counter+1);\n $empty_counter++;\n }\n $array[0][$i] = $slug;\n }\n\n if ($empty_counter) {\n if ($empty_counter == 1) {\n $text = \"One header field was found to be empty. It has \"\n . \"been named \" . $slug . \".\";\n } else {\n $text = $empty_counter . \" header fields were found be empty. \"\n . \"They have been named by the system.\";\n }\n $this->notifier->add($text, 'warning', 106);\n }\n\n return $array;\n }", "public static function arrayucwords($array) {\r\n foreach ($array as $key => $value) {\r\n if (is_string($value)) {\r\n $array[$key] = ucwords(trim($value));\r\n }\r\n }\r\n return $array;\r\n}", "public static function stringizeOrderBy($array)\n {\n //normalize single column orderBy statement\n if (is_string(reset($array)))\n {\n $array = array($array);\n } \n \n $columnsOrderBy = array();\n \n foreach ($array as $orderBy)\n {\n// var_dump($orderBy);\n $columnsOrderBy[] = $orderBy['column'] . ' ' . $orderBy['direction'];\n }\n \n return implode(', ', $columnsOrderBy);\n }", "public static function arrayToUpper($array) {\r\n foreach ($array AS $key => $value) {\r\n if (is_string($value)) {\r\n $array[$key] = strtoupper(trim($value));\r\n }\r\n }\r\n return $array;\r\n}", "public function normalizeColumns(array &$rows) : array\n {\n $maxNumColumns = 0;\n\n // Find the max number of columns that appear in any given row\n foreach ($rows as $row) {\n $maxNumColumns = max($maxNumColumns, count($row));\n }\n\n $maxLengths = array_pad([], $maxNumColumns, 0);\n\n // Normalize the number of columns in each row\n foreach ($rows as &$row) {\n $row = array_pad($row, $maxNumColumns, '');\n }\n\n // Get the length of the longest value in each column\n foreach ($rows as &$row) {\n foreach ($row as $column => &$value) {\n $value = trim($value);\n $maxLengths[$column] = max($maxLengths[$column], mb_strlen($value));\n }\n }\n\n return $maxLengths;\n }", "public function by_name_normalized_multi(array $name_normalized_arr) {\n $keys_arr = [];\n foreach ($name_normalized_arr as $k => $name_normalized) {\n $keys_arr[$k] = [ 'name_normalized' => (string) $name_normalized, ];\n }\n return parent::_by_fields_multi(\n self::BY_NAME_NORMALIZED,\n $keys_arr\n );\n }", "function normalize($tags) {\n //clean tags from strange characters\n $tags = str_replace(array('\"', '\\'', '/'), \"_\", $tags);\n\n //normalize\n if(!is_array($tags)) {\n $tags = utf8_strtolower(trim($tags));\n } else {\n $tags = array_filter($tags);//remove empty values\n foreach($tags as $i => $tag) {\n $tags[$i] = utf8_strtolower(trim($tags[$i]));\n }\n }\n return $tags;\n }", "public function san($input = '')\n {\n if(is_array($input))\n {\n // Replace each entity with a safe version\n $queryText = $input[0];\n \n for($index = 1; $index < count($input); $index ++)\n {\n $safePart = $this->san($input[$index]);\n $queryText = str_replace('{' . $index . '}', $safePart, $queryText);\n }\n \n return $queryText;\n }\n else\n {\n return mysql_real_escape_string($input);\n }\n }", "function map_columns($columns)\n {\n $columns[$this->taxonomies_id] = __($this->taxonomies_name, $this->tax_domain);\n return $columns;\n }", "function arrayCSort($marray, $column, $sortflag) {\n\t\tforeach ($marray as $row) {\n\t\t\t$sortarr[] = strtolower($row[$column]);\n\t\t}\n\t\tif (isset($sortarr)) {\n\t\t\tif (!is_array($sortarr) ) {\n\t\t\t\treturn $marray;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $marray;\n\t\t}\n\t\tarray_multisort($sortarr, $sortflag, $marray, $sortflag);\n\t\treturn $marray;\n\t}", "private function mapThe(array $columns, string $prefix): array\n {\n return array_map(function(string $column) use ($prefix): string {\n return $prefix . $column;\n }, $columns);\n }", "public function getValidColumns(array $columns);", "public function arrayKeysToLowercase($array)\n {\n return array_change_key_case($array, \\CASE_LOWER);\n }", "abstract public function sanatizeParameters(array $params);", "protected function _nameprep($input)\n {\n $output = array();\n $error = false;\n //\n // Mapping\n // Walking through the input array, performing the required steps on each of\n // the input chars and putting the result into the output array\n // While mapping required chars we apply the cannonical ordering\n foreach($input as $v)\n {\n // Map to nothing == skip that code point\n if(in_array($v, $this->NP['map_nothing']))\n continue;\n // Try to find prohibited input\n if(in_array($v, $this->NP['prohibit']) || in_array($v, $this->NP['general_prohibited']))\n {\n $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));\n return false;\n }\n foreach($this->NP['prohibit_ranges'] as $range)\n {\n if($range[0] <= $v && $v <= $range[1])\n {\n $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));\n return false;\n }\n }\n // Hangul syllable decomposition\n if(0xAC00 <= $v && $v <= 0xD7AF)\n {\n foreach($this->_hangul_decompose($v) as $out)\n $output[] = (int)$out;\n // There's a decomposition mapping for that code point\n }\n elseif(isset($this->NP['replacemaps'][$v]))\n {\n foreach($this->_apply_cannonical_ordering($this->NP['replacemaps'][$v]) as $out)\n {\n $output[] = (int)$out;\n }\n }\n else\n {\n $output[] = (int)$v;\n }\n }\n // Before applying any Combining, try to rearrange any Hangul syllables\n $output = $this->_hangul_compose($output);\n //\n // Combine code points\n //\n $last_class = 0;\n $last_starter = 0;\n $out_len = count($output);\n for($i = 0; $i < $out_len; ++$i)\n {\n $class = $this->_get_combining_class($output[$i]);\n if((!$last_class || $last_class > $class) && $class)\n {\n // Try to match\n $seq_len = $i - $last_starter;\n $out = $this->_combine(array_slice($output, $last_starter, $seq_len));\n // On match: Replace the last starter with the composed character and remove\n // the now redundant non-starter(s)\n if($out)\n {\n $output[$last_starter] = $out;\n if(count($out) != $seq_len)\n {\n for($j = $i + 1; $j < $out_len; ++$j)\n $output[$j - 1] = $output[$j];\n unset($output[$out_len]);\n }\n // Rewind the for loop by one, since there can be more possible compositions\n $i --;\n $out_len --;\n $last_class = ($i == $last_starter)? 0 :$this->_get_combining_class($output[$i - 1]);\n continue;\n }\n }\n // The current class is 0\n if(!$class)\n $last_starter = $i;\n $last_class = $class;\n }\n return $output;\n }", "function implodeToLower(string $delimiter, array $array):string\n{\n $string = implode($delimiter, array_map('strtolower', $array));\n return $string;\n}", "public function returnArrayAsLowercase($array)\n {\n return self::arrayCaseing('strtolower', $array);\n }", "public function __invoke(array $params = [])\n {\n return $this->columnize($params);\n }", "private function format_array( $array ) {\n\n if ( !is_array( $array ) ) {\n\n if ( is_serialized( $array ) ) {\n\n $array = maybe_unserialize( $array );\n\n }\n else {\n\n $array = explode( ',', $array );\n\n }\n\n }\n\n return array_filter( array_map( 'trim', array_map( 'strtolower', $array ) ) );\n\n }", "function db_tableby_to_sqladd($arr){\t\n\tif ( is_array( $arr ) ) {\n\t\t$s='';\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$s.=DB_PRE.$k.' as '.$v.',';\n\t\t}\n\t\treturn $s;\n\t}elseif(strpos( $arr,',' )>0) \t{\n\t\treturn DB_PRE.str_replace(',',','.DB_PRE,$arr);\t\t\n\t}else {\n\t\tif (strpos( $arr,DB_PRE )>0){\n\t\t\treturn $arr;\n\t\t}else{\n\t\t\treturn DB_PRE.$arr;\n\t\t}\t\t\n\t}\n}", "function tableRemap($rows, $map) {\n $mapParts = explode(',', $map);\n $map = array();\n foreach($mapParts as $dst) {\n $kv = explode('(', $dst);\n if (count($kv) == 2) {\n list($dst, $src) = $kv;\n $src = substr($src, 0, -1);\n } else $src = $dst;\n $map[] = sprintf('\"%s\" => isset($el[\"%s\"]) ? $el[\"%s\"] : null', $dst, $src, $src);\n }\n $fn = create_function('$el', 'return array(' . join(', ', $map) . ');');\n return array_map($fn, $rows);\n}", "function tableRemap($rows, $map) {\n $mapParts = explode(',', $map);\n $map = array();\n foreach($mapParts as $dst) {\n $kv = explode('(', $dst);\n if (count($kv) == 2) {\n list($dst, $src) = $kv;\n $src = substr($src, 0, -1);\n } else $src = $dst;\n $map[] = sprintf('\"%s\" => isset($el[\"%s\"]) ? $el[\"%s\"] : null', $dst, $src, $src);\n }\n $fn = create_function('$el', 'return array(' . join(', ', $map) . ');');\n return array_map($fn, $rows);\n}", "function implode_column($glue, $column, $arr) {\n $values = array();\n foreach ($arr as $row) {\n $value = lavnn($column, $row, '');\n if ($value != '')\n $values[] = $value;\n }\n return implode($glue, $values);\n}", "public function processArray($input){\n\t\tforeach (static::$columns as $column) {\n\t\t\tif(isset($input[$column])){\n\t\t\t\t$this->$column = $input[$column];\n \t\t\t}\n\t\t}\n\t}", "function qwe_clean($array){\r\n\r\n\t\t\t\t\t\t\t\t\t\treturn array_map('mysql_real_escape_string', $array) ;\r\n\t\t\t\t\t\t\t\t\t}", "function array_lower($a_arr){\n\tarray_walk($a_arr, 'walk_tolower');\n\treturn $a_arr;\n}", "function md_multisort($arr, $col, $method = SORT_ASC)\n{\n\tif(!is_array($arr) || empty($arr)) return false;\n\tif($col === null) return $arr;\n\telseif($col == 'name') $tmp = array_keys($arr);\n\telse foreach($arr as $key => $row) $tmp[$key] = @$row[$col];\n\tarray_multisort($tmp, $method, $arr);\n\treturn $arr;\n}", "function s_m_put_txt_data_order_columnnames($columnnames, $width, $tablename){\r\n if(count($columnnames) == 0){\r\n echo \"Error, no columnnames in $tablename\";\r\n die();\r\n }\r\n // make columnnames same as rows\r\n $columnnames_new = array();\r\n for($k = 0; $k < count($columnnames); $k++){\r\n $columnnames_new[$k] = $columnnames[$k] . str_repeat(\" \", $width[$k] - strlen($columnnames[$k]));\r\n }\r\n return $columnnames_new;\r\n}", "private function normalizeMatches($matches)\n\t{\n\t\t$matches = array_reduce(array_map(function ($i)\n\t\t{\n\t\t\treturn array_diff_key(array_filter($i, 'strlen'), array_flip(array_filter(array_keys($i), 'is_numeric')));\n\t\t}, $matches), 'array_merge', array());\n\n\t\t$matches = array_reduce(array_keys($matches), function (&$acc, $item) use ($matches)\n\t\t{\n\t\t\t$token = strstr($item, '__', true);\n\t\t\tif ($token === false)\n\t\t\t\t$token = $item;\n\t\t\t$acc[$token] = $matches[$item];\n\t\t\treturn $acc;\n\t\t}, array());\n\n\t\treturn $matches;\n\t}", "public function by_name_normalized_multi(array $name_normalized_arr, array $order_by=null, $offset=null, $limit=null) {\n $keys_arr = [];\n foreach ($name_normalized_arr as $k => $name_normalized) {\n $keys_arr[$k] = [ 'name_normalized' => (string) $name_normalized, ];\n }\n return parent::_by_fields_multi(\n self::BY_NAME_NORMALIZED,\n $keys_arr,\n $order_by,\n $offset,\n $limit\n );\n }", "function clean($array){\n\n\t\treturn array_map('mysql_real_escape_string', $array);\n\n\t}", "private static function _casenormalize(&$val)\n {\n $val = strtolower($val);\n }", "protected function _sortByArray($array) {}", "private function makePKAttributesArray($array){\n\n \t\t$PKAttributes;\n \t\t$count = 0;\n \t\t$referenceTableKeys = $this->tableNames;\n \t\t$refTableKeyCount = count($referenceTableKeys);\n\n\n \t\tforeach($array as $row){\n \t\t\t$searchElement = $row['table_name'];\n\t if($count !=0 && $searchElement != $tableNames[$count-1] ){\n\t \tfor($i=0;$i<$refTableKeyCount;$i++){\n\t \t\tif($row['table_name'] == $referenceTableKeys[$i] ){\n\t \t\t\t$PKAttributes[$count]=array($row['table_name'] => $row['column_name']);\n\t \t\t}\n\t \t}\n\t \t$tableNames[$count]=$searchElement;\n\t \t$count++;\n\t }\n\t else if ($count == 0){\n\t \tfor($i=0;$i<$refTableKeyCount;$i++){\n\t \t\tif($row['table_name'] == $referenceTableKeys[$i] ){\n\t \t\t\t$PKAttributes[$count]=array($row['table_name'] => $row['column_name']);\n\t \t\t}\n\t \t}\n\t \t$tableNames[0] = $array[0]['table_name'];\n\t \t$count++;\n\t }\n\t }\n\n\t //removes indexed keys and returns a clean array\n\t $PKtemp;\n \t\tforeach ($PKAttributes as $array){\n \t\t\tforeach ($array as$tableName=>$PK){\n \t\t\t\t$PKtemp[$tableName]=$PK;\n \t\t\t}\n \t\t}\n\n \t\t$PKAttributes = $PKtemp;\n\t return $PKAttributes;\n \t}", "abstract protected function getCompositeColumnsNames();", "function change_tag_col($str,$arr_cols){\r\n\r\n\t\tpreg_match_all('/#COL(\\d+)#/i', $str, $matches, PREG_SET_ORDER);\r\n\r\n\t\tfor($i=0; $i<count($matches); $i++){\r\n\t\t\t$str=str_replace($matches[$i][0], addslashes($arr_cols[$matches[$i][1]-1]), $str);\r\n\t\t}\r\n\r\n\t\treturn $str;\r\n\r\n\t}", "public function format_array( $array ) {\n\t\tif ( ! is_array( $array ) ) {\n\t\t\tif ( is_serialized( $array ) ) {\n\t\t\t\t$array = maybe_unserialize( $array );\n\t\t\t} else {\n\t\t\t\t$array = explode( ',', $array );\n\t\t\t}\n\t\t}\n\t\treturn array_filter( array_map( 'trim', array_map( 'strtolower', $array ) ) );\n\t}", "public function clearColumnsFromAliasing()\n {\n foreach ($this->columns as $index => $column) {\n $this->columns[$index] = $this->clearColumn($column);\n }\n foreach ($this->columns as $index => $column) {\n $this->columns[$index] = $this->clearColumn($column);\n }\n }", "public function columnCode(){\n $columnNames = [];\n $names = [];\n $codes = [];\n $columns = DB::table('helpers')->pluck('helper');\n foreach ($columns as $key=>$column){\n $columnNames[$key] = unserialize($column);\n }\n for($i=0;$i<count($columnNames);$i++){\n for($j=0;$j<count($columnNames[$i]);$j++){\n\n array_push($names,$columnNames[$i][$j]);\n }\n\n }\n array_push($names,'hd_image');\n array_push($names,'ld_image');\n array_push($names,'datasheet');\n array_push($names,'footprint');\n array_push($names,'manufacturer_part_number');\n array_push($names,'quantity_available');\n array_push($names,'unit_price');\n array_push($names,'manufacturer');\n array_push($names,'description');\n array_push($names,'packaging');\n array_push($names,'series');\n array_push($names,'part_status');\n array_push($names,'minimum_quantity');\n array_push($names,'original');\n\n $names = array_unique($names);\n $names = array_values($names);\n\n\n for($t=0;$t<count($names);$t++){\n $codes[str_random(4)] = $names[$t];\n }\n\n\n\n DB::table('column_names')->update(['column_name'=>serialize($codes)]);\n\n\n }", "public static function camelizeArray(array $array)\n {\n return array_reduce(\n array_keys($array),\n function ($result, $key) use ($array) {\n $result[self::camelizeStr($key)] =\n // Is value array-like?\n (is_array($value = $array[$key]) || is_object($value) && $value = (array) $value) ?\n self::camelizeArray($value) : $value;\n\n return $result;\n },\n []\n );\n }", "protected function columnNames($aData) {\n\t if (!is_array($aData)) {\n\t return false;\n\t }\n\t \n\t $aColumns = array_flip($this->aFields);\n\t \n\t foreach ($aColumns as $realColumnName => $value) {\n\t $aColumns[$realColumnName] = str_replace('_', '', $realColumnName);\n\t if (!isset($aData[$aColumns[$realColumnName]])) {\n\t unset($aColumns[$realColumnName]);\n\t }\n\t }\n\t \n\t return $aColumns;\n\t}", "public function sort_array_by_col($array)\n {\n function compare($wert_a, $wert_b)\n {\n // Sortierung nach dem zweiten Wert des Array (Index: 1)\n $a = $wert_a[0];\n $b = $wert_b[0];\n if ($a == $b) {\n return 0;\n }\n return ($a > $b) ? -1 : +1;\n }\n usort($array, 'compare');\n return $array;\n }", "private function makeTableNamesArray($array){\n\n \t\t$tableNames;\n \t \t$count = 0;\n\n \t\n\t \tforeach($array as $row){\n\t $searchElement = $row['table_name'];\n\t if($count !=0 && $searchElement != $tableNames[$count-1] ){\n\t $tableNames[$count]=$searchElement;\n\t $count++;\n\t }\n\t else if ($count == 0){\n\t $tableNames[0] = $array[0]['table_name'];\n\t $count++;\n\t }\n\n\t }\n\n \treturn $tableNames;\n \t}", "public function dtPerformColumnFilter($columns);", "protected function parseColumnsArguments(array $args)\n {\n // args could be list of name, or one argument indexed array name => alias\n $cols = (count($args) === 1 && is_array($args[0])) ? $args[0] : $args;\n\n // parse column\n foreach ($cols as $key => $value){\n \n // Each arg could be a non indexed array of name, or \n // an indexed array name => alias\n $column = !is_int($key) ? $key : $value;\n $columnValue = !is_int($key) ? $value : null;\n $this->column($column, $columnValue);\n }\n }", "protected function canonicalizeColumn(\n $column,\n $aliasColumns = false,\n &$tablesUsed = null,\n $includeTableName = true\n ) {\n // First, map onto alias if needed\n $asString = '';\n if (isset($this->columnAliases[$column])) {\n if ($aliasColumns) {\n $asString = ' AS ' . $this->connObj->escapeIdent($column);\n }\n list($table, $column) = $this->columnAliases[$column];\n } else {\n $table = $this->tableName;\n }\n\n if (isset($tablesUsed)) {\n if (!in_array($table, $tablesUsed)) {\n $tablesUsed[] = $table;\n }\n }\n\n if ($includeTableName) {\n return $this->connObj->escapeIdent($table) . '.' . $this->connObj->escapeIdent($column) . $asString;\n } else {\n return $this->connObj->escapeIdent($column) . $asString;\n }\n }", "private function normalizeFunctions(array $args): array\n\t{\n\t\tif (isset($args[0])) {\n\t\t\treturn $args;\n\t\t}\n\n\t\t$processedArgs = [];\n\t\tforeach ($args as $argName => $argValue) {\n\t\t\t[$argName, $operator] = ConditionParserHelper::parsePropertyOperator($argName);\n\t\t\t$processedArgs[] = [CompareFunction::class, $argName, $operator, $argValue];\n\t\t}\n\t\treturn $processedArgs;\n\t}", "function input_mapping(array $mapping, $data)\n{\n $translated = array();\n\n foreach ($mapping as $from => $to) {\n if (array_key_exists($from, $data))\n {\n $translated[$to] = strlen(trim($data[$from])) > 0 ? trim($data[$from]) : null;\n }\n }\n\n return $translated;\n}", "function mysort(&$array){\n foreach($array as $k=>$v) $temp[$k] = preg_replace('/[a-zA-Z]/','',$k);\n asort($temp, SORT_NUMERIC);\n foreach(array_keys($temp) as $k) $temp[$k] = $array[$k];\n $array = $temp;\n }", "private function cleanupFieldNames($data)\r\n\t{\r\n\t\tforeach ($data as $key => $value)\r\n\t\t{\r\n\t\t\t// Translate field name to lower case\r\n\t\t\t$newKey = $this->makeLowerCaseName($key);\r\n\t\t\tif ($newKey != $key)\r\n\t\t\t{\r\n\t\t\t\t$data[$newKey] = $value;\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "private function sanitizeInput(array $inputArray){\n $counter = 0;\n $filteredInput = [];\n foreach ($inputArray as $key => $value) {\n $filteredInput[$key] = mysqli_real_escape_string($this->db, $value);\n }\n return $filteredInput;\n }", "function f_clean($link, $array) {\r\n return array_map('f_mysqlEscape', $array);\r\n}", "public function denormalize(array $data);", "public function unquoteSimpleColumnName(string $name): string;", "public static function compileColumnList(array $columns) {\n\t\t$compiled = array();\n\n\t\tforeach ($columns as $column) {\n\t\t\t$compiled[] = static::compileName($column);\n\t\t}\n\n\t\treturn '(' . implode(', ', $compiled) . ')';\n\t}", "public static function convertKeysToSnakeCase($arrays)\n {\n $new = array();\n foreach ($arrays as $key => $value) {\n $new[self::convertToSnakeCase($key)] = $value;\n }\n return $new;\n }", "private function realColumnAttribute($column_name)\r\n\t{\r\n\t\tif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_LOWER)\r\n\t\t\treturn strtolower($column_name);\r\n\t\telseif($this->pdo->options[LikePDO::ATTR_CASE] == LikePDO::CASE_UPPER)\r\n\t\t\treturn strtoupper($column_name);\r\n\t\telse\r\n\t\t\treturn $column_name;\r\n\t}", "private function canonicalizeHeaders() {\r\n\t\t$canonicalized_headers = [];\r\n\t\tforeach ($this->headers as $key => $value) {\r\n\t\t\t$canonicalized_headers[strtolower($key)] = preg_replace('/\\s+/', ' ', trim($value));\r\n\t\t}\r\n\r\n\t\tksort($canonicalized_headers);\r\n\r\n\t\t$serialized_header = '';\r\n\t\tforeach ($canonicalized_headers as $key => $value) {\r\n\t\t\t$serialized_header .= $key . ':' . $value . \"\\t\";\r\n\t\t}\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('canonicalized_headers', $canonicalized_headers);\r\n\t\t$this->verbose('serialized_header', str_replace(\"\\t\", \"\\\\t\", $serialized_header));\r\n\r\n\t\treturn $serialized_header;\r\n\t}", "protected function normalizeName($name){\n \n // canary...\n if(is_numeric($name)){\n throw new InvalidArgumentException(sprintf('an all numeric $name like \"%s\" is not allowed',$name));\n }//if\n \n $ret_mix = null;\n \n if(is_array($name)){\n \n $ret_mix = array();\n \n foreach($name as $key => $val){\n $ret_mix[$key] = mb_strtolower((string)$val);\n }//foreach\n \n }else{\n \n // get rid of any namespaces...\n $ret_mix = str_replace('\\\\','_',$name);\n $ret_mix = mb_strtolower((string)$ret_mix);\n \n }//if/else\n \n return $ret_mix;\n \n }", "protected function cleanTableNames() {}", "function rawpheno_function_make_r_compatible($column_header) {\n // Get R transformation rules set in the admin control panel.\n $word_rules = variable_get('rawpheno_rtransform_words');\n $char_rules = variable_get('rawpheno_rtransform_characters');\n $replace_rules = variable_get('rawpheno_rtransform_replace');\n\n $arr_match = array();\n $arr_replace = array();\n $r = explode(',', $replace_rules);\n\n // Convert the rule to key and value pair. The key is the matching character/word and\n // the values is the replacement value when key is found in a string.\n foreach($r as $g) {\n list($match, $replace) = explode('=', $g);\n $arr_match[] = trim($match);\n $arr_replace[] = trim($replace);\n }\n\n // Convert special characters transformation rules in string to array.\n $char_rules = explode(',', $char_rules);\n\n // Convert words transformation rules in string to array.\n $word_rules = explode(',', $word_rules);\n\n // Remove leading and trailing spaces from the selected trait.\n // Convert string to lowercase.\n $selected_trait = trim(strtolower($column_header));\n // 1. Break the column header in string to individual words,\n // and remove all words that matches an entry in the words transfomation rules.\n $w = explode(' ', $selected_trait);\n foreach($w as $c) {\n $c = trim($c);\n\n // Skip the words in the traits that are present in the\n // words transformation rules.\n if (!in_array($c, $word_rules)) {\n // Do match and replace, as well as, removal of special characters\n // only when the current word is not in the words transformation rules.\n // 2. Match and replace based on match and replace rule.\n $c = str_replace($arr_match, $arr_replace, $c);\n // 3. Remove all special characters listed in remove chars rule.\n $c = str_replace($char_rules, '', $c);\n\n // All transformation rules applied, make sure that\n // the result is not a blank space.\n if (!empty($c)) {\n $rfriendly[] = trim($c);\n }\n }\n }\n\n // Final transformation is replacing all spaces to dots/period (.)\n return ucfirst(implode('.', $rfriendly));\n}", "abstract protected function encodingTablesOrder();", "public function normalize(&$data)\n {\n if (empty($data)) {\n return false;\n }\n $normalized = array();\n foreach ($data as $count => $row) {\n foreach ($this->fields as $column) {\n list($model, $field) = explode('.', $column);\n if (array_key_exists($model, $row)) {\n if (array_key_exists($field, $row[$model])) {\n $normalized[$count][$column] = $row[$model][$field];\n }\n }\n if (array_key_exists($field, $row)) {\n $normalized[$count][$column] = $row[$field];\n }\n }\n }\n $this->data = $normalized;\n\n return true;\n }", "private function convertColumnsPdo(\n array $array_keys,\n String $pattern = '',\n Bool $double = false\n ): String {\n $columns = array();\n foreach($array_keys as $key)\n {\n $pdoColumn = $double ? \"$key\" . \"$pattern\" . \"$key\" : \"$pattern\" . \"$key\";\n array_push($columns, $pdoColumn);\n }\n\n return implode(\", \", $columns);\n }", "protected function normaliseRules(array $rules)\n {\n // We can simply call Validator::make($data, $rules)->getRules() to get the normalised rules,\n // but Laravel will ignore any nested array rules (`ids.*')\n // unless the key referenced (`ids`) exists in the dataset and is a non-empty array\n // So we'll create a single-item array for each array parameter\n $values = collect($rules)\n ->filter(function ($value, $key) {\n return Str::contains($key, '.*');\n })->mapWithKeys(function ($value, $key) {\n if (Str::endsWith($key, '.*')) {\n // We're dealing with a simple array of primitives\n return [Str::substr($key, 0, -2) => [Str::random()]];\n } elseif (Str::contains($key, '.*.')) {\n // We're dealing with an array of objects\n [$key, $property] = explode('.*.', $key);\n\n // Even though this will be overwritten by another property declaration in the rules, we're fine.\n // All we need is for Laravel to see this key exists\n return [$key => [[$property => Str::random()]]];\n }\n })->all();\n\n // Now this will return the complete ruleset.\n // Nested array parameters will be present, with '*' replaced by '0'\n $newRules = Validator::make($values, $rules)->getRules();\n\n // Transform the key names back from 'ids.0' to 'ids.*'\n return collect($newRules)->mapWithKeys(function ($val, $paramName) use ($rules) {\n if (Str::contains($paramName, '.0')) {\n $genericArrayKeyName = str_replace('.0', '.*', $paramName);\n\n // But only if that was the original value\n if (isset($rules[$genericArrayKeyName])) {\n $paramName = $genericArrayKeyName;\n }\n }\n\n return [$paramName => $val];\n })->toArray();\n }", "protected function guessColumns()\n {\n $models = $this->dataProvider->getModels();\n $model = reset($models);\n if (is_array($model) || is_object($model)) {\n foreach ($model as $name => $value) {\n if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {\n $this->columns[] = (string) $name;\n }\n }\n }\n }", "public function obfuscate(array $array): array\n {\n if ($this->keys === []) {\n return $array;\n }\n array_walk_recursive(\n $array,\n function (&$contents, $key) {\n if (isset($contents)\n && in_array(strtolower($key), $this->keys, true)\n ) {\n $contents = $this->obfuscationString;\n }\n }\n );\n return $array;\n }", "private function mysqlRealEscapeArray(array $input) {\r\n\t\t$output = array();\r\n\t\tforeach($input as $name => $value) {\r\n\t\t\tif(is_array($value)) {\r\n\t\t\t\t$output[mysql_real_escape_string($name)] = $this->mysqlRealEscapeArray($value);\r\n\t\t\t} else {\r\n\t\t\t\t$output[mysql_real_escape_string($name)] = mysql_real_escape_string($value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "private function arrayChangeKeyCaseUnicode($arr, $c = CASE_LOWER)\n {\n $c = ($c == CASE_LOWER) ? MB_CASE_LOWER : MB_CASE_UPPER;\n\n $ret = [];\n\n foreach ($arr as $k => $v) {\n $ret[mb_convert_case($k, $c, \"UTF-8\")] = $v;\n }\n\n return $ret;\n }", "private function _normalizeQuery($query)\n\t{\n\n\t\t//Check query\n\t\tif($query === NULL)\n\t\t\treturn array();\n\n\t\t$ret = array();\n\t\tforeach($query as $key=>$val)\n\t\t{\n\t\t\tif($val instanceof \\Framework\\Interfaces\\IModelDataType)\n\t\t\t\t$value = $this->_driver->convertModelDataTypeToNativeDataType($val);\n\t\t\telse\n\t\t\t\t$value = $val;\n\n\t\t\t$ret[$key] = $value;\n\t\t}\n\n\t\treturn $ret;\n\t}", "protected function map_field($table_name, &$source_array) {\n\t\t$table_field_list = $this->db->list_fields($table_name);\n\t\tforeach ($source_array as $source_key => $source_value) {\n\t\t\t$found = FALSE;\n\t\t\tforeach ($table_field_list as $column_name) {\n\t\t\t\tif ($source_key === $column_name) {\n\t\t\t\t\t$found = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$found) {\n\t\t\t\tunset($source_array[$source_key]);\n\t\t\t}\n\t\t}\n\t}", "public function testTranslateFieldName ()\n {\n $types = [\n TableMap::TYPE_PHPNAME,\n TableMap::TYPE_CAMELNAME,\n TableMap::TYPE_COLNAME,\n TableMap::TYPE_FIELDNAME,\n TableMap::TYPE_NUM\n ];\n $expecteds = [\n TableMap::TYPE_PHPNAME => 'AuthorId',\n TableMap::TYPE_CAMELNAME => 'authorId',\n TableMap::TYPE_COLNAME => 'book.author_id',\n TableMap::TYPE_FIELDNAME => 'author_id',\n TableMap::TYPE_NUM => 5,\n ];\n foreach ($types as $fromType) {\n foreach ($types as $toType) {\n $name = $expecteds[$fromType];\n $expected = $expecteds[$toType];\n $result = BookTableMap::translateFieldName($name, $fromType, $toType);\n $this->assertEquals($expected, $result);\n }\n }\n }", "function isi_key($dataset)\n {\n global $ATRIBUT;\n $keys = array_keys($ATRIBUT);\n $arr = array();\n foreach ($dataset as $key => $val) {\n foreach ($val as $k => $v) {\n $arr[$key][$keys[$k - 1]] = strtolower($v);\n }\n }\n\n //echo '<pre>'.print_r($arr, 1).'</pre>'; \n return $arr;\n }", "protected function prepareAttributes(array $attributes)\n\t{\n\t\t$result = array();\n\n\t\tforeach ($attributes as $key => $attributeValue)\n\t\t{\n\t\t\t$newKey = mb_strtolower($key);\n\t\t\t$newKey = str_replace('_', '-', $newKey);\n\n\t\t\tif (is_array($attributeValue))\n\t\t\t{\n\t\t\t\t$newAttribute = $this->prepareAttributes($attributeValue);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$newAttribute = $attributeValue;\n\t\t\t}\n\n\t\t\t$result[$newKey] = $newAttribute;\n\t\t}\n\n\t\treturn $result;\n\t}", "function acf_array_camel_case($array = array())\n{\n}", "function array_to_sqladd($arr) {\n\t$s = '';\n\tforeach($arr as $k=>$v) {\n\t\t$v = addslashes($v);\n\t\t$op = substr($k, -1);\n\t\tif($op == '+' || $op == '-') {\n\t\t\t$k = substr($k, 0, -1);\n\t\t\t$s .= \"`$k`=`$k`$op'$v',\";\n\t\t} else {\n\t\t\t$s .= \"`$k`='$v',\";\n\t\t}\n\t}\n\treturn substr($s, 0, -1);\n}", "function sanitizeArray(&$array)\n{\n $excludeListForSanitization = array('query');\n// $excludeListForSanitization = array();\n\n foreach ($array as $k => $v) {\n\n // split to key and value\n list($key, $val) = preg_split(\"/=/\", $v, 2);\n if (!isset($val)) {\n continue;\n }\n\n // when magic quotes is on, need to use stripslashes,\n // and then addslashes\n if (PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()) {\n $val = stripslashes($val);\n }\n // note that we must use addslashes here because this function is called before the db connection is made\n // and sql_real_escape_string needs a db connection\n $val = addslashes($val);\n\n // if $key is included in exclude list, skip this param\n if (!in_array($key, $excludeListForSanitization)) {\n\n // check value\n if (strpos($val, '\\\\')) {\n list($val, $tmp) = explode('\\\\', $val);\n }\n\n // remove control code etc.\n $val = strtr($val, \"\\0\\r\\n<>'\\\"\", \" \");\n\n // check key\n if (preg_match('/\\\"/i', $key)) {\n unset($array[$k]);\n continue;\n }\n\n // set sanitized info\n $array[$k] = sprintf(\"%s=%s\", $key, $val);\n }\n }\n}", "public function prepareForInsert($input = null) {\n\t\tif (!isset($input))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tmp = array();\n\t\t\tforeach ($input as $key => $value){\n\t\t\t\t$tmp[$key] = mb_strtoupper($value);\n\t\t\t}\n\t\t\treturn array_replace($this->getAttributes(), $tmp);\n\t\t}\n\t}", "function db_array_to_update_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' ) $arr = toutf( $arr );\n\tif ( is_array( $arr ) ) {\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$v = ( $v );\n\t\t\t$op = substr( $k, -1 );\n\t\t\tif ( $op == '+' || $op == '-' ) {\n\t\t\t\t$k = substr( $k, 0, -1 );\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$k$op$v,\";\n\t\t\t} else {\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$v,\";\n\t\t\t}\n\t\t}\n\t\treturn substr( $s, 0, -1 );\n\t} else {\n\t\treturn $arr;\n\t}\n}", "public function sanitize_data($data_array) {\n // The sequence of these events is important!\n $data_array = $this->remove_empty_rows($data_array); // run first to get rid of trailing CSV row from Excel save-as\n $data_array = $this->pad_to_rectangle($data_array);\n $data_array = $this->trim_all_elements($data_array);\n $data_array = $this->remove_empty_rows($data_array);\n $data_array = $this->remove_empty_cols($data_array);\n $data_array = $this->slugify_headers($data_array, 0);\n // $data_array = $this->slugify_levels($data_array, 0, array('/#/'=>'num'));\n $data_array = $this->infer_levels($data_array);\n $data_array = $this->remove_subtotals($data_array);\n $data_array = $this->remove_duplicates($data_array);\n $data_array = $this->convert_timepoints_to_numbers($data_array);\n\n return $data_array;\n }", "function array_multisort_2d($array,$column,$sortorder='',$base=1){\n\tglobal $array_multisort_2d;\n\tif(!$array)return $array;\n\n\tforeach($array as $n=>$v){\n\t\t//develop link based on column\n\t\t$ref[]=strtolower($v[$column]);\n\t\t$refb[]=$n;\n\t}\n\t//need to develop to arsort if called\n\tasort($ref);\n\t$base=$base-1;\n\tforeach($ref as $n=>$v){\n\t\t$base++;\n\t\t$buffer[$base]=$array[$refb[$n]];\n\t}\n\treturn $buffer;\n}", "public function by_region_name_normalized_multi(array $region_name_normalized_arr) {\n $keys_arr = [];\n foreach ($region_name_normalized_arr as $k => $region_name_normalized) {\n $keys_arr[$k] = [\n 'region_id' => (int) $region_name_normalized['region_id'],\n 'name_normalized' => (string) $region_name_normalized['name_normalized'],\n ];\n }\n return parent::_by_fields_multi(\n self::BY_REGION_NAME_NORMALIZED,\n $keys_arr\n );\n }", "public function array_sanitize($array){\n\n\t\t\treturn htmlentities(mysql_real_escape_string($array));\n\n\t\t}", "public function processColumnListing($results)\n {\n $mapping = function ($r) {\n $r = (object) $r;\n\n return $r->colname;\n };\n\n return array_map($mapping, $results);\n }", "public static function natcasesort(array &$array): bool{\n return natcasesort($array);\n }", "public function slugArray($tags);", "protected function _translateArgs(array $args): array\n {\n foreach ($args as $k => $arg) {\n if (is_string($arg)) {\n $args[$k] = __d($this->_validationDomain, $arg);\n }\n }\n\n return $args;\n }" ]
[ "0.6120062", "0.5680468", "0.56124735", "0.5518829", "0.55095965", "0.5494155", "0.54717237", "0.5468686", "0.5465605", "0.5296554", "0.5230362", "0.52098703", "0.518212", "0.51787955", "0.51099926", "0.5083169", "0.5046441", "0.5035044", "0.50278705", "0.5012975", "0.49972433", "0.49850178", "0.49417815", "0.49407336", "0.4933026", "0.49247012", "0.49232465", "0.49147233", "0.49115986", "0.487331", "0.4872371", "0.4850766", "0.48457652", "0.48372123", "0.48372123", "0.4830096", "0.48298225", "0.4826596", "0.4826503", "0.48250437", "0.48194742", "0.47994593", "0.4796864", "0.47788393", "0.47533324", "0.4745833", "0.47417068", "0.4738735", "0.4731617", "0.47237876", "0.4717787", "0.4701117", "0.46913296", "0.4687483", "0.46831876", "0.46796915", "0.4669024", "0.46528733", "0.46489942", "0.4636382", "0.4634934", "0.46320987", "0.46314287", "0.46199033", "0.4618557", "0.46112597", "0.4607691", "0.45877472", "0.45844096", "0.45780164", "0.45739585", "0.45665973", "0.45648485", "0.45628455", "0.45531276", "0.45501596", "0.45451972", "0.45432964", "0.45392242", "0.45390013", "0.45365754", "0.45230883", "0.4520055", "0.4515067", "0.45131937", "0.45116434", "0.4509047", "0.45053697", "0.44942787", "0.448763", "0.4484293", "0.4479242", "0.44782293", "0.44767895", "0.44757506", "0.44751817", "0.4473468", "0.44724393", "0.4466725", "0.4465887" ]
0.57988644
1
Construct a WHERE string to allow joins with other tables
private function constructJoinString($tables) { $joinStrings = array(); foreach ($tables as $table) { // Don't join with current table if ($table == $this->tableName) { continue; } $thisTableJoinColumns = (array)$this->joinColumns[$table][0]; $otherTableJoinColumns = (array)$this->joinColumns[$table][1]; foreach ($thisTableJoinColumns as $key => $columns) { $otherColumns = $otherTableJoinColumns[$key]; $columnStrings = array(); if (!is_array($columns) || count($columns) == 1) { // One-to-many relationship or one-to-one relationship foreach ((array)$otherColumns as $otherColumn) { $columnStrings[] = $this->tableName . '.' . $this->connObj->escapeIdent($columns) . ' = ' . $table . '.' . $this->connObj->escapeIdent($otherColumn); } } elseif (!is_array($columns) || count($otherColumns) == 1) { // Many-to-one relationship foreach ((array)$columns as $column) { $columnStrings[] = $this->tableName . '.' . $this->connObj->escapeIdent($column) . ' = ' . $table . '.' . $this->connObj->escapeIdent($otherColumns); } } $joinStrings[] = '(' . implode(' OR ', $columnStrings) . ')'; } } return $joinStrings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "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}", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\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 static function buildWhere( array $where, $conjunction = 'AND' ) {\n\t\tif ( $where ) {\n\t\t\treturn 'WHERE (' . implode( \") {$conjunction} (\", $where ) . ') ';\n\t\t}\n\t\treturn '';\n\t}", "private function generateWhereString($array){\n\t\t$str = \" WHERE \";\n\t\tforeach($array as $k => $v){\n\t\t\t$str .= \" $k = $v\";\n\t\t}\n\t\treturn $str;\n\t}", "public function createWhere() {\n\t\tlist($where, $joins) = parent::createWhere();\n\t\tif (!($this->parent->parent instanceof QuerySet))\n\t\t\t$where = \" WHERE \" . $where;\n\t\telse\n\t\t\t$where = \" AND \" . $where;\n\t \n\t\treturn array($where, $joins);\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "protected function getGeneralWhereClause() {}", "private function buildWhereString(array $whereFields = [])\n {\n $where = [];\n foreach ($whereFields as $field => $value) {\n $where[] = $field . Operators::EQUALS . $this->getConnection()->quote($value);\n }\n\n return implode(' AND ', $where);\n }", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "public function buildWhereSQL(DialectInterface $dialect)\n {\n if (!isset($this->whereBuilder) || !$this->whereBuilder->hasConditions()) {\n return '';\n }\n\n return 'WHERE '.$this->whereBuilder->buildConditionSQL($dialect);\n }", "protected function getWhereClause() {}", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "function cond_to_sqladd($cond) {\n\t$s = '';\n\tif(!empty($cond)) {\n\t\t$s = ' WHERE ';\n\t\tforeach($cond as $k=>$v) {\n\t\t\tif(!is_array($v)) {\n\t\t\t\t$v = addslashes($v);\n\t\t\t\t$s .= \"$k = '$v' AND \";\n\t\t\t} else {\n\t\t\t\tforeach($v as $k1=>$v1) {\n\t\t\t\t\t$v1 = addslashes($v1);\n\t\t\t\t\t$k1 == 'LIKE' AND $v1 = \"%$v1%\";\n\t\t\t\t\t$s .= \"$k $k1 '$v1' AND \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$s = substr($s, 0, -4);\n\t}\n\treturn $s;\n}", "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}", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "function build_generic_where_clause ($the_query_string) {\n\t$where_clauses = Array();\n\t$the_query_string = $this->db->quote($the_query_string);\n\tarray_push($where_clauses, \"bugs.name like '$the_query_string%'\");\n\tif (is_numeric($the_query_string)) array_push($where_clauses, \"bugs.bug_number like '$the_query_string%'\");\n\n\t$the_where = \"\";\n\tforeach($where_clauses as $clause)\n\t{\n\t\tif($the_where != \"\") $the_where .= \" or \";\n\t\t$the_where .= $clause;\n\t}\n\n\treturn $the_where;\n\t}", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "function translated_plain_where($base, $field) {\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 \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "protected function genWhere(array $where): string\n {\n $outWhere = [];\n foreach ($where as $k => $v) {\n if (is_int($k)) {\n $outWhere[] = $v;\n } elseif (is_null($v)) {\n $outWhere[] = $k . ' is null';\n } else {\n $outWhere[] = $k . ' = ?';\n }\n }\n return !empty($outWhere) ? implode(' AND ', $outWhere) : '1 = 1';\n }", "private function getWhereClause($conn, $where){\n\t\tif (!is_array($where)){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql_where=\"\";\n\t\tforeach($where as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif ($sql_where!=\"\"){\n\t\t\t\t$sql_where = $sql_where . \" AND \";\n\t\t\t}\n\t\t\tif (is_array($val) ) {\n\t\t\t\tif (count($val) > 0) {\n\t\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` IN (\";\n\t\t\t\t\t$quoted_values = array();\n\t\t\t\t\tforeach ($val as $v) {\n\t\t\t\t\t\t$quoted_values[] = $this->quote($conn, $v, $field_info[\"type\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$sql_where = $sql_where . implode(', ', $quoted_values).')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` = \";\n\t\t\t\t$sql_where = $sql_where . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t\t}\n\t\t}\n\t\treturn $sql_where;\n\t}", "private function formatWheres()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->wheres as $val)\n\t\t{\n\t\t\tif ($value != '')\n\t\t\t\t$value .= ' AND ';\n\t\t\t$value .= $val;\n\t\t}\n\t\treturn $value;\n\t}", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }", "public function buildWhere(array $where = null, array &$values = [])\n {\n if ($where === null) {\n return '';\n }\n\n return 'WHERE ' . $this->buildCondition($where, $values);\n }", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "protected function _buildJoin(array $filter_data=array())\n {\n return \"\";\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "private function generateSearchWhereClause($strings){\n $where = '';\n// $strings = explode(\" \", $queryString);\n $length = count($strings);\n for($i = 0; $i < $length - 1; $i++){\n $string = $strings[$i];\n $where .= \"product_name LIKE '%{$this->db->escape_like_str($string)}%'\n OR product_description LIKE '%{$this->db->escape_like_str($string)}%'\n OR category_name LIKE '%{$this->db->escape_like_str($string)}%'\n OR category_description LIKE '%{$this->db->escape_like_str($string)}%' OR \";\n }\n $where .= \"product_name LIKE '%{$this->db->escape_like_str($strings[$i])}%'\n OR product_description LIKE '%{$this->db->escape_like_str($strings[$i])}%'\n OR category_name LIKE '%{$this->db->escape_like_str($strings[$i])}%'\n OR category_description LIKE '%{$this->db->escape_like_str($strings[$i])}%' \";\n return \"($where)\";\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "function _where ($identifier_array, $o = TRUE) {\n\t\t$statement = '';\n\t\tif ( !isset($identifier_array) || !$identifier_array ) {\n\t\t\treturn $statement;\n\t\t}\n\t\t$statement .= $o ? ' WHERE ' : ' ';\n\t\tforeach ($identifier_array as $query_array) {\n\t\t\t$sub_stmt = '(';\n\t\t\tif ( isset($query_array['name']) && ! is_array($query_array['value']) ) {\n\t\t\t\t$regex = isset($query_array['regex']) ? $query_array['regex'] : '@';\n\t\t\t\t$sub_stmt .= '`' . $query_array['name'] . '` ';\n\t\t\t\t$sub_stmt .= (isset($query_array['ctype']) ? $query_array['ctype'] : '=') . ' ';\n\t\t\t\t$sub_stmt .= $this->escape($query_array['value'], $regex, FALSE);\n\t\t\t} else {\n\t\t\t\t// Incoming value is an array.\n\t\t\t\t$sub_stmt .= $this->_where($query_array['value'], FALSE);\n\t\t\t}\n\t\t\t$sub_stmt .= ')';\n\t\t\t$sub_stmt .= (isset($query_array['atype']) ? (' ' . $query_array['atype']).' ' : '');\n\t\t\t$statement .= $sub_stmt;\n\t\t}\n\t\treturn $statement; \n\t}", "public static function createWhereStatement($arr_filter) {\n\n\n\t\t/**\n\t\t * @var $ilDB \\ilDBInterface\n\t\t */\n\t\t$ilDB = $GLOBALS['DIC']->database();\n\t\t$where = array();\n\n\n\t\t$where[] = '(question.assisted_exercise_id = ' . $ilDB->quote($arr_filter['obj_id'], 'integer') . ')';\n\n\t\tif(!empty($arr_filter['firstname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.firstname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['firstname']\t. \"%\");\n\n\t\t}\n\n\t\tif(!empty($arr_filter['lastname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.lastname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['lastname']\t. \"%\");\n\t\t}\n\n\t\tif(!empty($arr_filter['title'])) {\n\t\t\t$where[] = $ilDB->like(\"question.title\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['title']\t. \"%\");\n\n\t\t}\n\n\n\t\tif($arr_filter['isassessed'] == 1) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(0, 'integer') . ' OR answer.is_assessed is Null)';\n\t\t}\n\t\tif($arr_filter['isassessed'] == 2) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(1, 'integer') . ')';\n\t\t}\n\n\n\n\t\tif (!empty($where)) {\n\t\t\treturn ' WHERE ' . implode(' AND ', $where) . ' ';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "public function genWhere($whereArr)\n {\n $where = '';\n $where = implode(' AND ', $whereArr);\n return $where;\n }", "private function buildFindQuery(?string $filter = null): string\n {\n // means product_name and not product_id\n $sql = 'SELECT o, i, p FROM App\\Entity\\Order o LEFT JOIN o.inventory i LEFT JOIN i.product p';\n\n if (isset($filter)) {\n $sql = $sql . ' WHERE i.sku = :filter OR i.productId = :filter';\n }\n\n return $sql;\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "protected function _buildWhere(array $filter_data = array())\n {\n\t\t$where = \"1\";\n \t\n \tif( isset($filter_data['category']) && $filter_data['category'] )\n\t\t{\n\t\t\t$where .= \" AND {$this->c_table}.category_id=\".intval($filter_data['category']);\n\t\t}\n\t\t\n\t\treturn $where;\n }", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n $where = ''; // return value\n $and = 'WHERE '; // combining operator\n $loose = false;\n $surname = '';\n\n // belt and suspenders\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // process parameters\n $translate = null;\n $initRow = $this->information['initrow'];\n $className = $this->information['classname'];\n $nsclass = __NAMESPACE__ . \"\\\\\" . $className;\n\n foreach($this->parms as $fldname => $value)\n { // loop through all parameters\n $expression = '';\n if (is_int($fldname) && is_array($value))\n { // OR expression\n $or = '';\n $orExpression = '';\n foreach($value as $fld2 => $val2)\n {\n $fieldLc = $nsclass::getRealFieldName($fld2);\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria</p>\\n\";\n }\n else\n { // valid field names\n if (is_string($initRow[$fieldLc]))\n $expression = $this->getWherePattern($fieldLc,\n $val2);\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $val2);\n else\n $expression = $this->getWhereCommon($fieldLc,\n $val2);\n if (strlen($expression) > 0)\n {\n $orExpression .= $or . $expression;\n $or = ' OR ';\n }\n } // valid field namess\n } // loop through comparisons\n if (strlen($orExpression) > 0)\n {\n $where .= $and . '(' . $orExpression . ')';\n $and = ' AND ';\n }\n } // OR expression\n else\n if (is_string($fldname))\n { // field name\n if (strtolower($fldname) == 'loosesurname')\n {\n if ($value == 'y' || $value == 'Y')\n $loose = true;\n else\n if (is_bool($value))\n $loose = $value;\n else\n if ($value === 1)\n $loose = true;\n continue;\n }\n if (preg_match('/^(\\w+)\\.(\\w+)/', $fldname, $matches))\n {\n $subtable = $matches[1];\n $info = Record::getInformation($subtable);\n $subclass = $info['classname'];\n $initRow = $info['initrow'];\n $fieldLc = strtolower($matches[2]);\n }\n else\n {\n $subclass = $nsclass;\n $fieldLc = $nsclass::getRealFieldName($fldname);\n $initRow = $this->information['initrow'];\n }\n\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria for class $nsclass</p>\\n\";\n }\n else\n { // valid field names\n if (array_key_exists($fieldLc, $initRow))\n { // field defined in initrow\n if (is_string($initRow[$fieldLc]))\n {\n if ($fieldLc == 'surname')\n {\n if (is_string($value))\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n else\n $surname = $value;\n }\n else\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n }\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $value);\n else\n {\n if ($debug)\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" \\$initRow['$fieldLc']=\" .\n gettype($initRow[$fieldLc]) .\n \"</p>\\n\";\n foreach($initRow as $f => $v)\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ . ' ' .\n $f . '=' . gettype($v) . \"='$v'</p>\\n\";\n }\n $expression = $this->getWhereCommon($fieldLc,\n $value);\n }\n if (strlen($expression) > 0)\n {\n $where .= $and . $expression;\n $and = ' AND ';\n }\n } // field defined in initrow\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" '$fieldLc' <b>not</b> defined in initRow for class $subclass</p>\\n\";\n } // valid field names\n } // field name\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name \" .\n print_r($fldname,true) .\n \" in selection criteria</p>\\n\";\n } // loop through all parameters\n\n if (strlen($surname) > 0)\n { // add surname check\n $loosetext = 'false';\n if ($loose)\n {\n $loosetext = 'true';\n $expression = $this->getSurnameChk($this->table,\n $surname);\n }\n else\n {\n if (preg_match('/\\^[a-zA-Z ]*\\$/', $surname))\n $surname = substr($surname, 1, strlen($surname) -2);\n $surnameRec = new Surname(array('surname' => $surname));\n $pattern = $surnameRec['pattern'];\n $soundslike = $surnameRec['soundslike'];\n if (strlen($pattern) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('surname' => $pattern));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n else\n if (strlen($soundslike) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('soundslike' => $soundslike));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n \n $expression = $this->getWherePattern('surname',\n $surname);\n }\n $where .= $and . $expression;\n $and = ' AND ';\n } // add surname check\n\n return $where;\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "function build_sql_part($params, $op=' AND ', $schema=null) {\n\t$parts = array();\n\tforeach($params as $k=>$v){\n\t if(!isset($v)) continue;\n if(preg_match('/^[._]/',$k)) continue;\n if(!preg_match('/^`.+`$/',$v)){\n $v = \"'\".$this->escape($v).\"'\";\n\t }\n if(preg_match('/^(\\w+)\\.(\\w+)$/',$k,$matches)){\n $tbl = $matches[1]; $col = $matches[2];\n $parts[] = \"`$tbl`.`$col`=$v\";\n }else{\n $parts[] = \"`$k`=$v\";\n }\n\t}\n\n\treturn implode($op,$parts);\n }", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "private function constructCondStringStatic(&$tablesUsed, $conds)\n {\n $groupStrings = array();\n $andGroupStrings = array();\n\n foreach ($conds as $group => $conditions) {\n foreach ($conditions as &$condition) {\n $column = $this->canonicalizeColumn($condition[COND_COLUMN], false, $tablesUsed);\n $before = $after = '';\n if ($condition[COND_OPERATOR] == 'LIKE') {\n $before = '%';\n $after = '%';\n } elseif ($condition[COND_OPERATOR] == 'STARTSWITH') {\n $condition[COND_OPERATOR] = 'LIKE';\n $after = '%';\n }\n\n $condition = $column . ' ' . $condition[COND_OPERATOR] . \" '\" .\n $before . $this->connObj->escapeString($condition[1]) . $after . \"'\";\n }\n\n if ($group === 0) {\n $groupStrings[$group] = implode(' AND ', $conditions);\n } elseif (is_string($group) && substr($group, 0, 3) === 'AND') {\n // 'AND1', 'AND2' are a special type of groups\n $andGroupStrings[$group] = '(' . implode(' AND ', $conditions) . ')';\n } else {\n $groupStrings[$group] = '(' . implode(' OR ', $conditions) . ')';\n }\n }\n\n if (!empty($andGroupStrings)) {\n $groupStrings[] = '(' . implode(' OR ', $andGroupStrings) . ')';\n }\n\n $groupStrings = array_merge($groupStrings, $this->constructJoinString($tablesUsed));\n\n return implode(' AND ', $groupStrings);\n }", "function GetString()\r\n\t{\r\n\t\tif (!trim($this->_strWhere))\r\n\t\t{\r\n\t\t\t$arrWhere = Array();\r\n\t\t\tforeach($this->_arrWhere AS $strKey=>$strValue)\r\n\t\t\t{\r\n\t\t\t\t$arrWhere[] = \"$strKey = <$strKey>\";\r\n\t\t\t}\r\n\t\t\t$strWhere = trim(implode(\" AND \", $arrWhere));\r\n\t\t\treturn $strWhere;\r\n\t\t}\r\n\r\n\t\treturn $this->_strWhere;\r\n\t}", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "function array_to_where_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_where = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_where[] = \"`$k`='$v'\";\n\t}\n\t$s_where = implode(' AND ', $a_where);\n\treturn $s_where;\n}", "protected function user_where_clause() {}", "protected static function whereFormat($where){\n $whereArray = array();\n\n $operate = ' AND ';\n\n foreach ($where as $key => $set){\n if(is_string($set)){\n if(count($where) == 2){\n list($filed,$value) = $where;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($where) == 3){\n list($filed,$exp,$value) = $where;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n break;\n }elseif(is_array($set)){\n if(count($set) == 2){\n list($filed,$value) = $set;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($set) == 3){\n list($filed,$exp,$value) = $set;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n }\n\n }\n return implode($operate, $whereArray);\n }", "function get_sql_where(){\r\n\t\t$where_str='';\r\n\t\t$multiple_search_str='';\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' ORDER BY ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' ORDER BY ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telseif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telse\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7).')';\r\n\t\t}else{\r\n\t\t\t$where_str_ini='';\r\n\t\t}\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++)\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\r\n\t\tfor($i=0; $i<count($arr_sql_fields); $i++){\r\n\r\n\t\t\tif(empty($this->multiple_search[$i]))\r\n\t\t\t\t$this->multiple_search[$i]='';\r\n\r\n\t\t\tif($this->search!='' and $this->search_init[$i]!='f')\r\n\t\t\t\t$where_str.=(($i==0 and $where_str_ini) ? ' AND ' : '').($where_str ? ' OR ' : '(').$arr_sql_fields[$i].\" LIKE '%\".$this->search.\"%'\";\r\n\r\n\t\t\tif(count($this->multiple_search)>0 and $this->multiple_search[$i]!='' and $this->multiple_search_init[$i]!='f')\r\n\t\t\t\t$multiple_search_str.=(($where_str_ini or $where_str or $multiple_search_str) ? ' AND ' : '').$arr_sql_fields[$i].\" LIKE '%\".$this->multiple_search[$i].\"%'\";\r\n\r\n\t\t}\r\n\r\n\t\tif($where_str!='')\r\n\t\t\t$where_str.=')';\r\n\r\n\t\treturn (($where_str_ini or $where_str or $multiple_search_str) ? ' WHERE ' : '').$where_str_ini.$where_str.$multiple_search_str;\r\n\t}", "protected function concatenateWheresClauses($builder, $sql): string\n {\n $statement = $builder instanceof JoinClause ? 'on' : 'where';\n\n return $statement.' '.$this->removeStatementBoolean(implode(' ', $sql));\n }", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "public function createWhereString($blockName, $groupingType = 'AND', $qbs = NULL) {\n\t\tif($qbs === NULL) {\n\t\t\t$qbs = $this->qbs[$blockName];\n\t\t}\n\n\t\t$whereStr = '';\n\t\t$first = true;\n\t\tforeach($qbs['where'] as $whereElement) {\n\t\t\tif(!$first) {\n\t\t\t\t$whereStr .= ' ' . $groupingType;\n\t\t\t} else {\n\t\t\t\t$whereStr .= '';\n\t\t\t}\n\n\t\t\tif(is_array($whereElement)) {\n\t\t\t\t$whereStr .= ' ' . $whereElement['a'] . ' ' . $whereElement['operator'] . ' ' . $whereElement['b'];\n\t\t\t} else {\n\t\t\t\t$whereStr .= ' ' . $whereElement;\n\t\t\t}\n\t\t\t$first = false;\n\t\t}\n\n\t\treturn $whereStr;\n\t}", "public function toString()\n\t{\n\t\tif($this->str === null)\n\t\t{\n\t\t\tif(!empty($this->values))\n\t\t\t{\n\t\t\t\t$len = count($this->values);\n\t\t\t\t$conditions = '';\n\n\t\t\t\tforeach($this->values as $i => $value)\n\t\t\t\t{\n\t\t\t\t\tswitch($value[self::TYPE])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . $value[self::VALUE];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t\t\t$params = array();\n\n\t\t\t\t\t\t\tforeach($value[self::VALUE] as $val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$params[] = self::escape($val);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' IN (' . implode(',', $params) . ')';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . self::escape($value[self::VALUE]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions.= ($i < $len - 1) ? ' ' . $value[self::CONJUNCTION] . ' ' : '';\n\t\t\t\t}\n\n\t\t\t\treturn $this->str = 'WHERE ' . $conditions;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->str = '';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->str;\n\t\t}\n\t}", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// gidnumber\n\t\tif (isset($filters['gidNumber']))\n\t\t{\n\t\t\t$where[] = \"gidNumber=\" . $this->_db->quote($filters['gidNumber']);\n\t\t}\n\n\t\t// action\n\t\tif (isset($filters['action']))\n\t\t{\n\t\t\t$where[] = \"action=\" . $this->_db->quote($filters['action']);\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql = \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "function getSearchString()\n{\n $includedSearchString = getIncludedSearchString();\n $excludedSearchString = getExcludedSearchString();\n $searchString =\"\";\n if ($includedSearchString != \"\" && $excludedSearchString !=\"\"){\n $searchString = \" WHERE (\".$includedSearchString;\n $searchString = substr($searchString, 0, strlen($searchString) - 4) . \")\"; //delete the last \" OR \" four characters\n $excludeString = substr($excludedSearchString, 0, strlen($excludedSearchString) - 5); //delete the last \" AND \" five characters\n $searchString .= \" AND (\" . $excludeString . \")\"; //add exclude aspects at the end\n }elseif($includedSearchString != \"\"){\n $searchString = \" WHERE (\".$includedSearchString;\n $searchString = substr($searchString, 0, strlen($searchString) - 4) . \")\"; //delete the last \" OR \" four characters\n }elseif($excludedSearchString !=\"\"){\n $searchString = \" WHERE (\";\n $excludeString = substr($excludedSearchString, 0, strlen($excludedSearchString) - 5); //delete the last \" AND \" five characters\n $searchString .= $excludeString . \")\"; //add exclude aspects at the end\n }\n return $searchString;\n}", "public function toString(): string\n {\n $conditions = \\array_map(static function (ConditionInterface $condition): string {\n return $condition->toString();\n }, $this->conditions);\n\n return \\sprintf('( %s )', \\implode(' OR ', $conditions));\n }", "function get_where_clause_from_url () {\r\n\t\t$url_params = array();\r\n\t\t$where = array();\r\n\t\t$where_clause = '';\r\n\r\n\t\t$url = $_SERVER['REQUEST_URI'];\r\n\t\t$url_arr = parse_url($url);\r\n\t\tif (!array_key_exists(\"query\", $url_arr)) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t\r\n\t\tparse_str($url_arr[\"query\"], $url_params);\r\n\t\t\r\n\r\n\t\tif (array_key_exists('id', $url_params)) {\r\n\t\t\tif (is_numeric($url_params['id'])) {\r\n\t\t\t\t$where[] = 'id = ' . $url_params['id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('first_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['first_name'])) {\r\n\t\t\t\t$where[] = 'first_name = ' . \"'\" . $url_params['first_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('last_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['last_name'])) {\r\n\t\t\t\t$where[] = 'last_name = ' . \"'\" . $url_params['last_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('email', $url_params)) {\r\n\t\t\tif (filter_var($url_params['email'], FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t\t$where[] = 'email = ' . \"'\" . $url_params['email'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('gender', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['gender'])) {\r\n\t\t\t\t$where[] = 'gender = ' . \"'\" . $url_params['gender'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('title', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['title'])) {\r\n\t\t\t\t$where[] = 'title = ' . \"'\" . $url_params['title'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('dept', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['dept'])) {\r\n\t\t\t\t$where[] = 'dept = ' . \"'\" . $url_params['dept'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($where)) {\r\n\t\t\t$where_clause = \"WHERE \" . implode(\" AND \", $where);\r\n\t\t}\r\n\r\n\t\treturn $where_clause;\r\n\r\n\t}", "public function generateWhere(?string $prepend = null): string\n {\n if (null === $prepend) {\n $prepend = 'WHERE';\n }\n return $this->dbc->generateWhere($this->whereClauses, $prepend);\n }", "private function conditions(DBConnection $conn, Peer $peer) {\n $cond= '';\n foreach ($this->conditions as $condition) $cond.= $condition->asSql($conn, $peer).' and ';\n return substr($cond, 0, -5);\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "public function parseWhere($where){\n $whereStr = '';\n if(is_string($where)){\n $whereStr = $where;\n }else{\n $str = array();\n foreach($where as $key => $val){\n\t$str[] = \"`$key` = \".Model::parseValue($val);\n }\n $whereStr = \"where \".implode(\" AND \", $str);\n }\n return $whereStr;\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function get_additional_conditions()\n {\n $l_type = (int) $_GET[C__GET__ID];\n\n if ($l_type > 0)\n {\n return ' AND cat_rel.isys_catg_its_type_list__isys_its_type__id = ' . $this->convert_sql_id($l_type) . ' ';\n } // if\n\n return '';\n }", "protected abstract function getJoinClause(array $joins);", "public function WHERE_string($str) {\n\t\t$field_name = $str;\n\n\t\t// But if we see some funky characters (like AND, OR or whitespace)\n\t\tif (preg_match('#\\s|AND|OR|\\(|\\)#', $str)) {\n\t\t\treturn $this->WHERE_literal($str);\t\n\t\t}\n\n\t\treturn $this->WHERE_once($str);\n\t}", "private function sql_where($filter, $structure) {\n\t\t$pool_class = $structure['class'] . 'Pool_Model';\n\t\t$visitor = new $this->sql_builder_visitor_class_name(array($pool_class, \"map_name_to_backend\"));\n\t\t$sql = \" WHERE \".$filter->visit($visitor, false);\n\t\treturn $sql;\n\t}", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\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 tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "function getSQLWhereCondition($query_header, $post, $config_language_id)\n {\n $sql = \" WHERE pd.language_id = '\" . (int) $config_language_id . \"' \";\n\n // Filter by categories\n if (isset($post['categories'])) {\n $category_ids = array_map('intval', $post['categories']);\n $category_ids = implode(\",\", $category_ids);\n\n $sql .= \" AND p2c.category_id IN (\" . $category_ids . \") \";\n }\n\n // Filter by manufacturers\n if (isset($post['manufacturers'])) {\n $manufacturer_ids = array_map('intval', $post['manufacturers']);\n $manufacturer_ids = implode(\",\", $manufacturer_ids);\n\n $sql .= \" AND p.manufacturer_id IN (\" . $manufacturer_ids . \") \";\n }\n\n // Filter by special_groups\n if (isset($post['special_groups'])) {\n $special_groups_ids = array_map('intval', $post['special_groups']);\n $special_groups_ids = implode(\",\", $special_groups_ids);\n\n $sql .= \" AND ps.product_special_group_id IN (\" . $special_groups_ids . \") \";\n }\n\n // Attach additional chosen products\n if (isset($post['products'])) {\n $product_ids = array_map('intval', $post['products']['id']);\n\n $sql .= \" UNION \" . $query_header;\n $sql .= \" WHERE ps.product_id IN (\" . implode(\",\", $product_ids) . \") AND pd.language_id = '\" . (int) $config_language_id . \"' \";\n }\n\n return $sql;\n }", "public function buildSQL($provider, $builder) {\n $repos = @$this->repositories[$provider];\n if (isset($repos['enabled']) && !$repos['enabled']) {\n return '';\n }\n $o = $this->repository($provider);\n $sql = \"SELECT * FROM (\\n\";\n $sql .= '--INCLUDE=' . $builder['block_name'] . \"\\n\";\n $sql .= \") t\\n\";\n if (@$builder['where']) {\n $sql .= \"WHERE \" . $o->buildFilterSQL($builder['where']);\n }\n return $sql;\n\n }", "public function renderWhere(bool $withBinds = false): string\n {\n $cond = $this->render($withBinds);\n return $cond ? \"WHERE $cond\" : '';\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "protected function _whereCondition($condition) \n\t{\n\t\t$result = 'WHERE ';\n\n\t\tforeach ($condition as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t$this->_stringData($condition);\n\t\t\t\t\t$result .= \"`\" . $key . \"`=\" . $value. ' AND ';\n\t\t\t\t} else {\n\t\t\t\t\t$result .= $this->_moreWhere($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//substr last 'and'\n\t\t$result = substr($result, 0, -5);\n\n\t\treturn $result;\n\t}", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= test@test.com']\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 }" ]
[ "0.75827557", "0.7273241", "0.6998636", "0.69210315", "0.690039", "0.68872297", "0.6871172", "0.68552506", "0.68329376", "0.6831749", "0.6817354", "0.6798132", "0.67962193", "0.678697", "0.67838526", "0.6768199", "0.6742892", "0.6728412", "0.66818607", "0.66771865", "0.66729766", "0.6659214", "0.6658896", "0.6657714", "0.66303056", "0.66211796", "0.6615565", "0.66080284", "0.6595314", "0.6536941", "0.65000206", "0.64975226", "0.648139", "0.6471824", "0.64274025", "0.64225703", "0.64211243", "0.6402389", "0.6396443", "0.6385483", "0.63693506", "0.63583344", "0.63455546", "0.63455456", "0.63442296", "0.6320866", "0.63095474", "0.6302688", "0.6300707", "0.6299759", "0.627311", "0.62714106", "0.6266244", "0.6263232", "0.62595874", "0.62418926", "0.624107", "0.6220556", "0.6219042", "0.62165874", "0.62068915", "0.6201065", "0.6196816", "0.6194847", "0.6184833", "0.61833304", "0.6175148", "0.6172781", "0.61644256", "0.61513263", "0.6131262", "0.6126564", "0.61254823", "0.61137766", "0.61037856", "0.60866195", "0.60861355", "0.6070454", "0.6065944", "0.6033113", "0.60323375", "0.60322285", "0.60278213", "0.602617", "0.60238445", "0.60145897", "0.60095197", "0.60013866", "0.5999822", "0.59672445", "0.5961934", "0.595835", "0.5956364", "0.5955756", "0.59490776", "0.59473735", "0.5946926", "0.59463346", "0.5944882", "0.592417" ]
0.59243613
99
Note: the following all are in static/instance pairs; the static version can be used for generic SQL manipulation, while the instance version relies on $this>conds, $this>limit, etc. Constructs the WHERE clause string for the SELECT query.
private function constructCondStringStatic(&$tablesUsed, $conds) { $groupStrings = array(); $andGroupStrings = array(); foreach ($conds as $group => $conditions) { foreach ($conditions as &$condition) { $column = $this->canonicalizeColumn($condition[COND_COLUMN], false, $tablesUsed); $before = $after = ''; if ($condition[COND_OPERATOR] == 'LIKE') { $before = '%'; $after = '%'; } elseif ($condition[COND_OPERATOR] == 'STARTSWITH') { $condition[COND_OPERATOR] = 'LIKE'; $after = '%'; } $condition = $column . ' ' . $condition[COND_OPERATOR] . " '" . $before . $this->connObj->escapeString($condition[1]) . $after . "'"; } if ($group === 0) { $groupStrings[$group] = implode(' AND ', $conditions); } elseif (is_string($group) && substr($group, 0, 3) === 'AND') { // 'AND1', 'AND2' are a special type of groups $andGroupStrings[$group] = '(' . implode(' AND ', $conditions) . ')'; } else { $groupStrings[$group] = '(' . implode(' OR ', $conditions) . ')'; } } if (!empty($andGroupStrings)) { $groupStrings[] = '(' . implode(' OR ', $andGroupStrings) . ')'; } $groupStrings = array_merge($groupStrings, $this->constructJoinString($tablesUsed)); return implode(' AND ', $groupStrings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "protected function getWhereClause() {}", "protected function getGeneralWhereClause() {}", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n $where = ''; // return value\n $and = 'WHERE '; // combining operator\n $loose = false;\n $surname = '';\n\n // belt and suspenders\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // process parameters\n $translate = null;\n $initRow = $this->information['initrow'];\n $className = $this->information['classname'];\n $nsclass = __NAMESPACE__ . \"\\\\\" . $className;\n\n foreach($this->parms as $fldname => $value)\n { // loop through all parameters\n $expression = '';\n if (is_int($fldname) && is_array($value))\n { // OR expression\n $or = '';\n $orExpression = '';\n foreach($value as $fld2 => $val2)\n {\n $fieldLc = $nsclass::getRealFieldName($fld2);\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria</p>\\n\";\n }\n else\n { // valid field names\n if (is_string($initRow[$fieldLc]))\n $expression = $this->getWherePattern($fieldLc,\n $val2);\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $val2);\n else\n $expression = $this->getWhereCommon($fieldLc,\n $val2);\n if (strlen($expression) > 0)\n {\n $orExpression .= $or . $expression;\n $or = ' OR ';\n }\n } // valid field namess\n } // loop through comparisons\n if (strlen($orExpression) > 0)\n {\n $where .= $and . '(' . $orExpression . ')';\n $and = ' AND ';\n }\n } // OR expression\n else\n if (is_string($fldname))\n { // field name\n if (strtolower($fldname) == 'loosesurname')\n {\n if ($value == 'y' || $value == 'Y')\n $loose = true;\n else\n if (is_bool($value))\n $loose = $value;\n else\n if ($value === 1)\n $loose = true;\n continue;\n }\n if (preg_match('/^(\\w+)\\.(\\w+)/', $fldname, $matches))\n {\n $subtable = $matches[1];\n $info = Record::getInformation($subtable);\n $subclass = $info['classname'];\n $initRow = $info['initrow'];\n $fieldLc = strtolower($matches[2]);\n }\n else\n {\n $subclass = $nsclass;\n $fieldLc = $nsclass::getRealFieldName($fldname);\n $initRow = $this->information['initrow'];\n }\n\n if (is_null($fieldLc))\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name '$fldname' in selection criteria for class $nsclass</p>\\n\";\n }\n else\n { // valid field names\n if (array_key_exists($fieldLc, $initRow))\n { // field defined in initrow\n if (is_string($initRow[$fieldLc]))\n {\n if ($fieldLc == 'surname')\n {\n if (is_string($value))\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n else\n $surname = $value;\n }\n else\n $expression =\n $this->getWherePattern($fieldLc,\n $value);\n }\n else\n if (is_int($initRow[$fieldLc]))\n $expression = $this->getWhereInt($fieldLc,\n $value);\n else\n {\n if ($debug)\n {\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" \\$initRow['$fieldLc']=\" .\n gettype($initRow[$fieldLc]) .\n \"</p>\\n\";\n foreach($initRow as $f => $v)\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ . ' ' .\n $f . '=' . gettype($v) . \"='$v'</p>\\n\";\n }\n $expression = $this->getWhereCommon($fieldLc,\n $value);\n }\n if (strlen($expression) > 0)\n {\n $where .= $and . $expression;\n $and = ' AND ';\n }\n } // field defined in initrow\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" '$fieldLc' <b>not</b> defined in initRow for class $subclass</p>\\n\";\n } // valid field names\n } // field name\n else\n $warn .= \"<p>RecordSet::getWhere: \" . __LINE__ .\n \" Unrecognized field name \" .\n print_r($fldname,true) .\n \" in selection criteria</p>\\n\";\n } // loop through all parameters\n\n if (strlen($surname) > 0)\n { // add surname check\n $loosetext = 'false';\n if ($loose)\n {\n $loosetext = 'true';\n $expression = $this->getSurnameChk($this->table,\n $surname);\n }\n else\n {\n if (preg_match('/\\^[a-zA-Z ]*\\$/', $surname))\n $surname = substr($surname, 1, strlen($surname) -2);\n $surnameRec = new Surname(array('surname' => $surname));\n $pattern = $surnameRec['pattern'];\n $soundslike = $surnameRec['soundslike'];\n if (strlen($pattern) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('surname' => $pattern));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n else\n if (strlen($soundslike) > 0)\n {\n $surnameSet = new RecordSet('Surnames',\n array('soundslike' => $soundslike));\n $surname = array();\n foreach($surnameSet as $record)\n $surname[] = \"^\" . $record['surname'] . \"$\";\n }\n \n $expression = $this->getWherePattern('surname',\n $surname);\n }\n $where .= $and . $expression;\n $and = ' AND ';\n } // add surname check\n\n return $where;\n }", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "function get_sql_where(){\r\n\t\t$where_str='';\r\n\t\t$multiple_search_str='';\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' ORDER BY ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' ORDER BY ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telseif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telse\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7).')';\r\n\t\t}else{\r\n\t\t\t$where_str_ini='';\r\n\t\t}\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++)\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\r\n\t\tfor($i=0; $i<count($arr_sql_fields); $i++){\r\n\r\n\t\t\tif(empty($this->multiple_search[$i]))\r\n\t\t\t\t$this->multiple_search[$i]='';\r\n\r\n\t\t\tif($this->search!='' and $this->search_init[$i]!='f')\r\n\t\t\t\t$where_str.=(($i==0 and $where_str_ini) ? ' AND ' : '').($where_str ? ' OR ' : '(').$arr_sql_fields[$i].\" LIKE '%\".$this->search.\"%'\";\r\n\r\n\t\t\tif(count($this->multiple_search)>0 and $this->multiple_search[$i]!='' and $this->multiple_search_init[$i]!='f')\r\n\t\t\t\t$multiple_search_str.=(($where_str_ini or $where_str or $multiple_search_str) ? ' AND ' : '').$arr_sql_fields[$i].\" LIKE '%\".$this->multiple_search[$i].\"%'\";\r\n\r\n\t\t}\r\n\r\n\t\tif($where_str!='')\r\n\t\t\t$where_str.=')';\r\n\r\n\t\treturn (($where_str_ini or $where_str or $multiple_search_str) ? ' WHERE ' : '').$where_str_ini.$where_str.$multiple_search_str;\r\n\t}", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "function get_sql_select(){\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false)\r\n\t\t\t$select_str=substr($this->sql_query,0,stripos($this->sql_query,' WHERE '));\r\n\t\telse\r\n\t\t\t$select_str=$this->sql_query;\r\n\r\n\t\treturn $select_str;\r\n\r\n\t}", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\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 }", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function getWhereClause()\n {\n return $this->where_clause;\n }", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function __toString()\n\t{\n\t\t// Initialize variables.\n\t\t$query = '';\n\n\t\t// Add the SELECT and FROM clauses.\n\t\t$query .= 'SELECT '.implode(',', $this->_select);\n\t\t$query .= \"\\nFROM \".implode(',', $this->_from);\n\n\t\t// Special case for JOIN clauses.\n\t\tif ($this->_join) {\n\t\t\t$query .= \"\\n\".implode(\"\\n\", $this->_join);\n\t\t}\n\n\t\t// Add the WHERE clause if it exists.\n\t\tif ($this->_where) {\n\t\t\t$query .= \"\\nWHERE \".$this->_where;\n\t\t}\n\n\t\t// Add the optional GROUP BY and HAVING clauses if they exist.\n\t\tif ($this->_group) {\n\t\t\t$query .= \"\\nGROUP BY \".implode(',', $this->_group);\n\t\t}\n\t\tif ($this->_having) {\n\t\t\t$query .= \"\\nHAVING \".implode(',', $this->_having);\n\t\t}\n\n\t\t// Add any UNION queries.\n\t\tforeach ($this->_union as $union)\n\t\t{\n\t\t\t$query .= \"\\nUNION\".((!$union->unionDistinct) ? ' ALL' : '');\n\t\t\t$query .= \"\\n\".$union;\n\t\t}\n\n\t\t// Add the optional ORDER BY clause if it exists.\n\t\tif ($this->_order) {\n\t\t\t$query .= \"\\nORDER BY \".implode(',', $this->_order);\n\t\t}\n\n\t\treturn $query;\n\t}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "protected function user_where_clause() {}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tif ($this->CurrentFilter <> \"\") {\n\t\t\tif ($sFilter <> \"\") $sFilter = \"(\" . $sFilter . \") AND \";\n\t\t\t$sFilter .= \"(\" . $this->CurrentFilter . \")\";\n\t\t}\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),\n\t\t\t$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);\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}", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\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 getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "protected abstract function getWhereClause(array $conditions);", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function where($whereClause = null)\r\n\t\t{\r\n\t\t\tif($whereClause != null and $whereClause != 'false'){\r\n\t\t\t\tif($this->_where != '') $this->_where .= ' ' . $whereClause;\r\n\t\t\t\telse $this->_where = ' WHERE ' . $whereClause;\r\n\t\t\t}\r\n\t\t\telse if($whereClause == 'false'){\r\n\t\t\t\t//this is used as a bypass on some methods\r\n\t\t\t\t$this->_where = 'false';\r\n\t\t\t}\r\n\t\t\treturn $this;\r\n\t\t}", "public function get_sql() {\r\n\t\t// The parts of the final query\r\n\t\t$where = array();\r\n\r\n\t\tforeach ( $this->queries as $key => $query ) {\r\n\t\t\t$where_parts = $this->get_sql_for_subquery( $query );\r\n\t\t\tif ( $where_parts ) {\r\n\t\t\t\t// Combine the parts of this subquery into a single string\r\n\t\t\t\t$where[ $key ] = '( ' . implode( ' AND ', $where_parts ) . ' )';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Combine the subquery strings into a single string\r\n\t\tif ( $where )\r\n\t\t\t$where = ' AND ( ' . implode( \" {$this->relation} \", $where ) . ' )';\r\n\t\telse\r\n\t\t\t$where = '';\r\n\r\n\t\t/**\r\n\t\t * Filter the date query WHERE clause.\r\n\t\t *\r\n\t\t * @since 3.7.0\r\n\t\t *\r\n\t\t * @param string $where WHERE clause of the date query.\r\n\t\t * @param WP_Date_Query $this The WP_Date_Query instance.\r\n\t\t */\r\n\t\treturn apply_filters( 'get_date_sql', $where, $this );\r\n\t}", "protected function getWhere()\n {\n global $debug;\n global $warn;\n\n if ($debug)\n $warn .= '<p>SubDistrictSet::getWhere: ' . \n print_r($this->parms, true) . \"</p>\\n\";\n $where = '';\n $and = 'WHERE ';\n if (!is_array($this->sqlParms))\n $this->sqlParms = array();\n\n // create WHERE clause\n foreach($this->parms as $fldname => $value)\n {\n $fieldLc = SubDistrict::getRealFieldName($fldname);\n switch($fieldLc)\n { // act on specific fields\n case 'sd_census':\n { // census field\n if (is_string($value))\n {\n $censusId = $value;\n $censusObj = new Census(array('censusid'=> $value));\n }\n else\n if ($value instanceof Census)\n {\n $censusObj = $value;\n $censusId = $censusObj->get('censusid');\n }\n $where .= \"$and`SD_Census`=:censusid\";\n $this->sqlParms['censusid'] = $censusId;\n $and = ' AND ';\n if (!$censusObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported Census='$value'</p>\\n\";\n break;\n } // census field\n\n case 'sd_distid':\n { // district id field\n if (is_string($value))\n {\n $distId = $value;\n $parms = array('census'=>$censusObj,\n 'id' => $value);\n $districtObj = new District($parms);\n }\n else\n if ($value instanceof District)\n {\n $districtObj = $value;\n $distId = $districtObj->get('id');\n }\n $where .= \"$and`SD_DistId`=:distid\";\n $this->sqlParms['distid'] = $distId;\n $and = ' AND ';\n if (!$districtObj->isExisting())\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unsupported District='$distId'</p>\\n\";\n break;\n } // domain field\n\n default:\n {\n $warn .= \"<p>SubDistrictSet::getWhere: \" . __LINE__ .\n \" Unrecognized search parameter `$fldname`.</p>\";\n break;\n }\n\n } // act on specific fields\n } // loop through all parameters\n\n return $where;\n }", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "public function __toString() {\n // to do it. This allows constructs like \"(string) $query\" to work. When\n // the query will be executed, it will be recompiled using the proper\n // placeholder generator anyway.\n if (!$this->compiled()) {\n $this->compile($this->connection, $this);\n }\n\n // Create a sanitized comment string to prepend to the query.\n $comments = $this->connection->makeComment($this->comments);\n\n // SELECT\n $query = $comments . 'SELECT ';\n if ($this->distinct) {\n $query .= 'DISTINCT ';\n }\n\n // FIELDS and EXPRESSIONS\n $fields = array();\n foreach ($this->tables as $alias => $table) {\n if (!empty($table['all_fields'])) {\n $fields[] = $this->connection->escapeTable($alias) . '.*';\n }\n }\n foreach ($this->fields as $alias => $field) {\n // Always use the AS keyword for field aliases, as some\n // databases require it (e.g., PostgreSQL).\n $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeAlias($field['alias']);\n }\n foreach ($this->expressions as $alias => $expression) {\n $fields[] = $expression['expression'] . ' AS ' . $this->connection->escapeAlias($expression['alias']);\n }\n $query .= implode(', ', $fields);\n\n\n // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.\n $query .= \"\\nFROM \";\n foreach ($this->tables as $alias => $table) {\n $query .= \"\\n\";\n if (isset($table['join type'])) {\n $query .= $table['join type'] . ' JOIN ';\n }\n\n // If the table is a subquery, compile it and integrate it into this query.\n if ($table['table'] instanceof SelectQueryInterface) {\n // Run preparation steps on this sub-query before converting to string.\n $subquery = $table['table'];\n $subquery->preExecute();\n $table_string = '(' . (string) $subquery . ')';\n }\n else {\n $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';\n }\n\n // Don't use the AS keyword for table aliases, as some\n // databases don't support it (e.g., Oracle).\n $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);\n\n if (!empty($table['condition'])) {\n $query .= ' ON ' . $table['condition'];\n }\n }\n\n // WHERE\n if (count($this->where)) {\n // There is an implicit string cast on $this->condition.\n $query .= \"\\nWHERE \" . $this->where;\n }\n\n // GROUP BY\n if ($this->group) {\n $query .= \"\\nGROUP BY \" . implode(', ', $this->group);\n }\n\n // HAVING\n if (count($this->having)) {\n // There is an implicit string cast on $this->having.\n $query .= \"\\nHAVING \" . $this->having;\n }\n\n // ORDER BY\n if ($this->order) {\n $query .= \"\\nORDER BY \";\n $fields = array();\n foreach ($this->order as $field => $direction) {\n $fields[] = $field . ' ' . $direction;\n }\n $query .= implode(', ', $fields);\n }\n\n // RANGE\n // There is no universal SQL standard for handling range or limit clauses.\n // Fortunately, all core-supported databases use the same range syntax.\n // Databases that need a different syntax can override this method and\n // do whatever alternate logic they need to.\n if (!empty($this->range)) {\n if($this->range['start']) {\n $query .= \"\\nROWS \" . (int) $this->range['length'] . \" TO \" . (int) $this->range['start'] + (int) $this->range['length'];\n } else {\n $query .= \"\\nROWS \" . (int) $this->range['length']; \n }\n }\n\n // UNION is a little odd, as the select queries to combine are passed into\n // this query, but syntactically they all end up on the same level.\n if ($this->union) {\n foreach ($this->union as $union) {\n $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];\n }\n }\n\n if ($this->forUpdate) {\n $query .= ' FOR UPDATE';\n }\n\n return $query;\n }", "public function createWhere() {\n\t\tlist($where, $joins) = parent::createWhere();\n\t\tif (!($this->parent->parent instanceof QuerySet))\n\t\t\t$where = \" WHERE \" . $where;\n\t\telse\n\t\t\t$where = \" AND \" . $where;\n\t \n\t\treturn array($where, $joins);\n\t}", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "function get_sql(){\r\n\r\n\t\treturn $this->get_sql_select().$this->get_sql_where().$this->get_sql_order().$this->get_sql_limit();\r\n\r\n\t}", "function build_generic_where_clause ($the_query_string) {\n\t$where_clauses = Array();\n\t$the_query_string = $this->db->quote($the_query_string);\n\tarray_push($where_clauses, \"bugs.name like '$the_query_string%'\");\n\tif (is_numeric($the_query_string)) array_push($where_clauses, \"bugs.bug_number like '$the_query_string%'\");\n\n\t$the_where = \"\";\n\tforeach($where_clauses as $clause)\n\t{\n\t\tif($the_where != \"\") $the_where .= \" or \";\n\t\t$the_where .= $clause;\n\t}\n\n\treturn $the_where;\n\t}", "public function buildWhereSQL(DialectInterface $dialect)\n {\n if (!isset($this->whereBuilder) || !$this->whereBuilder->hasConditions()) {\n return '';\n }\n\n return 'WHERE '.$this->whereBuilder->buildConditionSQL($dialect);\n }", "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}", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "private function getWhereClause($conn, $where){\n\t\tif (!is_array($where)){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql_where=\"\";\n\t\tforeach($where as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif ($sql_where!=\"\"){\n\t\t\t\t$sql_where = $sql_where . \" AND \";\n\t\t\t}\n\t\t\tif (is_array($val) ) {\n\t\t\t\tif (count($val) > 0) {\n\t\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` IN (\";\n\t\t\t\t\t$quoted_values = array();\n\t\t\t\t\tforeach ($val as $v) {\n\t\t\t\t\t\t$quoted_values[] = $this->quote($conn, $v, $field_info[\"type\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$sql_where = $sql_where . implode(', ', $quoted_values).')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` = \";\n\t\t\t\t$sql_where = $sql_where . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t\t}\n\t\t}\n\t\treturn $sql_where;\n\t}", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "protected function _whereCondition($condition) \n\t{\n\t\t$result = 'WHERE ';\n\n\t\tforeach ($condition as $key => $value) {\n\t\t\tif (in_array($key, $this->_fields)) {\n\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t$this->_stringData($condition);\n\t\t\t\t\t$result .= \"`\" . $key . \"`=\" . $value. ' AND ';\n\t\t\t\t} else {\n\t\t\t\t\t$result .= $this->_moreWhere($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//substr last 'and'\n\t\t$result = substr($result, 0, -5);\n\n\t\treturn $result;\n\t}", "private function _where($whereData) \n\t{\n\t\t// record the where data inside the object statement data for further use.\n\t\t$this->_stmtData = $whereData;\n\t\t\n\t\t// Fetch the field names\n\t\t$fields = array_keys ( $whereData );\n\t\t\n\t\t// initiating the where clause\n\t\t$where_clause = ' WHERE ';\n\t\t\n\t\t// setting up a counter\n\t\t$count = 1;\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$where_clause .= $field . \"=:\" . $field;\n\t\t\t\n\t\t\t// For all iterations besides the last one add an AND operator\n\t\t\tif ($count < count ( $fields )) {\n\t\t\t\t$count ++;\n\t\t\t\t$where_clause .= ' AND ';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_query .= $where_clause;\n\t}", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "public function getWhereClauseCondition() {\n\n if (isset($this->whereClauseCondition)) {\n $setCondition = $this->whereClauseCondition;\n return $setCondition;\n } else {\n $defaultCondition = \"=\";\n return $defaultCondition;\n }\n }", "public function sqlForFilters($where_clause = '1', $order_clause = 'id', $offset = 0, $limit = 1)\n {\n\t\t$sql = <<<SQL\n\t\tSELECT\n\t\t\tDISTINCT(invoice.id) as id \n\n\t\tFROM\n\t\t\tinvoice\n\n\t\tLEFT JOIN card ON card.id = invoice.card_id\n\t\tLEFT JOIN user AS attorney ON attorney.id = invoice.attorney_id\n\t\tLEFT JOIN person AS client ON client.id = invoice.client_id\n\t\tLEFT JOIN invoicetype ON invoicetype.id = invoice.invoicetype_id\n\t\t\n\t\tWHERE {$where_clause}\n\n\t\tORDER BY {$order_clause}\n\n\t\tLIMIT {$offset}, {$limit}\nSQL;\n return $sql;\n }", "public function where($conditions){\n\t\t\t$string = self::WHERE;\n\t\t\t\n\t\t\tforeach($conditions as $val){\n\t\t\t\t$typeR = gettype($val['right']);\n\n\t\t\t\t$string .= ' ' . ((isset($val['link']) && !empty($val['link'])) ? $val['link'] . ' ' : '');\n\n\t\t\t\tif(isset($val['paranthesis']) && isset($val['paranthesis']['open']))\n\t\t\t\t\t$string .= '(';\n\t\t\t\t$string .= $val['left'] . ' ' . $val['operator'] . ' ' . ($typeR == \"string\" ? \"'\" . $val['right'] . \"'\" : $val['right']);\n\n\t\t\t\tif(isset($val['paranthesis']) && isset($val['paranthesis']['close']))\n\t\t\t\t\t$string .= ')';\n\t\t\t}\n\t\t\t$this->_query .= $string . ' ';\n\t\t\treturn $this->_returnObject ? $this : $string;\n\t\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}", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "public function toString()\n\t{\n\t\tif($this->str === null)\n\t\t{\n\t\t\tif(!empty($this->values))\n\t\t\t{\n\t\t\t\t$len = count($this->values);\n\t\t\t\t$conditions = '';\n\n\t\t\t\tforeach($this->values as $i => $value)\n\t\t\t\t{\n\t\t\t\t\tswitch($value[self::TYPE])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . $value[self::VALUE];\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t\t\t$params = array();\n\n\t\t\t\t\t\t\tforeach($value[self::VALUE] as $val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$params[] = self::escape($val);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' IN (' . implode(',', $params) . ')';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\t$conditions.= $value[self::COLUMN] . ' ' . $value[self::OPERATOR] . ' ' . self::escape($value[self::VALUE]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$conditions.= ($i < $len - 1) ? ' ' . $value[self::CONJUNCTION] . ' ' : '';\n\t\t\t\t}\n\n\t\t\t\treturn $this->str = 'WHERE ' . $conditions;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->str = '';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->str;\n\t\t}\n\t}", "protected function getQuery()\n {\n $query = $this->database->select()->from($this->table);\n \n foreach ($this->join as $join) {\n if (!is_array($join[2])) {\n $join[2] = array($join[2]);\n }\n \n $where = array_shift($join[2]);\n if (!empty($join[2])) {\n foreach ($join[2] as $i => $value) {\n $join[2][$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $join[2]);\n }\n \n $query->join($join[0], $join[1], $where, $join[3]);\n }\n \n foreach ($this->filter as $i => $filter) {\n //array('post_id=%s AND post_title IN %s', 123, array('asd'));\n $where = array_shift($filter);\n if (!empty($filter)) {\n foreach ($filter as $i => $value) {\n $filter[$i] = $this->database->bind($value);\n }\n \n $where = vsprintf($where, $filter);\n }\n \n $query->where($where);\n }\n \n return $query;\n }", "protected function WhereClause($conditions = array(), $type = 0) {\n\n $conditionsStr = \"\";\n\n if (count($conditions)) {\n\n $counter = 0;\n\n foreach ($conditions as $condkey => $condvalue) {\n\n $notType = false;\n\n $condvalue['operatortype'] = isset($condvalue['operatortype']) ? $condvalue['operatortype'] : 'AND';\n\n $condvalue['operatortype'] = strtoupper($condvalue['operatortype']);\n\n if (!in_array($condvalue['operatortype'], array('AND', 'OR'))) {\n\n $condvalue['operatortype'] = \"AND\";\n }\n\n if (isset($condvalue['notoperator']) &&\n $condvalue['notoperator']) {\n\n $notType = true;\n }\n\n if ($counter == 0) {\n\n switch ($type) {\n case 1: {\n $condvalue['operatortype'] = \"ON\";\n break;\n }\n case 2: {\n $condvalue['operatortype'] = \"HAVING\";\n break;\n }\n default: {\n $condvalue['operatortype'] = \"WHERE\";\n }\n }\n }\n\n $conditionsStr .= \" \" . $condvalue['operatortype'];\n\n if ($notType) {\n\n $conditionsStr .= \" NOT\";\n }\n\n if (isset($condvalue['startbrackets'])) {\n\n $condvalue['startbrackets'] = preg_replace(\"/[^(\\(|\\))]/\", \"\", $condvalue['startbrackets']);\n\n $conditionsStr .= \" \" . $condvalue['startbrackets'];\n }\n\n $noCondition = true;\n\n if (!(isset($condvalue['column']) &&\n $condvalue['column']) &&\n isset($condvalue['subquery']) &&\n $condvalue['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $condvalue['subquery']->\n IsSelect()) {\n\n $condvalue['column'] = '(' . rtrim($condvalue['subquery']->\n Generate(), ';') . ')';\n\n $noCondition = false;\n } else if (isset($condvalue['column'])) {\n\n $condvalue['column'] = \"{$condvalue['column']}\";\n\n $noCondition = false;\n }\n\n if (!(isset($condvalue['column']) &&\n $condvalue['column']) &&\n isset($condvalue['value']) &&\n $condvalue['value']) {\n\n $condvalue['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($condvalue['value']);\n $condvalue['column'] = \"'{$condvalue['value']}'\";\n\n $noCondition = false;\n }\n\n if (!(isset($condvalue['rightcolumn']) &&\n $condvalue['rightcolumn']) &&\n isset($condvalue['rightsubquery']) &&\n $condvalue['rightsubquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $condvalue['rightsubquery']->\n IsSelect()) {\n\n $condvalue['rightcolumn'] = '(' . rtrim($condvalue['rightsubquery']->\n Generate(), ';') . ')';\n\n $noCondition = false;\n } else if (isset($condvalue['rightcolumn'])) {\n\n $condvalue['rightcolumn'] = \"{$condvalue['rightcolumn']}\";\n\n $noCondition = false;\n }\n\n if (!(isset($condvalue['rightcolumn']) &&\n $condvalue['rightcolumn']) &&\n isset($condvalue['rightvalue']) &&\n $condvalue['rightvalue']) {\n\n $condvalue['rightvalue'] = $this->\n connection->\n GetConn()->\n real_escape_string($condvalue['rightvalue']);\n $condvalue['rightcolumn'] = \"'{$condvalue['rightvalue']}'\";\n\n $noCondition = false;\n }\n\n if (!$noCondition) {\n\n if (!isset($condvalue['operator']) ||\n !$condvalue['operator']) {\n\n $condvalue['operator'] = \"=\";\n }\n\n $conditionsStr .= \" {$condvalue['column']} {$condvalue['operator']} {$condvalue['rightcolumn']}\";\n }\n\n if (isset($condvalue['endbrackets'])) {\n\n $condvalue['endbrackets'] = preg_replace(\"/[^(\\(|\\))]/\", \"\", $condvalue['endbrackets']);\n\n $conditionsStr .= \" \" . $condvalue['endbrackets'];\n }\n\n $counter++;\n }\n }\n\n return $conditionsStr;\n }", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "function translated_plain_where($base, $field) {\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 \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "static public function BuildSQLWhereClause( $whereArray, $customArray = array() )\r\n\t{\r\n\t\t$where = '';\r\n\t\tif( $whereArray )\r\n\t\t{\r\n\t\t\tforeach( $whereArray as $key => $value )\r\n\t\t\t{\r\n\t\t\t\tif( strlen( $where ) == 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\tif( is_string( $key ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where = \" WHERE `\" . $key . \"` = \" . $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where = \" WHERE \" . $value;\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{\r\n\t\t\t\t\tif( is_string( $key ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where .= \" AND `\" . $key . \"` = \" . $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$where .= \" AND \" . $value;\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\t\r\n\t\tif( !empty( $customArray ) )\r\n\t\t{\r\n\t\t\tforeach( $customArray as $value )\r\n\t\t\t{\r\n\t\t\t\tif( strlen( $where ) == 0 )\r\n\t\t\t\t{\r\n\t\t\t\t\t$where = \" WHERE \" . $value;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$where .= \" AND \" . $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $where;\r\n\t}", "function where($s)\n{\n\t$this->tryModify();\n\tif(!isset($this->query['where'])) $this->query['where'] = array();\n\t$this->query['where'][] = $this->setWhereParams($s, func_get_args(), 1);\n\treturn $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 }", "public function\n\t\tget_select_query()\n\t{\n\t\t$query = '';\n\t\t\n\t\t$key_fields = $this->get_key_fields();\n\t\t\n\t\t#print_r($key_fields);\n\t\t\n\t\t$display_fields = $this->get_display_fields();\n\t\t\n\t\t#print_r($display_fields);\n\t\t\n\t\t$table_name = $this->get_table_name();\n\t\t\n\t\t$ordering_fields = $this->get_ordering_fields();\n\t\t\n\t\t#print_r($ordering_fields);\n\t\t\n\t\t/*\n\t\t * The select clause.\n\t\t */\n\t\t\n\t\t$select_fields = array();\n\t\t\n\t\tforeach ($key_fields as $key_field) {\n\t\t\t$select_fields[] = $key_field;\n\t\t}\n\t\t\n\t\tforeach ($display_fields as $display_field) {\n\t\t\t$select_fields[] = $display_field['name'];\n\t\t}\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$select_fields = array_unique($select_fields);\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$query .= 'SELECT ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($select_fields as $select_field) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $select_field . ' ';\n\t\t}\n\t\t\n\t\t/*\n\t\t * The from clause.\n\t\t */\n\t\t\n\t\t$query .= ' FROM ' . $table_name . ' ';\n\t\t\n\t\t/*\n\t\t * The order by clause.\n\t\t */\n\t\t\n\t\t$query .= ' ORDER BY ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($ordering_fields as $of) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $of['name'] . ' ' . $of['direction'] . ' ';\n\t\t}\n\t\t\n\t\t#echo $query;\n\t\t\n\t\treturn $query;\n\t}", "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 _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "public function sql($criteria=NULL)\n {\n if($this->limite == 0 OR $this->offset() == 0){\n\t $sql = $this->sql . \"\";\n\t return $sql;\n\t}\n else{\n $sql = $this->sql . \" LIMIT {$this->limite} OFFSET {$this->offset()} \";\n\treturn $sql;\n }\n }", "protected function _moreWhere($field, $condition) \n\t{\n\t\t$result = '`' . $field . '`';\n\n\t\t$tag = strtolower($condition[0]);\n\t\tif (gettype($condition[1]) == 'string') {\n\t\t\t$condition[1] == \"'\" . $condition[1] . \"'\";\n\t\t}\n\n\t\tswitch ($tag) {\n\t\t\tcase 'in':\n\t\t\t\t$result .= ' IN (' . implode(',', $condition[1]) . ')';\n\t\t\t\tbreak;\n\t\t\tcase '>':\n\t\t\t\t$result .= ' >' . $condition[1];\n\t\t\t\tbreak;\n\t\t\tcase '<':\n\t\t\t\t$result .= ' <' . $condition[1];\n\t\t\t\tbreak;\n\t\t\tcase '<>':\n\t\t\t\t$result .= ' <>' . $condition[1];\n\t\t\t\tbreak;\n\t\t\tcase 'between':\n\t\t\t\t$result .= ' BETWEEN ' . $condition[1][0] . ' AND ' . $condition[1][1];\n\t\t}\n\n\t\t$result .= ' AND ';\n\n\t\treturn $result;\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\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE l.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "public function __toString(): string\n {\n return sprintf(\n 'SELECT %s FROM %s WHERE %s',\n implode(', ', $this->fields),\n implode(', ', $this->table),\n implode(', ', $this->condition)\n );\n }", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "public function where($params = array()) \n {\n $sql = $this->_data['query'] . ' WHERE ';\n if(is_array($params)) {\n $condition = $this->replaceParam($params);\n $sql .= $condition;\n $this->_data['where'] = $condition;\n } else {\n $sql .= $params;\n $this->_data['where'] = $params;\n }\n $this->_data['query'] = $sql;\n return $this;\n }", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "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 }", "public function where($condition1, $operator, $condition2) {\r\n\t\t$this->query .= \" WHERE \" . $condition1 . $operator . \"'\" . $condition2 . \"'\";\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "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}", "public function getWhere()\n\t{\n\t\tif(empty($this->sWhere))\n\t\t{\n\t\t\treturn 'TRUE';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->sWhere;\n\t\t}\n\t}", "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 buildSelectStringECommerce($aWhere = null, $sAndOr = \" AND \")\n {\n $sSelect = \"SELECT * FROM $this->_sClassName where 1\";\n\n if ($aWhere) {\n $sWhereAdd = \"\";\n reset($aWhere);\n while (list($name, $value) = each($aWhere)) {\n $sWhereAdd .=\"md5($this->_sClassName.$name) = '$value' $sAndOr\";\n }\n\n $sWhereAdd = trim($sWhereAdd, $sAndOr);\n $sWhereAdd = \" AND ( \".$sWhereAdd.\" )\";\n }\n\n $sSelect .=$sWhereAdd;\n\n $this->_sQueryString = $sSelect;\n return $this->_sQueryString;\n }", "public function where()\n {\n return $this->query; \n }", "function where_this($id = null) {\n\t\tif (!$id) {\n\t\t\t$id = $this->id;\n\t\t}\n\n\t\treturn \" WHERE \".$this->id_field.\" = '\".$this->db->escape($id).\"'\";\n\t}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "abstract protected function buildSQL(): string;", "public function getSQL($sWhere, $iLanguage = 0, $iShopId = 1)\n {\n if (!$this->_aFieldList) {\n return;\n }\n\n $sSQL = 'select ';\n $blSep = false;\n\n foreach ($this->_aFieldList as $sField) {\n if ($blSep) {\n $sSQL .= ',';\n }\n\n $sSQL .= $this->_getSqlFieldName($sField, $iLanguage, $iShopId);\n $blSep = true;\n }\n\n\n $sSQL .= ' from ' . $this->getTableName($iShopId, $iLanguage) . ' ' . $sWhere;\n\n return $sSQL;\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= test@test.com']\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 }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "public function where($conditions)\n {\n if(!$this->query)\n {\n return false;\n }\n \n // Were multiple arguments passed?\n if(func_num_args() > 1)\n {\n $conditions = func_get_args();\n }\n \n $conditions = stripslashes($this->san($conditions));\n $this->query .= \"WHERE {$conditions} \";\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "public function toSQL()\n {\n $sql = '`' . $this->fieldName . '` ' . $this->getOperator() . ' ' . $this->getSearchValue();\n if (null != $this->tableName) {\n $sql = '`' . $this->tableName . '`.' . $sql;\n }\n \n return $sql;\n }" ]
[ "0.75069577", "0.7337574", "0.7234889", "0.72184044", "0.7197214", "0.70903647", "0.7048081", "0.69343436", "0.6926804", "0.6866899", "0.6815463", "0.679863", "0.6772328", "0.675982", "0.6717521", "0.66830975", "0.6677829", "0.6666542", "0.6661245", "0.6653828", "0.66536874", "0.6650348", "0.66053486", "0.66038245", "0.6560597", "0.655164", "0.6546737", "0.65296316", "0.65278316", "0.651487", "0.6513587", "0.6489751", "0.648405", "0.6481021", "0.64762485", "0.6461718", "0.64600617", "0.6429348", "0.63958216", "0.63898396", "0.63588893", "0.6353062", "0.6350911", "0.63476586", "0.63342357", "0.6332152", "0.63300276", "0.63279855", "0.63197166", "0.6312647", "0.63084346", "0.62982804", "0.62821865", "0.62778956", "0.6241331", "0.62367934", "0.6230277", "0.62286663", "0.62275916", "0.62275326", "0.6222285", "0.6219868", "0.61855686", "0.6180892", "0.6180892", "0.6160556", "0.6156518", "0.6142417", "0.61280674", "0.61139226", "0.60983217", "0.6077333", "0.6070741", "0.60703284", "0.6062533", "0.6052387", "0.60497797", "0.604942", "0.60481006", "0.6041435", "0.60403776", "0.60398096", "0.60307014", "0.6022367", "0.60176873", "0.60128456", "0.6011123", "0.60070187", "0.6001996", "0.60004073", "0.6000309", "0.5999373", "0.599643", "0.5992244", "0.598419", "0.59784734", "0.59739095", "0.59661984", "0.59636426", "0.59575015", "0.59574324" ]
0.0
-1
Constructs the LIMIT clause string for the SELECT query.
private static function constructLimitStringStatic($limit) { $string = $limit['start']; if ($limit['limit'] !== false) { $string .= ", {$limit['limit']}"; } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _sql_limit() {\n\t\tif ( $this->limit ) {\n\t\t\treturn ' LIMIT ' . $this->limit;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t}", "function getLimitSql()\n\t{\n\t\t$sql = \"LIMIT \" . $this->getLimit();\n\t\treturn $sql;\n\t}", "function selectLimit ($limit, $offset=null)\n {\n return \" LIMIT {$limit}\".($offset? \" OFFSET {$offset}\": null);\n }", "protected function compileLimit(Builder $query, $limit)\n {\n return 'LIMIT '.(int) $limit;\n }", "protected function _limit($sql)\n\t{\n\t\treturn $sql.' LIMIT '.($this->qb_offset ? $this->qb_offset.', ' : '').(int) $this->qb_limit;\n\t}", "protected function compileLimit(Builder $query, int $limit)\n {\n return 'limit ' . (int)$limit;\n }", "function get_sql_limit(){\r\n\t\t$limit_str='';\r\n\r\n\t\tif($this->items_per_page!='all' and $this->items_per_page!='')\r\n\t\t\t$limit_str=' LIMIT '.($this->page-1)*$this->items_per_page.','.$this->items_per_page;\r\n\r\n\t\treturn $limit_str;\r\n\t}", "public function sql_select_limit( $sql, $offset, $row_count)\n {\n if($row_count)\n {\n $this->sql = $sql . \" LIMIT \".$offset.\",\".$row_count;\n }\n return $this->sql;\n }", "public static function build_limit( $limit ) {\n if ( empty( $limit ) ) {\n return '';\n }\n\n return ' LIMIT ' . absint( $limit ) . ' ';\n }", "public function limit($sql)\n {\n //if (!$this->parent->order) {\n // $this->parent->throwError('limit without a sort', '');\n //}\n if (strpos($sql, ',')) {\n $arr = explode(',', $sql);\n return \" OFFSET {$arr[0]} ROWS FETCH NEXT {$arr[1]} ROWS ONLY\";\n }\n\n return \" OFFSET 0 ROWS FETCH NEXT $sql ROWS ONLY\";\n }", "protected function getLimitString()\n {\n $str = '';\n if (!empty($this->limit)) {\n $str = self::TAB_SEPARATOR;\n if (!empty($this->skip)) {\n $this->limit = $this->skip . ', ' . $this->limit;\n }\n $str .= 'LIMIT ' . $this->limit . self::LINE_SEPARATOR;\n }\n return $str;\n }", "function q_limit($query, $limit, $off=0)\n{\n\treturn $query .' LIMIT '. $limit .' OFFSET '. $off;\n}", "protected function compileLimit(Builder $query, $limit)\n\t{\n\t\treturn '';\n\t}", "function limitResult($sql, $limit,$offset=false) {\n\t\tif($offset === false || $offset == 0) {\n\t\t\tif ( stripos($sql, \"SELECT\") === false ) {\n\t\t\t\treturn \"TOP {$limit} \" . $sql;\n\t\t\t} else {\n\t\t\t\treturn preg_replace(\"/(^\\s*select\\s+(distinctrow|distinct)?)/i\", \"\\\\1 TOP {$limit}\", $sql);\n\t\t\t}\t\t\n\t\t} else {\n\t\t $orderby = stristr($sql, 'ORDER BY');\n\t if ($orderby !== false) $order = str_ireplace('ORDER BY', '', $orderby);\n\t $sql = preg_replace('/(^\\s*select\\s+(distinctrow|distinct)?)/i', '\\\\1 TOP(10000000) ', $sql);\n\t $sql = '\n\t \tSELECT * FROM (\n\t \t SELECT sub2.*, ROW_NUMBER() OVER(ORDER BY sub2.line2) AS line3 FROM (\n\t \t SELECT 1 AS line2, sub1.* FROM (' . $sql . ') AS sub1\n\t \t ) as sub2\n\t \t) AS sub3 \n\t \tWHERE line3 BETWEEN ' . ($limit) . ' AND ' . ($offset + $limit);\n\t if ($orderby !== false) {\n\t \t$sql .= ' ORDER BY ' . $order;\n\t }\t\t\t\n\t return $sql;\n\t\t}\n\t}", "protected function compileLimit(Builder $query, $limit)\r\n {\r\n // Only apply BETWEEN clause, if missing OFFSET, otherwise use presto way to LIMIT records\r\n if (is_int($query->offset)) {\r\n // using custom BETWEENLIMIT clause only to detect if it is limit to prevent conflict with BETWEEN.\r\n // Handling it in Connection.php\r\n return 'BETWEENLIMIT '.(int) $limit;\r\n } else {\r\n return parent::compileLimit($query, $limit);\r\n }\r\n }", "public function limit(string $sqlQuery, $number) : string\n {\n $offset = 0;\n if (is_array($number)) {\n if (isset($number[1]) && strlen($number[1])) {\n $offset = $number[1];\n }\n\n $number = $number[0];\n }\n\n if (strpos($sqlQuery, 'ORDER BY') === false) {\n $sqlQuery .= ' ORDER BY 1';\n }\n\n return $sqlQuery.\" OFFSET {$offset} ROWS FETCH NEXT {$number} ROWS ONLY\";\n }", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "protected function limit(int $limit){\n $this->query .= \"LIMIT \" . $limit . \" \";\n }", "public function setSqlLimit($limit)\n {\n if ($this->searchResult !== null) {\n $limit = '';\n }\n\n return $limit;\n }", "public function limit($sql){\n\t\t$params = get_params(func_get_args());\n\t\t$sql_new = $sql;\n\t\n\t\tif(isset($params['limit']) && is_numeric($params['limit'])){\n\t\t\t$sql_new.=\" LIMIT $params[limit]\";\n\t\t}\n\t\t\n\t\tif(isset($params['offset']) && is_numeric($params['offset'])){\n\t\t\t$sql_new.=\" OFFSET $params[offset]\";\n\t\t}\n\t\t\n\t\treturn $sql_new;\n\t}", "public function getLimitOffsetClause()\n\t{\n\t\treturn $this->limit;\n\t}", "public function limit($sql){\n\t\t$params = get_params(func_get_args());\n\t\t$sql_new = $sql;\n\t\n\t\tif(isset($params['limit']) && is_numeric($params['limit'])){\n\t\t\t$sql_new.=\" FIRST $params[limit]\";\n\t\t}\n\t\t\n\t\tif(isset($params['offset']) && is_numeric($params['offset'])){\n\t\t\t$sql_new.=\" SKIP $params[offset]\";\n\t\t}\n\t\t\n\t\treturn $sql_new;\n\t}", "private function sql_limit()\n {\n // Get LIMIT statement\n $limit = null;\n\n // RETURN LIMIT statement\n return $limit;\n }", "public function __toString()\n {\n $sql = parent::__toString();\n $this->connection->limit($sql, $this->limit);\n return $sql;\n }", "public function limit($sql, $number){\n\t\tif(!is_numeric($number)||$number<0){\n\t\t\treturn $sql;\n\t\t}\n\t\tif(preg_match('/ORDER[\\t\\n\\r ]+BY/i', $sql)){\n\t\t\tif(stripos($sql, 'WHERE')){\n\t\t\t\treturn preg_replace('/ORDER[\\t\\n\\r ]+BY/i', \"AND ROWNUM <= $number ORDER BY\", $sql);\n\t\t\t} else {\n\t\t\t\treturn preg_replace('/ORDER[\\t\\n\\r ]+BY/i', \"WHERE ROWNUM <= $number ORDER BY\", $sql);\n\t\t\t}\n\t\t} else {\n\t\t\tif(stripos($sql, 'WHERE')){\n\t\t\t\treturn $sql.' AND ROWNUM <= '.$number;\n\t\t\t} else {\n\t\t\t\treturn $sql.' WHERE ROWNUM <= '.$number;\n\t\t\t}\n\t\t}\n\t}", "public function limitClause(){\n try {\n // Sparql11query.g:164:3: ( LIMIT INTEGER ) \n // Sparql11query.g:165:3: LIMIT INTEGER \n {\n $this->match($this->input,$this->getToken('LIMIT'),self::$FOLLOW_LIMIT_in_limitClause592); \n $this->match($this->input,$this->getToken('INTEGER'),self::$FOLLOW_INTEGER_in_limitClause594); \n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function sqlSetSelectLimit($selectSql, $limit, $offset = null) {\n if (!preg_match('/\\s+ORDER\\s+BY\\s+/i', $selectSql)) $selectSql .= ' ORDER BY 1';\n $offset = null === $offset ? 0 : (int)$offset;\n $selectSql .= ' OFFSET ' . $offset . ' ROWS';\n if ($limit !== null) {\n $limit = (int)$limit;\n $selectSql .= ' FETCH NEXT ' . $limit . ' ROWS ONLY';\n }\n return $selectSql;\n }", "function getLimit()\n\t{\n\t\tif ($this->total_records == 0)\n\t\t{\n\t\t\t$lastpage = 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$lastpage = ceil($this->total_records/$this->size);\n\t\t}\n\t\t\n\t\t$page = $this->page;\t\t\n\t\t\n\t\tif ($this->page < 1)\n\t\t{\n\t\t\t$page = 1;\n\t\t} \n\t\telse if ($this->page > $lastpage && $lastpage > 0)\n\t\t{\n\t\t\t$page = $lastpage;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$page = $this->page;\n\t\t}\n\t\t\n\t\t$sql = ($page - 1) * $this->size . \",\" . $this->size;\n\t\t\n\t\treturn $sql;\n\t}", "protected function compileLimit(Builder $builder, $limit): string\n {\n return 'limit '.(int) $limit;\n }", "private function limitClause ($conditions) {\n\n // We only do anything if the 'LIMIT' key exists in the array\n if (array_key_exists(\"LIMIT\",$conditions)) {\n\n // The 'LIMIT' key exists in the array so continue the SQL statement with an 'LIMIT'\n $this->_sql .= ' LIMIT ';\n\n // If a start position has been specified add it to the SQL statement followed by a comma\n $this->_sql .= (isset($conditions['LIMIT'][1])) ? $conditions['LIMIT'][1].',' : '';\n\n // Add the limit number to the SQL statement\n $this->_sql .= $conditions['LIMIT'][0];\n\n }\n }", "function _limit_offset ($limit, $offset) {\n\t\t$statement = '';\n\t\tif (isset($limit) && $limit) {\n\t\t\tif (is_integer($limit)) {\n\t\t\t\t$statement .= \" LIMIT {$limit}\";\n\t\t\t} else {\n\t\t\t\t$statement .= \" LIMIT \" . intval($limit);\n\t\t\t}\n\t\t} else {\n\t\t\t$statement .= \" LIMIT 0\";\n\t\t}\n\t\tif (isset($offset) && $offset) {\n\t\t\tif (is_integer($offset)) {\n\t\t\t\t$statement .= \" OFFSET {$offset} \";\n\t\t\t} else {\n\t\t\t\t$statement .= \" OFFSET \" . intval($offset) . \" \";\n\t\t\t}\n\t\t}\n\t\treturn $statement;\n\t}", "public function apply_limit($query, $offset = 0, $limit = 0) {\n\n\t\t\t\n\t\t\t$high_where = '';\n\t\t\t$lower_where = 0;\n if($offset>0 || $limit>0) {\n $high_where = '\"_RN\" <= '.($offset+$limit).' AND ';\n $lower_where = $offset+1;\n }\n $sql = sprintf('SELECT * FROM (SELECT ROWNUM AS \"_RN\", \"_SUB\".* FROM (%s) \"_SUB\") WHERE %s \"_RN\" >= %d',$query, $high_where, $lower_where);\n\t\t\t\n\t\t\treturn $sql;\n\t\t}", "public function buildLimitOffset($limit = null, $offset = null)\n {\n $sql = [];\n\n if ($this->adapter instanceof Mssql) {\n if ($offset !== null || $limit !== null) {\n // If offset is null, sprintf will convert it to 0\n $sql[] = sprintf('OFFSET %d ROWS', $offset);\n }\n\n if ($limit !== null) {\n // FETCH FIRST n ROWS ONLY for OFFSET 0 would be an alternative here\n $sql[] = \"FETCH NEXT $limit ROWS ONLY\";\n }\n } else {\n if ($limit !== null) {\n $sql[] = \"LIMIT $limit\";\n }\n\n if ($offset !== null) {\n $sql[] = \"OFFSET $offset\";\n }\n }\n\n return implode($this->separator, $sql);\n }", "public function testLimitSetFromClauseString()\n {\n $query = new SQLSelect();\n $query->setSelect('*');\n $query->setFrom('\"SQLSelectTest_DO\"');\n\n $query->setLimit('20 OFFSET 10');\n $limit = $query->getLimit();\n $this->assertEquals(20, $limit['limit']);\n $this->assertEquals(10, $limit['start']);\n }", "private function _sql_offset() {\n\t\tif ( $this->limit && $this->offset ) {\n\t\t\treturn ' OFFSET '. $this->offset;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t}", "protected abstract function getLimitOffsetClause($limit, $offset = 0);", "public function sql($criteria=NULL)\n {\n if($this->limite == 0 OR $this->offset() == 0){\n\t $sql = $this->sql . \"\";\n\t return $sql;\n\t}\n else{\n $sql = $this->sql . \" LIMIT {$this->limite} OFFSET {$this->offset()} \";\n\treturn $sql;\n }\n }", "protected function getLimit(\\codename\\core\\model\\plugin\\limit $limit) : string {\r\n if ($limit->limit > 0) {\r\n return \" LIMIT \" . $limit->limit . \" \";\r\n }\r\n return '';\r\n }", "function limit ($limit, $offset = null) {\n\t\tif ($limit) {\n\t\t\t$rt = '';\n\t\t\tif (!strpos(strtolower($limit), 'limit') || strpos(strtolower($limit), 'limit') === 0) {\n\t\t\t\t$rt = ' LIMIT';\n\t\t\t}\n\t\t\t$rt .= ' ' . $limit;\n\t\t\tif ($offset) {\n\t\t\t\t$rt .= ' OFFSET ' . $offset;\n\t\t\t}\n\t\t\treturn $rt;\n\t\t}\n\t\treturn null;\n\t}", "public function limit($limit) {\r\n\t\t$this->query .= \" LIMIT \" . $limit;\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "private function _limit($numRows) \n\t{\n\t\t$this->_query .= \" LIMIT \" . ( int ) $numRows;\n\t}", "public function limit($limit,$offset = null)\n {\n $this->_limitStr = \" LIMIT \".intval($limit);\n if (!is_null($offset)) {\n $this->_limitStr .= ', '.intval($offset);\n }\n\n return $this;\n }", "protected function getLimitClause(array $params)\n {\n $offset = isset($params['page']) ? sprintf('OFFSET %d', $params['page']) : '';\n $limit = isset($params['perPage']) ? sprintf('LIMIT %d', $params['perPage']) : '';\n return $limit . ' ' . $offset;\n }", "public /*overrides*/ function getLimitSubquery()\n {\n $map = reset($this->_queryComponents);\n $table = $map['table'];\n $componentAlias = key($this->_queryComponents);\n\n // get short alias\n $alias = $this->getSqlTableAlias($componentAlias);\n\n $driverName = $this->_conn->getAttribute(Doctrine_Core::ATTR_DRIVER_NAME);\n\n // initialize the base of the subquery\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n $subquery = 'SELECT ';\n } else {\n $subquery = 'SELECT DISTINCT ';\n }\n // what about composite keys?\n if (is_array($table->getIdentifier())) {\n foreach ($table->getIdentifier() as $id) {\n $primaryKey[] = $this->_conn->quoteIdentifier($alias . '.' . $id);\n }\n $subquery .= join(', ', $primaryKey);\n } else {\n $primaryKey = $alias . '.' . $table->getColumnName($table->getIdentifier());\n $subquery .= $this->_conn->quoteIdentifier($primaryKey);\n }\n\n // pgsql & oracle need the order by fields to be preserved in select clause\n if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {\n foreach ($this->_sqlParts['orderby'] as $part) {\n // Remove identifier quoting if it exists\n $e = $this->_tokenizer->bracketExplode($part, ' ');\n foreach ($e as $f) {\n if ($f == 0 || $f % 2 == 0) {\n $partOriginal = str_replace(',', '', trim($f));\n $callback = create_function('$e', 'return trim($e, \\'[]`\"\\');');\n $part = trim(implode('.', array_map($callback, explode('.', $partOriginal))));\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n // don't add functions\n if (strpos($part, '(') !== false) {\n continue;\n }\n\n // don't add primarykey column (its already in the select clause)\n if ($part !== $primaryKey) {\n $subquery .= ', ' . $partOriginal;\n }\n }\n }\n }\n }\n\n $orderby = $this->_sqlParts['orderby'];\n $having = $this->_sqlParts['having'];\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n $subquery .= ', ' . $expr[0] . ' AS ' . $this->_aggregateAliasMap[$dqlAlias];\n }\n }\n } else {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n foreach ($having as $k => $v) {\n $having[$k] = str_replace($this->_aggregateAliasMap[$dqlAlias], $expr[0], $v);\n }\n foreach ($orderby as $k => $v) {\n $e = explode(' ', $v);\n if ($e[0] == $this->_aggregateAliasMap[$dqlAlias]) {\n $orderby[$k] = $expr[0];\n }\n }\n }\n }\n }\n\n // Add having fields that got stripped out of select\n preg_match_all('/`[a-z0-9_]+`\\.`[a-z0-9_]+`/i', implode(' ', $having), $matches, PREG_PATTERN_ORDER);\n if (count($matches[0]) > 0) {\n $subquery .= ', ' . implode(', ', array_unique($matches[0]));\n }\n\n $subquery .= ' FROM';\n\n foreach ($this->_sqlParts['from'] as $part) {\n // preserve LEFT JOINs only if needed\n if (substr($part, 0, 9) === 'LEFT JOIN') {\n $e = explode(' ', $part);\n // Fix for http://www.doctrine-project.org/jira/browse/DC-706\n // Fix for http://www.doctrine-project.org/jira/browse/DC-594\n if (empty($this->_sqlParts['orderby']) && empty($this->_sqlParts['where']) && empty($this->_sqlParts['having']) && empty($this->_sqlParts['groupby'])) {\n continue;\n }\n }\n\n $subquery .= ' ' . $part;\n }\n\n // all conditions must be preserved in subquery\n $subquery .= ( ! empty($this->_sqlParts['where']))? ' WHERE ' . implode(' ', $this->_sqlParts['where']) : '';\n $subquery .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : '';\n $subquery .= ( ! empty($having))? ' HAVING ' . implode(' AND ', $having) : '';\n $subquery .= ( ! empty($orderby))? ' ORDER BY ' . implode(', ', $orderby) : '';\n\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n // When using \"ORDER BY x.foo\" where x.foo is a column of a joined table,\n // we may get duplicate primary keys because all columns in ORDER BY must appear\n // in the SELECT list when using DISTINCT. Hence we need to filter out the\n // primary keys with an additional DISTINCT subquery.\n // #1038\n $quotedIdentifierColumnName = $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()));\n $subquery = 'SELECT doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' FROM (' . $subquery . ') doctrine_subquery_alias'\n . ' GROUP BY doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' ORDER BY MIN(ROWNUM)';\n }\n\n // add driver specific limit clause\n $subquery = $this->_conn->modifyLimitSubquery($table, $subquery, $this->_sqlParts['limit'], $this->_sqlParts['offset']);\n\n $parts = $this->_tokenizer->quoteExplode($subquery, ' ', \"'\", \"'\");\n\n foreach ($parts as $k => $part) {\n if (strpos($part, ' ') !== false) {\n continue;\n }\n\n $part = str_replace(array('\"', \"'\", '`'), \"\", $part);\n\n if ($this->hasSqlTableAlias($part)) {\n $parts[$k] = $this->_conn->quoteIdentifier($this->generateNewSqlTableAlias($part));\n continue;\n }\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\.[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('.', $match);\n\n // Rebuild the original part without the newly generate alias and with quoting reapplied\n $e2 = array();\n foreach ($e as $k2 => $v2) {\n $e2[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n $match = implode('.', $e2);\n\n // Generate new table alias\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n // Requote the part with the newly generated alias\n foreach ($e as $k2 => $v2) {\n $e[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n\n $replace = implode('.' , $e);\n\n // Replace the original part with the new part with new sql table alias\n $parts[$k] = str_replace($match, $replace, $parts[$k]);\n }\n }\n\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($parts as $k => $part) {\n if (strpos($part, \"'\") !== false) {\n continue;\n }\n if (strpos($part, '__') == false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\_\\_[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('__', $match);\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n $parts[$k] = str_replace($match, implode('__', $e), $parts[$k]);\n }\n }\n }\n\n $subquery = implode(' ', $parts);\n return $subquery;\n }", "public function get($limit='')\n {\n if(!empty($limit))\n {\n $limit = ' LIMIT ' . $limit;\n }\n\n $sql = 'SELECT ' . $this->select\n . ' FROM ' . $this->dbName. '.'.$this->table\n . $this->join\n . $this->where\n . $this->groupBy\n . $this->orderBy\n . $limit;\n\n $this->query = $sql;\n return $this->query;\n }", "public function limit($limit, $offset = null)\n {\n if ($limit) {\n $rt = '';\n if (!strpos(strtolower($limit), 'limit') || strpos(strtolower($limit), 'limit') === 0) {\n $rt = ' LIMIT';\n }\n $rt .= ' '.$limit;\n if ($offset) {\n $rt .= ' OFFSET '.$offset;\n }\n\n return $rt;\n }\n }", "function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) \r\n\t {\r\n\t $offsetStr = ($offset >= 0) ? \" OFFSET $offset\" : '';\r\n\t $limitStr = ($nrows >= 0) ? \" LIMIT $nrows\" : '';\r\n\t return $secs2cache ?\r\n\t $this->CacheExecute($secs2cache,$sql.\"$limitStr$offsetStr\",$inputarr,$arg3)\r\n\t :\r\n\t $this->Execute($sql.\"$limitStr$offsetStr\",$inputarr,$arg3);\r\n\t }", "public function get_sql_limit($default = '')\n {\n $sql_limit = \"\";\n $limit = rest::request()->get(\"limit\", $default);\n if (isset($limit) && is_numeric($limit)) {\n $limit = (int) $limit;\n $sql_limit .= \"LIMIT \".$limit;\n\n $page = rest::request()->get(\"page\");\n if (isset($page) && is_numeric($page)) {\n $page = (int) $page;\n if (!$page) {\n throw new rest_error(400, \"Parámetro 'page' invalido. Se esperaba un valor mayor o igual que 1 y se recibio '$page'\");\n }\n $offset = ($page - 1) * $limit;\n $sql_limit .= \" OFFSET \".$offset;\n }\n }\n\n return $sql_limit;\n }", "public function getQuery()\n {\n $query = parent::getQuery();\n if ( $this->hasLimit )\n {\n if ( $this->offset) \n {\n if ( !$this->orderString ) \n {\n // Uh ow. We need some columns to sort in the oposite order to make this work\n throw new ezcQueryInvalidException( \"LIMIT workaround for MS SQL\", \"orderBy() was not called before getQuery().\" );\n }\n return 'SELECT * FROM ( SELECT TOP ' . $this->limit . ' * FROM ( ' . self::top( $this->offset + $this->limit, $query ) . ' ) AS ezcDummyTable1 ' . $this->invertedOrderString . ' ) AS ezcDummyTable2 ' . $this->orderString;\n }\n return self::top( $this->limit, $query );\n }\n return $query;\n }", "protected function buildLimits(Query $query)\n {\n return $query->getLimit() !== null ? ' LIMIT '.$query->getLimit() : '';\n }", "public function sqlQuery($sqlQuery, $limit = PHP_INT_MAX, $offset = 0);", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "function fetch_query($condition, $limit = 0, $offset = 0)\n\t{\n\t\t$query = \"SELECT * FROM \" . TABLE_PREFIX . \"threadrate AS threadrate\";\n\t\tif ($condition)\n\t\t{\n\t\t\t$query .= \" WHERE $condition\";\n\t\t}\n\n\t\t$limit = intval($limit);\n\t\t$offset = intval($offset);\n\t\tif ($limit)\n\t\t{\n\t\t\t$query .= \" LIMIT $offset, $limit\";\n\t\t}\n\n\t\treturn $query;\n\t}", "public function limit($limit, $context)\n\t{\n\t\tif (!$limit) {\n\t\t\treturn;\n\t\t}\n\t\tif ($offset = $context->offset() ? : '') {\n\t\t\t$offset = \" OFFSET {$offset}\";\n\t\t}\n\t\treturn \"LIMIT {$limit}{$offset}\";\n\t}", "public function limit($limit) {\r\n $this->sqlLimit = $limit;\r\n return $this;\r\n }", "abstract public function _limit($str, $limit, $offset = false);", "protected function getLimit() {\n if (isset($this->data['page'])) { // ...in the main table while pagination is used\n $l1 = ($this->data['page'] - 1) * $this->posts_per_page;\n $l2 = $this->posts_per_page;\n $limit = \"$l1, $l2\";\n }\n else $limit = \"0, \".$this->posts_per_page;\n return $limit;\n }", "public function limit($limit)\n {\n return $this->query->limit($limit);\n }", "function sqladdlimit($cpage=1)\r\n{\r\n if($cpage<1||$cpage>$this->page_count)$cpage=1;\r\n $cpage--;\r\n $query=\" Limit \".($cpage * $this->page_set).\",\".$this->page_set ;\r\n return $query;\r\n}", "private function topEnSql($query){\n $sql = mb_strtolower(trim($query));\n $substr = 'select';\n $attachment = ' top 10 ';\n return str_replace($substr, $substr.$attachment, $sql);\n }", "function AddTop($strSQL, $n)\n{\n\t$tstr = strtoupper($strSQL);\n\t$ind1 = strpos($tstr,\"SELECT\");\n\treturn substr($strSQL,0,$ind1+6).\" top \".$n.\" \".substr($strSQL,$ind1+6);\n}", "function getLimitString($nPageNo, $iRowPerPage)\n\t{\n\t\t$sReturn = '';\n\t\tif (isset($iRowPerPage) && $iRowPerPage>0)\n\t\t{\n\t\t\tif($nPageNo == 0 || is_null($nPageNo))\n\t\t\t{\n\t\t\t\t$nPageNo = 1;\n\t\t\t}\n\t\t\t$iOffset = ($nPageNo-1)*$iRowPerPage;\n\t\t\t$sReturn = \" LIMIT \".$iRowPerPage.\" OFFSET \" . $iOffset;\n\t\t}\n\t\treturn $sReturn;\n\t}", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "function addLimit( $limit , $offset )\n{\n\tif(!empty($limit))\n\t{\n\t\t$limit = ($limit < 0)?0:$limit;\n\t\tif(!empty($offset) )\n\t\t{\n\t\t\t$offset = ($offset < 0)?0:$offset;\n\t\t\treturn \" LIMIT $offset , $limit \" ;\n\t\t}\n\t\telse\n\t\t\treturn \" LIMIT 0 , $limit \" ;\n\t}\n\telse\n\t\treturn \" LIMIT 0 , 10 \" ;\n}", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "static private function top( $rowCount, $query )\n {\n return 'SELECT TOP ' . $rowCount . substr( $query, strlen( 'SELECT' ) );\n }", "private function _limit($sqlStatement, $number = 1){\n\t\treturn $this->_db->limit($sqlStatement, $number);\n\t}", "public function limit($limit = 10, $offset = 0): Database\n {\n $this->query .= 'LIMIT ' . $limit . ' OFFSET ' . $offset . ' ';\n return $this;\n }", "public function applyLimitOffset($sql, $limit=-1, $offset=-1)\n\t{\n\t\t$limit = $limit!==null ? intval($limit) : -1;\n\t\t$offset = $offset!==null ? intval($offset) : -1;\n\t\tif($limit > 0 || $offset > 0)\n\t\t{\n\t\t\t$limitStr = ' LIMIT '.$limit;\n\t\t\t$offsetStr = $offset >= 0 ? ' OFFSET '.$offset : '';\n\t\t\treturn $sql.$limitStr.$offsetStr;\n\t\t}\n\t\telse\n\t\t\treturn $sql;\n\t}", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function limit($str) \n {\n $this->_data['limit'] = $str;\n $this->_data['query'] .= ' LIMIT '.$str;\n return $this;\n }", "public static function limit($limit);", "function limit_offset($limit = 0, $offset = 0) {\r\n \tif (!$limit) return false;\r\n\r\n \tif ($offset) {\r\n \t\treturn \" LIMIT $offset, $limit\";\r\n \t} else {\r\n \t\treturn \" LIMIT $limit\";\r\n \t}\r\n }", "public function limit($limit = null, $offset = 0) {\n if($limit) {\n $this->limit = 'LIMIT '.floor($offset).', '.floor($limit);\n } else {\n $this->limit = '';\n }\n return $this;\n }", "public function limit($limit);", "public function limit($limit);", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "private function getPositionSubSql() {\n\t\t$table = $this->query->getTableMap()::TABLE_NAME;\n\t\t$col = Model::aliasproperty('id');\n\t\t$sql = \"SELECT $col, @rownum := @rownum + 1 AS position FROM $table\";\n\t\t$whereClause = $this->getWhereClauseString();\n\n\t\tif (empty($whereClause) === false) {\n\t\t\t$sql .= ' WHERE ' . $whereClause;\n\t\t}\n\t\treturn $sql;\n\t}", "public function limit($start, $end = '')\n {\n if(!$this->query)\n {\n return false;\n }\n \n $this->query .= 'LIMIT ';\n $start = intval($start);\n \n if(empty($end))\n {\n $this->query .= $start . ' '; \n }\n else\n {\n $end = intval($end);\n $this->query .= $start . ', ' . $end . ' ';\n } \n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function limit($limit, $offset = 0)\n {\n $limit = intval($limit);\n $offset = intval($offset);\n $this->limit_str = \"{$offset}, {$limit}\";\n return $this;\n }", "function getString($usingLimits = true, $count = false) {\n $out = array('SELECT');\n $this->fieldsToString($out, $count);\n $out[] = 'FROM';\n $out[] = (string)$this->table;\n if($this->_joins) {\n $out[] = (string)implode(' ', $this->_joins);\n }\n if($this->_where) {\n $where = (string)$this->_where;\n if ($where) {\n $out[] = 'WHERE';\n $out[] = $where;\n }\n }\n if($this->_order && !$count) {\n $out[] = 'ORDER BY';\n $out[] = implode(', ', $this->_order);\n }\n if($usingLimits && !$count && $this->_limit) {\n $this->limitToString($out);\n }\n return implode(' ', $out);\n }", "public function limit($limit,$offset);", "public function limit($limit)\t{\n\t\t$this->limit = array(\"LIMIT $limit\");\n\t\treturn $this;\n\t}", "function modifyLimitQuery($query, $from, $count)\n {\n $this->limit_from = $from;\n $this->limit_count = $count;\n return $query;\n }", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function addLimit($amt, $offset = \"0\") {\n $this->sql .= \" LIMIT $offset, $amt\";\n }", "function limit($count) {\n\t\t$this->appendStmt('limit', \"LIMIT ?\", [$count]);\n\t\treturn $this;\n\t}", "public function limit($limit, $offset = null);", "function limit($limit, $offset = 0)\n{\n\t$this->tryModify();\n\t$this->query['limit'] = array((int)$limit, (int)$offset);\n\treturn $this;\n}", "public function limit($x, $y = 0)\n {\n // Alittle cleaning\n $x = $this->clean($x);\n $y = $this->clean($y);\n \n // Creat an offset if we have one, then build the sql statement\n $offset = ($y != 0) ? \" OFFSET \". $y : \"\";\n $this->sql .= \" LIMIT \". $x . $offset;\n return $this;\n }", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') {\n \n $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n \n // trace query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n #$this->logQuery($debugQuery); // activate for debugging purposes only - no logging by default for non-modifying queries like selects!\n \n return $query;\n \n }", "public function LIMIT_string($str) {\n\t\t$row_count = (int)$str;\n\t\t$offset = null;\n\n\t\t/* Check for \"offset, row_count\" notation */\n\t\tif (preg_match('/(\\d+)[, ]\\s{0,2}(\\d+)/', $str, $mc)) {\n\t\t\tlist($tmp, $offset, $row_count) = $mc;\n\t\t} else \n\t\t/* Check for \"row_count OFFSET offset\" notation */\n\t\tif (preg_match('/(\\d+)\\sOFFSET\\s(\\d+)/', $str, $mc)) {\n\t\t\tlist($tmp, $row_count, $offset) = $mc;\n\t\t}\n\n\t\t$this->LIMIT_once($offset, $row_count);\n\t}", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "public function getJoinLimit()\n {\n return $this->get(self::_JOIN_LIMIT);\n }", "public function limit($limit = \"\"){\n\t\t\tif(is_numeric($limit)){\n\t\t\t\t$this->limit = \" LIMIT :limit\";\n\t\t\t\t$this->addParam(\"limit\", $limit);\n\t\t\t}else{\n\t\t\t\t$this->limit = false;\n\t\t\t\tunset($this->parameters[\"limit\"]);\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function limit(int $limit, int $offset);", "public function getSQL($limit='unset',$num='unset',$pageless='unset') \n {\n\t\tif ($limit != 'unset'){$limit_per_page = $limit;}\n\t\telse {$limit_per_page = $this->getLimitPerPage();}\n \n $offset = $this->getOffset($limit); \n\t\t\n\t\tif ($num != 'unset')\n\t {\n\t\t if ($limit == 'All' || $limit == 'all' || $limit == 'ALL'){ $ret = $this->_sql;}\n\t\t \n\t\telse \n\t\t{\n\t$ret = str_replace( '{numspace}', \" LIMIT {$limit_per_page} OFFSET {$offset} \", $this->_numsql );\t\t\t\n\t\t}\n\t\t}\t\t\n\t\telse\n\t\t{\n\t\t\tif ($limit == 'All'){ $ret = $this->_sql;}\n\t\t\telse $ret = $this->_sql . \" LIMIT {$limit_per_page} OFFSET {$offset} \";\n\t\t}\t\n\t\tif ($pageless != 'unset'){$ret = $this->_sql;}\n\t\t$results = $this->connection($ret);\n\t\t$this->bull = $ret; \n\t\t\n return $results;\n \n }", "public function limit($limit)\r\n {\r\n $this->query->limit($limit);\r\n \r\n return $this;\r\n }", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "public function getQueryLimit() {\n\t\treturn $this->queryLimit;\n\t}" ]
[ "0.7842032", "0.7774762", "0.762396", "0.7582403", "0.7451979", "0.7380278", "0.7359524", "0.7355495", "0.7307751", "0.7297185", "0.7230373", "0.72080284", "0.71682703", "0.70811343", "0.7032517", "0.70161337", "0.699707", "0.69904554", "0.689428", "0.6830767", "0.6828416", "0.6805465", "0.67826205", "0.6767783", "0.67027354", "0.6690245", "0.66620743", "0.6613837", "0.66016346", "0.6525448", "0.65002394", "0.64795464", "0.64445573", "0.6412752", "0.6409483", "0.639946", "0.63885677", "0.63853174", "0.6380535", "0.6342449", "0.63337195", "0.6331316", "0.6318204", "0.63153917", "0.63109595", "0.62931675", "0.6284056", "0.62711257", "0.62651455", "0.62639546", "0.62535423", "0.62078094", "0.62010163", "0.61915475", "0.6187559", "0.6185934", "0.61516225", "0.6137125", "0.61348313", "0.6109043", "0.60575324", "0.60379636", "0.602522", "0.600867", "0.6006772", "0.59686995", "0.59560496", "0.59481233", "0.59368587", "0.5916572", "0.5913896", "0.5880943", "0.58651644", "0.5850693", "0.5845588", "0.5845588", "0.58288544", "0.582858", "0.5827796", "0.582681", "0.58224034", "0.5801162", "0.5796217", "0.57719594", "0.5765326", "0.575996", "0.5755179", "0.57526875", "0.5743082", "0.5738448", "0.5736682", "0.57231706", "0.5721065", "0.5718527", "0.57026035", "0.5701527", "0.569685", "0.56871706", "0.56683886", "0.56649816" ]
0.59815365
65
Constructs the ORDER BY clause string for the SELECT query.
private function constructOrderByStringStatic(&$tablesUsed, $orderBy) { $orderByStrings = array(); foreach ($orderBy as &$clause) { list($column, $ascDesc) = $clause; $canonical = $this->canonicalizeColumn($column, false, $tablesUsed); $orderByStrings[] = "{$canonical} {$ascDesc}"; } return implode(', ', $orderByStrings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrderByClause() {\n\n\t\ttx_pttools_assert::isTrue($this->isSortable, array('message' => 'This column is not sortable'));\n\t\tswitch ($this->sortingState) {\n\t\t\tcase self::SORTINGSTATE_NONE: {\n\t\t\t\t$orderBy = '';\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_ASC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'ASC');\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_DESC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'DESC');\n\t\t\t} break;\n\n\t\t\tdefault: {\n\t\t\t\tthrow new tx_pttools_exception('Invalid sorting state!');\n\t\t\t} break;\n\t\t}\n\t\treturn $orderBy;\n\t}", "protected function compileOrderByStatement()\n {\n if (is_array($this->builderCache->orderBy) && count($this->builderCache->orderBy) > 0) {\n for ($i = 0, $c = count($this->builderCache->orderBy); $i < $c; $i++) {\n if ($this->builderCache->orderBy[ $i ][ 'escape' ] !== false\n && ! $this->isLiteral(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n )\n ) {\n $this->builderCache->orderBy[ $i ][ 'field' ] = $this->conn->protectIdentifiers(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n );\n }\n\n $this->builderCache->orderBy[ $i ] = $this->builderCache->orderBy[ $i ][ 'field' ]\n . $this->builderCache->orderBy[ $i ][ 'direction' ];\n }\n\n return $this->builderCache->orderBy = \"\\n\" . sprintf(\n 'ORDER BY %s',\n implode(', ', $this->builderCache->orderBy)\n );\n } elseif (is_string($this->builderCache->orderBy)) {\n return $this->builderCache->orderBy;\n }\n\n return '';\n }", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "protected function buildOrderClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_orders)>0) {\r\n\t\t\t$sql.=' ORDER BY '.implode(', ', $this->_salt_orders);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "function get_order_by_clause() {\n $result = parent::get_order_by_clause();\n\n //make sure the result is actually valid\n if ($result != '') {\n //always sort by course in addition to everything else\n $result .= ', coursename, courseid';\n }\n\n return $result;\n }", "private function makeOrderingSQL($order_by) {\n $all_columns = \"\";\n if (is_array($order_by))\n {\n foreach ($order_by as $column_name)\n\t{\n\t $all_columns .= $column_name . ', ';\n\t}\n $all_columns = rtrim($all_columns, ', ');\n }\n else\n {\n $all_columns = $order_by;\n }\n return 'ORDER BY ' . $all_columns;\n}", "protected function _compile_order_by()\n\t{\n\t\tif (is_array($this->qb_orderby) && count($this->qb_orderby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_orderby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\tif ($this->qb_orderby[$i]['escape'] !== FALSE && ! $this->_is_literal($this->qb_orderby[$i]['field']))\n\t\t\t\t{\n\t\t\t\t\t$this->qb_orderby[$i]['field'] = $this->protect_identifiers($this->qb_orderby[$i]['field']);\n\t\t\t\t}\n\n\t\t\t\t$this->qb_orderby[$i] = $this->qb_orderby[$i]['field'].$this->qb_orderby[$i]['direction'];\n\t\t\t}\n\n\t\t\treturn $this->qb_orderby = \"\\nORDER BY \".implode(', ', $this->qb_orderby);\n\t\t}\n\t\telseif (is_string($this->qb_orderby))\n\t\t{\n\t\t\treturn $this->qb_orderby;\n\t\t}\n\n\t\treturn '';\n\t}", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "public function getOrderBy()\n\t{\n\t\t$sort = $this->getSessionOrderBy();\n\t\treturn BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sort);\n\t}", "public function getOrderBy()\n\t{\n\t\t$sort = $this->getSessionOrderBy();\n\t\treturn BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sort);\n\t}", "function get_sql_order(){\r\n\r\n\t\tif(stripos($this->sql_query,' ORDER BY ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '),stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' ORDER BY '));\r\n\t\t\telse\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '));\r\n\t\t}else{\r\n\t\t\t$order_str_ini='';\r\n\t\t}\r\n\r\n\t\t$order_str='';\r\n\t\t$arr_new_cols=array();\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++){\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\t\t\t$arr_new_cols[]=$this->extra_cols[$i][0];\r\n\t\t}\r\n\r\n\t\t$arr_sort=explode('_',$this->sort);\r\n\t\tasort($arr_sort);\r\n\r\n\t\tforeach($arr_sort as $key => $value){\r\n\r\n\t\t\tif(!in_array($key+1,$arr_new_cols)){\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='a')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' ASC';\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='d')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' DESC';\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn $order_str_ini.$order_str;\r\n\t}", "public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }", "public function get_sql_sort() {\n $sort = parent::get_sql_sort();\n\n return $sort . ', s.id DESC';\n }", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "function GetOrderBy() {\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql(\"\", \"\", \"\", \"\", $this->getSqlOrderBy(), \"\", $sSort);\n\t}", "protected function getSortString()\n {\n $query = '';\n if (!empty($this->sort)) {\n $sort = implode(', ', $this->sort);\n $query = self::TAB_SEPARATOR . \"SORT \" . $sort . self::LINE_SEPARATOR;\n }\n return $query;\n }", "function get_sql_sort() {\n $order = parent::construct_order_by($this->get_sort_columns());\n\n $defaultorder = array(\n 'problem_label' => 'ASC',\n 'difficulty_points' => 'ASC'\n );\n\n if ($order == '') {\n foreach ($defaultorder as $key => $value) {\n if (strpos($order, $key) === false) {\n $order = \"$key $value, $order\";\n }\n }\n }\n\n return trim($order, \", \");\n }", "private function _buildOrderClause()\n {\n $order = array();\n\n switch ( $this->orderby ) {\n case self::ORDERBY_DATE:\n $order[] = 'date_enreg' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_BEGIN_DATE:\n $order[] = 'date_debut_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_END_DATE:\n $order[] = 'date_fin_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_MEMBER:\n $order[] = 'nom_adh' . ' ' . $this->ordered;\n $order[] = 'prenom_adh' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_TYPE:\n $order[] = ContributionsTypes::PK;\n break;\n case self::ORDERBY_AMOUNT:\n $order[] = 'montant_cotis' . ' ' . $this->ordered;\n break;\n /*\n Hum... I really do not know how to sort a query with a value that\n is calculated code side :/\n case self::ORDERBY_DURATION:\n break;*/\n default:\n $order[] = $this->orderby . ' ' . $this->ordered;\n break;\n }\n\n return $order;\n }", "public function build_order_by( $order_by, $order = 'ASC' ) {\n if ( empty( $order_by ) ) {\n return '';\n }\n $sql = ' ORDER BY ' . $this->get_row_suffix() . $order_by;\n if ( ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {\n $order = 'ASC';\n }\n\n return $sql . ' ' . $order . ' ';\n }", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = '';\n\t\t\t\t$sort = $this->fields_arr['orderby_field'];\n\t\t\t\t$orderBy = $this->fields_arr['orderby'];\n\t\t\t\tif ($sort AND $orderBy)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sql_sort = ' '.$sort.' '.$orderBy;\n\t\t\t\t\t}\n\t\t\t}", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}", "protected function _appendOrderByClause(Zend_Db_Select $query)\n {\n $order = strtoupper($this->_getParam($this->_orderKey, $this->_defaultOrderDirection));\n $orderBy = $this->_getParam($this->_orderByKey, $this->_defaultOrderColumn);\n \n if (in_array($orderBy, $this->_getTable()->info('cols'))) {\n $this->view->order = $order;\n $this->view->orderBy = $orderBy;\n \n $query->order($orderBy . ' ' . $order);\n }\n \n return $query;\n }", "function getOrderBySQL($orderBys)\n{\n $SQL = '';\n if( count($orderBys) > 0 ){\n $SQL .= ' ORDER BY ';\n $obSQLs = array();\n foreach( $orderBys as $obField => $desc ){\n if( $desc ){\n $obSQLs[] = $obField . ' DESC';\n }else{\n $obSQLs[] = $obField;\n }\n }\n $SQL .= join(',',$obSQLs);\n }\n return $SQL;\n}", "function _order_by ($identifier_array, $o = TRUE) {\n\t\t$statement = '';\n\t\tif ( !isset($identifier_array) || !$identifier_array ) {\n\t\t\treturn $statement;\n\t\t}\n\t\t$statement .= $o ? ' ORDER BY ' : ' ';\n\t\t$c = count($identifier_array);\n\t\tfor ($count = 0; $count < $c; $count++) {\n\t\t\t$query_array = $identifier_array[$count]; \n\t\t\t$statement .= '`'. $query_array['column_name'] . '` ';\n\t\t\tif ($count == $c - 1) {\n\t\t\t\t$statement .= $query_array['asc_desc'] . ' ';\n\t\t\t} else {\n\t\t\t\t$statement .= $query_array['asc_desc'] . ', ';\n\t\t\t}\n\t\t}\n\t\treturn $statement;\n\t}", "public function makeOrderBy( $options ) {\n\t\tif ( isset( $options['ORDER BY'] ) ) {\n\t\t\t$ob = is_array( $options['ORDER BY'] )\n\t\t\t\t? implode( ',', $options['ORDER BY'] )\n\t\t\t\t: $options['ORDER BY'];\n\n\t\t\treturn ' ORDER BY ' . $ob;\n\t\t}\n\n\t\treturn '';\n\t}", "protected function compileOrder(CompilableClause $query)\n {\n if (empty($query->statements['orders'])) {\n return '';\n }\n\n $sql = [];\n\n foreach ($query->statements['orders'] as $part) {\n if ($part['sort'] instanceof ExpressionInterface) {\n $part['sort'] = $part['sort']->build($query, $this);\n } else {\n $part['sort'] = $this->quoteIdentifier($query, $query->preprocessor()->field($part['sort']));\n }\n\n $sql[] = $part['sort'].' '.$part['order'];\n }\n\n return ' ORDER BY '.implode(', ', $sql);\n }", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "public function orderBy(){\r\n $this->orderBy = \"ORDER BY \";\r\n $args = func_get_args();\r\n foreach($args as $arg){\r\n $this->orderBy.= $this->db->formatTableName($arg);\r\n if(end($args) !== $arg){\r\n $this->orderBy.=\", \";\r\n } \r\n\r\n }\r\n return $this;\r\n }", "public function toSQL(Parameters $params, bool $inner_clause)\n {\n $drv = $params->getDriver();\n $clauses = $this->getClauses();\n\n $strs = array();\n foreach ($clauses as $clause)\n $strs[] = $drv->toSQL($params, $clause);\n\n if (count($strs) === 0)\n return;\n\n return \"ORDER BY \" . implode(\", \", $strs);\n }", "function ajan_esc_sql_order( $order = '' ) {\n\t$order = strtoupper( trim( $order ) );\n\treturn 'DESC' === $order ? 'DESC' : 'ASC';\n}", "public function order_by() {\r\n\t\t$fields = func_get_args();\r\n\r\n\t\t// Loop through the columns\r\n\t\tfor ( $i = 0; $i < intval( $_GET['iSortingCols'] ); $i++ ) {\r\n\t\t\t// Add the necessary comman\r\n\t\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t\t$this->order_by .= ',';\r\n\t\t\t\r\n\t\t\t// Compile the fields\r\n\t\t\t$this->order_by .= $fields[$_GET['iSortCol_' . $i]] . ' ' . $_GET['sSortDir_' . $i];\r\n\t\t}\r\n\t\t\r\n\t\t// If it's not empty\r\n\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t$this->order_by = ' ORDER BY ' . $this->order_by;\r\n\t}", "public function getQuery()\n {\n $query = parent::getQuery();\n if ( $this->hasLimit )\n {\n if ( $this->offset) \n {\n if ( !$this->orderString ) \n {\n // Uh ow. We need some columns to sort in the oposite order to make this work\n throw new ezcQueryInvalidException( \"LIMIT workaround for MS SQL\", \"orderBy() was not called before getQuery().\" );\n }\n return 'SELECT * FROM ( SELECT TOP ' . $this->limit . ' * FROM ( ' . self::top( $this->offset + $this->limit, $query ) . ' ) AS ezcDummyTable1 ' . $this->invertedOrderString . ' ) AS ezcDummyTable2 ' . $this->orderString;\n }\n return self::top( $this->limit, $query );\n }\n return $query;\n }", "protected function _stringOrderBy($orderBy) \n\t{\n\t\t$result = 'ORDER BY ';\n\t\t//if is string, explode it!\n\t\tif (!is_array($orderBy)) {\n\t\t\t$orderBy = explode(' ', $orderBy);\n\t\t}\n\n\t\t$result .= '`' . $orderBy[0] . '` ' . strtoupper($orderBy[1]);\n\n\t\treturn $result;\n\t}", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "function getOrderingAndPlaygroundQuery()\n\t{\n\t\treturn 'SELECT ordering AS value,name AS text FROM #__joomleague_playground ORDER BY ordering';\n\t}", "private function getOrderString() {\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $order = '';\r\n if (isset($this->resource->requestData['order']) && count($this->resource->requestData['order'])) {\r\n $orderBy = array();\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n for ($i = 0, $ien = count($this->resource->requestData['order']); $i < $ien; $i++) {\r\n // Convert the column index into the column data property\r\n $columnIdx = intval($this->resource->requestData['order'][$i]['column']);\r\n $requestColumn = $this->resource->requestData['columns'][$columnIdx];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['orderable'] == 'true') {\r\n $dir = $this->resource->requestData['order'][$i]['dir'] === 'asc' ? 'ASC' : 'DESC';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $orderBy[] = $fld[0] . '.' . $fld[1] . \" \" . $dir;\r\n } else {\r\n\r\n $orderBy[] = $column['db'] . \" \" . $dir;\r\n }\r\n }\r\n }\r\n $order = implode(', ', $orderBy);\r\n }\r\n return $order;\r\n }", "private function buildOrderBy() {\n\t\t$hasorderby = false;\n\t\tforeach($this->ordergroup as $key=>$extra) {\n\t\t\tif(strpos(strtoupper($extra), 'ORDER BY') !== false) {\n\t\t\t\t$this->orders[] = str_replace('ORDER BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'LIMIT') !== false) {\n\t\t\t\t$this->limit = $extra;\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'GROUP BY') !== false) { \n\t\t\t\t$this->groups[] = str_replace('GROUP BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t}\n\t}", "protected function prepareOrderByStatement() {}", "protected function setOrder() {\r\n if( $this->sqlOrderBy ) {\r\n $this->sql .= ' ORDER BY ' . $this->sqlOrderBy;\r\n }\r\n }", "public function orderBy($sql);", "protected function buildOrders(Query $query)\n {\n return count($query->getOrder()) > 0 ? ' ORDER BY '.implode(',', $query->getOrder()) : '';\n }", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "function _buildContentOrderBy($q = false)\n\t{\n\t\t$filter_order = $this->getState('filter_order');\n\t\t$filter_order_Dir = $this->getState('filter_order_Dir');\n\n\t\tif ($filter_order=='a.filename_displayed') $filter_order = ' CASE WHEN a.filename_original<>\"\" THEN a.filename_original ELSE a.filename END ';\n\t\t$orderby \t= ' ORDER BY '.$filter_order.' '.$filter_order_Dir.', a.filename';\n\n\t\treturn $orderby;\n\t}", "function _buildContentOrderBy() {\r\n\t\tglobal $mainframe, $context;\r\n\t\t\r\n\t\t$filter_order = $mainframe->getUserStateFromRequest ( $context . 'filter_order', 'filter_order', '1' );\r\n\t\t$filter_order_Dir = $mainframe->getUserStateFromRequest ( $context . 'filter_order_Dir', 'filter_order_Dir', '' );\r\n\t\t\r\n\t\tif ($filter_order == 'h.ordering' || $filter_order == 'ordering') {\r\n\t\t\t$orderby = ' ORDER BY 1 ';\r\n\t\t} else {\r\n\t\t\t$orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir;\r\n\t\t}\r\n\t\treturn $orderby;\r\n\t}", "public static function getRawQueryOrderClause($sidx, $sord)\n {\n if (!empty($sidx) && !empty($sord)) {\n return sprintf(' ORDER BY %s', \\SQLite3::escapeString($sidx . ' ' . $sord));\n }\n return '';\n }", "public function buildOrderBy(array $orderBy = null, array &$values = [])\n {\n if ($orderBy === null) {\n return '';\n }\n\n $sql = [];\n\n foreach ($orderBy as $column) {\n list($column, $direction) = $column;\n\n if ($column instanceof ExpressionInterface) {\n $column = $this->buildExpression($column, $values);\n } elseif ($column instanceof Select) {\n $column = \"({$this->assembleSelect($column, $values)[0]})\";\n }\n\n if ($direction !== null) {\n $sql[] = \"$column $direction\";\n } else {\n $sql[] = $column;\n }\n }\n\n return 'ORDER BY ' . implode(', ', $sql);\n }", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "protected function getOrderByQuery()\n {\n\t\t$isWhat = $this->model->isWhat();\n\t\t$remoteTable = $this->model->tableName();\n\t\t$localOrderBy = [];\n\t\t$relations = [\n\t\t\t\\nitm\\widgets\\models\\Vote::tableName() => [\n\t\t\t\t'select' => new Expression('COUNT(*)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Issues::tableName() => [\n\t\t\t\t'select' => new Expression('COALESCE(created_at, updated_at)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Replies::tableName() => [\n\t\t\t\t'select' => new Expression('COALESCE(created_at, updated_at)'),\n\t\t\t],\n\t\t\t\\nitm\\widgets\\models\\Revisions::tableName() => [\n\t\t\t\t'select' => ['COUNT(*)'],\n\t\t\t]\n\t\t];\n\t\tforeach($relations as $table=>$relation){\n\t\t\t$localOrderBy[serialize(new Expression('('.(new Query)\n\t\t\t\t->from($table)\n\t\t\t\t->select($relation['select'])\n\t\t\t\t->where([\n\t\t\t\t\t\"$table.parent_id\" => \"$remoteTable.id\",\n\t\t\t\t\t\"$table.parent_type\" => $isWhat\n\t\t\t\t])->createCommand()->getRawSql().')'))] = SORT_DESC;\n\t\t}\n $localOrderBy = array_merge($localOrderBy, [\n serialize(new Expression(\"(CASE $remoteTable.status\n\t\t\t\tWHEN 'normal' THEN 0\n\t\t\t\tWHEN 'important' THEN 1\n\t\t\t\tWHEN 'critical' THEN 2\n\t\t\tEND)\")) => SORT_DESC,\n ]);\n\n return array_merge($localOrderBy, \\nitm\\helpers\\QueryFilter::getOrderByQuery($this->model));\n }", "protected abstract function getOrderByClause(array $sorts);", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "function get_sort_sql($fieldname) {\n return '';\n }", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "function _buildContentOrderBy()\n\t{\t\t\t\n\t\t$orderEvents = EventBookingHelper::getConfigValue('order_events');\n\t\tif ($orderEvents == 2) {\n\t\t\t$orderby = ' ORDER BY a.event_date ';\n\t\t} else {\n\t\t\t$orderby = ' ORDER BY a.ordering ';\t\n\t\t}\t\t\t\n\t\treturn $orderby;\n\t}", "public function getOrderBy() {\n\t\tglobal $log, $adb;\n\t\t$log->debug('> getOrderBy');\n\t\t$cmodule = get_class($this);\n\t\t$order_by = '';\n\t\tif (GlobalVariable::getVariable('Application_ListView_Default_Sorting', 0, $cmodule)) {\n\t\t\t$order_by = GlobalVariable::getVariable('Application_ListView_Default_OrderField', $this->default_order_by, $cmodule);\n\t\t}\n\n\t\tif (isset($_REQUEST['order_by'])) {\n\t\t\t$order_by = $adb->sql_escape_string($_REQUEST['order_by']);\n\t\t} elseif (!empty($_SESSION[$cmodule.'_Order_By'])) {\n\t\t\t$order_by = $adb->sql_escape_string($_SESSION[$cmodule.'_Order_By']);\n\t\t}\n\t\t$log->debug('< getOrderBy');\n\t\treturn $order_by;\n\t}", "protected function _buildContentOrderBy()\n\t{\n\t\t$app\t\t= JFactory::getApplication('site');\n\t\t$db\t\t\t= $this->getDbo();\n\t\t$params\t\t= $this->state->params;\n\t\t$itemid\t\t= $app->input->get('id', 0, 'int') . ':' . $app->input->get('Itemid', 0, 'int');\n\t\t$orderCol\t= $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');\n\t\t$orderDirn\t= $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');\n\t\t$orderby\t= ' ';\n\n\t\tif (!in_array($orderCol, $this->filter_fields))\n\t\t{\n\t\t\t$orderCol = null;\n\t\t}\n\n\t\tif (!in_array(strtoupper($orderDirn), array('ASC', 'DESC', '')))\n\t\t{\n\t\t\t$orderDirn = 'ASC';\n\t\t}\n\n\t\tif ($orderCol && $orderDirn)\n\t\t{\n\t\t\t$orderby .= $db->escape($orderCol) . ' ' . $db->escape($orderDirn) . ', ';\n\t\t}\n\n\t\t$articleOrderby\t\t= $params->get('orderby_sec', 'rdate');\n\t\t$articleOrderDate\t= $params->get('order_date');\n\t\t$categoryOrderby\t= $params->def('orderby_pri', '');\n\t\t$secondary\t\t\t= ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', ';\n\t\t$primary\t\t\t= ContentHelperQuery::orderbyPrimary($categoryOrderby);\n\n\t\t$orderby .= $primary . ' ' . $secondary . ' a.created ';\n\n\t\treturn $orderby;\n\t}", "protected static function buildSqlOrderBy($sort) {\n\t\treturn DSC::buildSqlOrderBy(new self::$CLASS_NAME, $sort);\n\t}", "protected static function buildSqlOrderBy($sort) {\n\t\treturn DSC::buildSqlOrderBy(new self::$CLASS_NAME, $sort);\n\t}", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "function orderBy($columns, $direction = \"\") {\n\t\t\n\t\tif (gettype($columns) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($columns as $col => $dir) {\n\t\t\t\t$cols[] = \"`$col` $dir\";\n\t\t\t}\n\t\t\t$cols = implode($cols, \",\");\n\t\t} else {\n\t\t\tif (!preg_match(\"/\\\\)$/\", $columns)) $cols = \"`$columns` $direction\";\n\t\t\telse $cols = \"$columns $direction\";\n\t\t\t// $cols = \"`\" . implode(\"` `\", preg_split(\"/\\s/i\", $columns)) . \"` $direction\";\n\t\t\t// $cols = \"`$columns` $direction\";\n\t\t}\n\t\t\n\t\tif (!isset($this->stmts['orderBy']))\n\t\t\t$cols = \"ORDER BY $cols\";\n\t\t\n\t\t$this->appendStmt('orderBy', \"$cols\");\n\n\t\treturn $this;\n\t}", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "public function orderBy($vars){\n\t\t\t$string = self::ORDER_BY;\n\t\t\t\n\t\t\t$cpt = 0;\n\t\t\tforeach($vars as $var){\n\t\t\t\t$string .= ' ' . $var;\n\t\t\t\tif(($cpt+1) < count($vars)){\n\t\t\t\t\t$string .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_query .= $string . ' ';\n\t\t\treturn $this->_returnObject ? $this : $string;\n\t\t}", "public function __toString()\n\t{\n\t\t// Initialize variables.\n\t\t$query = '';\n\n\t\t// Add the SELECT and FROM clauses.\n\t\t$query .= 'SELECT '.implode(',', $this->_select);\n\t\t$query .= \"\\nFROM \".implode(',', $this->_from);\n\n\t\t// Special case for JOIN clauses.\n\t\tif ($this->_join) {\n\t\t\t$query .= \"\\n\".implode(\"\\n\", $this->_join);\n\t\t}\n\n\t\t// Add the WHERE clause if it exists.\n\t\tif ($this->_where) {\n\t\t\t$query .= \"\\nWHERE \".$this->_where;\n\t\t}\n\n\t\t// Add the optional GROUP BY and HAVING clauses if they exist.\n\t\tif ($this->_group) {\n\t\t\t$query .= \"\\nGROUP BY \".implode(',', $this->_group);\n\t\t}\n\t\tif ($this->_having) {\n\t\t\t$query .= \"\\nHAVING \".implode(',', $this->_having);\n\t\t}\n\n\t\t// Add any UNION queries.\n\t\tforeach ($this->_union as $union)\n\t\t{\n\t\t\t$query .= \"\\nUNION\".((!$union->unionDistinct) ? ' ALL' : '');\n\t\t\t$query .= \"\\n\".$union;\n\t\t}\n\n\t\t// Add the optional ORDER BY clause if it exists.\n\t\tif ($this->_order) {\n\t\t\t$query .= \"\\nORDER BY \".implode(',', $this->_order);\n\t\t}\n\n\t\treturn $query;\n\t}", "private function orderBy($param) {\n if (isset($param['column']) && isset($param['type'])) {\n $this->sql .= 'ORDER BY ' . $param['column'] . ' ' . $param['type'] . ' ';\n }\n }", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function getOrderBy()\n {\n return $this->order_by;\n }", "public function addOrderBy($clauses = null, $direction = null)\n {\n if (empty($clauses)) {\n return $this;\n }\n\n if (is_string($clauses)) {\n if (strpos($clauses ?? '', \"(\") !== false) {\n $sort = preg_split(\"/,(?![^()]*+\\\\))/\", $clauses ?? '');\n } else {\n $sort = explode(\",\", $clauses ?? '');\n }\n\n $clauses = [];\n\n foreach ($sort as $clause) {\n list($column, $direction) = $this->getDirectionFromString($clause, $direction);\n $clauses[$column] = $direction;\n }\n }\n\n if (is_array($clauses)) {\n foreach ($clauses as $key => $value) {\n if (!is_numeric($key)) {\n $column = trim($key ?? '');\n $columnDir = strtoupper(trim($value ?? ''));\n } else {\n list($column, $columnDir) = $this->getDirectionFromString($value);\n }\n\n $this->orderby[$column] = $columnDir;\n }\n } else {\n user_error('SQLSelect::orderby() incorrect format for $orderby', E_USER_WARNING);\n }\n\n // If sort contains a public function call, let's move the sort clause into a\n // separate selected field.\n //\n // Some versions of MySQL choke if you have a group public function referenced\n // directly in the ORDER BY\n if ($this->orderby) {\n $i = 0;\n $orderby = [];\n foreach ($this->orderby as $clause => $dir) {\n // public function calls and multi-word columns like \"CASE WHEN ...\"\n if (strpos($clause ?? '', '(') !== false || strpos($clause ?? '', \" \") !== false) {\n // Move the clause to the select fragment, substituting a placeholder column in the sort fragment.\n $clause = trim($clause ?? '');\n do {\n $column = \"_SortColumn{$i}\";\n ++$i;\n } while (array_key_exists('\"' . $column . '\"', $this->orderby ?? []));\n $this->selectField($clause, $column);\n $clause = '\"' . $column . '\"';\n }\n $orderby[$clause] = $dir;\n }\n $this->orderby = $orderby;\n }\n\n return $this;\n }", "abstract protected function _buildOrderBy( $order );", "public function\n\t\tget_select_query()\n\t{\n\t\t$query = '';\n\t\t\n\t\t$key_fields = $this->get_key_fields();\n\t\t\n\t\t#print_r($key_fields);\n\t\t\n\t\t$display_fields = $this->get_display_fields();\n\t\t\n\t\t#print_r($display_fields);\n\t\t\n\t\t$table_name = $this->get_table_name();\n\t\t\n\t\t$ordering_fields = $this->get_ordering_fields();\n\t\t\n\t\t#print_r($ordering_fields);\n\t\t\n\t\t/*\n\t\t * The select clause.\n\t\t */\n\t\t\n\t\t$select_fields = array();\n\t\t\n\t\tforeach ($key_fields as $key_field) {\n\t\t\t$select_fields[] = $key_field;\n\t\t}\n\t\t\n\t\tforeach ($display_fields as $display_field) {\n\t\t\t$select_fields[] = $display_field['name'];\n\t\t}\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$select_fields = array_unique($select_fields);\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$query .= 'SELECT ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($select_fields as $select_field) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $select_field . ' ';\n\t\t}\n\t\t\n\t\t/*\n\t\t * The from clause.\n\t\t */\n\t\t\n\t\t$query .= ' FROM ' . $table_name . ' ';\n\t\t\n\t\t/*\n\t\t * The order by clause.\n\t\t */\n\t\t\n\t\t$query .= ' ORDER BY ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($ordering_fields as $of) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $of['name'] . ' ' . $of['direction'] . ' ';\n\t\t}\n\t\t\n\t\t#echo $query;\n\t\t\n\t\treturn $query;\n\t}", "protected function _compile_order_by(array $columns)\n {\n $sort = array();\n\n foreach ($columns as $group)\n {\n list($column, $direction) = $group;\n\n $direction = strtoupper($direction);\n if ( ! empty($direction))\n {\n $direction = ' '.($direction == 'ASC' ? 'ASC' : 'DESC');\n }\n\n $column = $this->quote_identifier($column);\n $column = $this->quote_field($column, false);\n $sort[] = $column.$direction;\n }\n\n return 'ORDER BY '.implode(', ', $sort);\n }", "public function getSortString($sFieldName = null, $sType = null)\n {\n $sRes = \" order by \";\n if ($sFieldName) {\n $sRes .= $sFieldName;\n } else {\n $sRes .= \"oxid\";\n }\n if ($sType && ($sType == \"ASC\" || $sType == \"DESC\")) {\n $sRes .= \" \" . $sType;\n }\n\n return $sRes;\n }", "public function orderby($columns,$condition){\n\t\t$this->query[\"ORDERBY\"] .= \"(\" . $columns .\") \". $condition;\n\t\treturn $this;\n\t}", "function orderBy($orderBy, $order)\n {\n if (empty($orderBy)) {\n return false;\n }\n \n $columns = $this->to_string($orderBy);\n \n $order = (in_array(strtoupper($order), array( 'ASC', 'DESC'))) ? strtoupper($order) : 'ASC';\n \n return 'ORDER BY '.$columns.' '. $order;\n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "protected function buildSelectClause() {\r\n\t\t$sql='';\r\n\t\t$fields=array();\r\n\t\tforeach($this->_salt_fields as $data) {\r\n\t\t\t/** @var SqlExpr $expr */\r\n\t\t\tlist($expr, $alias) = $data;\r\n\r\n\t\t\t$fields[]=$expr->toSQL().' as '.self::escapeName($alias);\r\n\t\t\t$this->linkBindsOf($expr, ClauseType::SELECT);\r\n\t\t}\r\n\t\t$sql.=implode(', ', $fields);\r\n\t\treturn $sql;\r\n\t}", "public function get_sql_order_by($default = null)\n {\n $get_order = rest::request()->get(\"order\");\n $usar_default = false;\n if (trim($get_order) == '') {\n if ($default !== null) {\n $usar_default = true;\n $get_order = $default;\n } else {\n return \"\";\n }\n }\n $sql_order_by = array();\n $get_campos = explode(\",\", $get_order);\n\n foreach ($get_campos as $get_campo) {\n $get_campo = trim($get_campo);\n $signo = substr($get_campo, 0, 1);\n switch ($signo) {\n case '+':\n $signo = \" ASC\";\n break;\n case '-':\n $signo = \" DESC\";\n break;\n default:\n throw new rest_error(400, \"Parámetro 'order' invalido. Se esperaba + o - y se recibio '$signo'\");\n }\n $campo = substr($get_campo, 1);\n if ($usar_default) {\n $sql_order_by[] = $campo.$signo;\n } elseif (!isset($this->campos_ordenables[$campo])) {\n throw new rest_error(400, \"Parámetro 'order' invalido. No esta permitido ordenar por campo '$campo'\");\n } else {\n $alias_sql = $this->campos_ordenables[$campo]['alias_sql'];\n $sql_order_by[] = $alias_sql.$signo;\n }\n }\n if (empty($sql_order_by)) {\n return \"\";\n } else {\n return \"ORDER BY \".implode(', ', $sql_order_by);\n }\n }", "function buildOrderParams() \n\t{\n\t\tif ($this->sortByGroup === false && $this->sortField != \"\"){\n\t\t\t$this->strOrderBy = \"Order by \".$this->sortField;\n\t\t\tif ($this->sortOrder == \"A\")\n\t\t\t\t$this->strOrderBy .= \" asc\";\n\t\t\telse \n\t\t\t\t$this->strOrderBy .= \" desc\";\n\t\t}\n\t}", "static function sort_query($sql, $sort, $qualifier='') {\n /**\n * $sql is query string to which ORDER BY clause will be appended.\n *\n * $sort is sort name. See class docstring.\n *\n * $qualifier is optional table reference name to prepend to columns.\n */\n \n if ($sort == 'best') {\n return self::get_sort_best($sql, $qualifier);\n }\n else if ($sort == 'recent') {\n return self::get_sort_recent($sql, $qualifier);\n }\n }", "function order_by($params, $default_field, $default_order = 'ASC') {\r\n \tif (isset($params['sortby'])) {\r\n \t\t$default_field = $params['sortby'];\r\n \t}\r\n\r\n \tif (isset($params['sortdir'])) {\r\n \t\t$default_order = $params['sortdir'];\r\n \t}\r\n\r\n \treturn \"ORDER BY $default_field $default_order\";\r\n\r\n }", "public function toSql()\n {\n if (0 === count($this->getParams())) {\n return 'SELECT *';\n } else {\n return 'SELECT ' . implode(', ', $this->getParams());\n }\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function compileOrders(Builder $query, $orders)\n {\n return 'ORDER BY '.implode(', ', array_map(function ($order) {\n return $this->wrap($order['column']).' '.mb_strtoupper($order['direction']);\n }, $orders));\n }", "public static function stringizeOrderBy($array)\n {\n //normalize single column orderBy statement\n if (is_string(reset($array)))\n {\n $array = array($array);\n } \n \n $columnsOrderBy = array();\n \n foreach ($array as $orderBy)\n {\n// var_dump($orderBy);\n $columnsOrderBy[] = $orderBy['column'] . ' ' . $orderBy['direction'];\n }\n \n return implode(', ', $columnsOrderBy);\n }", "public function &getOrderBy();", "public function getOrderBy()\r\n\t{\r\n\t\treturn $this->orderBy;\r\n\t}", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "private function orderClause ($conditions) {\n\n // We only do anything if the 'ORDER' key exists in the array\n if(array_key_exists(\"ORDER\",$conditions)){\n // The 'ORDER' key exists in the array so continue the SQL statement with an 'ORDER BY'\n $this->_sql .= ' ORDER BY ';\n\n // We will use $i to see if we are at the first condition so set it to 0\n $i = 0;\n\n foreach($conditions['ORDER'] as $value){\n\n // If we have more than one condition, prefix each one (after the //first) with ', '\n $this->_sql .= ($i > 0) ? ', ' : '';\n\n // Add the ORDER BY condition\n // [0] = table\n // [1] = column\n // [2] = direction\n //\n // Work on this once table aliases are avaiable\n $this->_sql .= '`'.$value[0].'`.`'.$value[1].'` '.$value[2];\n\n // Increment the counter\n $i++;\n } // End foreach\n } // End array_key_exists\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}", "public function default_order_by()\r\n {\r\n $this->db->order_by('partners.id');\r\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "public function getOrderBy(): ?string\n {\n return $this->orderBy;\n }", "protected function getOrderBy(array $data) : string {\n\n\t\t\t$order_by = [];\n\n\t\t\tforeach ($this->castOrderBy($data) as $field => $direction) $order_by[] = ('ent.' . $field . ' ' . $direction);\n\n\t\t\t# ------------------------\n\n\t\t\treturn implode(', ', $order_by);\n\t\t}", "public static function order($fields)\n {\n $order = self::set(\"order\");\n\n $order = Validator::contains($order)->validate($fields)? $order: null;\n\n return $order? \" ORDER BY {$order}\": null;\n }", "public function addOrderClause(Zend_Db_Select &$select) {\n // Distill the WHERE class from the Select object\n $where = $select->getPart(Zend_Db_Select::WHERE);\n // Save the existing ORDER clause.\n $originalOrder = $select->getPart(Zend_Db_Select::ORDER);\n $select->reset(Zend_Db_Select::ORDER);\n \n $alias = '';\n if ($this->_modelAlias) {\n $alias = $this->_modelAlias . '.';\n }\n\n /**\n * If a registered foreign key (see self::_relationConfig) is found, this query is \n * considered to be a related fetch() command, and an ORDER BY clause is added with\n * the registered weight column.\n */\n foreach ($where as $w) {\n foreach ($this->_relationConfig as $model => $modelRelationConfig) {\n if (strpos($w, $modelRelationConfig[self::FOREIGN_KEY_COLUMN_KEY]) !== false) {\n $select->order($alias . $modelRelationConfig[self::WEIGHT_COLUMN_KEY].' DESC');\n }\n }\n }\n \n // Return the existing ORDER clause, only this time '<weight-column> DESC' will be in front of it\n foreach ($originalOrder as $order) {\n // [0] = column, [1] = direction\n if (is_array($order)) {\n $order = $order[0].' '.$order[1];\n }\n $select->order($order);\n } \n }", "protected function getOrderByAttribute()\n {\n return $this->fetchData[self::ORDER_CLAUSE];\n }", "public function getOrdering() : string {\n\t\treturn $this->ordering;\n\t}", "public function dbOrderBy($orderbyCols) {\r\n $this->orderByCols = $orderbyCols;\r\n return $this;\r\n }", "function orderby($column) {\n\treturn \"<span class='orderby'><a href='?orderby={$column}&order=asc'>&darr;</a><a href='?orderby={$column}&order=desc'>&uarr;</a></span>\";\n}" ]
[ "0.76595104", "0.7619451", "0.7604367", "0.7563004", "0.7491403", "0.7315069", "0.7257167", "0.72425914", "0.7215502", "0.7215502", "0.7116528", "0.7102549", "0.7014338", "0.6956059", "0.6956059", "0.6956059", "0.682452", "0.6789073", "0.6730342", "0.671701", "0.66994524", "0.66786206", "0.66433316", "0.66148543", "0.6612651", "0.66005874", "0.657707", "0.65658385", "0.655968", "0.6528126", "0.65239596", "0.6485069", "0.6461193", "0.64321125", "0.63926136", "0.63630277", "0.63435876", "0.6321625", "0.6321285", "0.6286117", "0.6280882", "0.62750137", "0.6265614", "0.62574375", "0.6255543", "0.6229126", "0.62127775", "0.6155631", "0.6150374", "0.61333", "0.6100242", "0.609777", "0.60883987", "0.60769314", "0.6070456", "0.6043333", "0.60311306", "0.60311306", "0.60279304", "0.6007505", "0.59850836", "0.5969894", "0.59584874", "0.59410745", "0.59254736", "0.59254736", "0.59254736", "0.59240127", "0.58602715", "0.5844994", "0.5835178", "0.58261895", "0.5807854", "0.5793746", "0.578844", "0.5779901", "0.57757604", "0.57753", "0.57642823", "0.5762665", "0.5748445", "0.5735313", "0.5729292", "0.5726502", "0.5719818", "0.57194465", "0.57077765", "0.5690946", "0.5683421", "0.5673077", "0.5668466", "0.5659454", "0.565731", "0.5655286", "0.5653894", "0.5653819", "0.55985653", "0.5593791", "0.55859244", "0.5585478" ]
0.58352697
70
Constructs the GROUP BY clause string for the SELECT query.
private function constructGroupByStringStatic(&$tablesUsed, $groupBy) { return implode(', ', $this->canonicalizeColumns($groupBy, false, $tablesUsed)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildGroupClause() {\r\n\t\t$sql = '';\r\n\t\tif (count($this->_salt_groups) > 0) {\r\n\t\t\t$sql.=' GROUP BY '.implode(', ', $this->_salt_groups);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "protected function _compile_group_by()\n\t{\n\t\tif (count($this->qb_groupby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_groupby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t// Is it already compiled?\n\t\t\t\tif (is_string($this->qb_groupby[$i]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->qb_groupby[$i] = ($this->qb_groupby[$i]['escape'] === FALSE OR $this->_is_literal($this->qb_groupby[$i]['field']))\n\t\t\t\t\t? $this->qb_groupby[$i]['field']\n\t\t\t\t\t: $this->protect_identifiers($this->qb_groupby[$i]['field']);\n\t\t\t}\n\n\t\t\treturn \"\\nGROUP BY \".implode(', ', $this->qb_groupby);\n\t\t}\n\n\t\treturn '';\n\t}", "protected function compileGroupByStatement()\n {\n if (count($this->builderCache->groupBy) > 0) {\n for ($i = 0, $c = count($this->builderCache->groupBy); $i < $c; $i++) {\n // Is it already compiled?\n if (is_string($this->builderCache->groupBy[ $i ])) {\n continue;\n }\n\n $this->builderCache->groupBy[ $i ] = ($this->builderCache->groupBy[ $i ][ 'escape' ]\n === false OR\n $this->isLiteral(\n $this->builderCache->groupBy[ $i ][ 'field' ]\n ))\n ? $this->builderCache->groupBy[ $i ][ 'field' ]\n : $this->conn->protectIdentifiers($this->builderCache->groupBy[ $i ][ 'field' ]);\n }\n\n return \"\\n\" . sprintf(\n 'GROUP BY %s',\n implode(', ', $this->builderCache->groupBy)\n );\n }\n\n return '';\n }", "private function sql_groupBy()\n {\n // Get WHERE statement\n $groupBy = $this->curr_tableField;\n\n // RETURN GROUP BY statement without GROUP BY\n return $groupBy;\n }", "public function build_group_by( $group ) {\n if ( empty( $group ) ) {\n return '';\n }\n\n return ' GROUP BY ' . $group;\n }", "protected function compileGroup(CompilableClause $query)\n {\n if (empty($query->statements['groups'])) {\n return '';\n }\n\n $fields = array_map(fn (string $group) => $query->preprocessor()->field($group), $query->statements['groups']);\n\n if ($query->isQuoteIdentifier()) {\n $fields = $this->quoteIdentifiers($query, $fields);\n }\n\n return ' GROUP BY '.implode(', ', $fields);\n }", "public function buildGroupBy(array $groupBy = null, array &$values = [])\n {\n if ($groupBy === null) {\n return '';\n }\n\n foreach ($groupBy as &$column) {\n if ($column instanceof ExpressionInterface) {\n $column = $this->buildExpression($column, $values);\n } elseif ($column instanceof Select) {\n $column = \"({$this->assembleSelect($column, $values)[0]})\";\n }\n }\n\n return 'GROUP BY ' . implode(', ', $groupBy);\n }", "protected function getGroupbySql($data) {\n $str = '';\n if ($data->groupBys) {\n foreach ($data->groupBys as $group) {\n $str .= ' ' . $group['col'] . ($group['direction'] ? ' ' . strtoupper($group['direction']) : '') . ($group['option'] ? ' ' . strtoupper($group['option']) : '');\n }\n }\n\n return $str ? ' GROUP BY ' . $str : '';\n }", "function groupBy($groupBy)\n {\n if (empty($groupBy)) {\n return false;\n }\n \n $columns = $this->to_string($groupBy);\n \n return 'GROUP BY ' .$columns;\n }", "public function groupBy($sql);", "public function toSQL(Parameters $params, bool $inner_clause)\n {\n $groups = $this->getGroups() ?? array();\n $having = $this->getHaving() ?? array();\n\n if (empty($groups))\n throw new QueryException(\"No groups in GROUP BY clause\");\n \n $drv = $params->getDriver();\n\n $parts = array();\n foreach ($groups as $group)\n {\n $parts[] = $drv->toSQL($params, $group);\n }\n \n $having = !empty($having) ? ' ' . $drv->toSQL($params, $having) : \"\";\n\n return \"GROUP BY \" . implode(\", \", $parts) . $having;\n }", "public function getQueryGroupby() {\n $R = 'R_'. $this->id;\n return \"$R.value_id\";\n }", "private function groupBy() {\n $this->sql .= 'GROUP BY inv_agent_id ';\n }", "protected function setGroup() {\r\n //var_dump($this->sql);\r\n if( $this->sqlGroupBy ) {\r\n var_dump($this->sql);\r\n $this->sql .= ' GROUP BY ' . $this->sqlGroupBy;\r\n }\r\n //var_dump($this->sql);\r\n }", "public function makeGroupByWithHaving( $options ) {\n\t\t$sql = '';\n\t\tif ( isset( $options['GROUP BY'] ) ) {\n\t\t\t$gb = is_array( $options['GROUP BY'] )\n\t\t\t\t? implode( ',', $options['GROUP BY'] )\n\t\t\t\t: $options['GROUP BY'];\n\t\t\t$sql .= ' GROUP BY ' . $gb;\n\t\t}\n\t\tif ( isset( $options['HAVING'] ) ) {\n\t\t\t$having = is_array( $options['HAVING'] )\n\t\t\t\t? $this->makeList( $options['HAVING'], LIST_AND )\n\t\t\t\t: $options['HAVING'];\n\t\t\t$sql .= ' HAVING ' . $having;\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function group_by($groupBy) \n {\n $this->sql .= \" GROUP BY \". $this->clean($groupBy);\n return $this;\n }", "protected static function buildGroupBySQL($groupBy) {\n\t\t$ts = 'FROM_UNIXTIME(timestamp/1000)';\t// just for saving space\n\n\t\tswitch ($groupBy) {\n\t\t\tcase 'year':\n\t\t\t\treturn 'YEAR(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'month':\n\t\t\t\treturn 'YEAR(' . $ts . '), MONTH(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'week':\n\t\t\t\treturn 'YEAR(' . $ts . '), WEEKOFYEAR(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'day':\n\t\t\t\treturn 'YEAR(' . $ts . '), DAYOFYEAR(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'hour':\n\t\t\t\treturn 'YEAR(' . $ts . '), DAYOFYEAR(' . $ts . '), HOUR(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'minute':\n\t\t\t\treturn 'YEAR(' . $ts . '), DAYOFYEAR(' . $ts . '), HOUR(' . $ts . '), MINUTE(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'second':\n\t\t\t\treturn 'YEAR(' . $ts . '), DAYOFYEAR(' . $ts . '), HOUR(' . $ts . '), MINUTE(' . $ts . '), SECOND(' . $ts . ')';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function prepareGroupByPart()\n {\n $this->groupByQuery = 'GROUP BY ';\n $this->groupByQuery .= implode(', ', $this->groupByPart);\n $this->groupByQuery = \" {$this->groupByQuery} \";\n }", "protected function buildGroups(Query $query)\n {\n return count($query->getGroup()) > 0 ? ' GROUP BY '.implode(',', $query->getGroup()) : '';\n }", "function str()\n\t{\n return\n \"SELECT $this->select\" .\n \" FROM $this->from \" .\n \" WHERE $this->where \" .\n ($this->group_by ? \" GROUP BY $this->group_by\": '') .\n ($this->having ? \" HAVING $this->having\" : '') .\n ($this->order_by ? \" ORDER BY $this->order_by\": '') .\n ($this->limit ? \" LIMIT $this->limit\": '');\t\t\t\n }", "protected abstract function getGroupByClause(array $grouping);", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\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}", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "protected function compileGroups(Builder $query, array $groups)\n {\n return 'group by ' . $this->columnIze($groups);\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(Zend_Db_Select::GROUP);\n\n return $countSelect;\n }", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(\\Zend_Db_Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n\n $countSelect->reset(\\Zend_Db_Select::GROUP);\n\n return $countSelect;\n }", "public function composeCountQuery()\n\t{\n\t\t$query = '';\n\n\t\tif (!empty($this->group)) {\n\t\t\t// if the query uses GROUP BY we have to call COUNT on sub-query\n\t\t\t$query .= 'SELECT COUNT( sub.' . $this->orm->getConfigDbPrimaryKey() . ') AS count\n\t\t\tFROM (SELECT ' . $this->orm->getConfigDbTable() . '.' . $this->orm->getConfigDbPrimaryKey() . '';\n\t\t} else {\n\t\t\t$query .= 'SELECT count(' . $this->orm->getConfigDbTable() . '.' . $this->orm->getConfigDbPrimaryKey() . ') AS count';\n\t\t}\n\n\t\t$query .= ' FROM ' . $this->orm->getConfigDbTable() . ' ';\n\n\t\tif (!empty($this->joinTables)) {\n\t\t\t$query .= ' ' . implode(' ', $this->joinTables);\n\t\t}\n\n\t\tif (!empty($this->search)) {\n\t\t\t$query .= ' WHERE ' . implode($this->imploder, $this->search);\n\t\t}\n\n\t\tif (!empty($this->group)) {\n\t\t\t$query .= ' GROUP BY ' . implode(', ', $this->group) . ') AS sub';\n\t\t}\n\n\t\treturn $query;\n\t}", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "protected function buildSelectClause() {\r\n\t\t$sql='';\r\n\t\t$fields=array();\r\n\t\tforeach($this->_salt_fields as $data) {\r\n\t\t\t/** @var SqlExpr $expr */\r\n\t\t\tlist($expr, $alias) = $data;\r\n\r\n\t\t\t$fields[]=$expr->toSQL().' as '.self::escapeName($alias);\r\n\t\t\t$this->linkBindsOf($expr, ClauseType::SELECT);\r\n\t\t}\r\n\t\t$sql.=implode(', ', $fields);\r\n\t\treturn $sql;\r\n\t}", "public function getQueryGroupby() {\n // SubmittedOn is stored in the artifact\n return 'a.submitted_on';\n }", "public function __toString()\n\t{\n\t\t// Initialize variables.\n\t\t$query = '';\n\n\t\t// Add the SELECT and FROM clauses.\n\t\t$query .= 'SELECT '.implode(',', $this->_select);\n\t\t$query .= \"\\nFROM \".implode(',', $this->_from);\n\n\t\t// Special case for JOIN clauses.\n\t\tif ($this->_join) {\n\t\t\t$query .= \"\\n\".implode(\"\\n\", $this->_join);\n\t\t}\n\n\t\t// Add the WHERE clause if it exists.\n\t\tif ($this->_where) {\n\t\t\t$query .= \"\\nWHERE \".$this->_where;\n\t\t}\n\n\t\t// Add the optional GROUP BY and HAVING clauses if they exist.\n\t\tif ($this->_group) {\n\t\t\t$query .= \"\\nGROUP BY \".implode(',', $this->_group);\n\t\t}\n\t\tif ($this->_having) {\n\t\t\t$query .= \"\\nHAVING \".implode(',', $this->_having);\n\t\t}\n\n\t\t// Add any UNION queries.\n\t\tforeach ($this->_union as $union)\n\t\t{\n\t\t\t$query .= \"\\nUNION\".((!$union->unionDistinct) ? ' ALL' : '');\n\t\t\t$query .= \"\\n\".$union;\n\t\t}\n\n\t\t// Add the optional ORDER BY clause if it exists.\n\t\tif ($this->_order) {\n\t\t\t$query .= \"\\nORDER BY \".implode(',', $this->_order);\n\t\t}\n\n\t\treturn $query;\n\t}", "public function get_group_by()\n\t{\n\t\treturn NULL;\n\t}", "abstract protected function _buildGroupBy( $group );", "public function group($str) \n {\n $this->_data['group'] = $str;\n $this->_data['query'] .= ' GROUP BY '.$str;\n return $this;\n }", "public function visitGroupClause(\n /*IGroupClause*/ $node) /*: mixed*/ {\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $key = /*(string)*/$node->getKey()->accept($this);\n\n return 'group '.$collection.' by '.$key;\n }", "public function formatQuery($sql) {\r\n\t\t//regex work with a lookahead to avoid splitting things inside single quotes\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(WHERE|FROM|GROUP BY|HAVING|ORDER BY|LIMIT|OFFSET|UNION|DUPLICATE KEY)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n$0\", $sql\r\n\t\t);\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(INNER|LEFT|RIGHT|CASE|WHEN|END|ELSE|AND)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n $0\", $sql);\r\n\t\treturn $sql;\r\n\t}", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function groupBy($sql) {\n $this->__groupBy__ = $sql;\n return $this;\n }", "function get_report_sql_groups() {\n return '';\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::GROUP);\n\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::GROUP);\n return $countSelect;\n }", "public function getSelectCountSql()\n {\n $countSelect = parent::getSelectCountSql();\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::GROUP);\n return $countSelect;\n }", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "function getGroupBy() {\n return $this->getAdditionalProperty('group_by', self::DONT_GROUP);\n }", "public function getSQL(){\n $sqlString = \"select \";\n $campos = $this->getCampos();\n //var_dump($campos);\n if (is_array($campos) && empty($campos)) {\n $sqlString .= \" * \";\n } else {\n $campos = \"\";\n foreach ($this->getCampos() as $key => $value) {\n if (!$campos == \"\") { \n $campos.=\" ,\"; \n };\n $campos.=\" \".$value.\" as \".$key.\" \";\n }\n $sqlString .= $campos;\n }\n $sqlString .= \" from \" . $this->getTabla();\n if ( $this->getSQLFilter() != \"\" ) {\n $sqlString .= \" where \" . $this->getSQLFilter();\n }\n \n $sqlString .= $this->getSQLGroupBy();\n $sqlString .= $this->getSQLOrderBy();\n //echo $sqlString.\"\\n\";\n return $sqlString; \n }", "protected function getDistinct()\n {\n if ($this->distinct === true) {\n return 'SELECT DISTINCT ';\n }\n\n return 'SELECT ';\n }", "protected function buildValuesFromSelect(): string\n {\n $sql = '';\n\n // Check for a SELECT statement and append if available\n if ( isset($this->select) )\n {\n $sql .= $this->indentStatement($this->select, 1);\n\n $this->mergeBindings($this->select);\n }\n\n return $sql;\n }", "protected function buildOrderClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_orders)>0) {\r\n\t\t\t$sql.=' ORDER BY '.implode(', ', $this->_salt_orders);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "protected function compileGroups(Builder $builder, $groups): string\n {\n return 'group by '.$this->columnize($groups);\n }", "public function groupBy( array $group ) {\n $group = array_map(function($n) { return \"@$n\"; }, $group);\n $group = implode(' ', array_merge([count($group)], $group));\n $this->groupBy = \"GROUPBY $group\";\n return $this;\n }", "public function __toString()\n {\n // SELECT\n $parts = [\"SELECT\"];\n if ($this->select) {\n $parts[] = join(\", \", $this->select);\n } else {\n $parts[] = \"*\";\n }\n\n // FROM\n $parts[] = \"FROM\";\n $parts[] = $this->buildFrom();\n\n\n if (!empty($this->joins)) {\n foreach ($this->joins as $type => $joins) {\n foreach ($joins as [$table, $condition]) {\n $parts[] = strtoupper($type) . \" JOIN $table ON $condition\";\n }\n }\n }\n\n // WHERE\n if (!empty($this->where)) {\n $parts[] = \"WHERE\";\n $parts[] = \"(\" . join(\") AND (\", $this->where) . \")\";\n }\n\n // GROUP BY\n if (!empty($this->group)) {\n $parts[] = \"GROUP BY\";\n $parts[] = join(\", \", $this->group);\n }\n\n // ORDER BY\n if (!empty($this->order)) {\n $parts[] = \"ORDER BY\";\n $parts[] = join(\", \", $this->order);\n }\n\n // LIMIT\n if (!empty($this->limit)) {\n $parts[] = \"LIMIT {$this->limit}\";\n }\n\n return join(\" \", $parts);\n }", "public function getQuery()\n {\n $query = 'SELECT ';\n $query .= implode(', ', $this->select) . ' ';\n $query .= \"FROM $this->kind \";\n \n if ( ! empty($this->where) )\n {\n $query .= \"WHERE $this->where \";\n }\n \n if ( ! empty($this->groupBy) )\n {\n $query .= \"GROUP BY $this->groupBy \";\n }\n \n if ( ! empty($this->orderBy) )\n {\n $query .= \"ORDER BY $this->orderBy $this->orderByDirection \";\n }\n \n if ( $this->limit !== null )\n {\n $query .= \"LIMIT $this->limit \";\n }\n \n if ( $this->offset !== null )\n {\n $query .= \"OFFSET $this->offset\";\n }\n \n return trim($query);\n }", "public function\n\t\tget_select_query()\n\t{\n\t\t$query = '';\n\t\t\n\t\t$key_fields = $this->get_key_fields();\n\t\t\n\t\t#print_r($key_fields);\n\t\t\n\t\t$display_fields = $this->get_display_fields();\n\t\t\n\t\t#print_r($display_fields);\n\t\t\n\t\t$table_name = $this->get_table_name();\n\t\t\n\t\t$ordering_fields = $this->get_ordering_fields();\n\t\t\n\t\t#print_r($ordering_fields);\n\t\t\n\t\t/*\n\t\t * The select clause.\n\t\t */\n\t\t\n\t\t$select_fields = array();\n\t\t\n\t\tforeach ($key_fields as $key_field) {\n\t\t\t$select_fields[] = $key_field;\n\t\t}\n\t\t\n\t\tforeach ($display_fields as $display_field) {\n\t\t\t$select_fields[] = $display_field['name'];\n\t\t}\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$select_fields = array_unique($select_fields);\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$query .= 'SELECT ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($select_fields as $select_field) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $select_field . ' ';\n\t\t}\n\t\t\n\t\t/*\n\t\t * The from clause.\n\t\t */\n\t\t\n\t\t$query .= ' FROM ' . $table_name . ' ';\n\t\t\n\t\t/*\n\t\t * The order by clause.\n\t\t */\n\t\t\n\t\t$query .= ' ORDER BY ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($ordering_fields as $of) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $of['name'] . ' ' . $of['direction'] . ' ';\n\t\t}\n\t\t\n\t\t#echo $query;\n\t\t\n\t\treturn $query;\n\t}", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '')\n {\n // Table and fieldnames should be \"SQL-injection-safe\" when supplied to this function\n // Build basic query\n $query = 'SELECT ' . $select_fields . ' FROM ' . $from_table . ((string) $where_clause !== '' ? ' WHERE ' . $where_clause : '');\n // Group by\n $query .= (string) $groupBy !== '' ? ' GROUP BY ' . $groupBy : '';\n // Order by\n $query .= (string) $orderBy !== '' ? ' ORDER BY ' . $orderBy : '';\n // Group by\n $query .= (string) $limit !== '' ? ' LIMIT ' . $limit : '';\n // Return query\n if ($this->debugOutput || $this->store_lastBuiltQuery) {\n $this->debug_lastBuiltQuery = $query;\n }\n return $query;\n }", "public function groupBy($condition)\n {\n $this->groupbyString = $condition;\n return $this;\n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "public function to_str() {\n //\n //Construct the sql (select) statement\n $stmt = \n \"select \\n\"\n //\n //Field selection \n . \"{$this->fields->to_str()} \\n\"\n . \"from \\n\"\n //\n //For now the root is simply the name of a table or a bracketed \n //enclose sql \n . \"{$this->root->fromexp()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //The where clause, if necessary \n .\"{$this->wheres->to_str()}\";\n return $stmt;\n \n }", "protected function getFilterablePropertyGroupSQL() : QueryBuilder\n {\n $field = $this->getPropertySQLReplaceCondition(\"pgt.name\");\n $query = $this->connection->createQueryBuilder();\n $query->select([\"$field\"])\n ->from(\"property_group\", 'pg')\n ->leftJoin(\"pg\", \"property_group_translation\", \"pgt\",\n \"pg.id = pgt.property_group_id\"\n )\n ->leftJoin(\"pg\", \"sales_channel\", \"sc\", \"sc.id=:contextId\")\n ->andWhere(\"pg.filterable = 1\")\n ->andWhere(\"pgt.language_id=sc.language_id\")\n ->addGroupBy('pg.id')\n ->setParameter('contextId', Uuid::fromHexToBytes($this->getContextId()), ParameterType::BINARY);\n\n return $query;\n }", "public function toSql()\n {\n if (0 === count($this->getParams())) {\n return 'SELECT *';\n } else {\n return 'SELECT ' . implode(', ', $this->getParams());\n }\n }", "function SQLFormat ($query)\r{\r\t$lowercase = array ('select ', ' max', ' min', ' count', ' avg', ' sum',\r\t\t\t\t\t\t'from ', ' as ',\r\t\t\t\t\t\t'join ', \"left \\nJOIN \", \"right \\nJOIN \", \"inner \\nJOIN \", \"outer \\nJOIN \", ' on ',\r\t\t\t\t\t\t'where ', ' like ', ' and ', ' or ',\r\t\t\t\t\t\t'group by ',\r\t\t\t\t\t\t'order by ', ' asc', ' desc', 'ASC, ', 'DESC, ',\r\t\t\t\t\t\t'limit ',\r\t\t\t\t\t\t\"\\n\\n\");\r\t$uppercase = array ('SELECT ', ' MAX', ' MIN', ' COUNT', ' AVG', ' SUM',\r\t\t\t\t\t\t\"\\nFROM \", ' AS ',\r\t\t\t\t\t\t\"\\nJOIN \", \"\\nLEFT JOIN \", \"\\nRIGHT JOIN \", \"\\nINNER JOIN\", \"OUTER JOIN\", \"\\n\\tON \",\r\t\t\t\t\t\t\"\\nWHERE \", ' LIKE ', ' AND ', ' OR ',\r\t\t\t\t\t\t\"\\nGROUP BY \",\r\t\t\t\t\t\t\"\\nORDER BY\\n\\t\", ' ASC', ' DESC', \"ASC,\\n\\t\", \"DESC,\\n\\t\",\r\t\t\t\t\t\t\"\\nLIMIT \",\r\t\t\t\t\t\t\"\\n\");\r\r\treturn str_replace ($lowercase, $uppercase, $query);;\r}", "public function testBuildGroupByWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->groupBy('param1')\n ->groupBy('param2')\n ;\n\n $this->assertSame(\n 'GROUP BY alias.param1, alias.param2',\n $query->buildGroupBy()\n );\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "static public function GenerateBaseSelectClause()\r\n\t{\r\n\t\t$returnValue = \"\tSELECT\ta.TagID,\r\n\t\t\t\t\t\t\t\t\t\ta.TagText \";\r\n\r\n\t\treturn $returnValue;\r\n\t}", "final public function generateFormattedSQL()\n {\n $parts = $this->generateOrderedSQLParts();\n return array_reduce($parts, function ($memo, $part) {\n $type = current(array_keys($part));\n $value = current($part);\n $sep = $this->getSeparatorForPartType($type);\n if (!$memo) {\n return $value;\n }\n return \"{$memo}{$sep}{$value}\";\n }, null);\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function groupBy($field): QueryBuilderInterface\n\t{\n\t\tif ( ! is_scalar($field))\n\t\t{\n\t\t\t$newGroupArray = array_map([$this->driver, 'quoteIdent'], $field);\n\t\t\t$this->state->setGroupArray(\n\t\t\t\tarray_merge($this->state->getGroupArray(), $newGroupArray)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->state->appendGroupArray($this->driver->quoteIdent($field));\n\t\t}\n\n\t\t$this->state->setGroupString(' GROUP BY ' . implode(',', $this->state->getGroupArray()));\n\n\t\treturn $this;\n\t}", "private function makeOrderingSQL($order_by) {\n $all_columns = \"\";\n if (is_array($order_by))\n {\n foreach ($order_by as $column_name)\n\t{\n\t $all_columns .= $column_name . ', ';\n\t}\n $all_columns = rtrim($all_columns, ', ');\n }\n else\n {\n $all_columns = $order_by;\n }\n return 'ORDER BY ' . $all_columns;\n}", "protected function getGroupByAttribute()\n {\n return $this->fetchData[self::GROUP_CLAUSE];\n }", "public function testBuildGroupByWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->groupBy('is_admin', 'desc')\n )\n ->groupBy('id', 'asc')\n ;\n\n $this->assertSame(\n 'GROUP BY table1_alias.id, table2_alias.is_admin',\n $query->buildGroupBy()\n );\n }", "public function GetSQL()\n\t{\n\t\treturn db_get_select_sql($this->fields, $this->tables, $this->groupby, $this->filters, $this->sortfields, $this->limit);\n\t}", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "function groupBy($column) {\n if(!is_array($column)) {\n $column = array($column);\n }\n foreach ($column as $value) {\n $this->group_by .= ', `'.str_replace('.', '`.`', $value).'`';\n }\n $this->group_by = trim($this->group_by, ', ');\n return $this;\n }", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') {\n \n $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n \n // trace query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n #$this->logQuery($debugQuery); // activate for debugging purposes only - no logging by default for non-modifying queries like selects!\n \n return $query;\n \n }", "public function __toString() {\n // to do it. This allows constructs like \"(string) $query\" to work. When\n // the query will be executed, it will be recompiled using the proper\n // placeholder generator anyway.\n if (!$this->compiled()) {\n $this->compile($this->connection, $this);\n }\n\n // Create a sanitized comment string to prepend to the query.\n $comments = $this->connection->makeComment($this->comments);\n\n // SELECT\n $query = $comments . 'SELECT ';\n if ($this->distinct) {\n $query .= 'DISTINCT ';\n }\n\n // FIELDS and EXPRESSIONS\n $fields = array();\n foreach ($this->tables as $alias => $table) {\n if (!empty($table['all_fields'])) {\n $fields[] = $this->connection->escapeTable($alias) . '.*';\n }\n }\n foreach ($this->fields as $alias => $field) {\n // Always use the AS keyword for field aliases, as some\n // databases require it (e.g., PostgreSQL).\n $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeAlias($field['alias']);\n }\n foreach ($this->expressions as $alias => $expression) {\n $fields[] = $expression['expression'] . ' AS ' . $this->connection->escapeAlias($expression['alias']);\n }\n $query .= implode(', ', $fields);\n\n\n // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.\n $query .= \"\\nFROM \";\n foreach ($this->tables as $alias => $table) {\n $query .= \"\\n\";\n if (isset($table['join type'])) {\n $query .= $table['join type'] . ' JOIN ';\n }\n\n // If the table is a subquery, compile it and integrate it into this query.\n if ($table['table'] instanceof SelectQueryInterface) {\n // Run preparation steps on this sub-query before converting to string.\n $subquery = $table['table'];\n $subquery->preExecute();\n $table_string = '(' . (string) $subquery . ')';\n }\n else {\n $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';\n }\n\n // Don't use the AS keyword for table aliases, as some\n // databases don't support it (e.g., Oracle).\n $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);\n\n if (!empty($table['condition'])) {\n $query .= ' ON ' . $table['condition'];\n }\n }\n\n // WHERE\n if (count($this->where)) {\n // There is an implicit string cast on $this->condition.\n $query .= \"\\nWHERE \" . $this->where;\n }\n\n // GROUP BY\n if ($this->group) {\n $query .= \"\\nGROUP BY \" . implode(', ', $this->group);\n }\n\n // HAVING\n if (count($this->having)) {\n // There is an implicit string cast on $this->having.\n $query .= \"\\nHAVING \" . $this->having;\n }\n\n // ORDER BY\n if ($this->order) {\n $query .= \"\\nORDER BY \";\n $fields = array();\n foreach ($this->order as $field => $direction) {\n $fields[] = $field . ' ' . $direction;\n }\n $query .= implode(', ', $fields);\n }\n\n // RANGE\n // There is no universal SQL standard for handling range or limit clauses.\n // Fortunately, all core-supported databases use the same range syntax.\n // Databases that need a different syntax can override this method and\n // do whatever alternate logic they need to.\n if (!empty($this->range)) {\n if($this->range['start']) {\n $query .= \"\\nROWS \" . (int) $this->range['length'] . \" TO \" . (int) $this->range['start'] + (int) $this->range['length'];\n } else {\n $query .= \"\\nROWS \" . (int) $this->range['length']; \n }\n }\n\n // UNION is a little odd, as the select queries to combine are passed into\n // this query, but syntactically they all end up on the same level.\n if ($this->union) {\n foreach ($this->union as $union) {\n $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];\n }\n }\n\n if ($this->forUpdate) {\n $query .= ' FOR UPDATE';\n }\n\n return $query;\n }", "public function toCountQuery() {\r\n\t\t$sql='SELECT COUNT(*) as nb';\r\n\r\n\t\t$selectClause = $this->buildSelectClause();\r\n\t\t$hasDistinct = (strpos(strtolower($selectClause), 'distinct') !== FALSE);\r\n\r\n\t\t$excludeBinds = array();\r\n\t\tif (($hasDistinct) || (count($this->_salt_groups) > 0)) {\r\n\t\t\t// if select clause have a distinct... we have to count the complete subquery...\r\n \t\t\t// with groups, count() also need to be executed on a sub select query...\r\n \t\t\t// @see http://stackoverflow.com/questions/364825/getting-the-number-of-rows-with-a-group-by-query\r\n\t\t\t$sql.=' FROM ( SELECT '.$selectClause.$this->toBaseSQL().') c';\r\n\t\t} else {\r\n\t\t\t$excludeBinds = $this->getBinds(ClauseType::SELECT);\r\n\t\t\t// more simple query without select clause\r\n\t\t\t$sql.=$this->toBaseSQL();\r\n\t\t}\r\n\r\n\t\t$binds = $this->getBinds();\r\n\t\t$binds = array_diff_key($binds, $excludeBinds);\r\n\r\n\t\treturn new CountQuery($sql, $binds);\r\n\t}", "public function getSelectCountSql()\n {\n $countSelect = clone $this->getSelect();\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::ORDER);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::LIMIT_COUNT);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::LIMIT_OFFSET);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::GROUP);\n $countSelect->reset(\\Magento\\Framework\\DB\\Select::COLUMNS);\n $countSelect->columns(\"COUNT(*)\");\n\n return $countSelect;\n }", "public function rawGroupBy($groupBy)\n {\n $this->groupBy = new Expressions\\GroupByClause($groupBy, null, $this);\n return $this;\n }", "function create_list_count_query($where) {\r\n\t\t$q = parent::create_list_count_query($where);\r\n\t\t$q = preg_replace ('/select\\s+count\\(\\*\\)\\s+c/i', \"SELECT COUNT(DISTINCT `$this->table_name`.id) c\", $q);\r\n $q = preg_replace(\"/GROUP\\s+BY\\s+`$this->table_name`.id\\s*$/i\", '', $q);\r\n\t\treturn $q;\r\n\t}", "public function getSelects() {\n\t\t$sql = \"\";\n\n\t\tif (count($this->fields) > 0) {\n\t\t\tforeach ($this->fields as $field) {\n\t\t\t\t$sql .= $field[0];\n\t\t\t\tif ($field[1] != null) {\n\t\t\t\t\t$sql .= \" AS `{$field[1]}`\";\n\t\t\t\t}\n\t\t\t\t$sql .= \", \";\n\t\t\t}\n\t\t}\n\n\n\n\t\tif (count($this->join) > 0) {\n\t\t\tforeach ($this->join as $jo) {\n\t\t\t\t$j = $jo[2];\n\t\t\t\t$s = $j->getSelects();\n\t\t\t\tif ($s != \"\") {\n\t\t\t\t\t$sql .= \" \".$s.\", \";\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t $j = $jo[1];\n\t\t\t\tif (count($j->fields) == 0) {\n\t\t\t\t$j->fields[] = \"*\";\n\t\t\t\t}\n\t\t\t\tforeach ($j->fields as $field) {\n\t\t\t\tif ($field != \"*\") {\n\t\t\t\t$field = \"`\".$field.\"`\";\n\t\t\t\t}\n\t\t\t\t$sql .= \"`\".$j->getTable().\"`.\".$field.\", \";\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\n\t\tif (substr($sql, -2) == \", \") {\n\t\t\t$sql = substr($sql, 0, strlen($sql)-2);\n\t\t}\n\t\treturn $sql;\n\t}", "public function group($column)\n {\n // Make column name safe\n $column = $this->san($column);\n \n // GROUP BY .. \n $this->query .= 'GROUP BY ' . $column . ' ';\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function __toString()\n {\n if (!isset($this->_from[0]['table']) || !$this->_from[0]['table']) {\n //sanity check\n return '';\n }\n\n $sql = \"SELECT \";\n\n $column_parts = array();\n $from_parts = array();\n\n foreach ($this->_from as $from) {\n $table_key = (is_array($from['table'])) ? key($from['table']) : $from['table'];\n\n foreach ($from['columns'] as $column_key => $column_name) {\n if (strpos($column_name, '(') === false && strpos($column_name, '.') === false) {\n //This is NOT an expression and does not yet have \".\", add tbl name\n $column_name = $table_key . '.' . $column_name;\n }\n\n if (!geoString::isInt($column_key)) {\n $column_name .= ' AS ' . $column_key;\n }\n $column_parts[] = $column_name;\n }\n\n //figure out from\n switch ($from['join_type']) {\n case 'primary':\n //special case, this is first table, don't need to add join type\n $from_str = '';\n break;\n\n case self::JOIN_LEFT:\n $from_str = 'LEFT JOIN ';\n break;\n\n case self::JOIN_INNER:\n //break ommitted on purpose\n default:\n $from_str = 'INNER JOIN ';\n break;\n }\n\n if (is_array($from['table'])) {\n //using array(table_alias => table_name)\n $table = $from['table'];\n reset($table);\n $from_str .= current($table) . ' AS ' . key($table);\n } else {\n //simple string for table\n $from_str .= $from['table'];\n }\n if ($from['on'] && is_array($from['on'])) {\n $from_str .= ' ON ' . implode(' AND ', $from['on']);\n } elseif ($from['on']) {\n $from_str .= ' ON ' . $from['on'];\n }\n $from_parts [] = $from_str;\n }\n $sql .= implode(', ', $column_parts) . \"\\n\\tFROM \" . implode(\"\\n\\t\\t\", $from_parts);\n\n $where = $this->_where;\n\n if ($this->_orWhere) {\n //add all the OR's to the thingy\n foreach ($this->_orWhere as $name => $orWhere) {\n $where[$name] = \"(\" . implode(' OR ', $orWhere) . \")\";\n }\n }\n\n if ($where) {\n $sql .= \"\\n\\tWHERE \" . implode(' AND ', $where);\n }\n\n if ($this->_group) {\n $sql .= \"\\n\\tGROUP BY \" . implode(', ', $this->_group);\n }\n\n if ($this->_order) {\n $sql .= \"\\n\\tORDER BY \" . implode(', ', $this->_order);\n }\n\n if ($this->_count || $this->_offset) {\n $sql .= \"\\n\\tLIMIT {$this->_count}\";\n if ($this->_offset) {\n $sql .= \", {$this->_offset}\";\n }\n }\n\n return $sql;\n }", "public function implicitGroupby() {\n\t\treturn true;\n\t}", "static public function GenerateBaseSelectClause()\n\t{\n\t\t$returnValue = \"\tSELECT\ta.MerchantAccountID,\n\t\t\t\t\t\t\t\t\t\ta.Name,\n\t\t\t\t\t\t\t\t\t\ta.ProcessorClassName,\n\t\t\t\t\t\t\t\t\t\ta.IsAvailable,\n\t\t\t\t\t\t\t\t\t\tb.TransactionFee,\n\t\t\t\t\t\t\t\t\t\tb.DiscountPercent,\n\t\t\t\t\t\t\t\t\t\tb.AccountID \";\n\n\t\treturn $returnValue;\n\t}", "public function getSelectCountSql()\n {\n $this->_renderFilters();\n\n $countSelect = $this->_getClearSelect()\n ->columns('COUNT(DISTINCT cpf'.$this->_storeId.'.entity_id)')\n ->resetJoinLeft();\n return $countSelect;\n }", "public function groupBy(array $groupByClause): self\n {\n $this->fetchData[self::GROUP_CLAUSE] = $groupByClause;\n\n return $this;\n }", "public function stripGroupByForGroupByKeywordDataProvider() {}", "public function __toString(): string\n {\n return sprintf(\n 'SELECT %s FROM %s WHERE %s',\n implode(', ', $this->fields),\n implode(', ', $this->table),\n implode(', ', $this->condition)\n );\n }", "public function testBuildGroupByWithTwoArguments()\n {\n $query = $this->getQuery()\n ->groupBy('param1')\n ->groupBy('param2')\n ;\n\n $this->assertSame(\n 'GROUP BY param1, param2',\n $query->buildGroupBy()\n );\n }", "public function getGroupBy() {\n return $this->_groupBy;\n }", "public function getSelectClause()\n {\n $select = [];\n foreach ($this->all() as $column) {\n $select[] = $column->getRawSelect();\n }\n\n return implode(', ', $select);\n }", "public function getSelectCountSql() {\r\n $countSelect = clone $this->getSelect();\r\n\t\t\r\n\t\t$countSelect->reset();\r\n\t\t\r\n $countSelect\r\n ->from(['m' => new \\Zend_Db_Expr('(\r\n\t\t\t\tSELECT frequency_length\r\n\t\t\t\tFROM subscriptions_profiles AS main_table\r\n\t\t\t\tWHERE (main_table.status != \"active\") AND (FLOOR(main_table.frequency_length / (60 * 60 * 24)) > 0)\r\n\t\t\t\tGROUP BY CONCAT(frequency_length, merchant_source)\r\n\t\t\t)')], [])\r\n ->columns(array(\r\n\t\t\t\tnew \\Zend_Db_Expr('COUNT(*)')\r\n ));\r\n\t\t\r\n\t\treturn $countSelect;\r\n }" ]
[ "0.7874762", "0.7694933", "0.7580701", "0.7486703", "0.73949385", "0.68997246", "0.6828666", "0.679867", "0.67354035", "0.6650168", "0.6648849", "0.6622328", "0.654556", "0.64753497", "0.6474338", "0.64313126", "0.64033926", "0.6398834", "0.6325891", "0.63098955", "0.6275324", "0.62536776", "0.6170323", "0.6115725", "0.61141473", "0.6109585", "0.6102989", "0.6102989", "0.6102989", "0.6102989", "0.6094837", "0.6037802", "0.59999764", "0.59836966", "0.5964562", "0.5952872", "0.5921935", "0.59022444", "0.58752286", "0.5867779", "0.58328557", "0.5823793", "0.57845485", "0.5781633", "0.57811093", "0.5768296", "0.57233816", "0.5722624", "0.57140976", "0.57140976", "0.56990707", "0.5696205", "0.5681089", "0.56805086", "0.56258225", "0.5620964", "0.5606136", "0.557738", "0.5550339", "0.553576", "0.55244726", "0.55237013", "0.55149394", "0.5502024", "0.55006224", "0.5482447", "0.5475842", "0.5470182", "0.5468268", "0.5445347", "0.5442688", "0.5438448", "0.54307294", "0.54299504", "0.54260516", "0.5420729", "0.5406257", "0.5391374", "0.53852373", "0.5383094", "0.5378905", "0.53782815", "0.53677595", "0.5352579", "0.53476924", "0.5332962", "0.53292346", "0.5313728", "0.5312788", "0.53092873", "0.53020334", "0.52845526", "0.52839404", "0.5283641", "0.5273088", "0.52621186", "0.5253722", "0.5242962", "0.5236799", "0.5226391" ]
0.5725971
46
Constructs the part after SELECT for the SELECT query.
private function constructSelectColumnsStringStatic(&$tablesUsed, $selectColumns) { if ($selectColumns === '*') { $tablesUsed[] = $this->tableName; return '*'; } return implode(', ', $this->canonicalizeColumns((array)$selectColumns, true, $tablesUsed)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function RetSelect() {\n\n $return = \"SELECT\";\n\n if ($this->\n distinct) {\n\n $return .= \" DISTINCT\";\n }\n\n $columnsArr = [];\n\n foreach ($this->\n columns as $key => $value) {\n\n if (is_string($value)) {\n\n $columnsArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $columnsArr[] = \"(\" . $value['subquery']->\n Generate() . \")\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else if (isset($value['value'])) {\n\n $columnsArr[] = \"'{$value['value']}'\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n } else {\n\n $columnsArr[] = \"{$value['column']}\" . (isset($value['label']) &&\n is_string($value['label']) ? \" AS \\\"{$value['label']}\\\"\" : \"\");\n }\n }\n\n if (count($columnsArr)) {\n\n $return .= \" \" . implode($columnsArr, \", \");\n } else {\n\n $return .= \" *\";\n }\n\n\n $tablesStr = \"\";\n\n foreach ($this->\n tables as $key => $value) {\n\n if (is_string($value)) {\n\n $tablesStr .= \", $value\";\n } else {\n\n if (!(isset($value['table']) &&\n $value['table'] != \"\") &&\n isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $value['table'] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n\n if (!isset($value['alias'])) {\n\n throw new \\Exception(\"Error: Alias required in case of subquery to be used in from clause.\");\n }\n } else {\n\n $value['table'] = \"{$value['table']}\";\n }\n\n if (isset($value['alias'])) {\n\n $value['alias'] = \"`{$value['alias']}`\";\n }\n\n if (!isset($value['table']) ||\n $value['table'] == \"\") {\n\n throw new \\Exception(\"Error: Tables not properly provided in QueryHelper.\");\n }\n\n if (!isset($value['jointype'])) {\n\n $tablesStr .= \", \" . $value['table'];\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n } else {\n\n switch ($value['jointype']) {\n case 'j':\n\n $tablesStr .= \" JOIN \" . $value['table'];\n break;\n\n case 'ij':\n\n $tablesStr .= \" INNER JOIN \" . $value['table'];\n break;\n\n case 'cj':\n\n $tablesStr .= \" CROSS JOIN \" . $value['table'];\n break;\n\n case 'sj':\n\n $tablesStr .= \" STRAIGHT_JOIN \" . $value['table'];\n break;\n\n case 'lj':\n\n $tablesStr .= \" LEFT JOIN \" . $value['table'];\n break;\n\n case 'rj':\n\n $tablesStr .= \" RIGHT JOIN \" . $value['table'];\n break;\n\n case 'nj':\n\n $tablesStr .= \" NATURAL JOIN \" . $value['table'];\n break;\n\n case 'nlj':\n\n $tablesStr .= \" NATURAL LEFT JOIN \" . $value['table'];\n break;\n\n case 'nrj':\n\n $tablesStr .= \" NATURAL RIGHT JOIN \" . $value['table'];\n break;\n\n case 'loj':\n\n $tablesStr .= \" LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'roj':\n\n $tablesStr .= \" RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nloj':\n\n $tablesStr .= \" NATURAL LEFT OUTER JOIN \" . $value['table'];\n break;\n\n case 'nroj':\n\n $tablesStr .= \" NATURAL RIGHT OUTER JOIN \" . $value['table'];\n break;\n\n default:\n break;\n }\n\n if (isset($value['alias'])) {\n\n $tablesStr .= \" AS \" . $value['alias'];\n }\n\n if (isset($value['joinconditions']) &&\n count($value['joinconditions'])) {\n\n $tablesStr .= $this->\n WhereClause($value['joinconditions'], 1);\n }\n }\n }\n }\n\n $return .= \" FROM \" . ltrim($tablesStr, \", \");\n\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n\n $groupsArr = [];\n\n foreach ($this->\n group as $key => $value) {\n\n if (is_string($value)) {\n\n $groupsArr[] = \"{$value}\";\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $groupsArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\";\n } else if (isset($value['value'])) {\n\n $value['value'] = $this->\n connection->\n GetConn()->\n real_escape_string($value['value']);\n $groupsArr[] = \"'{$value['value']}'\";\n } else {\n\n $groupsArr[] = \"{$value['column']}\";\n }\n }\n\n if (count($groupsArr)) {\n\n $return .= \" GROUP BY \" . implode($groupsArr, \", \");\n }\n\n\n if (count($this->\n having)) {\n\n $return .= $this->\n WhereClause($this->\n having, 2);\n }\n\n\n $ordersArr = [];\n\n foreach ($this->\n order as $key => $value) {\n\n if (is_string($value)) {\n\n $ordersArr[] = $value;\n } else if (isset($value['subquery']) &&\n $value['subquery'] instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $value['subquery']->\n IsSelect()) {\n\n $ordersArr[] = \"(\" . rtrim($value['subquery']->\n Generate(), ';') . \")\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else if (isset($value['value'])) {\n\n $ordersArr[] = \"'{$value['value']}'\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n } else {\n\n $ordersArr[] = \"{$value['column']}\" . (isset($value['type']) &&\n $value['type'] == 'd' ? \" DESC\" : \"\");\n }\n }\n\n if (count($ordersArr)) {\n\n $return .= \" ORDER BY \" . implode($ordersArr, \", \");\n }\n\n if ($this->\n perpage > 0) {\n\n if ($this->\n page < 1) {\n\n $this->\n page = 1;\n }\n\n $startcount = $this->\n perpage * ($this->\n page - 1);\n\n $return .= \" LIMIT {$startcount}, {$this->\n perpage}\";\n }\n\n return $return . \";\";\n }", "abstract public function prepareSelect();", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "protected function _sql_select ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = ($this->bDistinct) ? 'SELECT DISTINCT ' : 'SELECT ';\n /*\n Select which fields ?\n */\n $sql .= (empty($this->aFields)) ? '*' : implode(', ', $this->aFields);\n /*\n From which tables ?\n */\n $sql .= (empty($this->aTables)) ? '' : \"\\nFROM \" . implode(', ', $this->aTables);\n /*\n Join something ?\n */\n if (!empty($this->aJoin))\n {\n foreach ($this->aJoin as $j)\n {\n $sql .= \"\\n{$j[0]} JOIN {$j[1]} ON {$j[2]}\";\n }\n }\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Group by ?\n */\n if (!empty($this->aGroupBy))\n {\n $sql .= \"\\nGROUP BY \" . implode(', ', $this->aGroupBy);\n }\n /*\n Having ?\n */\n if (!empty($this->aHaving))\n {\n $sql .= \"\\nHAVING \";\n foreach ($this->aHaving as $i)\n {\n $sql .= \"\\n{$i[0]}{$i[1]} {$i[2]}\";\n }\n }\n /*\n Order by ?\n */\n if (!empty($this->aOrderBy))\n {\n $sql .= \"\\nORDER BY \";\n foreach ($this->aOrderBy as $i)\n {\n $sql .= \"{$i[0]} {$i[1]}, \";\n }\n $sql = trim($sql, ', ');\n }\n /*\n Query limit ?\n */\n if ($this->nLimit !== false)\n {\n if ($this->nOffset !== false)\n {\n $sql .= \"\\nLIMIT \" . $this->nOffset . ', ' . $this->nLimit;\n }\n else\n {\n $sql .= \"\\nLIMIT 0, \" . $this->nLimit;\n }\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "private function buildSelectString () \n {\n $this->selectSql = \"SELECT \";\n $this->selectSql .= $this->columns;\n $this->selectSql .= \" FROM \" . $this->tableName;\n if ($this->where !== null && $this->where !== \"\") {\n $this->selectSql .= \" WHERE \" . $this->where;\n }\n if ($this->order !== null && $this->order !== \"\") {\n $this->selectSql .= \" ORDER BY \" . $this->order;\n }\n if ($this->other !== null && $this->other !== \"\") {\n $this->selectSql .= $this->other;\n }\n }", "public function get_select()\n {\n $flags = $this->sql_no_cache ? 'sql_no_cache' : '';\n $flags .= $this->sql_calc_found ? 'sql_calc_found_rows' : '';\n\n $fields_table = $this->alias ? $this->alias: self::quote_name($this->table);\n\n $fields = $this->fields ? join(', ', $this->fields): $fields_table.'.*';\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $having = $this->get_having();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n $mode = $this->for_update ? 'for update': '';\n $mode = $this->share_mode ? 'lock in share mode': '';\n // MySQL runs a needless filesort when grouping without an order clause. disable it.\n if ($group && !$order) $order = 'order by null';\n return \"select $flags $fields $from $join $where $group $having $order $limit $mode\";\n }", "protected function prepareSelectStatement() {}", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "protected function buildSelectClause() {\r\n\t\t$sql='';\r\n\t\t$fields=array();\r\n\t\tforeach($this->_salt_fields as $data) {\r\n\t\t\t/** @var SqlExpr $expr */\r\n\t\t\tlist($expr, $alias) = $data;\r\n\r\n\t\t\t$fields[]=$expr->toSQL().' as '.self::escapeName($alias);\r\n\t\t\t$this->linkBindsOf($expr, ClauseType::SELECT);\r\n\t\t}\r\n\t\t$sql.=implode(', ', $fields);\r\n\t\treturn $sql;\r\n\t}", "protected function getSelect() {\n $oSql = new SqlSelect();\n $oSql->setEntity($this->Persistence->getTableName());\n $oSql->addColumn(implode(',', $this->getColumns()));\n $oSql->setCriteria($this->Criteria); \n return $oSql->getInstruction();\n }", "public function select($table, $fields, $where, $order, $start);", "public function createSelectSql(): \\Hx\\Db\\Sql\\SelectInterface;", "static public function GenerateBaseSelectClause()\r\n\t{\r\n\t\t$returnValue = \"\tSELECT\ta.TagID,\r\n\t\t\t\t\t\t\t\t\t\ta.TagText \";\r\n\r\n\t\treturn $returnValue;\r\n\t}", "private function makeSelectAndFrom()\r\n\t{\r\n\t\t// Build SQL\r\n\t\t$sql = 'SELECT ';\r\n\t\r\n\t\t// Add custom fields (subqueries)\r\n\t\tif ($this->hasCustomFields())\r\n\t\t{\r\n\t\t\t// Find custom fields\r\n\t\t\tforeach ($this->fields as $field)\r\n\t\t\t{\r\n\t\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql .= '(' . $field->query . ') AS `' . $field->name . '`, ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif (!$this->hasForeignFields())\r\n\t\t{\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\t$sql .= implode(', ', $this->selectFields) . ' ';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$sql .= '`'.$this->name.'`.* ';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$sql .= 'FROM `'.$this->name.'` ';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get foreign fields\r\n\t\t\t$cols = array();\r\n\t\r\n\t\t\tif (isset($this->selectFields))\r\n\t\t\t{\r\n\t\t\t\t// Use custom field selection\r\n\t\t\t\tforeach ($this->selectFields as $field)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[] = $field;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Take all fields\r\n\t\t\t\t$cols[] = 't1.*';\r\n\t\t\t}\r\n\t\r\n\t\t\t$from_sql = 'FROM `'.$this->name.'` t1 ';\r\n\t\t\t$joined = array();\r\n\t\t\t$joins = array();\r\n\t\t\t$alias_no = 2;\r\n\t\t\t$tables[] = array('table' => $this->name, 'alias' => 't1');\r\n\t\r\n\t\t\t// Iterate over fields\r\n\t\t\tforeach ($this->fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$use_alias = false;\r\n\t\r\n\t\t\t\tif ($field instanceof ForeignField)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check if foreign field should be included, if select fields were set\r\n\t\t\t\t\tif (isset($this->selectFields))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$found = false;\r\n\t\t\t\t\t\tforeach ($this->selectFields as $sel_field)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (str_contains($sel_field, $field->name))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$found = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (!$found)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\t// Find out what kind of join it should be (INNER or LEFT)\r\n\t\t\t\t\t$join_type = strtoupper($field->joinType);\r\n\t\r\n\t\t\t\t\t// Check if it's a join between two foreign tables\r\n\t\t\t\t\tif ($field->joinFromTable == null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between this table and other table\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' => $this->name, \r\n\t\t\t\t\t\t\t'to_table' => $field->table,\r\n\t\t\t\t\t\t\t'from' => $field->joinFrom, \r\n\t\t\t\t\t\t\t'to' => $field->joinTo\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->CheckJoinExists($this_join, $joins))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table .'` t'.$alias_no.' ON t1.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Join between two other tables\r\n\t\r\n\t\t\t\t\t\t// Check if we need to make a new join\r\n\t\t\t\t\t\t$this_join = array(\r\n\t\t\t\t\t\t\t'from_table' \t=> $this->table_name, \r\n\t\t\t\t\t\t\t'to_table' \t\t=> $field->foreign_field->table,\r\n\t\t\t\t\t\t\t'from' \t\t\t=> $field->foreign_field->join_from, \r\n\t\t\t\t\t\t\t'to' \t\t\t=> $field->foreign_field->join_to\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\tif (!$this->checkJoinExists($this_join, $joins)) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON '.$alias.'.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$from_sql .= $join_type.' JOIN `'.$field->table.'` t'.$alias_no.' ON `'.$field->joinFromTable.'`.`'.$field->joinFrom.'` = t'.$alias_no.'.`'.$field->joinTo.'` ';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$joins[] = $this_join;\r\n\t\t\t\t\t\t\t$use_alias = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t\tif ($use_alias)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$cols[] = 't'.$alias_no.'.`'.$field->foreignFieldName .'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t$tables[] = array('table' => $field->table, 'alias' => 't'.$alias_no);\r\n\t\t\t\t\t\t$alias_no++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Check if table has alias\r\n\t\t\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $tables)) !== false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = $alias.'.`'.$field->foreignFieldName.'` AS `'.$field->name .'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$cols[] = '`'.$field->table.'`.`'.$field->foreignFieldName.'` AS `'.$field->name.'`';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->tableAliases = $tables;\r\n\t\r\n\t\t\t$sql .= implode(', ', $cols).' '.$from_sql;\r\n\t\r\n\t\t\t$this->table_aliases = $tables;\r\n\t\t}\r\n\t\r\n\t\treturn $sql;\r\n\t}", "private function _select(){\n $this->debugBacktrace();\n $parameter = $this->selectParam; //transfer to local variable.\n $this->selectParam = \"\"; //reset updateParam.\n\n \n \n $sql = \"\";\n if($this->hasRawSql){\n $sql = $parameter;\n $this->hasRawSql = false;\n }\n else{\n $tableName = $this->tableName;\n $this->tableName = \"\"; //reset.\n\n $columns = \"\";\n if(!isset($parameter) || empty($parameter)){\n $columns = \"*\";\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n else{\n //first check whether it has 'select' keyword\n $parameter = trim($parameter);\n $keyWord = substr($parameter,0,6);\n if(strtoupper($keyWord)==\"SELECT\") {\n $sql = $parameter;\n }\n else{\n $columns = $parameter;\n $sql = $this->_prepare_select_sql($columns,$tableName);\n }\n }\n }\n\n \n $queryObject = $this->_perform_mysql_query($sql);\n \n if(empty($this->selectModifier)){\n //No select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $quantity = 0;\n $rows = array();\n switch ($this->fetchType){\n case \"fetch_object\":\n while ($row = mysqli_fetch_object($queryObject)) {\n if(isset($tableName)){\n $meta = new stdClass();\n $meta->type = $tableName;\n $row->__meta = $meta;\n }\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_assoc\":\n while ($row = mysqli_fetch_assoc($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_array\":\n while ($row = mysqli_fetch_array($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_row\":\n while ($row = mysqli_fetch_row($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n case \"fetch_field\":\n while ($row = mysqli_fetch_field($queryObject)) {\n $rows[] = $row;\n $quantity++;\n }\n break;\n }\n\n if($quantity>0){\n mysqli_free_result($queryObject);\n }\n\n return $rows;\n //<----No select modifier (first, firstOrDefault, single, singleOrDefault) found \n }\n else{ \n //select modifier (first, firstOrDefault, single, singleOrDefault) found ---->\n $selectModifier = $this->selectModifier;\n $this->selectModifier = \"\";\n $row;\n switch($selectModifier){\n case \"first\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n break;\n \n case \"firstOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n break;\n\n case \"single\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n throw new ZeroException(\"No data found.\");\n }\n if($numRows > 1){\n throw new ZeroException(\"Multiple records found.\");\n }\n break;\n\n case \"singleOrNull\":\n $numRows = mysqli_num_rows($queryObject);\n if($numRows == 0){\n return NULL;\n }\n if($numRows > 1){\n return NULL;\n }\n break;\n }\n\n return $this->_prepareSingleRecord($queryObject);\n //<---- select modifier (first, firstOrDefault, single, singleOrDefault) found *212*062#\n }\n }", "protected function _transformQuery()\n {\n if (!$this->_dirty || $this->_type !== 'select') {\n return;\n }\n\n if (empty($this->_parts['from'])) {\n $this->from([$this->_repository->getAlias() => $this->_repository->table()]);\n }\n $this->_addDefaultFields();\n $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields);\n $this->_addDefaultSelectTypes();\n }", "function select() {\n return \"\n contact_a.id AS contact_id,\n contact_a.contact_sub_type AS contact_sub_type,\n contact_a.sort_name AS sort_name,\n source,\n created_date,\n modified_date\n \";\n }", "protected function getSelectStatement()\n {\n return \"SELECT BookID, ISBN10, ISBN13, Title, CopyrightYear, TrimSize, PageCountsEditorialEst\n as PageCount, Description, CoverImage, Status, Subcategories.SubcategoryID, SubcategoryName, Imprints.ImprintID, Imprint, BindingType FROM Books\n JOIN Statuses ON (Books.ProductionStatusID = Statuses.StatusID) JOIN Subcategories ON \n (Books.SubcategoryID = Subcategories.SubcategoryID) JOIN Imprints USING (ImprintID) JOIN BindingTypes USING (BindingTypeID)\";\n }", "protected function buildValuesFromSelect(): string\n {\n $sql = '';\n\n // Check for a SELECT statement and append if available\n if ( isset($this->select) )\n {\n $sql .= $this->indentStatement($this->select, 1);\n\n $this->mergeBindings($this->select);\n }\n\n return $sql;\n }", "private function GeneraSelectQuery($fields,$where)\r\n\t{\r\n\t\t$sql=\"select \r\n\t\t\t\".$fields.\" \r\n\t\t\tfrom Tabla\r\n\t\t\tinner join Tabla1 on Tabla1.id=Tabla.idTabla1\r\n\t\t\t\".(($where)?\" WHERE \".$where:\"\");\r\n\t\treturn $sql;\r\n\t}", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function SELECTquery($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') {\n \n $query = parent::SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n \n // trace query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n #$this->logQuery($debugQuery); // activate for debugging purposes only - no logging by default for non-modifying queries like selects!\n \n return $query;\n \n }", "function select() {\n return \"\n contact_a.id as contact_id ,\n contact_a.contact_type as contact_type,\n contact_a.sort_name as sort_name,\n contact_a.job_title as job_title,\n contact_a.organization_name as current_employer\n \";\n }", "public function createSelect()\n {\n return $this->getConnection()->select();\n }", "function select($spec) {\n\t\t$spec['select'] = array_unique($spec['select']);\n\t\tif(isset($spec['modifiers'])) {\n\t\t\t$spec['select'][0] = implode(' ', $spec['modifiers']) . ' ' . $spec['select'][0];\n\t\t\t$spec['modifiers'] = null;\n\t\t}\n\t\tif(isset($spec['join'])) {\n\t\t\t$spec['from'] = $spec['from'] . \" \" . implode(' ',$spec['join']);\n\t\t\t$spec['join'] = null;\n\t\t}\n\t\treturn $this->quoteIdentifiers($this->aliasFields($this->compile($spec), true));\n\t}", "public function getQuerySelect() {\n $R = 'R_'. $this->id;\n return \"$R.value_id AS `\". $this->name.\"`\";\n }", "static public function GenerateBaseSelectClause()\n\t{\n\t\t$returnValue = \"\tSELECT\ta.MerchantAccountID,\n\t\t\t\t\t\t\t\t\t\ta.Name,\n\t\t\t\t\t\t\t\t\t\ta.ProcessorClassName,\n\t\t\t\t\t\t\t\t\t\ta.IsAvailable,\n\t\t\t\t\t\t\t\t\t\tb.TransactionFee,\n\t\t\t\t\t\t\t\t\t\tb.DiscountPercent,\n\t\t\t\t\t\t\t\t\t\tb.AccountID \";\n\n\t\treturn $returnValue;\n\t}", "public abstract function getSelect(\n $fields, $from, $where = '', $groupby = '', $limit = 0, $offset = 0\n );", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "public function compileSelect(Builder $builder): string\n {\n if (is_null($builder->columns)) {\n $builder->columns = ['*'];\n }\n\n return trim($this->concatenate($this->compileComponents($builder)));\n }", "public function compileSelect(Builder $query)\n\t{\n\t\tif (is_null($query->columns)) $query->columns = array('*');\n\n\t\t$components = $this->compileComponents($query);\n\n\t\t// If an offset is present on the query, we will need to wrap the query in\n\t\t// a big \"ANSI\" offset syntax block. This is very nasty compared to the\n\t\t// other database systems but is necessary for implementing features.\n\t\tif ($query->limit > 0 || $query->offset > 0)\n\t\t{\n\t\t\treturn $this->compileAnsiOffset($query, $components);\n\t\t}\n\n\t\treturn trim($this->concatenate($components));\n\t}", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "function buildSelect($db_name,$table_name,$columns,$where_select){\n\n\t$query_select = \"SELECT \";\n\t//FILL COLUMNS FOR GET\n\tforeach ($columns as $c) {\n\t\t$query_select .= $c;\n\t\tif(array_search($c,$columns) != count($columns) - 1) $query_select .= \",\";\n\t}\n\tif($where_select != \"*\"){//GET \n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name WHERE \";\n\t\t//FILL VALUES WHERE\n\t\tend($where_select);\n\t\t$last_key = key($where_select);\n\t\tforeach ($where_select as $key => $value) {\n\t\t\t$query_select .= $key . \"=\" . \":\" . $key;\n\t\t\tif($key != $last_key) $query_select .= \" AND \";\n\t\t}\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,$where_select);\n\t}\n\telse{//GET ALL SELECT\n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name\";\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,\"*\");\n\t}\n\n}", "protected function _authenticateCreateSelect()\n {\n // build credential expression\n if (empty($this->_credentialTreatment)\n || (strpos($this->_credentialTreatment, \"?\") === false)\n ) {\n $this->_credentialTreatment = '?';\n }\n\n $credentialExpression = \n '(CASE WHEN ' . \n $this->_db->escape($this->_credentialColumn, true)\n . ' = ' . $this->_credentialTreatment \n . ' THEN 1 ELSE 0 END) AS '\n . $this->_db->escape('zend_auth_credential_match', true);\n\n // get select\n \n $dbSelect = \"SELECT *, $credentialExpression \" \n . \" FROM \" . $this->_tableName\n . ' WHERE '\n . $this->_db->escape($this->_identityColumn, true) . ' = ?';\n if ($this->_conditionStatement) { \n $dbSelect .= ' AND ' . $this->_conditionStatement;\n }\n return $dbSelect;\n }", "private function _prepare_select_sql($columns,$table){\n $this->debugBacktrace();\n $distinct = $this->distinct; $this->distinct = \"\";\n $sql = \"\";\n switch ($this->queryType){\n case \"select\":\n $sql = \"SELECT \". $distinct . \" \" . $columns .\" FROM \" . $table;\n break;\n case \"count\":\n case \"min\":\n case \"max\":\n case \"sum\":\n $aggregateFunctionName = $this->queryType;\n $sql = \"SELECT \". $aggregateFunctionName .\"(\". $distinct . \" \". $columns .\") as `\". $aggregateFunctionName .\"` FROM \" . $table;\n break;\n }\n \n if(!empty($this->joinClause)){\n $sql .= \" \" . $this->joinClause;\n $this->joinClause = \"\";\n }\n \n if(!empty($this->whereClause)){\n $sql .= \" WHERE \" . $this->whereClause;\n $this->whereClause =\"\";\n }\n \n \n if(!empty($this->groupByClause)){\n $sql .= \" GROUP BY \" . $this->groupByClause;\n $this->groupByClause =\"\";\n }\n \n if(!empty($this->havingClause)){\n $sql .= \" HAVING \" . $this->havingClause;\n $this->havingClause = \"\";\n }\n \n if(!empty($this->orderByClause)){\n $sql .= ' ORDER BY '. $this->orderByClause;\n $this->orderByClause = \"\";\n }\n //LIMIT 10 OFFSET 10\n if($this->selectModifier == \"first\"){\n $sql .= ' LIMIT 1';\n }\n else{\n if($this->takeQuantity > 0){\n $sql .= \" LIMIT \" . $this->takeQuantity;\n }\n }\n \n if($this->skipQuantity>0){\n $sql .= \" OFFSET \" . $this->skipQuantity;\n }\n \n return $sql;\n }", "function get_sql_select(){\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false)\r\n\t\t\t$select_str=substr($this->sql_query,0,stripos($this->sql_query,' WHERE '));\r\n\t\telse\r\n\t\t\t$select_str=$this->sql_query;\r\n\r\n\t\treturn $select_str;\r\n\r\n\t}", "protected function parseOperation()\n {\n $operation = 'select';\n\n $queryParts = explode('/', $this->query);\n array_shift($queryParts);\n\n if (!count($queryParts)) {\n $this->operation = $operation;\n\n return;\n }\n\n if (in_array($queryParts[0], $this->operations, true)) {\n $operation = array_shift($queryParts);\n if (count($queryParts) && is_numeric($queryParts[0])) {\n $this->params['limit'] = array_shift($queryParts);\n }\n $this->identifier = implode(',', $queryParts);\n } else {\n $this->identifier = implode(',', $queryParts);\n }\n\n if (!empty($this->identifier)) {\n $operation = 'namedselect';\n }\n\n $this->operation = $operation;\n }", "protected function getBaseSelect()\n {\n return \"SELECT * FROM \" . $this->getTableName();\n }", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "public function select();", "public function select();", "public function select();", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "protected static function select()\n {\n }", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "public function get_compiled_select($reset = TRUE)\n {\n $quote_ident = array($this, 'quote_identifier');\n\n // Callback to quote tables\n $quote_table = array($this, 'quote_table');\n\n // Callback to quote tables\n $quote_field = array($this, 'quote_field');\n\n // Start a selection query\n $sql = 'SELECT ';\n\n if ($this->_distinct === TRUE)\n {\n // Select only unique results\n $sql .= 'DISTINCT ';\n }\n\n if (empty($this->_select))\n {\n // Select all columns\n $sql .= '*';\n }\n else\n {\n $sql .= implode(', ', array_unique(array_map($quote_field, $this->_select)));\n }\n\n if ( ! empty($this->_from))\n {\n // Set tables to select from\n $sql .= ' FROM '.implode(', ', array_unique(array_map($quote_table, $this->_from)));\n }\n\n if( !empty($this->_atts['index_name']) )\n {\n $sql .= ' FORCE INDEX('.$this->_atts['index_name'].')';\n $this->_atts['index_name'] = '';\n }\n\n if ( ! empty($this->_join))\n {\n // Add tables to join[$table]\n $sql .= ' '.$this->_compile_join($this->_join);\n }\n\n if ( ! empty($this->_where))\n {\n // Add selection conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_group_by))\n {\n // Add sorting\n $sql .= ' GROUP BY '.implode(', ', array_map($quote_ident, $this->_group_by));\n }\n\n if ( ! empty($this->_having))\n {\n // Add filtering conditions\n $sql .= ' HAVING '.$this->_compile_conditions($this->_having);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ( $this->_as_row || $this->_as_field ) \n {\n $this->_limit = 1; \n }\n\n if ($this->_limit !== NULL)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n if ($this->_offset !== NULL)\n {\n // Add offsets\n $sql .= ' OFFSET '.$this->_offset;\n }\n\n if( !empty($this->_atts['lock']) && empty($this->_as_row) ) \n {\n $this->_atts['lock'] = false;//用过一次后释放\n $sql .= ' FOR UPDATE';\n }\n else if( !empty($this->_atts['share']) && empty($this->_as_row) ) \n {\n $this->_atts['share'] = false;//用过一次后释放\n $sql .= ' LOCK IN SHARE MODE';\n }\n\n return $sql;\n }", "function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->exec_SELECTquery_preProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\t$res = parent::exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_SELECTquery_postProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\treturn $res;\n\t}", "function exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy = '', $orderBy = '', $limit = '') {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->exec_SELECTquery_preProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\t$res = parent::exec_SELECTquery($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_SELECTquery_postProcessAction($select_fields, $from_table, $where_clause, $groupBy, $orderBy, $limit, $this);\n\t\t}\n\n\t\treturn $res;\n\t}", "public /*overrides*/ function getLimitSubquery()\n {\n $map = reset($this->_queryComponents);\n $table = $map['table'];\n $componentAlias = key($this->_queryComponents);\n\n // get short alias\n $alias = $this->getSqlTableAlias($componentAlias);\n\n $driverName = $this->_conn->getAttribute(Doctrine_Core::ATTR_DRIVER_NAME);\n\n // initialize the base of the subquery\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n $subquery = 'SELECT ';\n } else {\n $subquery = 'SELECT DISTINCT ';\n }\n // what about composite keys?\n if (is_array($table->getIdentifier())) {\n foreach ($table->getIdentifier() as $id) {\n $primaryKey[] = $this->_conn->quoteIdentifier($alias . '.' . $id);\n }\n $subquery .= join(', ', $primaryKey);\n } else {\n $primaryKey = $alias . '.' . $table->getColumnName($table->getIdentifier());\n $subquery .= $this->_conn->quoteIdentifier($primaryKey);\n }\n\n // pgsql & oracle need the order by fields to be preserved in select clause\n if ($driverName == 'pgsql' || $driverName == 'oracle' || $driverName == 'oci' || $driverName == 'mssql' || $driverName == 'odbc') {\n foreach ($this->_sqlParts['orderby'] as $part) {\n // Remove identifier quoting if it exists\n $e = $this->_tokenizer->bracketExplode($part, ' ');\n foreach ($e as $f) {\n if ($f == 0 || $f % 2 == 0) {\n $partOriginal = str_replace(',', '', trim($f));\n $callback = create_function('$e', 'return trim($e, \\'[]`\"\\');');\n $part = trim(implode('.', array_map($callback, explode('.', $partOriginal))));\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n // don't add functions\n if (strpos($part, '(') !== false) {\n continue;\n }\n\n // don't add primarykey column (its already in the select clause)\n if ($part !== $primaryKey) {\n $subquery .= ', ' . $partOriginal;\n }\n }\n }\n }\n }\n\n $orderby = $this->_sqlParts['orderby'];\n $having = $this->_sqlParts['having'];\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n $subquery .= ', ' . $expr[0] . ' AS ' . $this->_aggregateAliasMap[$dqlAlias];\n }\n }\n } else {\n foreach ($this->_expressionMap as $dqlAlias => $expr) {\n if (isset($expr[1])) {\n foreach ($having as $k => $v) {\n $having[$k] = str_replace($this->_aggregateAliasMap[$dqlAlias], $expr[0], $v);\n }\n foreach ($orderby as $k => $v) {\n $e = explode(' ', $v);\n if ($e[0] == $this->_aggregateAliasMap[$dqlAlias]) {\n $orderby[$k] = $expr[0];\n }\n }\n }\n }\n }\n\n // Add having fields that got stripped out of select\n preg_match_all('/`[a-z0-9_]+`\\.`[a-z0-9_]+`/i', implode(' ', $having), $matches, PREG_PATTERN_ORDER);\n if (count($matches[0]) > 0) {\n $subquery .= ', ' . implode(', ', array_unique($matches[0]));\n }\n\n $subquery .= ' FROM';\n\n foreach ($this->_sqlParts['from'] as $part) {\n // preserve LEFT JOINs only if needed\n if (substr($part, 0, 9) === 'LEFT JOIN') {\n $e = explode(' ', $part);\n // Fix for http://www.doctrine-project.org/jira/browse/DC-706\n // Fix for http://www.doctrine-project.org/jira/browse/DC-594\n if (empty($this->_sqlParts['orderby']) && empty($this->_sqlParts['where']) && empty($this->_sqlParts['having']) && empty($this->_sqlParts['groupby'])) {\n continue;\n }\n }\n\n $subquery .= ' ' . $part;\n }\n\n // all conditions must be preserved in subquery\n $subquery .= ( ! empty($this->_sqlParts['where']))? ' WHERE ' . implode(' ', $this->_sqlParts['where']) : '';\n $subquery .= ( ! empty($this->_sqlParts['groupby']))? ' GROUP BY ' . implode(', ', $this->_sqlParts['groupby']) : '';\n $subquery .= ( ! empty($having))? ' HAVING ' . implode(' AND ', $having) : '';\n $subquery .= ( ! empty($orderby))? ' ORDER BY ' . implode(', ', $orderby) : '';\n\n if (($driverName == 'oracle' || $driverName == 'oci') && $this->_isOrderedByJoinedColumn()) {\n // When using \"ORDER BY x.foo\" where x.foo is a column of a joined table,\n // we may get duplicate primary keys because all columns in ORDER BY must appear\n // in the SELECT list when using DISTINCT. Hence we need to filter out the\n // primary keys with an additional DISTINCT subquery.\n // #1038\n $quotedIdentifierColumnName = $this->_conn->quoteIdentifier($table->getColumnName($table->getIdentifier()));\n $subquery = 'SELECT doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' FROM (' . $subquery . ') doctrine_subquery_alias'\n . ' GROUP BY doctrine_subquery_alias.' . $quotedIdentifierColumnName\n . ' ORDER BY MIN(ROWNUM)';\n }\n\n // add driver specific limit clause\n $subquery = $this->_conn->modifyLimitSubquery($table, $subquery, $this->_sqlParts['limit'], $this->_sqlParts['offset']);\n\n $parts = $this->_tokenizer->quoteExplode($subquery, ' ', \"'\", \"'\");\n\n foreach ($parts as $k => $part) {\n if (strpos($part, ' ') !== false) {\n continue;\n }\n\n $part = str_replace(array('\"', \"'\", '`'), \"\", $part);\n\n if ($this->hasSqlTableAlias($part)) {\n $parts[$k] = $this->_conn->quoteIdentifier($this->generateNewSqlTableAlias($part));\n continue;\n }\n\n if (strpos($part, '.') === false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\.[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('.', $match);\n\n // Rebuild the original part without the newly generate alias and with quoting reapplied\n $e2 = array();\n foreach ($e as $k2 => $v2) {\n $e2[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n $match = implode('.', $e2);\n\n // Generate new table alias\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n // Requote the part with the newly generated alias\n foreach ($e as $k2 => $v2) {\n $e[$k2] = $this->_conn->quoteIdentifier($v2);\n }\n\n $replace = implode('.' , $e);\n\n // Replace the original part with the new part with new sql table alias\n $parts[$k] = str_replace($match, $replace, $parts[$k]);\n }\n }\n\n if ($driverName == 'mysql' || $driverName == 'pgsql') {\n foreach ($parts as $k => $part) {\n if (strpos($part, \"'\") !== false) {\n continue;\n }\n if (strpos($part, '__') == false) {\n continue;\n }\n\n preg_match_all(\"/[a-zA-Z0-9_]+\\_\\_[a-z0-9_]+/i\", $part, $m);\n\n foreach ($m[0] as $match) {\n $e = explode('__', $match);\n $e[0] = $this->generateNewSqlTableAlias($e[0]);\n\n $parts[$k] = str_replace($match, implode('__', $e), $parts[$k]);\n }\n }\n }\n\n $subquery = implode(' ', $parts);\n return $subquery;\n }", "function getSelectSql()\n {\n $str = \"SELECT * FROM \";\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "public function select()\n {\n return $this->_db->factory('select', $this);\n }", "protected function processSelect(\\Zend_Db_Select $select)\n { }", "public function buildSelect()\n {\n $this->query->select(\"DISTINCT(p.id),p.*,\n u.first_name as owner_first_name,u.last_name as owner_last_name,\n c.id as company_id,c.name as company_name,IF(p.id=d2.primary_contact_id, 1, 0) AS is_primary_contact\");\n\n $this->query->from(\"#__people AS p\");\n $this->query->leftJoin(\"#__people_cf as cf ON cf.person_id = p.id\");\n $this->query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $this->query->leftJoin(\"#__companies AS c ON c.id = p.company_id\");\n $this->query->leftJoin(\"#__deals AS d ON d.id = cf.association_id AND cf.association_type = 'deal'\");\n $this->query->leftJoin(\"#__deals AS d2 ON d2.primary_contact_id = p.id\");\n\n }", "public function sql_split_select( $sql)\n {\n // extract the SELECT clause\n $sql_upper = strtoupper($sql);\n $pos_select = strpos( $sql_upper, \"SELECT\");\n $pos_from = strpos( $sql_upper, \"FROM\");\n $sql_select = substr( $sql, $pos_select+6, $pos_from-$pos_select-6);\n\n return $sql_select;\n }", "private function _montaInicioSelectQuestionario()\r\n {\r\n $select = $this->select()\r\n ->setIntegrityCheck(false);\r\n\r\n $select->from(array('pp' => KT_B_PERGUNTA_PEDIDO),\r\n array('cd_pergunta_pedido',\r\n 'tx_titulo_pergunta',\r\n 'st_multipla_resposta',\r\n 'st_obriga_resposta',\r\n 'tx_ajuda_pergunta'),\r\n $this->_schema);\r\n $select->join(array('orpp' => $this->_name),\r\n '(pp.cd_pergunta_pedido = orpp.cd_pergunta_pedido)',\r\n array('st_resposta_texto',\r\n 'ni_ordem_apresenta'),\r\n $this->_schema);\r\n $select->join(array('rp' => KT_B_RESPOSTA_PEDIDO),\r\n '(orpp.cd_resposta_pedido = rp.cd_resposta_pedido)',\r\n array('cd_resposta_pedido',\r\n 'tx_titulo_resposta'),\r\n $this->_schema);\r\n \r\n return $select;\r\n }", "public function\n\t\tget_select_query()\n\t{\n\t\t$query = '';\n\t\t\n\t\t$key_fields = $this->get_key_fields();\n\t\t\n\t\t#print_r($key_fields);\n\t\t\n\t\t$display_fields = $this->get_display_fields();\n\t\t\n\t\t#print_r($display_fields);\n\t\t\n\t\t$table_name = $this->get_table_name();\n\t\t\n\t\t$ordering_fields = $this->get_ordering_fields();\n\t\t\n\t\t#print_r($ordering_fields);\n\t\t\n\t\t/*\n\t\t * The select clause.\n\t\t */\n\t\t\n\t\t$select_fields = array();\n\t\t\n\t\tforeach ($key_fields as $key_field) {\n\t\t\t$select_fields[] = $key_field;\n\t\t}\n\t\t\n\t\tforeach ($display_fields as $display_field) {\n\t\t\t$select_fields[] = $display_field['name'];\n\t\t}\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$select_fields = array_unique($select_fields);\n\t\t\n\t\t#print_r($select_fields);\n\t\t\n\t\t$query .= 'SELECT ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($select_fields as $select_field) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $select_field . ' ';\n\t\t}\n\t\t\n\t\t/*\n\t\t * The from clause.\n\t\t */\n\t\t\n\t\t$query .= ' FROM ' . $table_name . ' ';\n\t\t\n\t\t/*\n\t\t * The order by clause.\n\t\t */\n\t\t\n\t\t$query .= ' ORDER BY ';\n\t\t\n\t\t$first = TRUE;\n\t\tforeach ($ordering_fields as $of) {\n\t\t\tif ($first) {\n\t\t\t\t$first = FALSE;\n\t\t\t} else {\n\t\t\t\t$query .= ' , ';\n\t\t\t}\n\t\t\t\n\t\t\t$query .= ' ' . $of['name'] . ' ' . $of['direction'] . ' ';\n\t\t}\n\t\t\n\t\t#echo $query;\n\t\t\n\t\treturn $query;\n\t}", "public function select($what = \"*\"){\n\t\t\tif(is_string($what)){\n\t\t\t\t$this->select = \"SELECT \" . $what . \" FROM \" . $this->table;\n\t\t\t}else{\n\t\t\t\t$this->select = false;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "protected function compileSelect(): ?string\n {\n if (! $this->columns) {\n return null;\n }\n\n return \"select $this->columns\";\n }", "public function subSelect(){\n try {\n // Sparql11query.g:620:3: ( project whereClause solutionModifier ) \n // Sparql11query.g:621:3: project whereClause solutionModifier \n {\n $this->pushFollow(self::$FOLLOW_project_in_subSelect2248);\n $this->project();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_subSelect2250);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_subSelect2252);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tif ($this->CurrentFilter <> \"\") {\n\t\t\tif ($sFilter <> \"\") $sFilter = \"(\" . $sFilter . \") AND \";\n\t\t\t$sFilter .= \"(\" . $this->CurrentFilter . \")\";\n\t\t}\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),\n\t\t\t$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);\n\t}", "protected function runSelectWithMeta()\n {\n return $this->connection->selectWithMeta(\n $this->toSql(),\n $this->getBindings(),\n ! $this->useWritePdo\n );\n }", "public function getQuerySelect() {\n return \"a.submitted_on AS `\" .$this->name .\"`\";\n }", "function mSELECT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$SELECT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:116:3: ( 'select' ) \n // Tokenizer11.g:117:3: 'select' \n {\n $this->matchString(\"select\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function parse_select( $alias = 'q' ) {\n\n\t\tif ( $this->args['return_value'] == 'relationships' ) {\n\t\t\treturn new Select( Select::ALL, $alias );\n\t\t} else {\n\t\t\treturn parent::parse_select( $alias );\n\t\t}\n\t}", "function select_sql($table='', $fields='*', ...$get_args) {\n\t\t$this->select_result = false;\n return $this->selecting($table, $fields, ...$get_args);\t \n }", "function _get_select_fields()\r\n\t{\r\n\t\t$sql_exec_fields = array();\r\n\t\tforeach ($this->_params as $key => $val)\r\n\t\t{\r\n\t\t\t$tmp_field = $this->_node_table . '.' . $key . ' AS ' . $val;\r\n\t\t\t$sql_exec_fields[] = $tmp_field;\r\n\t\t} \r\n\r\n\t\t$fields = implode(', ', $sql_exec_fields);\r\n\t\treturn $fields;\r\n\t}", "protected function _selectCompound($parts)\n {\n $stmt = '';\n \n // default parts of each 'compound' element\n $default = array(\n 'type' => null, // 'UNION', 'UNION ALL', etc.\n 'spec' => null, // array or string for the SELECT statement\n );\n \n // combine the compound elements\n foreach ((array) $parts['compound'] as $compound) {\n \n // make sure we have the default elements\n $compound = array_merge($default, $compound);\n \n // is it an array of select parts?\n if (is_array($compound['spec'])) {\n // yes, build a select string from them\n $select = $this->_select($compound['spec']);\n } else {\n // no, assume it's already a select string\n $select = $compound['spec'];\n }\n \n // do we need to add the compound type?\n // note that the first compound type will be ignored.\n if ($stmt) {\n $stmt .= strtoupper($compound['type']) . \"\\n\";\n }\n \n // now add the select itself\n $stmt .= \"(\" . $select . \")\\n\";\n }\n \n // add any overall order\n if (! empty($parts['order'])) {\n $stmt .= \"ORDER BY\\n \";\n $stmt .= implode(\",\\n \", $parts['order']) . \"\\n\";\n }\n \n // done!\n return $stmt;\n }", "protected function getSelect()\n {\n $this->sql = '';\n\n foreach ($this->select_array as $key) {\n $new_sql = $this->getElement($key);\n $this->sql = $this->getSelectAppend($new_sql, $this->sql);\n }\n\n return $this->sql;\n }", "private function makeWhatPart() {\n $query = \"(\";\n foreach ($this->what as $field) {\n $query .= $field . \", \";\n }\n return substr_replace($query ,\") \",-2);\n }", "public function build_select( $fields = array() ) {\n if ( empty( $fields ) ) {\n return ' SELECT * ';\n }\n\n return ' SELECT ' . implode( ', ', $fields );\n }", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "public function buildSelect(Query $query) {\n return $this->renderStatement(Query::SELECT, [\n 'fields' => $this->formatFields($query),\n 'table' => $this->formatTable($query->getTable(), $query->getAlias()),\n 'joins' => $this->formatJoins($query->getJoins()),\n 'where' => $this->formatWhere($query->getWhere()),\n 'groupBy' => $this->formatGroupBy($query->getGroupBy()),\n 'having' => $this->formatHaving($query->getHaving()),\n 'compounds' => $this->formatCompounds($query->getCompounds()),\n 'orderBy' => $this->formatOrderBy($query->getOrderBy()),\n 'limit' => $this->formatLimitOffset($query->getLimit(), $query->getOffset()),\n ] + $this->formatAttributes($query->getAttributes()));\n }", "public function getMagicSqlSubQuery(): string;", "public function select($fields=null) { if ($fields) $this->fields($fields); return $this->execute($this->get_select()); }", "function select($fields = '*', $fetch_type = \\PDO::FETCH_ASSOC)\n {\n $this->db->table($this->getTableFullName());\n return call_user_func_array([$this->db, __FUNCTION__], func_get_args());\n }", "protected function _compile_select($select_override = FALSE)\r\n\t{\r\n // Combine any cached components with the current statements\r\n $this->_merge_cache();\r\n\r\n // Write the \"select\" portion of the query\r\n if ($select_override !== FALSE)\r\n {\r\n $sql = $select_override;\r\n }\r\n else\r\n {\r\n $sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';\r\n\r\n if (count($this->qb_select) === 0)\r\n {\r\n $sql .= '*';\r\n }\r\n else\r\n {\r\n // Cycle through the \"select\" portion of the query and prep each column name.\r\n // The reason we protect identifiers here rather then in the select() function\r\n // is because until the user calls the from() function we don't know if there are aliases\r\n foreach ($this->qb_select as $key => $val)\r\n {\r\n $no_escape = isset($this->qb_no_escape[$key]) ? $this->qb_no_escape[$key] : NULL;\r\n $this->qb_select[$key] = $this->protect_identifiers($val, FALSE, $no_escape);\r\n }\r\n\r\n $sql .= implode(', ', $this->qb_select);\r\n }\r\n }\r\n\r\n // Write the \"FROM\" portion of the query\r\n if (count($this->qb_from) > 0)\r\n {\r\n $sql .= \"\\nFROM \".$this->_from_tables();\r\n }\r\n\r\n // Write the \"JOIN\" portion of the query\r\n if (count($this->qb_join) > 0)\r\n {\r\n $sql .= \"\\n\".implode(\"\\n\", $this->qb_join);\r\n }\r\n\r\n $sql .= $this->_compile_wh('qb_where')\r\n .$this->_compile_group_by()\r\n .$this->_compile_wh('qb_having')\r\n .$this->_compile_order_by(); // ORDER BY\r\n\r\n // LIMIT\r\n if ($this->qb_limit)\r\n {\r\n $sql = $this->_limit($sql.\"\\n\");\r\n }\r\n\r\n // ----------------------------------------------------------------\r\n\r\n // Write the \"LOCK IN SHARE MODE\" portion of the query\r\n\r\n if ($this->qb_lock_in_share_mode)\r\n {\r\n $sql .= \"\\nLOCK IN SHARE MODE\";\r\n }\r\n\r\n // ----------------------------------------------------------------\r\n\r\n // Write the \"LOCK IN SHARE MODE\" portion of the query\r\n\r\n if ($this->qb_for_update)\r\n {\r\n $sql .= \"\\nFOR UPDATE\";\r\n }\r\n\r\n return $sql;\r\n\t}", "function selectFunction($primaryField,$polarityField,$textField,$tableName) {\n\t$sql=\"SELECT \" . $primaryField . \" AS ID, \" . $polarityField . \" AS field1,\" . $textField . \" AS field2 FROM \" . $tableName ;\n\treturn $sql ; \n}", "public function select()\n {\n return new QueryProxy('select', $this);\n }", "function select($fields = NULL)\n {\n // Create a fresh slate\n $this->object->_init();\n if (!$fields or $fields == '*') {\n $fields = $this->get_table_name() . '.*';\n }\n $this->object->_select_clause = \"SELECT {$fields}\";\n return $this->object;\n }", "protected function _compile_select($select_override = FALSE)\n\t{\n\t\t// Combine any cached components with the current statements\n\t\t$this->_merge_cache();\n\n\t\t// Write the \"select\" portion of the query\n\t\tif ($select_override !== FALSE)\n\t\t{\n\t\t\t$sql = $select_override;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql = ( ! $this->qb_distinct) ? 'SELECT ' : 'SELECT DISTINCT ';\n\n\t\t\tif (count($this->qb_select) === 0)\n\t\t\t{\n\t\t\t\t$sql .= '*';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Cycle through the \"select\" portion of the query and prep each column name.\n\t\t\t\t// The reason we protect identifiers here rather than in the select() function\n\t\t\t\t// is because until the user calls the from() function we don't know if there are aliases\n\t\t\t\tforeach ($this->qb_select as $key => $val)\n\t\t\t\t{\n\t\t\t\t\t$no_escape = isset($this->qb_no_escape[$key]) ? $this->qb_no_escape[$key] : NULL;\n\t\t\t\t\t$this->qb_select[$key] = $this->protect_identifiers($val, FALSE, $no_escape);\n\t\t\t\t}\n\n\t\t\t\t$sql .= implode(', ', $this->qb_select);\n\t\t\t}\n\t\t}\n\n\t\t// Write the \"FROM\" portion of the query\n\t\tif (count($this->qb_from) > 0)\n\t\t{\n\t\t\t$sql .= \"\\nFROM \".$this->_from_tables();\n\t\t}\n\n\t\t// Write the \"JOIN\" portion of the query\n\t\tif (count($this->qb_join) > 0)\n\t\t{\n\t\t\t$sql .= \"\\n\".implode(\"\\n\", $this->qb_join);\n\t\t}\n\n\t\t$sql .= $this->_compile_wh('qb_where')\n\t\t\t.$this->_compile_group_by()\n\t\t\t.$this->_compile_wh('qb_having')\n\t\t\t.$this->_compile_order_by(); // ORDER BY\n\n\t\t// LIMIT\n\t\tif ($this->qb_limit OR $this->qb_offset)\n\t\t{\n\t\t\treturn $this->_limit($sql.\"\\n\");\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function __toString() {\n // to do it. This allows constructs like \"(string) $query\" to work. When\n // the query will be executed, it will be recompiled using the proper\n // placeholder generator anyway.\n if (!$this->compiled()) {\n $this->compile($this->connection, $this);\n }\n\n // Create a sanitized comment string to prepend to the query.\n $comments = $this->connection->makeComment($this->comments);\n\n // SELECT\n $query = $comments . 'SELECT ';\n if ($this->distinct) {\n $query .= 'DISTINCT ';\n }\n\n // FIELDS and EXPRESSIONS\n $fields = array();\n foreach ($this->tables as $alias => $table) {\n if (!empty($table['all_fields'])) {\n $fields[] = $this->connection->escapeTable($alias) . '.*';\n }\n }\n foreach ($this->fields as $alias => $field) {\n // Always use the AS keyword for field aliases, as some\n // databases require it (e.g., PostgreSQL).\n $fields[] = (isset($field['table']) ? $this->connection->escapeTable($field['table']) . '.' : '') . $this->connection->escapeField($field['field']) . ' AS ' . $this->connection->escapeAlias($field['alias']);\n }\n foreach ($this->expressions as $alias => $expression) {\n $fields[] = $expression['expression'] . ' AS ' . $this->connection->escapeAlias($expression['alias']);\n }\n $query .= implode(', ', $fields);\n\n\n // FROM - We presume all queries have a FROM, as any query that doesn't won't need the query builder anyway.\n $query .= \"\\nFROM \";\n foreach ($this->tables as $alias => $table) {\n $query .= \"\\n\";\n if (isset($table['join type'])) {\n $query .= $table['join type'] . ' JOIN ';\n }\n\n // If the table is a subquery, compile it and integrate it into this query.\n if ($table['table'] instanceof SelectQueryInterface) {\n // Run preparation steps on this sub-query before converting to string.\n $subquery = $table['table'];\n $subquery->preExecute();\n $table_string = '(' . (string) $subquery . ')';\n }\n else {\n $table_string = '{' . $this->connection->escapeTable($table['table']) . '}';\n }\n\n // Don't use the AS keyword for table aliases, as some\n // databases don't support it (e.g., Oracle).\n $query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);\n\n if (!empty($table['condition'])) {\n $query .= ' ON ' . $table['condition'];\n }\n }\n\n // WHERE\n if (count($this->where)) {\n // There is an implicit string cast on $this->condition.\n $query .= \"\\nWHERE \" . $this->where;\n }\n\n // GROUP BY\n if ($this->group) {\n $query .= \"\\nGROUP BY \" . implode(', ', $this->group);\n }\n\n // HAVING\n if (count($this->having)) {\n // There is an implicit string cast on $this->having.\n $query .= \"\\nHAVING \" . $this->having;\n }\n\n // ORDER BY\n if ($this->order) {\n $query .= \"\\nORDER BY \";\n $fields = array();\n foreach ($this->order as $field => $direction) {\n $fields[] = $field . ' ' . $direction;\n }\n $query .= implode(', ', $fields);\n }\n\n // RANGE\n // There is no universal SQL standard for handling range or limit clauses.\n // Fortunately, all core-supported databases use the same range syntax.\n // Databases that need a different syntax can override this method and\n // do whatever alternate logic they need to.\n if (!empty($this->range)) {\n if($this->range['start']) {\n $query .= \"\\nROWS \" . (int) $this->range['length'] . \" TO \" . (int) $this->range['start'] + (int) $this->range['length'];\n } else {\n $query .= \"\\nROWS \" . (int) $this->range['length']; \n }\n }\n\n // UNION is a little odd, as the select queries to combine are passed into\n // this query, but syntactically they all end up on the same level.\n if ($this->union) {\n foreach ($this->union as $union) {\n $query .= ' ' . $union['type'] . ' ' . (string) $union['query'];\n }\n }\n\n if ($this->forUpdate) {\n $query .= ' FOR UPDATE';\n }\n\n return $query;\n }", "function test_select($urabe, $body)\n{\n $sql = $body->sql_select;\n $result = $urabe->select($sql);\n $result->message = \"Urabe test selection query with default parser\";\n return $result;\n}", "private function buildSelectColumns()\n {\n $columns = array();\n\n foreach ($this->query['select'] as $column => $as) {\n // Normal column select\n if (is_numeric($column)) {\n $columns[] = $this->columnName($as);\n }\n // Alias\n else {\n $columns[] = $this->columnName($column) . \" AS `{$as}`\";\n }\n }\n\n // Join columns and return\n return implode(', ', $columns);\n }", "public function testInitialSelectStatement()\n {\n $method = $this->builder_reflection->getMethod('sql_select_statement');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('select_statement');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array('SELECT * FROM table1'));\n\n $string = 'SELECT * FROM table1';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function selectResult($table,$field,$where) {\n\t\tif($where!='')\n\t\t\t$where= ' WHERE '.$where;\n \t$query = \"SELECT \".$field.\"\n \t FROM \".$this->tablePrefix .$table.$where ;\n\t\t//echo $query;//exit;\n $res = $this->execute($query);\n \treturn $this->fetchAll($res);\n }", "public function select()\n\t{\n\t\treturn call_user_func_array([$this->queryFactory->__invoke('select'), 'select'], func_get_args());\n\t}", "public function selectQuery(){\n try {\n // Sparql11query.g:43:3: ( SELECT ( DISTINCT | REDUCED )? ( ( variable )+ | ASTERISK ) ( datasetClause )* whereClause solutionModifier ) \n // Sparql11query.g:44:3: SELECT ( DISTINCT | REDUCED )? ( ( variable )+ | ASTERISK ) ( datasetClause )* whereClause solutionModifier \n {\n $this->match($this->input,$this->getToken('SELECT'),self::$FOLLOW_SELECT_in_selectQuery142); \n // Sparql11query.g:45:3: ( DISTINCT | REDUCED )? \n $alt4=2;\n $LA4_0 = $this->input->LA(1);\n\n if ( (($LA4_0>=$this->getToken('DISTINCT') && $LA4_0<=$this->getToken('REDUCED'))) ) {\n $alt4=1;\n }\n switch ($alt4) {\n case 1 :\n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('DISTINCT') && $this->input->LA(1)<=$this->getToken('REDUCED')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n break;\n\n }\n\n // Sparql11query.g:49:3: ( ( variable )+ | ASTERISK ) \n $alt6=2;\n $LA6_0 = $this->input->LA(1);\n\n if ( (($LA6_0>=$this->getToken('VAR1') && $LA6_0<=$this->getToken('VAR2'))) ) {\n $alt6=1;\n }\n else if ( ($LA6_0==$this->getToken('ASTERISK')) ) {\n $alt6=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 6, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt6) {\n case 1 :\n // Sparql11query.g:50:5: ( variable )+ \n {\n // Sparql11query.g:50:5: ( variable )+ \n $cnt5=0;\n //loop5:\n do {\n $alt5=2;\n $LA5_0 = $this->input->LA(1);\n\n if ( (($LA5_0>=$this->getToken('VAR1') && $LA5_0<=$this->getToken('VAR2'))) ) {\n $alt5=1;\n }\n\n\n switch ($alt5) {\n \tcase 1 :\n \t // Sparql11query.g:50:5: variable \n \t {\n \t $this->pushFollow(self::$FOLLOW_variable_in_selectQuery175);\n \t $this->variable();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt5 >= 1 ) break 2;//loop5;\n $eee =\n new EarlyExitException(5, $this->input);\n throw $eee;\n }\n $cnt5++;\n } while (true);\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:51:7: ASTERISK \n {\n $this->match($this->input,$this->getToken('ASTERISK'),self::$FOLLOW_ASTERISK_in_selectQuery184); \n\n }\n break;\n\n }\n\n // Sparql11query.g:53:3: ( datasetClause )* \n //loop7:\n do {\n $alt7=2;\n $LA7_0 = $this->input->LA(1);\n\n if ( ($LA7_0==$this->getToken('FROM')) ) {\n $alt7=1;\n }\n\n\n switch ($alt7) {\n \tcase 1 :\n \t // Sparql11query.g:53:3: datasetClause \n \t {\n \t $this->pushFollow(self::$FOLLOW_datasetClause_in_selectQuery192);\n \t $this->datasetClause();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop7;\n }\n } while (true);\n\n $this->pushFollow(self::$FOLLOW_whereClause_in_selectQuery195);\n $this->whereClause();\n\n $this->state->_fsp--;\n\n $this->pushFollow(self::$FOLLOW_solutionModifier_in_selectQuery197);\n $this->solutionModifier();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function _select ($table_name, $select_column_names, $distinct = FALSE) {\n\t\t$statement = $distinct ? 'SELECT DISTINCT ' : 'SELECT ';\n\t\tif ( isset($select_column_names) && $select_column_names ) {\n\t\t\t$count_select_column_names = count($select_column_names);\n\t\t\tfor ($pointer = 0; $pointer < $count_select_column_names; $pointer++) { \n\t\t\t\tif ($pointer == $count_select_column_names - 1 ) {\n\t\t\t\t\t$statement .= '`' . $select_column_names[$pointer] . '` ';\n\t\t\t\t} else {\n\t\t\t\t\t$statement .= '`' . $select_column_names[$pointer] . \"`, \";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$statement .= \"* \";\n\t\t}\n\t\t$statement .= \"FROM `{$table_name}` \" ;\n\t\treturn $statement;\n\t}", "public function subQuery() {\n $query = new SubQuery(Query::SELECT, $this->getRepository());\n $query->fields(func_get_args());\n\n return $query;\n }", "public function sql() {\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/select/query.twig.sql\");\n\t\treturn $sqlT->render([\"query\" => $this]);\n\t}", "function Select($table, $fields, $where, $limit = false, $where_type = 'AND')\n\t{\n\t\t$where = $this->QueryWhereGenerate($where);\n\t\t\n\t\t$fields_query = '';\n\t\t$where_query = '';\n\t\t\n\t\tif (strstr($fields, ','))\n\t\t{\n\t\t\t$fields_array = explode(',', $fields);\n\t\t\t\n\t\t\tforeach ($fields_array AS $field)\n\t\t\t{\n\t\t\t\t$fields_query .= ', `' . trim($field) . '`';\n\t\t\t}\n\t\t\t\n\t\t\t$fields_query = substr($fields_query, 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fields == '*')\n\t\t\t{\n\t\t\t\t$fields_query = $fields;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fields_query = '`' . $fields . '`';\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($where AS $key => $value)\n\t\t{\n\t\t\t$where_query .= ' ' . $where_type. \" `\" . $key . \"` \" . $value;\n\t\t}\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1) . ' LIMIT ' . $limit);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->RunQuery(\"SELECT \" . $fields_query . \" FROM `\" . $table . \"` WHERE \" . substr($where_query, strlen($where_type) + 1));\n\t\t}\n\t}", "protected function getSelectStatement() {\n return \"SELECT PostID, UserID, MainPostImage, Title, Message, PostTime\n FROM Posts\";\n }", "public function select(string $alias)\n {\n $query = new Select($this->driver, $this);\n $this->columns[] = array(\n 'type' => 'sub_query',\n 'query' => $query,\n 'alias' => $alias,\n );\n return $query;\n }", "private function formatSelectCommand( $cols = '*', $extra = null )\n {\n $sql = 'SELECT ' . $cols . ' FROM ' . $this->table_name;\n\n if ( $extra != null )\n $sql .= ' ' . $extra;\n\n return $sql;\n }", "public function createQuery()\n\t{\n\t\t$this->tab[] = $this->action;\n\t\t$this->tab[] = !is_array($this->field) ? $this->field : join(', ',$this->field);\n\t\t$this->tab[] = ' FROM '.$this->from;\n\t\tif(!empty($this->where)){$this->tab[] = 'WHERE '.$this->where;}\n\t\tif(!empty($this->and)){$this->tab[] = 'AND '.$this->and;}\n\t\tif(!empty($this->or)){$this->tab[] = 'OR '.$this->or;}\n\t\tif(!empty($this->in)){$this->tab[] = 'IN '.$this->in;}\n\t\tif(!empty($this->beetween)){$this->tab[] = 'BEETWEEN '.$this->beetween;}\n\t\tif(!empty($this->not)){$this->tab[] = 'NOT '.$this->not;}\n\t\tif(!empty($this->like)){$this->tab[] = 'LIKE '.$this->like;}\n\t\tif(!empty($this->order)){$this->tab[] = 'ORDER BY '.$this->order;}\n\t\treturn join(\" \",$this->tab);\n\t}", "public function getLastSelect();", "static function fetchSelectQuery($sqlParts, $returnFields=NULL) {\n $query = CRM_ComposeQL_SQLUtil::createSqlSelectStatement($sqlParts);\n\n $dao = self::executeQuery($query['sql'], $query['params']);\n\n $result = array();\n while ($dao->fetch()) {\n $row = array();\n if (isset($returnFields)) {\n foreach ($returnFields as $field => $alias) {\n if (is_numeric($field)) {\n $field = $alias;\n }\n $row[$alias] = $dao->$field;\n }\n } else {\n $row = $dao->toArray();\n }\n $result[] = $row;\n }\n\n return $result;\n }" ]
[ "0.7070159", "0.69273496", "0.6893183", "0.6893183", "0.6885555", "0.684788", "0.6825492", "0.67933905", "0.66997164", "0.6667512", "0.6566631", "0.65448034", "0.647625", "0.6393985", "0.63804954", "0.6369291", "0.63563025", "0.632755", "0.6305543", "0.6241519", "0.62316054", "0.62277615", "0.62095225", "0.6199991", "0.61873317", "0.6179789", "0.6179182", "0.6165293", "0.61525184", "0.61409533", "0.6139117", "0.6123542", "0.6054251", "0.60477024", "0.60299075", "0.6025425", "0.6022218", "0.6001754", "0.59998524", "0.5999661", "0.59900033", "0.59717476", "0.59717476", "0.59717476", "0.5967145", "0.5967145", "0.59639126", "0.5953182", "0.59491295", "0.5948233", "0.5948233", "0.59387743", "0.59382015", "0.5934976", "0.59258187", "0.59140366", "0.5904826", "0.58981186", "0.5897733", "0.58954227", "0.5888033", "0.58862084", "0.58856195", "0.5866938", "0.5858229", "0.58581245", "0.58500874", "0.5847193", "0.58347404", "0.582333", "0.582305", "0.58182985", "0.5799772", "0.57973784", "0.5793458", "0.579189", "0.57892877", "0.5788428", "0.575151", "0.57468295", "0.5742424", "0.5733486", "0.5732183", "0.57318896", "0.5719396", "0.5717804", "0.5715031", "0.57063574", "0.56963295", "0.56629235", "0.5661741", "0.56509584", "0.56490064", "0.5644715", "0.5639109", "0.5638579", "0.5635941", "0.5631146", "0.5628377", "0.5617257", "0.56059885" ]
0.0
-1
Constructs the part after UPDATE for the UPDATE ... SET or ON DUPLICATE KEY UPDATE query.
protected function constructUpdateStringStatic(&$tablesUsed, $info, $allTables = false) { $updateString = ''; foreach ($info as $column => $value) { if (!in_array($column, $this->noCommitColumns) && ($allTables || !isset($this->columnAliases[$column]))) { $updateString .= $this->canonicalizeColumn($column, false, $tablesUsed, $allTables) . " = '" . $this->connObj->escapeString($value) . "', "; } } // Remove the comma and space at the end return substr($updateString, 0, -2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}", "public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }", "public function SQL_UPDATE() {\r\n\t}", "protected function _sql_update ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'UPDATE ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0] . \"\\nSET \";\n /*\n Fields and values.\n */\n foreach ($this->aFields as $k => $f)\n {\n $sql .= $f . ' = ' . $this->aValues[$k] . ', ';\n }\n $sql = rtrim($sql, ', ');\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "private function getSQLForUpdate()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->_sqlParts['set'])\n . ($this->_sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->_sqlParts['where']) : '');\n\n $query = ($this->_maxResults === null && $this->_firstResult == null)\n ? $query\n : $this->_connection->getAdapter()->applyLimit($query, $this->_firstResult, $this->_maxResults);\n\n return $query;\n }", "public function buildUpdate()\n {\n $sql = 'UPDATE ' . $this->getTableSql() \n . ( $this->driver->type != 'sqlite' ? $this->getTableAlias() : '' )\n . ' SET '\n . $this->buildSetterSql()\n . $this->buildJoinSql()\n . $this->buildConditionSql()\n ;\n\n /* only supported in mysql, sqlite */\n if ( $this->driver->type == 'mysql' || $this->driver->type == 'sqlite' ) {\n $sql .= $this->buildLimitSql();\n }\n\n if ( $this->driver->trim ) {\n return trim($sql);\n }\n return $sql;\n }", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "protected final function simple_update_query ( $sql )\n\t{\n\t\t//----------\n\t\t// Tables\n\t\t//----------\n\n\t\t$_tables = array();\n\t\tif ( !isset( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif ( !is_array( $sql['tables'] ) )\n\t\t{\n\t\t\t$sql['tables'] = array( $sql['tables'] );\n\t\t}\n\t\tif ( !count( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $sql['tables'] as $_table )\n\t\t{\n\t\t\t# If \"table name aliases\" are used\n\t\t\tif ( is_array( $_table ) and count( $_table ) )\n\t\t\t{\n\t\t\t\tforeach ( $_table as $_alias=>$_table_name )\n\t\t\t\t{\n\t\t\t\t\tif ( is_numeric( $_alias ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true );\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$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true )\n\t\t\t\t\t\t\t. \" AS \"\n\t\t\t\t\t\t\t. $this->db->quoteIdentifier( $_alias, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t# If its just an array of strings - i.e. no \"table name aliases\"\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table ), true );\n\t\t\t}\n\t\t}\n\n\t\t//---------\n\t\t// \"SET\"\n\t\t//---------\n\n\t\tif ( !count( $sql['set'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$_set = array();\n\t\tforeach ( $sql['set'] as $_col => $_val )\n\t\t{\n\t\t\tif ( $_val instanceof Zend_Db_Expr )\n\t\t\t{\n\t\t\t\t$_val = $_val->__toString();\n\t\t\t\tunset( $sql['set'][ $_col ] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_val = \"?\";\n\t\t\t}\n\t\t\t$_set[] = $this->db->quoteIdentifier( $_col, true ) . ' = ' . $_val;\n\t\t}\n\n\t\t//-----------\n\t\t// \"WHERE\"\n\t\t//-----------\n\n\t\t$_where = ! is_array( $sql['where'] ) ? array( $sql['where'] ) : $sql['where'];\n\n\t\tforeach ($_where as $_cond => &$_term) {\n # is $_cond an int? (i.e. Not a condition)\n if ( is_int( $_cond ) ) {\n # $_term is the full condition\n if ( $_term instanceof Zend_Db_Expr ) {\n $_term = $_term->__toString();\n }\n } else {\n # $_cond is the condition with placeholder,\n # and $_term is quoted into the condition\n $_term = $this->db->quoteInto( $_cond, $_term );\n }\n $_term = '(' . $_term . ')';\n }\n\n $_where = implode(' AND ', $_where);\n\n\t\t//------------------------------\n\t\t// Build the UPDATE statement\n\t\t//------------------------------\n\n\t\t$this->cur_query = \"UPDATE \"\n\t\t\t. implode( \", \" , $_tables )\n\t\t\t. \" SET \" . implode( \", \" , $_set )\n\t\t\t. ( $_where ? \" WHERE \" . $_where : \"\" );\n\n\t\t//----------------------------------------------------------------\n\t\t// Execute the statement and return the number of affected rows\n\t\t//----------------------------------------------------------------\n\n\t\ttry\n\t\t{\n\t\t\t$stmt = $this->db->query( $this->cur_query, array_values( $sql['set'] ) );\n\t\t\t$result = $stmt->rowCount();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch ( Zend_Db_Exception $e )\n\t\t{\n\t\t\t$this->Registry->exception_handler( $e );\n\t\t\treturn false;\n\t\t}\n\t}", "function update($where_clause=null)\n {\n $db = $this->getDb();\n \n $sets = array();\n $values = array();\n// Kint::dump($this->fields);\n foreach( array_keys( $this->fields ) as $field )\n {\n //echo \"<br> field \".Kint::dump($field,'Field',false);\n if(!is_null($where_clause) && $field == $this->id_name){\n \techo \"Skipping primary key '$field' & $this->id_name since there is another WC '$where_clause' \";\n \tcontinue;\n }\t\n if('0'==$field ){\n \tcontinue;\n }\n elseif(is_int($field)){\n \t//Kint::dump($field);\n \t//Kint::dump(array_keys($this->fields));\n \tcontinue;\n }\n elseif (!isset($this->fields[$field]))\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n }\n elseif ($field == 'updated')\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n } \n else{\t\n \t$sets []= $field.'=?';\n \t$values []= $this->fields[ $field ];\n }\n }\n $set = join( \", \", $sets );\n \n if(is_null($where_clause)){\n \tif($this->id<0)\n \t\tdie(kint::dump('ERROR: this->id was not set on DBObject',$this));\n \t//$values []= $this->id;\n \t$where_clause = $this->id_name.'='.$this->id; \t\n }\n if(!str_contains($set, 'updated')){\n \t$set .= ',updated = null ';\n }\n\t$sql = 'UPDATE '.$this->table.' SET '.$set.\n \t' WHERE '.$where_clause;\n\t//$this->execute($sql,$values);\n\t//die ('SQL in Update<br/>'.$sql.'<br/>'.var_dump($values));\n //Kint::dump('UpdateSQL',$sql);\n //die('TEST');\n $cmd = 'prepare';\n\ttry{\n\t\t$sth = $db->prepare( $sql );\n\t\t$cmd = 'execute';\n\t\t$this->execute( $sth, $values );\n\t}\n catch(exception $e){\n \t$debug=Zend_Debug::dump('Statement with error',$sql);\t\n \tdie(__LINE__.'Exception in DBObject::'.$cmd.'() while cmd='.$cmd.' SQL='.$sql\n \t\t.' with values <br>'.$values\n \t\t.__LINE__.'Exception:<br>'.nl2br($e)\n \t\t.'<hr/>'.$debug);\n } \t\n }", "function yy_r101(){\n $this->_retvalue = new SQL\\Update($this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor);\n if ($this->yystack[$this->yyidx + -4]->minor) $this->_retvalue->joins($this->yystack[$this->yyidx + -4]->minor);\n if ($this->yystack[$this->yyidx + -2]->minor) $this->_retvalue->where($this->yystack[$this->yyidx + -2]->minor);\n if ($this->yystack[$this->yyidx + -1]->minor) $this->_retvalue->orderBy($this->yystack[$this->yyidx + -1]->minor);\n if ($this->yystack[$this->yyidx + 0]->minor) $this->_retvalue->limit($this->yystack[$this->yyidx + 0]->minor[0], $this->yystack[$this->yyidx + 0]->minor[1]);\n }", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "protected function prepareUpdateStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Fields to update.\n $fields = [];\n foreach (array_diff($this->columns, $this->uniqueColumns) as $field) {\n $fields[] = \"$field = :$field\";\n }\n $fields = implode(',', $fields);\n\n // Prepare our statement.\n return $this->connection->prepare(\"UPDATE {$this->table} SET $fields WHERE $clauses\");\n }", "function getUpdateSql()\n {\n $str = 'UPDATE ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . ' SET ';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str .= ',';\n }\n $str = $str . \" \" . $k . \"=\" . $this->prepareForQuery($this->$k);\n\n\n }\n }\n $str .= \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "public function updateSql(){\n\n $sql = \"UPDATE {$this->table} SET \";\n $i = 0;\n $size = sizeof($this->requestUpdateValues);\n\n foreach ($this->requestUpdateValues as $key=>$value) {\n $sql .= \"{$key} = {$this->params['columnName_Pdo'][$key]} \";\n $i++;\n if($i < $size) { $sql .= ' , '; }\n }\n \n $sql .= \" WHERE id IN ({$this->updateIds}) \";\n \n return $sql;\n }", "public function get_update()\n {\n $table = self::quote_name($this->table);\n $alias = $this->alias ? $this->alias: '';\n $where = $this->get_where();\n $limit = $this->get_limit();\n $set = self::prepare_set($this->set);\n return \"update $table $alias set $set $where $limit\";\n }", "public function SQLUpdate($tabela, $colsvals, $condicoes = \"\", $innerJoins = \"\"){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$condicoesAudit = $condicoes;\n\t\t\t\t\n\t\t\t\t$tabelaAudit = \"$tabela\".(($innerJoins != \"\") ? \"INNER JOIN $innerJoins\" : \"\");\n\n\t\t\t\t$dataBefore = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabelaAudit\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$condicoesAudit\"));\n\t\t\t} \n\n\t\t\t$condicoes = ($condicoes != \"\") ? \"WHERE $condicoes\" : \"\";\n\t\t\t\n\t\t\tif($this->SQLType == 1){\n\t\t\t\t\n\t\t\t\t$innerJoins = ($innerJoins != \"\") ? \"INNER JOIN $innerJoins\" : \"\";\n\t\t\t\t$query = \"UPDATE $tabela $innerJoins SET $colsvals $condicoes\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$innerJoins = ($innerJoins != \"\") ? \"FROM $tabela INNER JOIN $innerJoins\" : \"\";\n\t\t\t\t$query = \"UPDATE $tabela SET $colsvals $innerJoins $condicoes\";\n\t\t\t}\n\n\t\t\t$this->lastQuery = $query;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t$result = mysqli_query($this->connection, $query) or $this->reportQueryError(mysqli_error(), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$result = odbc_exec($this->connection, $query) or $this->reportQueryError(odbc_errormsg(), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$result = $this->connection->query($query) or $this->reportQueryError(implode(\":\", $this->connection->errorInfo()), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$dataAfter = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabelaAudit\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$condicoesAudit\"));\n\n\t\t\t\t$this->audit = false;\n\n\t\t\t\t$this->autoAudit($query, $dataAfter, $dataBefore);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "private function Update()\n {\n $return = false;\n $action = $this->Action();\n $values = $this->Values();\n $table = $this->Table();\n $where = $this->Where();\n $errorInfo = $this->ERROR_INFO(__FUNCTION__);\n if(MySQLChecker::isAction($action, $errorInfo) && MySQLChecker::isTable($table, $errorInfo) &&\n Checker::isArray($values, false, $errorInfo) && Checker::isArray($where, false, $errorInfo) ) {\n if (isset($values[Where::VALUES]) && isset($values[self::COLUMNS]) && isset($where[Where::VALUES])) {\n $columns = $values[self::COLUMNS];\n $values = $values[Where::VALUES] + $where[Where::VALUES];\n if (Checker::isArray($columns, false, $errorInfo) && Checker::isArray($values, false, $errorInfo)) {\n $return[Where::QUERY] = \"$action $table SET \";\n foreach($columns as $column => $key)\n {\n $return[Where::QUERY] .= \"$column=$key, \";\n }\n $return[Where::QUERY] = trim($return[Where::QUERY],\", \");\n $return[Where::QUERY] .= $where[Where::QUERY];\n $return[Where::VALUES] = $values;\n }\n } else $this->addError(__FUNCTION__, \"Values and Query are not set!\", $values);\n }\n return $return;\n }", "public function getForUpdateSQL();", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "function UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->UPDATEquery_preProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t}", "function Update()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$updateParam = \"\";\n\t\t$updateValue = \"\";\n\t\t$blobs = array();\n\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\tif( $fld[\"key\"] )\n\t\t\t\t$command.= '$this->Param[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\telse\n\t\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tif( !$fld[\"key\"] && !array_key_exists( strtoupper($fieldname), array_change_key_case($this->Param, CASE_UPPER) ) )\n\t\t\t{\n\t\t\t\tforeach($this->Value as $field => $value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateValue.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \", \";\n\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\t\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($this->Param as $field=>$value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateParam.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\tconstruct SQL and do update\t\n\t\tif ($updateParam)\n\t\t\t$updateParam = substr($updateParam, 0, -5);\n\t\tif ($updateValue)\n\t\t\t$updateValue = substr($updateValue, 0, -2);\n\t\t\t\n\t\tif ($updateValue && $updateParam)\n\t\t{\n\t\t\t$dalSQL = \"update \".$this->_connection->addTableWrappers( $this->m_TableName ).\" set \".$updateValue.\" where \".$updateParam;\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\n\t\t//\tcleanup\n\t\t$this->Reset();\n\t}", "public function update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }", "public function forUpdate($sql){\n\t\treturn $sql.' FOR UPDATE';\n\t}", "function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\t$res = parent::exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_UPDATEquery_postProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn $res;\n\t}", "protected function getUpdate()\n {\n $this->update_columns = $this->columns;\n\n $from = $this->getElement('from');\n $from = substr($from, 5, 999);\n\n $query_string = 'UPDATE ' . $from . PHP_EOL;\n $query_string .= 'SET ' . $this->getElement('update_columns') . PHP_EOL;\n $query_string .= $this->getElement('where');\n\n $this->sql = $query_string;\n\n return $this->sql;\n }", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "protected function updateSql()\n {\n $sql = \"UPDATE \" . $this->dbName . \".\" . $this->table . \" SET \";\n $preparedPlaceholders = $this->prepareNamedPlaceholder();\n\n $sql.= $preparedPlaceholders . \" WHERE \" . $this->tablePK . \"=:id;\";\n\n $this->query = $sql;\n }", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "function adv_update($table, array $data, array $where);", "public function parseUpdate(&$arguments)\n {\n $arguments['action'] = 'update';\n $arguments['table'] = $this->getNextWord();\n\n if (strpos($arguments['table'], '.')) {\n list($arguments['db'], $arguments['table']) = explode('.', $arguments['table']);\n }\n\n /* Look for some main keywords */\n while ($word = $this->getNextWord()) {\n switch (true) {\n /* Grab the value-set */\n case (strtolower(substr($word, 0, 3)) == 'set'):\n {\n $this->c -= strlen($word) + 1;\n $this->getValueSet($arguments);\n\n break;\n }\n\n /* Parse the where clause */\n case (strtolower($word) == 'where'):\n {\n $this->parseWhere($arguments);\n $this->c--;\n\n break;\n }\n\n /* Parse the orderby clause */\n case (strtolower($word) == 'orderby'):\n {\n $this->parseOrderBy($arguments);\n\n break;\n }\n\n /* Parse the limit clause */\n case (strtolower($word) == 'limit'):\n {\n $this->parseLimit($arguments);\n\n break;\n }\n }\n }\n\n /* Return whatever results we got back */\n return $arguments;\n }", "function prepare_update($id = '', $data = []){\n // if there is no data to set, then return an empty string\n if($data == [] || $id == ''){\n return '';\n }\n $set_sql = '';\n $where_sql = '';\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n\n $where_sql = $this->create_where($id, []);\n \n return \"UPDATE {$this->table_name} $set_sql $where_sql;\";\n }", "private\tfunction\t_prepareSaveQuery()\n\t\t{\n\t\t\tif(!$this->_columns) {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\tNULL;\n\t\t\t} else {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\t'INSERT INTO `'.$this->_table.'`(`'.implode('`,`', array_keys($this->_columns)).'`)'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rVALUES(?\".str_repeat(',?', sizeof($this->_columns) - 1).')'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rON DUPLICATE KEY UPDATE \".trim(self::$_queries[$this->_class]['updates'],', ');\n\t\t\t}\n\t\t\tunset(self::$_queries[$this->_class]['updates']);\n\t\t\t\n\t\t\treturn\tself::$_queries[$this->_class]['save'];\n\t\t}", "function genericupdate ($table, $primary, $data) {\n\n /* Support single and combined primary keys. */\n if(gettype($primary)=='string'){\n $primary=array($primary);\n }\n $where = '';\n foreach ($primary as $k) {\n $where .= $k.'=\"'.$data[$k].'\" AND ';\n unset($data[$k]);\n }\n $set = '';\n foreach ($data as $key => $value) {\n foreach ($primary as $k) {\n if($key != $k) continue; }\n if (substr($key,0,1) == '@')\n $set .= substr($key,1).'='.$value.',';\n else\n $set .= $key.'=\"'.mysql_real_escape_string($value).'\",';\n }\n // UPDATE table SET a=1, b=2, c=3\n $query = 'UPDATE '.$table.' SET '.substr($set,0,strlen($set)-1).\n ' WHERE '.substr($where,0,strlen($where)-5);\n return $query;\n}", "public function orUpdate($data)\n {\n // Add the extra rule\n $orUpdateQuery = 'ON DUPLICATE KEY UPDATE ';\n \n // Add the column/value updates\n foreach($data as $field => $value)\n\t\t{\n\t\t\t$orUpdateQuery .= '`' . $this->san($field) . \"` = '\" . $this->san($value) . \"', \";\n\t\t}\n\t\t\n\t\t// Remove comma\n\t\t$this->query .= substr($orUpdateQuery, 0, -2) . ' ';\n\t\t\n // Return a ref. to this object for chainability\n return $this;\n }", "function buildUpdate($params)\n {\n $result = '';\n $setStatement = '';\n $fieldList = $this->getFieldList($params['table']);\n reset($fieldList);\n\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $setStatement .= \"`\" . current($fieldList) . \"` = '\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildUpdate #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $setStatement = preg_replace(\"/,\\s*$/\", \"\", $setStatement);\n\n $result = \"UPDATE \" . $params[\"table\"] . \" SET \" . $setStatement;\n\n if (isset($params['where']))\n {\n $result .= \" WHERE \" . $params['where'] . \";\" ;\n }\n else\n {\n $result .= \";\";\n }\n\n return $result;\n }", "private function create_update_sql($arr) {\n return implode(\" = ?, \\n\", array_keys($arr)).' = ?';\n }", "function dbupdate($table, $fields, $where = [1=>0], $funcs = null ) {\r\n\tglobal $msq;\r\n\t$parts = [];\r\n\tforeach ($fields as $k => $v)\r\n\t\t$parts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\tif ($funcs != null) {\r\n\t\tforeach ($funcs as $k => $v) {\r\n\t\t\t$parts []= $k.' = '.$v;\r\n\t\t}\r\n\t}\r\n\t$whparts = [];\r\n\tforeach ($where as $k => $v)\r\n\t\t$whparts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\t$q = \"update \".$table.\" set \".implode(\", \",$parts).\" where \".implode(\" and \",$whparts);\r\n\treturn dbcommit($q);\r\n}", "public function update( $table, $set, $where='', $shutdown=false, $preformatted=false, $add_join=array() );", "function fn_update($table, $param, $condition) {\r\n foreach ($param as $key => $value) {\r\n $this->query(\"update $table set $key = $value where $condition\");\r\n }\r\n }", "protected function _getUpdateCondition($tableName)\n\t{\n\t\treturn 'modification_id = ' . $this->_db->quote($this->getExisting('modification_id'));\n\t}", "private static function prepareUpdate($toupdate) {\n $updates = \"\";\n $keys = array_keys($toupdate);\n for($i = 0; $i < count($keys); $i++) {\n $updates .= $keys[$i] . \"=?\";\n $updates .= ($i < count($keys) - 1 ? \", \" : \" \");\n }\n $updates .= \"WHERE id=?\";\n return $updates;\n }", "function update($table='', $keyandvalue, ...$wherekeys) { \n if ( ! is_array( $keyandvalue ) || ! isset($table) || $table=='' ) {\n\t\t\t$this->setParamaters();\n return false;\n }\n \n $sql=\"UPDATE $table SET \";\n \n foreach($keyandvalue as $key=>$val) {\n if(strtolower($val)=='null') {\n\t\t\t\t$sql.= \"$key = NULL, \";\n } elseif(in_array(strtolower($val), array( 'current_timestamp()', 'date()', 'now()' ))) {\n\t\t\t\t$sql.= \"$key = CURRENT_TIMESTAMP(), \";\n\t\t\t} else {\n\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t$sql.= \"$key = \"._TAG.\", \";\n\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t} else \n\t\t\t\t\t$sql.= \"$key = '\".$this->escape($val).\"', \";\n\t\t\t}\n }\n \n $where = $this->where(...$wherekeys);\n if (is_string($where)) { \n $sql = rtrim($sql, ', ') . $where;\n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->query($sql, true) : $this->query($sql) ; \n } else {\n\t\t\t$this->setParamaters();\n return false;\n\t\t}\n }", "function afterUpdate($post_array, $primary_key='0'){\n // $identificador=$primary_key;\n // while(strlen($identificador)<4) $identificador=\"0\".$identificador;\n // $id=$post_array['id_grupo'];\n // $texto_grupo=$this->db->query(\"SELECT texto_grupo FROM c_grupos WHERE id='$id'\")->row()->texto_grupo;\n // $descripcion=$identificador.'-'.$post_array['nombre_actividad'];\n // if($texto_grupo) $descripcion.='-'.$texto_grupo;\n // $this->db->query(\"UPDATE c_actividades_infantiles SET descripcion='$descripcion' WHERE id='$primary_key'\");\n }", "function update_query($table_name, $condition, $data = null, $unescaped_data = null) {\r\n\t\t$values = array();\r\n\r\n\t\tif (isset($data)) {\r\n\t\t\tforeach($data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = '\".$this->escape($value).\"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isset($unescaped_data)) {\r\n\t\t\tforeach($unescaped_data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = \".$value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!count($values)) {\r\n\t\t\ttrigger_error(\"No data in update_query\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = \"UPDATE `$table_name` SET \".implode(', ',$values).\" WHERE \".$condition;\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "protected function setUpdateArray() {\n $column_names = getColumnNames($this->table_name);\n foreach ($column_names as $column_name) {\n if (isset($_POST[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_POST[$column_name]);\n } else if (isset($_GET[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_GET[$column_name]);\n }\n }\n }", "function update() {\n $col_names = array('first_name', 'last_name', 'category_id', 'active');\n $dat_param = array(':fn', ':ln', ':ci', ':ac');\n $sani_type = array('str', 'str', 'int', 'flag');\n $sub_check = array(false, false, false, false);\n $dat_types = array(PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_INT);\n\n $any_sub = false;\n\n //make sure non-optional data is set\n if (!isset($this->id)) throw new Exception('id must be provided');\n if (!isset($this->updated_by)) throw new Exception('updated_by must be provided'); \n\n $update_string = \"updated_by=:ub\";\n \n //check if updateable data exists, sanitize it, build up the update string:\n //a) loop through the updateable parameters\n for ($i = 0; $i < count($col_names); $i++) {\n\n //b) if it is set, attempt to sanitize/check it for update\n if (isset($this->{$col_names[$i]})) {\n $any_sub = true;\n $sub_check[$i] = true;\n $update_string .= \", {$col_names[$i]}={$dat_param[$i]}\";\n\n //c) sanitize/check by type\n if ($sani_type[$i] === 'str') {\n $this->{$col_names[$i]} = htmlspecialchars(strip_tags($this->{$col_names[$i]}));\n\n } elseif ($sani_type[$i] === 'flag') {\n if ( !($this->{$col_names[$i]} === 0 || $this->{$col_names[$i]} === 1) ) {\n throw new Exception(\"{$col_names[$i]} must be either 0 or 1\");\n }\n } elseif ($sani_type[$i] === 'int') {\n if (filter_var($this->{$col_names[$i]}, FILTER_VALIDATE_INT) === false) {\n throw new Exception('category_id does not conform');\n }\n }\n }\n } \n\n if (!$any_sub) throw new Exception('no data was submitted for staff member update.');\n \n $sql = \"UPDATE \n {$this->table_name}\n SET\n {$update_string}\n WHERE\n id=:id\";\n\n $stmt = $this->conn->prepare($sql);\n \n //bind the non-optional data to the query\n $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);\n $stmt->bindParam(':ub', $this->updated_by, PDO::PARAM_STR);\n\n //if the data was found and sanitized, then bind the data to the parameter\n for ($i=0; $i < count($col_names); $i++) { \n if ($sub_check[$i] === true) {\n $stmt->bindParam($dat_param[$i], $this->{$col_names[$i]}, $dat_types[$i]);\n }\n }\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "protected function buildSaveUpdate($async, $db, $table, array $data, $pk) {\n\t\t$lowPri = ($async ? 'LOW_PRIORITY' : '');\n\t\t$kvp = $this->makeKvp($data);\n\t\treturn \"UPDATE {$lowPri} `{$db}`.`{$table}` SET {$kvp} WHERE `{$this->pk}` = '{$pk}'\";\n\t}", "function generateUpdateQuery($tableName, $columns, $rowData)\n{\n //Genereate the SET part of the query\n $i = 0;\n $set = \"\";\n\n for($i = 0; $i < count($columns); $i=$i+1)\n {\n\t//Check if the data value has been put inside single-quotes and add\n\t//them if needed\n\t$len = strlen($rowData[$i]);\n\tif( $len <= 1 || $rowData[$i][0] != \"'\" || $rowData[$i][$len-1] != \"'\" )\n\t $set = $set . $columns[$i] . \"='\" . $rowData[$i] . \"'\";\n\telse\n\t $set = $set . $columns[$i] . \"=\" . $rowData[$i];\n\n\tif ($i+1 < count($columns))\n\t $set = $set . \",\";\n }\n\n $len = strlen($rowData[0]);\n if( $len <= 1 || $rowData[0][0] != \"'\" || $rowData[0][$len-1] != \"'\" )\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"='\" . $rowData[0] . \"'\";\n else\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"=\" . $rowData[0];\n}", "private function updateThing($thing, $thing_id, $thing_details) {\n //print_r($thing_details);\n //print_r($thing_id);\n $returnid = -1;\n /* get settext */\n $settings = array();\n $statement = \"\";\n $conditions = array();\n foreach ($thing_details as $key => $value) {\n if (is_string($value))\n\t{\n\t $value = trim($value);\n\t if (strlen($value) == 0)\n\t {\n\t $value === null;\n\t }\n\t}\n $lcasekey = $key; // don't need lower case\n $settings[] = $lcasekey . \" = \" . \":\" . $lcasekey;\n }\n $settext = implode(\", \", $settings);\n //print_r(\"settext: $settext\\n\");\n $conditions = array();\n if (is_array($thing_id) && $this->is_assoc($thing_id)) {\n\t/* no primary key, build $keytext from columns */\n\tforeach ($thing_id as $column_name => $value) {\n\t $conditions[] = $column_name . \" = \" . $value;\n\t }\n\t//print_r($conditions);\n\t$keytext = implode(\" AND \", $conditions);\n\t$returnid = $thing_details;\n }\n else {\n $primary_key = strtolower($thing) . '_' . 'id';\n $conditions[$primary_key] = $thing_id;\n $keytext = $this->makeConstraintSQL($conditions);\n $returnid = $thing_id;\n }\n\n //$keytext = $primary_key . \" = :\" . $primary_key;\n $statement = \"update $thing set \" . $settext . \" where \" . $keytext;\n\n //print_r($statement);\n //print_r($thing_details);\n try {\n $stmt = $this->conn->prepare($statement);\n $stmt->execute($thing_details);\n \n }\n catch(Exception $e) {\n $this->error .= '<pre>ERROR: ' . $e->getMessage() . '</pre>';\n }\n return $returnid;\n}", "function SQL_update ($var1,$var2,$var3,$var4,$var5,$var6 = null){\n\t/* Var definition\n\tvar1: Table_name\n\tvar2: Column to update\n\tvar3: Value to set\n\tvar4: Column to match\n\tvar5: Value to match\n\tvar6: Optional extra argument\n\t*/\n\tif ($var1 == null or $var2 == null or $var3 == null or $var4 == null or $var5 == null) {kernel_log(\"Missing argument for 'SQL_update'\",3);return;}\n\tif (gettype($var1) != \"string\" or gettype($var2) != \"string\" or gettype($var3) != \"string\" or gettype($var4) != \"string\" or gettype($var5) != \"string\") { kernel_log(\"Invalid argument type for 'SQL_update'\",3);return;}\n\t$return = null;\n\t\n\t$query = \"UPDATE $var1 SET $var2=$var3 WHERE $var4=$var5\";\n\tif ($var6 != null) {$query .= \" $var6\";}\n\t$return = sql_query($query);\n\treturn $return;\n}", "public function UPDATEquery($table, $where, $fields_values, $no_quote_fields=FALSE) {\n \n $query = parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n \n // log query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n $this->logQuery($debugQuery);\n \n return $query;\n \n }", "function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}", "private function getUpdateMixQuery()\n {\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n $query = \"UPDATE \" . TB_USAGE . \" SET \";\n $query .= \"equipment_id={$this->db->sqltext($this->equipment_id)}, \";\n $query .= \"apmethod_id=\" . ((empty($this->apmethod_id)) ? \"NULL\" : \"{$this->db->sqltext($this->apmethod_id)}\") . \", \";\n $query .= \"voc={$this->db->sqltext($this->voc)}, \";\n $query .= \"voclx={$this->db->sqltext($this->voclx)}, \";\n $query .= \"vocwx={$this->db->sqltext($this->vocwx)}, \";\n $query .= \"waste_percent=\" . ((empty($this->waste_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->waste_percent)}\") . \", \";\n $query .= \"recycle_percent=\" . ((empty($this->recycle_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->recycle_percent)}\") . \", \";\n $query .= \"description='{$this->db->sqltext($this->description)}', \";\n $query .= \"rule_id={$this->db->sqltext($this->rule_id)}, \";\n $query .= \"exempt_rule = \" . ((empty($this->exempt_rule)) ? \"NULL\" : \"'{$this->db->sqltext($this->exempt_rule)}'\") . \", \";\n $query .= \"notes = \" . ((empty($this->notes)) ? \"NULL\" : \"'{$this->db->sqltext($this->notes)}'\") . \", \";\n $query .= \"creation_time = {$this->db->sqltext($this->creation_time)}, \";\n $query .= \"spent_time = {$spentTime}, \";\n $query .= \"iteration = {$this->db->sqltext($this->iteration)}, \";\n $query .= \"parent_id = \" . ((empty($this->parent_id)) ? \"NULL\" : $this->db->sqltext($this->parent_id)) . \", \";\n $query .= \"pfp_id = {$pfpId}, \";\n $query .= \"last_update_time = NOW() \";\n $query .= \" WHERE mix_id ={$this->db->sqltext($this->mix_id)}\";\n return $query;\n }", "static function Update($table,$param,$param_value,$condition){\n mysql_query(\"update $table set $param = $param_value where $condition\");\n }", "protected function execUpdate($table, $where, $fields_values)\n {\n $no_quote_fields = FALSE;\n $GLOBALS[\"TYPO3_DB\"]->exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n }", "function build_update($table,$arr,$where) {\n\t$str = \"UPDATE `\".$table.\"` SET \";\n\t$keys = array_keys($arr);\n\tfor($a=0;$a<count($keys);$a++) {\n\t\t$updates[] = \"`\".$keys[$a].\"`='\".str_replace(\"'\",\"''\",$arr[$keys[$a]]).\"'\";\n\t}\n\n\t$str .= implode(',',$updates).' WHERE '.$where;\n\n\treturn $str;\n}", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "public function queryUpdate($table, $data, $where) : int;", "public function update($table_name, $fields_values = array(), $where = array())\r\n {\r\n }", "public function updateSpecific($cols, $conditions, $table) \n {\n $values = array();\n $prepReq = \"UPDATE \".$table.\" SET\";\n foreach ($cols as $col) \n { \n $prepReq = $prepReq.\" \".$col[0].\" = ?,\"; \n array_push($values, $col[1]);\n }\n $prepReq = substr_replace($prepReq ,\"\",-1); //remove last coma\n\n if(sizeof($conditions) != 0) \n {\n $prepReq = $prepReq . \" WHERE\";\n foreach ($conditions as $condition) \n { \n $prepReq = $prepReq.\" \".$condition[0].\" = ? and\"; \n array_push($values, $condition[1]);\n }\n $prepReq = substr_replace($prepReq ,\"\",-4); //remove last \" AND\"\n } \n else \n { \n $prepReq = $prepReq . \" WHERE 1\"; \n }\n\n $req = $this->db->prepare($prepReq);\n $res = $req->execute($values);\n return $res;\n\n }", "function updateData($table, $where, $fields)\n {\n $sql = \"\";\n $condition = \"\";\n $val = \"\";\n foreach ($where as $key => $value) {\n $condition .= \"$key = ?\";\n }\n foreach ($fields as $key => $value) {\n $val .= \"$key = ? , \";\n }\n $val = substr($val, 0, -2);\n $sql .= \"update $table set $val where $condition\";\n // print_r($sql);\n // exit;\n $result = $this->conn->prepare($sql);\n $temp = array_merge(array_values($fields), array_values($where));\n if ($result->execute($temp)) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }", "function _update ($table_name) {\n\t\treturn \"UPDATE `{$table_name}`\";\n\t}", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "private function getUpdateableClause () {\n\t\t$where = new Where;\n\t\tforeach ($this->primaryKeys as $key) {\n\t\t\t$value = $this->retreive($key);\n\t\t\tif ($value){\n\t\t\t\t$where->equals($key, $this->retreive($key));\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"Primary key (\". $key .\") has no value!\");\n\t\t\t}\n\t\t}\n\n\t\treturn $where;\n\t}", "function mysqlUpdateAny($before,$after,$table='*'){\n /*\n Updates with $after\n any field in $table (or in every table in the DB) that is = $before\n */\n $updates_made=0;\n if(!self::tableExists($table) && $table!='*')\n die(__FUNCTION__.'(): Table:\"'.$table.'\" doesn\\'t exist');\n \n if($table=='*'):\n \n $Tables=self::getDbStructure(); //EasyQuery\n \n foreach($Tables as $table_name=>$Field):\n \n foreach($Field as $field_name=>$FieldInfo):\n \n $updates_made+=\n self::update('\n UPDATE '.$table_name.' SET '.$field_name.'=\"'.$after.'\"\n WHERE '.$field_name.'=\"'.$before.'\"\n ');\n \n endforeach;\n \n endforeach;\n \n else:\n \n $Fields=self::getFieldNames($table);\n \n foreach($Fields as $field):\n\n $updates_made+=\n self::update('\n UPDATE '.$table.' SET '.$field.'=\"'.$after.'\"\n WHERE '.$field.'=\"'.$before.'\"\n ');\n \n endforeach;\n \n endif;\n \n \n \n return $updates_made;\n \n \n }", "function test_update($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update($table_name, $values, \"$column_name = $column_value\");\n}", "public function constructCommitQuery()\n {\n $allKeysSet = count(array_diff($this->keys, array_keys($this->info))) === 0;\n // If all keys set, default to update; otherwise, default to insert\n\n $columnsString = '';\n $valuesString = '';\n $updateString = '';\n\n $tablesUsed = array(); // Not needed; only support for one table right now\n\n foreach ($this->info as $column => $value) {\n if (!in_array($column, $this->noCommitColumns) &&\n !isset($this->columnAliases[$column])) {\n $value = $this->connObj->escapeString($value);\n $canonical = $this->canonicalizeColumn($column, false, $tablesUsed, false);\n $columnsString .= \"{$canonical}, \";\n $valuesString .= \"'{$value}', \";\n }\n }\n\n $tablesUsed = array();\n $columnsString = substr($columnsString, 0, -2);\n $valuesString = substr($valuesString, 0, -2);\n $updateString = $this->constructUpdateString($tablesUsed);\n\n // Update or insert with one query!\n if ($this->connObj->canUseOnDuplicateKeyUpdate()) {\n return \"INSERT INTO \" . $this->tableName .\n \" ({$columnsString}) VALUES ({$valuesString}) \" .\n \"ON DUPLICATE KEY UPDATE {$updateString}\";\n }\n\n $insertQuery = \"INSERT INTO \" . $this->tableName . \" ({$columnsString}) VALUES ({$valuesString})\";\n if ($allKeysSet && !empty($this->keys)) {\n // Check if we have an existing row in the database\n $tablesUsedBlackHole = array(); // Waste variable\n\n $whereString = $this->constructKeyCondString();\n\n $columnsString = $this->constructSelectColumnsStringStatic($tablesUsedBlackHole, $this->keys);\n $selectQuery = \"SELECT {$columnsString} FROM {$this->tableName} WHERE {$whereString}\";\n $result = $this->query($selectQuery);\n\n if ($result !== false && $this->connObj->fetchResult($result) !== false) {\n return \"UPDATE {$this->tableName} SET {$updateString} WHERE {$whereString}\";\n } else {\n return $insertQuery;\n }\n } else {\n return $insertQuery;\n }\n }", "public function get_compiled_update($reset = TRUE)\n {\n $sql = 'UPDATE '.(isset($this->_atts['ignore']) && $this->_atts['ignore'] ? ' IGNORE ' : ' ').\n $this->table_prefix($this->_table);\n if ( ! empty($this->_join))\n {\n // Add tables to join\n $sql .= ' '.$this->_compile_join($this->_join);\n }\n\n // Add the columns to update\n $sql .= ' SET '.$this->_compile_set($this->_set);\n\n if ( ! empty($this->_where))\n {\n // Add selection conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ($this->_limit !== null)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n return $sql;\n }", "public function update(array $param = array('table'=>'','data'=>[],'condition'=>[])) {\n\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (REQUIRED) associated array of columns and data e.g. ['column'=>'value','column'=>'value',...]\n $arrData = isset($param['data']) ? $param['data'] : [];\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n if( count( $arrData ) < 1 ) {\n echo \"data missing\";\n die;\n }\n\n $insert_values = [];\n $strColumns = \"\";\n $strWhere = \"\";\n\n if( count( $arrData ) > 0 ) {\n foreach($arrData as $key => $val){\n $strColumns .= \" `\".$key.\"` = ?, \";\n array_push($insert_values,$val);\n }\n $strColumns = substr($strColumns, 0, -2);\n }\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $insert_values, $col[1] );\n $strWhere .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $insert_values, $col[2] );\n $strWhere .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $strWhere .= \" AND \";\n }\n $strWhere = ' WHERE ' . substr($strWhere, 0, -4);\n }\n \n\n $strQry = \"UPDATE `\".$tableName.\"` SET \" . $strColumns . $strWhere . \";\";\n\n // print_r( $strQry ); \n // print_r( $insert_values ); die;\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n // $count = $this->stmt->rowCount(); // effected rows if updated with same value you will get zero\n // if( $count > 0 ) {\n // echo $count . ' record(s) updated successfully.';\n return [\n 'success' => true,\n 'message' => 'Record(s) updated successfully.',\n 'data' => null,\n 'code' => '001'\n ];\n // } else {\n // return [\n // 'success' => false,\n // 'message' => 'fails to get record(s)',\n // 'data' => null,\n // 'code' => '002'\n // ];\n // }\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n 'code' => '003'\n ];\n }\n $this->stmt = null;\n }", "function update( $table = '', $data = NULL, $where = NULL, $format = NULL, $where_format = NULL )\n\t{\n\t\t//check all necessary arguments\n\t\tif( !$table || !$data || !$where )\n\t\t\treturn FALSE;\n\t\t\n\t\t//prepare a list to store the insert args as they come\n\t\t$arg_list = array();\n\t\t\n\t\t//begin building the query\n\t\t$query = 'UPDATE';\t\t\t\n\t\t\n\t\t//set the table name in the query\n\t\tif( is_array( $table ) ) //allow for different prefix\n\t\t{\n\t\t\t$query .= $table[0];\n\t\t\t$arg_list[] = $table[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query .= ' %t';\n\t\t\t$arg_list[] = $table;\n\t\t}\n\t\t\n\t\t$query .= ' SET';\n\t\t\n\t\t//add each piece of data to the query\n\t\t$i=0;\n\t\tforeach( $data as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $data ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ' WHERE';\n\t\t\n\t\t//add each where condition to the query\n\t\t$i=0;\n\t\tforeach( $where as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $where_format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$where_format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $where ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ';';\n\t\t\n\t\t//prepare/sanitze the query\n\t\t$query = $this->prepare( $query, $arg_list );\n\n\t\t//execute the query and return the results\n\t\treturn $this->query( $query );\n\t}", "function update_mysql_table($table,$row,$idfld,$id,$newval,$otheroptionsarr=null) {\n\n\treturn mysql_query(\"UPDATE \".$table.\" \n\t\t\t\t\t\tSET \".$row.\"='\".$newval.\"' \".$otheroptionsarr['andset'].\"\n\t\t\t\t\t\tWHERE \".$idfld.\"='\".$id.\"' \".$otheroptionsarr['andwhere'].\"\n\t\t\t\t\t\t\") or die(\"update_mysql_table(UPDATE \".$table.\" SET \".$row.\"='\".$newval.\"' \".$otheroptionsarr['andset'].\" WHERE \".$idfld.\"='\".$id.\"' \".$otheroptionsarr['andwhere'].\" \".mysql_error());\n}", "function update_single_field($table,$set_field,$set_value,$where_field,$where_value)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"UPDATE $table SET $set_field = '$set_value' WHERE $where_field = '$where_value'\";\n\n\t\tif( !$result = $db->sql_query($sql) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Garage DB', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\treturn;\n\t}", "function editQuestionDB($update_arr=array(),$condition_arr=array()) {\r\n $this->db->where($condition_arr);\r\n $update = $this->db->update('dipp_question_master', $update_arr);\r\n if($update) {\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n\t}", "public function update($table, array $fields_arr, $where) {\n }", "protected function _getUpdateCondition($tableName)\r\n\t{\r\n\t\treturn 'bookmark_id = ' . $this->_db->quote($this->getExisting('bookmark_id'));\r\n\t}", "public function dbUpdate($table_name, $condition_col, $condition_val, $update) {\n\t\treturn DB::table($table_name)->where($condition_col, $condition_val)->update($update);\n\t}", "function prepare_update($rowindex) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->on_edit_callback != '') {\r\n $this->ds->{$colvar}[$rowindex] = eval($col->on_edit_callback);\r\n }\r\n }\r\n return True;\r\n }", "public function update( $sql, $params=array());", "public function getUpdateQuery($model)\n {\n $data = $model->getData();\n $fields = array_keys($data[0]);\n $valueFields = [];\n $conditions = [];\n $primaryKey = $model->getDescription()->getPrimaryKey();\n\n foreach ($fields as $field) {\n $quotedField = $this->db->quoteIdentifier($field);\n\n if (array_search($field, $primaryKey) !== false) {\n $conditions[] = \"{$quotedField} = :{$field}\";\n } else {\n $valueFields[] = \"{$quotedField} = :{$field}\";\n }\n }\n\n return 'UPDATE '.\n $model->getDBStoreInformation()['quoted_table'].\n ' SET '.implode(', ', $valueFields).\n ' WHERE '.implode(' AND ', $conditions);\n }", "public function save(){\n\t\t$v = get_object_vars($this);\n\t\tunset($v['TABLE']);\n\t\tunset($v['IS_UPDATING']);\n\t\t$key_s = \"\";\n\t\t$key_v = \"\";\n\t\tforeach($v as $key => $val){\n\t\t\t$key_s .= \"$key, \";\n\t\t\t$key_v .= \"'$val', \";\n\t\t}\n\t\t$key_s = substr_replace($key_s, '', strlen($key_s)-2);\n\t\t$key_v = substr_replace($key_v, '', strlen($key_v)-2);\n\t\tif($this->IS_UPDATING){\n\t\t\t$str = \"\";\n\t\t\tunset($v['id']);\n\t\t\tforeach($v as $key => $val){\n\t\t\t\t$str .= $key . \"='$val', \";\n\t\t\t}\n\t\t\t$str = substr_replace($str, '', strlen($str)-2);\n\t\t\t$query = \"UPDATE {$this->TABLE} SET $str WHERE id = {$this->id}\";\n\t\t} else {\n\t\t\t$query = \"INSERT INTO {$this->TABLE} ($key_s) VALUES ($key_v)\";\n\t\t}\n\t\t$q = parent::query($query);\n\t\treturn $q;\n\t}", "function update($table, $id, $data){\n global $conn;\n$sql = \"UPDATE $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$sql = $sql . \" WHERE id=?\";\n$data['id'] = $id;\n$stmt = executeQuery($sql, $data);\nreturn $stmt->affected_rows;\n}", "abstract function update (\\Database\\Query\\Query $query);", "function sql_update($table, $fields = array(), $where = null, $join = null, $limit = null, $offset = null) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$prefix = var_get('sql/prefix', '');\n\n\t$query = 'UPDATE ' . sql_quote($prefix . $table, true);\n\t\n\t$sql_fields = array();\n\tforeach ($fields as $key => $value) {\n\t\tif( is_numeric($key) && is_string($value) ){\n\t\t\t$sql_fields[] = $value;\t\n\t\t}else{\n\t\t\t$sql_fields[] = $key . ' = ' . sql_quote($value);\n\t\t}\n\t}\n\t$query .= ' SET ' . implode(', ', $sql_fields) . ' ';\n\n\tif( $join ){\n\t\tif( is_string($join) ){\n\t\t\t$query .= ' ' . $join;\n\t\t}elseif( is_array($join) ){\n\t\t\t$query .= ' ' . sql_join($join, $table);\n\t\t}\n\t}\n\n\t$query .= !$where ? '' : ' WHERE ' . sql_logic($where);\n\n\t// LIMIT CLAUSE\n\tif( !is_null($limit) ){\n\t\t$query .= ' LIMIT ' . (int)$limit;\n\t\tif( !is_null($offset) ){\n\t\t\t$query .= ' OFFSET ' . (int)$offset;\n\t\t}\n\t}\n\n\tsql_dump($query);\n\n\t$q = $sql->prepare($query . ';');\n\treturn $q->execute();\n}", "static function sql_to_update($table, $data, $wheredata)\n {\n $sql = \"UPDATE `$table` SET \";\n //fields\n $fields = \"\";\n if (is_array($data)){\n $counter = count($data);\n foreach ($data as $key=>$value)\n {\n $counter--;\n if (is_numeric($value)) {\n $fields .= \"`\" . $key . \"` = 0\" . $value . \"\" . (($counter == 0) ? \"\": \",\");\n } elseif (strpos($value, \"'\") !== false){//tim thay '\n $fields .= \"`\" . $key . \"` = \\\"\" . $value . \"\\\"\" . (($counter == 0) ? \"\": \",\");\n } else {\n $fields .= \"`\" . $key . \"` = '\" . $value . \"'\" . (($counter == 0) ? \"\": \",\");\n }\n } \n } else $fields = $data;\n \n //where\n $where = \" WHERE true\";\n if (empty($wheredata)) {\n $where = \"\";\n } elseif (is_array($wheredata)) {\n $counter = count($wheredata);\n foreach ($wheredata as $key=>$value)\n {\n $counter--;\n if ($key == \"time\") $key = \"`\" . $key . \"`\";\n if (is_numeric($value)) {\n $where .= \" AND (\" . $key . \" = \" . $value . \")\";\n }elseif (strpos($value, \"'\") !== false){//tim thay '\n $where .= \" AND (\" . $key . \" = \\\"\" . $value . \"\\\")\";\n } else {\n $where .= \" AND (\" . $key . \" = '\" . $value . \"')\";\n }\n }\n } else $where = \" WHERE \" . $wheredata . \" \";\n $sql .= $fields . $where;\n \n return $sql;\n }", "function updateViaPreparedPostHash($table,$key,$fields,$post,$data = array()){\n //print_pre($post,\"post hash\");\n //print_pre($data,\"data hash\");\n //print \"updateViaPreparedPostHash(): fields \" . implode(\",\",$fields) . \"<br>\\n\";\n if( ! isset($post[$key]) || $post[$key] == \"\" ){\n // then dont do anything\n //print \"updateViaPreparedPostHash(): post key failed<br>\\n\";\n return \"\";\n }\n $where = \" where $key='{$post[$key]}'\";\n \n // convert any special changes for html display to original values... ie: apostrophes\n foreach($post as &$p) $p = str_replace(array(\"&apos;\",\"\\'\"),array(\"'\",\"'\"),$p);\n \n $fs = array();\n $vs = array();\n foreach( $fields as $field){\n if( $post[$field] != $data[$field] ) {\n $fs[] = \"$field=?\";\n $vs[] = $post[$field];\n }\n }\n //print \"updateViaPreparedPostHash(): field count: \" . count($fs) . \"<br>\\n\";\n \n if( count($fs) > 0) {\n $setstr = implode(\",\",$fs);\n $vstr = implode(\",\",$vs);\n $pq = \"update $table set \" . $setstr . $where;\n $stm = $this->dbh->prepare($pq);\n $status = $stm->execute($vs);\n //print \"updateViaPreparedPostHash(): prepared query: $pq : valstr: $vstr<br>\\n\";\n return $stm->queryString . \" with values: \" . $vstr;\n }\n else return \"\";\n \n //$this->mesgs .= \"qstr: $qstr<br>\\n\";\n }", "public function updateQuery(): string\n {\n return 'UPDATE products \n SET name = :name, quantity = :quantity, price = :price, msrp = :msrp \n WHERE id = :id';\n }", "public function prepareUpdate() {\n $this->connection->update($this->mapTable)\n ->fields(array('needs_update' => MigrateMap::STATUS_NEEDS_UPDATE))\n ->execute();\n }", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "function update($tab, $data, $cond)\n{\n\t$fields = '';\n\tif (is_array($data)) {\n\t\t$sep = '';\n\t\tforeach($data as $k => $v) {\n\t\t\t//if ($k == '' or $v == '') continue;\n\t\t\tif (is_null($v)) $v = 'NULL'; else $v = \"'\".$this->escape($v).\"'\";\n\t\t\t$fields .= $sep.$this->drv->quote($k).\"=$v\";\n\t\t\t$sep = ',';\n\t\t}\n\t}\n\telse $fields = $data;\n\t\n\t$args = (func_num_args() > 3)? array_slice(func_get_args(),3) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\t$sql = \"UPDATE $tab set $fields WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}", "public static function GetUpdateQuery($table, $keys_and_values, $conditions)\r\n\t{\r\n\t\t$q = new QSqlQuery();\r\n\t\t$q->update()->{$table}->set();\r\n\r\n\t\tforeach ($keys_and_values as $key => $value)\r\n\t\t\t$q->{$key}->eq()->val($value);\r\n\r\n\t\t$q->where();\r\n\t\t\r\n\t\t$pos = 0;\r\n\t\tforeach ($conditions as $key => $value)\r\n\t\t{\r\n\t\t\tif ($pos > 0)\r\n\t\t\t\t$q->and();\r\n\t\t\t$q->{$key}->eq()->val($value);\r\n\t\t\t$pos++;\r\n\t\t}\r\n\t\treturn $q;\r\n\t}", "public function get_update_qry($vals){\n foreach($_POST AS $key => $value) { $_POST[$key] = $this->prep_sql($value); }\n\n $base = \"INSERT INTO `people` ( `first_name` , `last_name` , `address` \";\n $base .= \", `email` , `phone` , `social` , `username` , `password` ) \";\n $fmt_str = \"VALUES( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' );\";\n $res = sprintf($fmt_str, // can't just unpack?...hrm\n\t $vals[$this->new_post_vars[0]],\n \t $vals[$this->new_post_vars[1]],\n \t $vals[$this->new_post_vars[2]],\n \t $vals[$this->new_post_vars[3]],\n \t $vals[$this->new_post_vars[4]],\n \t $vals[$this->new_post_vars[5]],\n \t $vals[$this->new_post_vars[6]],\n \t $vals[$this->new_post_vars[7]]);\n $fin = $base . $res;\n return $fin;\n }", "function Update($table, $fields, $where, $where_type = 'AND')\n\t{\n\t\t$fields = $this->QuerySetGenerate($fields);\n\t\t$where = $this->QueryWhereGenerate($where);\n\t\t\n\t\t$set_query = '';\n\t\t$where_query = '';\n\t\t\n\t\tforeach ($fields AS $key => $field)\n\t\t{\n\t\t\t$set_query .= ', `' . $key . '` = ' . $field;\n\t\t}\n\t\t\n\t\tif (is_array($table))\n\t\t{\n\t\t\tforeach ($where AS $key => $value)\n\t\t\t{\n\t\t\t\t$where_query .= ' ' . $where_type. \" `\" . $key . \"` \" . $value;\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($table AS $_table)\n\t\t\t{\n\t\t\t\t$this->RunQuery(\"UPDATE `\" . $_table . \"` SET \" . substr($set_query, 1) . \" WHERE \" . substr($where_query, strlen($where_type) + 1));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($where AS $key => $value)\n\t\t\t{\n\t\t\t\t$where_query .= ' ' . $where_type. \" `\" . $key . \"` \" . $value;\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->RunQuery(\"UPDATE `\" . $table . \"` SET \" . substr($set_query, 1) . \" WHERE \" . substr($where_query, strlen($where_type) + 1));\n\t\t}\n\t}", "function update($tbl, $dataArray, $conditional=null)\n\t{\n\t\tforeach($dataArray as $k=>$v){\n\t\t\t$updsql .= \"$k='\".$this->real_escape_string($v).\"', \";\n\t\t}\n\t\t$updsql = substr ($updsql, 0, strlen($updsql) - 2);\n\t\tif($conditional != ''){\n\t\t\t$updsql.= \"WHERE {$conditional}\";\n\t\t}\n\t\t$sql = \"UPDATE {$tbl} SET {$updsql}\";\n\t\t$this->query($sql);\n\t}", "abstract public function update(string $table, array $set, array $where, array $options = []): int;", "protected function saveUpdate(array $data, array &$param = array()) {\r\n\r\n // TEMPORARY: SAVE LOG DISABLED\r\n // $this->saveLog('UPDATE', $data);\r\n\r\n //\r\n // disable cache reset, if model is not enabled for it.\r\n // At the moment, we don't even use the PRIMARY cache\r\n //\r\n if($this->cache) {\r\n $cacheGroup = $this->getCachegroup();\r\n $cacheKey = \"PRIMARY_\" . $data[$this->getPrimarykey()];\r\n $this->clearCache($cacheGroup, $cacheKey);\r\n }\r\n\r\n // raw data for usage with the timemachine\r\n if($this->useTimemachine()) {\r\n $raw = $data;\r\n }\r\n\r\n $query = 'UPDATE ' . $this->getTableIdentifier() .' SET ';\r\n $parts = [];\r\n\r\n foreach ($this->config->get('field') as $field) {\r\n if(in_array($field, array($this->getPrimarykey(), $this->table . \"_modified\", $this->table . \"_created\"))) {\r\n continue;\r\n }\r\n\r\n // If it exists, set the field\r\n if(array_key_exists($field, $data)) {\r\n\r\n if (is_object($data[$field]) || is_array($data[$field])) {\r\n $data[$field] = $this->jsonEncode($data[$field]);\r\n }\r\n\r\n $var = $this->getStatementVariable(array_keys($param), $field);\r\n\r\n // performance hack: store modelfield instance!\r\n if(!isset($this->modelfieldInstance[$field])) {\r\n $this->modelfieldInstance[$field] = \\codename\\core\\value\\text\\modelfield::getInstance($field);\r\n }\r\n $fieldInstance = $this->modelfieldInstance[$field];\r\n\r\n $param[$var] = $this->getParametrizedValue($this->delimit($fieldInstance, $data[$field]), $this->getFieldtype($fieldInstance));\r\n $parts[] = $field . ' = ' . ':'.$var;\r\n }\r\n }\r\n\r\n if($this->saveUpdateSetModifiedTimestamp) {\r\n $parts[] = $this->table . \"_modified = \".$this->getServicingSqlInstance()->getSaveUpdateSetModifiedTimestampStatement($this);\r\n }\r\n $query .= implode(',', $parts);\r\n\r\n $var = $this->getStatementVariable(array_keys($param), $this->getPrimarykey());\r\n // use timemachine, if capable and enabled\r\n // this stores delta values in a separate model\r\n\r\n // if ( ((new \\ReflectionClass($this))->implementsInterface('\\\\codename\\\\core\\\\model\\\\timemachineInterface')\r\n if($this->useTimemachine()) {\r\n $tm = \\codename\\core\\timemachine::getInstance($this->getIdentifier());\r\n $tm->saveState($data[$this->getPrimarykey()], $raw); // we have to use raw data, as we can't use jsonified arrays.\r\n }\r\n\r\n $param[$var] = $this->getParametrizedValue($data[$this->getPrimarykey()], 'number_natural'); // ? hardcoded type?\r\n\r\n $query .= \" WHERE \" . $this->getPrimarykey() . \" = \" . ':'.$var;\r\n return $query;\r\n\r\n }", "public function update($tblname, array $set_val_cols, $cod_val_cols){\n\t\t\n\t\t//append set_val_cols associative array elements \n\t\t$i=0;\n\t\tforeach($set_val_cols as $key=>$value) {\n\t\t\t$set[$i] = $key.\" = '\".$value.\"'\";\n\t\t $i++;\n\t\t}\n\n\t\t$Stset = implode(\", \",$set);\n\n/*\t\t//append cod_val_cols associative array elements\n\t\t$i=0;\n\t\tforeach($cod_val_cols as $key=>$value) {\n\t\t\t$cod[$i] = $key.\" = '\".$value.\"'\";\n\t\t $i++;\n\t\t}\n\n\t\t$Stcod = implode(\" AND \",$cod);\n*/\n\t\t//Update operation\n\t\tif($this->connection->query(\"UPDATE $tblname SET $Stset WHERE $cod_val_cols\") === TRUE){\n\t\t\tif(mysqli_affected_rows($this->connection)){\n\t\t\t\t#echo \"Record updated successfully<br>\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t#echo \"The Record you want to updated is no loger exists<br>\";\n\t\t\t}\n\t\t}else{\n\t\t\t#echo \"Error to update\".$this->connection->error;\n\t\t}\n\t}", "protected function _getUpdateCondition($tableName)\n {\n return 'handler_id = ' . $this->_db->quote($this->getExisting('handler_id'));\n }", "public function forUpdate($set = TRUE);" ]
[ "0.67769265", "0.63679963", "0.6334168", "0.62646544", "0.62502277", "0.6193436", "0.6161077", "0.6101469", "0.6079234", "0.60638815", "0.6044693", "0.6002905", "0.5967198", "0.5961416", "0.5950802", "0.5937583", "0.5900366", "0.5892704", "0.5823707", "0.5811677", "0.5809797", "0.577872", "0.5769814", "0.57680523", "0.57643384", "0.57503", "0.5747458", "0.5743464", "0.57331795", "0.57163376", "0.57141745", "0.56768405", "0.56496674", "0.5641378", "0.5636104", "0.56269866", "0.56235796", "0.5616361", "0.5603849", "0.5592349", "0.55719995", "0.55694664", "0.5568575", "0.55624986", "0.5544596", "0.55357444", "0.55149543", "0.54928476", "0.54926133", "0.54916537", "0.54746544", "0.5467846", "0.5440227", "0.5420454", "0.5418809", "0.5397611", "0.5386631", "0.5363001", "0.53602463", "0.5357121", "0.5355272", "0.53542954", "0.5348864", "0.5348732", "0.53460675", "0.5329633", "0.53292143", "0.5329124", "0.5326474", "0.5316141", "0.5300787", "0.5295971", "0.5284633", "0.52806896", "0.527625", "0.52760005", "0.5275951", "0.52733296", "0.52638704", "0.5262448", "0.5245934", "0.5238219", "0.52374655", "0.5236277", "0.5228377", "0.52273095", "0.5227057", "0.5215147", "0.5214658", "0.52110684", "0.5207989", "0.5206544", "0.51967543", "0.5190303", "0.5188418", "0.5186009", "0.5181953", "0.5178804", "0.5178538", "0.5178223", "0.5175909" ]
0.0
-1
Select the data from the database based on the conditions, order by, etc. given
public function select($options = null) { $query = $this->constructSelectQuery($options); //global $argv, $netId; if (isset($argv) || $netId == 'zpx2') var_dump($query); if ($query === false) { return false; } $this->result = $this->query($query); return ($this->result !== false ? $this : false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "function getAllRows($select, $tblName, $where = NULL , $and = NULL , $orderFeild = 'created_at' , $ordering = 'DESC')\n{\n global $conn;\n $rowStmt = $conn->prepare(\"SELECT $select FROM $tblName\n $where $and ORDER BY $orderFeild $ordering\");\n $rowStmt->execute();\n $rows = $rowStmt->fetchAll();\n return $rows;\n}", "public function select()\r\n\t{\r\n\t\t$this->clear();\r\n\t\t$where = null;\r\n\t\t// no args, so I'm searching for ALL... or doing a specific search\r\n\t\tif(func_num_args() === 0\r\n\t\t || ($where = call_user_func_array(array($this->obj, 'buildWhere'), func_get_args())))\r\n\t\t{\r\n\t\t\t$query = 'SELECT *\r\n\t\t\t\tFROM '.$this->obj->buildFrom();\r\n\t\t\t// pass args to where generator\r\n\t\t\tif($where)\r\n\t\t\t{\r\n\t\t\t\t$query .= ' WHERE '.$where;\r\n\t\t\t}\r\n\t\t\t$results = $this->site->db->query($query);\r\n\t\t\t$success = ($results->num_rows > 0);\r\n\t\t\twhile($row = $results->fetch_assoc())\r\n\t\t\t{\r\n\t\t\t\t$obj = new $this->obj->__CLASS__($this->obj->site);\r\n\t\t\t\tif($obj->loadRow($row))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->push($obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $success;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "function select_data_by_condition($tablename, $contition_array = array(), $data = '*', $sortby = '', $orderby = '', $limit = '', $offset = '', $join_str = array(), $groupby = '') {\n //print_r($join_str);\n //die();\n $this->db->select($data);\n if (!empty($join_str)) {\n // pre($join_str);\n foreach ($join_str as $join) {\n if ($join['join_type'] == '') {\n $this->db->join($join['table'], $join['join_table_id'] . '=' . $join['from_table_id']);\n }\n else{\n $this->db->join($join['table'], $join['join_table_id'] . '=' . $join['from_table_id'], $join['join_type']);\n }\n }\n }\n\n $this->db->where($contition_array);\n if(!empty($having)){\n $this->db->having($having);\n }\n //Setting Limit for Paging\n if ($limit != '' && $offset == 0) {\n $this->db->limit($limit);\n } else if ($limit != '' && $offset != 0) {\n $this->db->limit($limit, $offset);\n }\n //order by query\n if ($sortby != '' && $orderby != '') {\n $this->db->order_by($sortby, $orderby);\n }\n\n $this->db->group_by($groupby);\n $query = $this->db->get($tablename);\n\n if ($query->num_rows() > 0) {\n return $query->result_array();\n } else {\n return array();\n }\n }", "function select($where = false){\n $query=\"SELECT * FROM \". $this->tableName ;\n $separator=\" WHERE \";\n if ($where){\n foreach ( $where as $key => $value){\n\t$query .= $separator . $key . \" = '\" . $value . \"'\";\n\t$separator = \" AND \";\n }\n }\n $query .= \";\";\n \n $results = array();\n $res = $this->dbh->query($query);\n while ($row = $res->fetch_assoc()){\n array_push($results, $row);\n }\n return $results;\n }", "public function select($table, $fields, $where, $order, $start);", "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 }", "function fetch($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_array($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}", "public function get(){\n $this->query = \"SELECT \".$this->select.\" FROM $this->table WHERE \";\n $wheres = $this->mergeWhere().\" OR \".$this->mergeOrWhere();\n $query = $this->query.$wheres;\n $statement = $this->prepare($query);\n $statement->execute($this->bindings);\n return $statement->fetchAll();\n }", "function read_all(){\n \n // select all query\n $query = \"SELECT\n *\n FROM\n \" . $this->table_name . \"\n ORDER BY\n date DESC\";\n //SELECT id, username, date, content, IF(private, 'true', 'false') private\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function test_to_select($value1,$value2){\r\n\t\t\t$limit=10;\r\n\t\t$sql=\"select * from \".$this->table.\" where course_id=$value1 and chapter_id=$value2 order by test_name asc\";\r\n\t\t$objSql = new SqlClass();\r\n\t\t$record = $objSql->executeSql($sql);\r\n\t\treturn $record;\r\n\t\t//echo $sql;\r\n\t\t//$pagination_qatar = new pagination_qatar();\r\n\t\t//$pagination_qatar->createPaging($sql,$limit);\r\n\t\twhile($row=mysql_fetch_object($pagination_qatar->resultpage)){\r\n\t\t$rowdc[]=$row;\r\n\t\t}\r\n\t\t \r\n\t\t \r\n\t\treturn $rowdc;\r\n\t\t}", "function getRecords($table, $fields=\"\", $condition=\"\", $orderby=\"\", $single_row=false) //$condition is array \n\t{\n//\t\tif($fields != \"\")\n//\t\t{\n//\t\t\t$this->db->select($fields);\n//\t\t}\n\n $rs = $this->db->table($table);\n\n\t\tif($orderby != \"\")\n\t\t{\n $rs->orderBy($orderby,'DESC');\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs->getWhere($condition);\n\t\t}\n\t\t\n\t\tif($single_row)\n\t\t{ \n\t\t\treturn $rs->get()->getResultArray();\n\t\t}\n\t\treturn $rs->get()->getResultArray();\n\n\t}", "public function Select($cond)\r\n\t\r\n {\r\n\t\tglobal $db;\r\n if($cond==\"\")\r\n {\r\n $sql = \"SELECT * FROM \".$this->TableName;\r\n } else\r\n {\t\r\n\t\t \t\r\n\t\t $sql = \"SELECT * FROM \". $this->TableName.\" \".$cond;\r\n }\r\n try{\r\n $query = $db->prepare($sql);\r\n $query->execute();\r\n $arr['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n $arr['err'] = false;\r\n } catch(PDOException $e){\r\n $arr['err'] = true;\r\n $arr['msg'] = $e->getMessage(); \r\n } \r\n return $arr;\r\n }", "public function cpSelectAsc($tablename,$value3=0,$value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n $sql.= \" ORDER BY $value3 ASC\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "abstract public function prepareSelect();", "function getData($orderBys = null)\n{\n global $dbh;\n\n $SQL = $this->getListSQL();\n $SQL .= $this->getOrderBySQL($orderBys);\n\n $result = $dbh->getAll($SQL, DB_FETCHMODE_ASSOC);\n dbErrorCheck($result);\n\n return $result;\n}", "function View($condition,$table,$where_condition,$orderby){\n\t\t$select = \"select $condition from $table $where_condition $orderby\";\n\t\t$run = $this->connect->query($select);\n\t\t\n\t\tif($run->num_rows >= 1){\n\t\t\t\n\t\t\twhile($fetch = $run->fetch_assoc())\n\t\t\t{\n\t\t\t\t$data[] = $fetch;\n\t\t\t} //while loop close\n\t\t\treturn $data;\n\t\t} // if num_rows close\n\t}", "public function selectByFilter($orderDataVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($orderDataVo)) $orderDataVo = new OrderDataVo();\n$sql = \"select * from `order_data` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($orderDataVo->orderDataId)){ //If isset Vo->element\n$fieldValue=$orderDataVo->orderDataId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order_data_id` $key :orderDataIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order_data_id` $key :orderDataIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderDataIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderDataIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order_data_id` = :orderDataIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `order_data_id` = :orderDataIdKey';\n}\n$params[]=array(':orderDataIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($orderDataVo->orderId)){ //If isset Vo->element\n$fieldValue=$orderDataVo->orderId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order_id` $key :orderIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order_id` $key :orderIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order_id` = :orderIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `order_id` = :orderIdKey';\n}\n$params[]=array(':orderIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($orderDataVo->data)){ //If isset Vo->element\n$fieldValue=$orderDataVo->data;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `data` $key :dataKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `data` $key :dataKey\";\n}\nif($type == 'str') {\n $params[] = array(':dataKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':dataKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `data` = :dataKey';\n$isFirst=false;\n}else{\n$condition.=' and `data` = :dataKey';\n}\n$params[]=array(':dataKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('OrderDataVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "abstract function get_sql_filter($data);", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "public function cpSelectDsc($tablename,$value3=0, $value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n $sql.= \" ORDER BY $value3 DESC\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \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 user_where_clause() {}", "private function get_datatable_query()\n {\n if (permission('supplier-bulk-delete')){\n $this->column_order = [null,'id','name', 'address','mobile', 'email', 'city', 'country','status', null, null];\n }else{\n $this->column_order = ['id','name', 'address','mobile', 'email', 'city', 'country','status', null, null];\n }\n \n $query = self::toBase();\n\n //search query\n if (!empty($this->_name)) {\n $query->where('name', 'like', '%' . $this->_name . '%');\n }\n if (!empty($this->_mobile)) {\n $query->where('mobile', 'like', '%' . $this->_mobile . '%');\n }\n if (!empty($this->_email)) {\n $query->where('email', 'like', '%' . $this->_email . '%');\n }\n if (!empty($this->_status)) {\n $query->where('status', $this->_status);\n }\n\n //order by data fetching code\n if (isset($this->orderValue) && isset($this->dirValue)) { //orderValue is the index number of table header and dirValue is asc or desc\n $query->orderBy($this->column_order[$this->orderValue], $this->dirValue); //fetch data order by matching column\n } else if (isset($this->order)) {\n $query->orderBy(key($this->order), $this->order[key($this->order)]);\n }\n return $query;\n }", "function getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\tif (!$table) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$db\t\t= JFactory::getDbo();\r\n\t\t$query\t= $db->getQuery(true);\r\n\t\t\r\n\t\t$query->select('a.id');\r\n\t\t//$query->select('a.'.$key.' ,a.'.$label.'');\r\n\t\tif (is_array($fields)) {\r\n\t\t\tforeach($fields as $field) {\r\n\t\t\t\t$query->select('a.'.$field);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$query->from($table.' as a');\r\n\r\n\t\tif ( is_array($where) ) {\r\n\t\t\tforeach($where as $where_key => $where_item) {\r\n\t\t\t\t$query->where('a.'.$where_key.' = \"'.$where_item.'\"' );\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif (is_array($order)) {\r\n\t\t\tforeach($order as $order_item) {\r\n\t\t\t\t$query->order('a.'.$order_item);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif ( is_int($limit_start) && is_int($limit_limit) ) { \r\n\t\t\t$db->setQuery((string)$query,$limit_start, $limit_limit);\r\n\t\t} else {\r\n\t\t\t$db->setQuery((string)$query);\r\n\t\t}\r\n\r\n\t\tif (!$db->query()) {\r\n\t\t\tJError::raiseError(500, $db->getErrorMsg());\r\n\t\t}\r\n\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db;\r\n\t}", "public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }", "public function select($table_name, $fields = array(), $where = array(), $order_by = '')\r\n {\r\n }", "function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "function selectData($table, $where)\n {\n $sql = \"\";\n $record = array();\n $condition = \"\";\n foreach ($where as $key => $value) {\n $condition .= $key . \"= ? and \";\n }\n $condition = substr($condition, 0, -5);\n $sql .= \"select * from $table where $condition\";\n $result = $this->conn->prepare($sql);\n $result->execute(array_values($where));\n if ($result->rowCount() > 0) {\n $row = $result->fetch(PDO::FETCH_ASSOC);\n return $row;\n } else {\n return false;\n }\n $this->conn = null;\n }", "private function getDataTablesQuery() {\n\n\t\t$this->db->select('*');\n $this->db->from($this->table);\n //$this->db->where_not_in('akses',2); // mendandakan dia admin\n \n $i = 0;\n foreach ($this->column as $item)\n {\n if($_POST['search']['value'])\n ($i===0) ? $this->db->like($item, $_POST['search']['value']) : $this->db->or_like($item, $_POST['search']['value']);\n $column[$i] = $item;\n $i++;\n }\n \n if(isset($_POST['order']))\n {\n $this->db->order_by($column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);\n }\n else if(isset($this->order))\n {\n $order = $this->order;\n $this->db->order_by(key($order), $order[key($order)]);\n }\n }", "function select($tablename,$firstColumn,$lastColumn,$sort = '',$columnName = '',$valueName=''){\n if($valueName == ''){\n $this->query = \"SELECT * from $tablename order by $columnName $sort limit $firstColumn,$lastColumn\";\n }else{\n if(is_numeric($valueName)){\n $this->query = \"select * from $tablename where $columnName < $valueName order by $columnName $sort limit $firstColumn,$lastColumn\";\n }else{\n $this->query = \"select * from $tablename where $columnName like '$valueName%' order by $columnName $sort limit $firstColumn,$lastColumn\";\n }\n }\n \n return $this->query;\n }", "function getConditionalData($select_atrib,$conditions){\n $query = \"SELECT \";\n $comma_counter = 1;\n foreach ($select_atrib as $val){\n $query .= \"{$val}\";\n if($comma_counter < sizeof($select_atrib)){\n $query .= \",\";\n $comma_counter += 1;\n }\n\n }\n $query .= \" FROM $this->table_name WHERE \".$conditions;\n\n $result = $this->db_connect->query($query);\n if (!$result) {\n die(\"Data Retrieve failed: \" . $this->db_connect->error);\n } else {\n if ($result->num_rows > 0) {\n $data = array();\n while ($row = $result->fetch_assoc()) {\n array_push($data,$row);\n }\n return $data;\n }else{\n return null;\n }\n }\n }", "public function cpSelect($tablename,$value1=0,$value2=0) {\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1='$value1[$key1]'\";\n }\n if($value1!=0 && $value2!=0) \n {\n $key2= key($value2);\n $sql.=\" AND $key2='$value2[$key2]'\";\n }\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "function selecting($table='', $fields='*', ...$get_args) { \n\t\t$getfromtable = $this->fromtable;\n\t\t$getselect_result = $this->select_result; \n\t\t$getisinto = $this->isinto;\n \n\t\t$this->fromtable = null;\n\t\t$this->select_result = true;\t\n\t\t$this->isinto = false;\t\n \n $skipwhere = false;\n $wherekeys = $get_args;\n $where = '';\n\t\t\n if ( ! isset($table) || $table=='' ) {\n $this->setParamaters();\n return false;\n }\n \n $columns = $this->to_string($fields);\n \n\t\tif (isset($getfromtable) && ! $getisinto) \n\t\t\t$sql=\"CREATE TABLE $table AS SELECT $columns FROM \".$getfromtable;\n elseif (isset($getfromtable) && $getisinto) \n\t\t\t$sql=\"SELECT $columns INTO $table FROM \".$getfromtable;\n else \n\t\t\t$sql=\"SELECT $columns FROM \".$table;\n\n if (!empty($get_args)) {\n\t\t\tif (is_string($get_args[0])) {\n $args_by = '';\n $groupbyset = false; \n $havingset = false; \n $orderbyset = false; \n\t\t\t\tforeach ($get_args as $where_groupby_having_orderby) {\n if (strpos($where_groupby_having_orderby,'WHERE')!==false ) {\n $args_by .= $where_groupby_having_orderby;\n $skipwhere = true;\n } elseif (strpos($where_groupby_having_orderby,'GROUP BY')!==false ) {\n $args_by .= ' '.$where_groupby_having_orderby;\n $groupbyset = true;\n } elseif (strpos($where_groupby_having_orderby,'HAVING')!==false ) {\n if ($groupbyset) {\n $args_by .= ' '.$where_groupby_having_orderby;\n $havingset = true;\n } else {\n $this->setParamaters();\n return false;\n }\n } elseif (strpos($where_groupby_having_orderby,'ORDER BY')!==false ) {\n $args_by .= ' '.$where_groupby_having_orderby; \n $orderbyset = true;\n }\n }\n if ($skipwhere || $groupbyset || $havingset || $orderbyset) {\n $where = $args_by;\n $skipwhere = true;\n }\n\t\t\t}\t\t\n\t\t} else {\n $skipwhere = true;\n } \n \n if (! $skipwhere)\n $where = $this->where( ...$wherekeys);\n \n if (is_string($where)) {\n $sql .= $where;\n if ($getselect_result) \n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->get_results($sql, OBJECT, true) : $this->get_results($sql); \n else \n return $sql;\n } else {\n $this->setParamaters();\n return false;\n } \n }", "function fetchFromAnyTable($table = null, $from = null, $to = null, $data = array(), $limit = 10000, $start = 0, $returnType = \"RESULTSET\", $where = null, $between = null, $orderBy = null) {\n\n if ($data == null) {\n $data = array(\"*\");\n }\n $tableColumnName = implode(',', $data);\n $query = \"\";\n $whereString = \"\";\n\n $count = 0;\n foreach ($where as $key => $data) {\n\n if (count($where) > 0) {\n\n if ($count == 0) {\n $whereString.=\"`$key` = '$data' \";\n } else {\n\n $whereString.=\"AND `$key` = '$data'\";\n }\n }\n $count++;\n }\n\n $orderByUnit = '';\n if ($orderBy != null) {\n if (count($orderBy) > 0)\n $orderByUnit = 'ORDER BY';\n foreach ($orderBy as $data) {\n\n\n if (count($orderBy) > 0) {\n\n if ($count == 0) {\n $orderByUnit.=\" '$data' \";\n } else {\n $orderByUnit.=\"AND '$data'\";\n }\n }\n }\n }\n\n if ($returnType == \"RESULTSET\") {\n $query = \"\n SELECT $tableColumnName FROM $table\n WHERE $whereString AND IF((:from !='' AND :to !='' AND :between !=''), :between BETWEEN :from AND :to ,1) $orderByUnit LIMIT %d , %d \";\n } else if ($returnType == \"ROWCOUNT\") {\n $query = \"\n SELECT COUNT('id_employee_type') AS count FROM $table\n WHERE $whereString \n AND IF((:from !='' AND :to !='' AND :between !=''), :between BETWEEN :from AND :to ,1) $orderBy LIMIT %d , %d \";\n }\n // echo $query;\n $sql = sprintf($query, $start, $limit);\n\n $data = array(\n 'between' => $between,\n 'from' => $from,\n 'to' => $to);\n\n return $this->db->mod_select($sql, $data, PDO::FETCH_ASSOC);\n }", "abstract protected function getWhereForRow($data);", "protected function prepareSelectStatement() {}", "public function Select($ConditionArray){\n\t\t \n\t\t$ReturnData = \"\";\n\t\t\n\t\tif(isset($ConditionArray['tablename']) and !empty($ConditionArray['tablename'])){\n\t\t\t$TableName = $ConditionArray['tablename'];\n\t\t}else{return\"\";}\n\t\t\n\t\tif(isset($ConditionArray['fields']) and !empty($ConditionArray['fields'])){ \n\t\t\t\n\t\t\t$FieldsArray = explode(\",\",$ConditionArray['fields'][0]);\n\t\t\t$Fields = \"\";\n\t\t\tforeach($FieldsArray as $FAKey=>$FAKRow){\n\t\t\t\t$Fields.=\"`\".$FAKRow.\"`, \"; \t\n\t\t\t}\n\t\t\t$Fields = rtrim($Fields,\", \");\n\t\t\t\n\t\t}else{$Fields = \"*\";}\n\t\t\n\t\tif(isset($ConditionArray['join']) and !empty($ConditionArray['join'])){\n\t\t\t$Join\t= $ConditionArray['join'];\n\t\t}else{$Join = \"\";}\n\t\t\n\t\tif(isset($ConditionArray['AndCondition']) and !empty($ConditionArray['AndCondition'])){\n\t\t\t$AndCondition\t= $ConditionArray['AndCondition'];\n\t\t}else{$AndCondition = \"\";}\n\t\t\n\t\tif(isset($ConditionArray['OrCondition']) and !empty($ConditionArray['OrCondition'])){\n\t\t\t$OrCondition\t= $ConditionArray['OrCondition'];\n\t\t}else{$OrCondition = \"\";}\n\t\t\n\t\tif(isset($ConditionArray['LikeCondition']) and !empty($ConditionArray['LikeCondition'])){\n\t\t\t$LikeCondition\t = $ConditionArray['LikeCondition'];\n\t\t}else{$LikeCondition = \"\";}\n\t\t\n\t\t\n\t\t\n\t\t$this->db->select($Fields); \n\t\t$this->db->from($TableName);\n\t\t\n\t\tif(!empty($Join)){\n\t\t\t$TablePrimaryField = ltrim($TableName,\"ll_\").\"_id\"; \n\t\t\t\n\t\t\tforeach($Join as $JKey=>$JRow){\n\t\t\t\t$JoinTablePrimaryField = \"\";\n\t\t\t\t$JoinTablePrimaryField = ltrim($JRow,\"ll_\").\"_id\";\n\t\t\t\t$this->db->join($JRow,$TableName.\".\".$JoinTablePrimaryField.\" = \".$JRow.\".\".$JoinTablePrimaryField,'left'); \n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!empty($OrCondition)){\n\t\t\t$this->db->where($OrCondition); \n\t\t}\t\t\n\t\tif(!empty($AndCondition)){\n\t\t\t$this->db->where($AndCondition); \n\t\t}\n\t\tif(!empty($LikeCondition)){\n\t\t\t$this->db->like($LikeCondition); \n\t\t}\n\t\t\n\t\t$query = $this->db->get(); \n\t\tif ($query->num_rows() > 0){\n\t\t\tforeach($query->result() as $row){\n\t\t\t $ReturnData[] = $row;\n\t\t\t}\n\t\t\treturn $ReturnData;\n\t\t}else{\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\n\t\t\n\t }", "public function select($table,$conditions = array()){\r\n\r\n $sql = 'SELECT *'; \r\n $sql .= ' FROM '.$table;\r\n\r\n if(is_array($conditions) && count($conditions)>0){\r\n $sql .= ' WHERE ';\r\n $i = 0;\r\n foreach($conditions as $key => $value){\r\n $pre = ($i > 0)?' AND ':'';\r\n $sql .= $pre.$key.\" = '\".$value.\"'\";\r\n $i++;\r\n }\r\n }\r\n \r\n $query = $this->db->prepare($sql);\r\n\r\n $query->execute(); \r\n \r\n $data = $query->fetchAll();\r\n\r\n return $data;\r\n }", "function fetchrecordset($id=\"\",$condition=\"\",$order=\"menu_id\")\n\t{\n\t\tif($id!=\"\" && $id!= NULL && is_null($id)==false)\n\t\t{\n\t\t$condition = \" and menu_id=\". $id .$condition;\n\t\t}\n\t\tif($order!=\"\" && $order!= NULL && is_null($order)==false)\n\t\t{\n\t\t\t$order = \" order by \" . $order;\n\t\t}\n\t\t$strquery=\"SELECT * FROM \".DB_PREFIX.\"menu WHERE 1=1 \" . $condition . $order;\n\t\t$rs=mysql_query($strquery);\n\t\treturn $rs;\n\t}", "function get()\n\t{\n\t\tif (empty($this->use_db)) $this->use_db = false; //use default connection\n\t\t$this->sql = 'SELECT * FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\t$this->apply_sort();\n\t\treturn $this->fetch_records();\n\t}", "function getSelectStatement($db, $params, $onlyCount) {\n\n\t\t$tableName = $db->escape_string($params[0], $db);\n\t\t$tableNameWithPrefix = $_ENV[\"table_prefix\"] . $tableName;\n\n\t\tif ($onlyCount) {\n\t\t\t$sqlQuery = \"select count(*) from `$tableNameWithPrefix`\";\n\t\t\t//if (isset($params[1])) {\n\t\t\t\t$sqlQuery .= $this->getFilter($db, $tableName, $params[1]);\n\t\t\t//}\n\t\t} else {\n\t\t\tif ($tableName == \"users\") {\n\t\t\t\t// change password to a dummy value\n\t\t\t\t$sqlQuery = \"SELECT id, username, 'dummy' as `password`, firstname, lastname, email, id_team, rights FROM `$tableNameWithPrefix`\";\n\t\t\t} else if ($tableName == \"play_table\") {\n\t\t\t\t$sqlQuery = \"select @rownum:=@rownum+1 as rank, t.*,\"\n\t\t\t\t\t\t. \" (t.wins * 3 + t.stand_off) as points,\"\n\t\t\t\t\t\t. \" (t.shoot - t.got) as goals_diff, \"\n\t\t\t\t\t\t. \" concat(shoot, ':', got) as goals\"\n\t\t\t\t\t\t. \" from `$tableNameWithPrefix` t, (SELECT @rownum:=0) r\";\n\t\t\t} else if ($tableName == \"player_match\") {\n\t\t\t\t$sqlQuery = \"select PM.*, SP.id_saison_team from `$tableNameWithPrefix` PM\"\n\t\t\t\t\t\t. \" left join `\" . $_ENV[\"table_prefix\"] . \"saison_player` SP on SP.id = PM.id_saison_player\";\n\t\t\t} else {\n\t\t\t\t$sqlQuery = \"select * from `$tableNameWithPrefix`\";\n\t\t\t}\n\n\t\t\t// set filter\n\t\t\t//if (isset($params[5])) {\n\t\t\t\t$sqlQuery .= $this->getFilter($db, $tableName, $params[5]);\n\t\t\t//}\n\n\t\t\t// set order\n\t\t\tif ($tableName == \"play_table\") {\n\t\t\t\t$sqlQuery .= \" order by points desc, goals_diff desc, t.shoot desc\";\n\t\t\t} else {\n\t\t\t\tif (isset($params[1]) && isset($params[2])) {\n\n\t\t\t\t\t$sortField = $params[1];\n\t\t\t\t\t$sortOrder = $params[2];\n\n\t\t\t\t\t$sqlQuery .= \" order by $sortField $sortOrder\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// set limit\n\t\t\tif (isset($params[3]) && isset($params[4])) {\n\t\t\t\t$firstIndex = $params[3];\n\t\t\t\t$maxRows = $params[4] - $firstIndex;\n\n\t\t\t\t$sqlQuery .= \" limit $firstIndex, $maxRows\";\n\t\t\t}\n\t\t}\n\t\t//\techo $sqlQuery;\n\t\treturn $sqlQuery;\n\t}", "function select_entries_where($table, $where, $items, $order)\n {\n $this->db->select($items);\n $this->db->from($table);\n $this->db->where($where);\n $this->db->order_by($order, \"asc\");\n \n $query = $this->db->get();\n \n return $query->result();\n }", "function buildSelect($db_name,$table_name,$columns,$where_select){\n\n\t$query_select = \"SELECT \";\n\t//FILL COLUMNS FOR GET\n\tforeach ($columns as $c) {\n\t\t$query_select .= $c;\n\t\tif(array_search($c,$columns) != count($columns) - 1) $query_select .= \",\";\n\t}\n\tif($where_select != \"*\"){//GET \n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name WHERE \";\n\t\t//FILL VALUES WHERE\n\t\tend($where_select);\n\t\t$last_key = key($where_select);\n\t\tforeach ($where_select as $key => $value) {\n\t\t\t$query_select .= $key . \"=\" . \":\" . $key;\n\t\t\tif($key != $last_key) $query_select .= \" AND \";\n\t\t}\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,$where_select);\n\t}\n\telse{//GET ALL SELECT\n\t\t//INTERMEDIATE\n\t\t$query_select .= \" FROM $table_name\";\n\t\texecuteQuery(\"USE $db_name\");\n\t\treturn executeQuery($query_select,\"*\");\n\t}\n\n}", "public function getData($table, $fields = '', $condition = '', $order_by = '', $limit = '') {\n\n $str_sql = '';\n if (is_array($fields)) {\n#$fields passed as array\n $str_sql.=implode(\",\", $fields);\n } elseif ($fields != \"\") {\n#$fields passed as string\n $str_sql .= $fields;\n } else {\n $str_sql .= '*'; #$fields passed blank\n }\n $this->db->select($str_sql);\n if (is_array($condition)) { #$condition passed as array\n if (count($condition) > 0) {\n foreach ($condition as $field_name => $field_value) {\n if ($field_name != '' && $field_value != '') {\n $this->db->where($field_name, $field_value);\n }\n }\n }\n } else if ($condition != \"\") { #$condition passed as string\n $this->db->where($condition);\n }\n if ($limit != \"\"){\n $this->db->limit($limit);#limit is not blank\n }\n if (is_array($order_by)) {\n $this->db->order_by($order_by[0], $order_by[1]); #$order_by is not blank\n } else if ($order_by != \"\") {\n $this->db->order_by($order_by); #$order_by is not blank\n }\n $this->db->from($table);\n \n#getting record from table name passed\n $query = $this->db->get();\n\n return $query->result_array();\n }", "public function select($tableName, $conditions = \"\", array $datasCond = array(), array $fieldsList = array()){\r\n //We try to perform the task\r\n try{\r\n //We check if any database is opened\r\n if (!$this->checkOpenDB()) {\r\n throw new Exception(\"There isn't any opened DataBase !\");\r\n }\r\n \r\n //Process fields to select\r\n if(count($fieldsList) == 0)\r\n $fields = \"*\";\r\n else {\r\n $fields = implode(\", \", $fieldsList);\r\n }\r\n\r\n //Generating SQL\r\n $sql = \"SELECT \".$fields.\" FROM \".$tableName.\" \".$conditions;\r\n $selectOBJ = $this->db->prepare($sql);\r\n $selectOBJ->execute($datasCond);\r\n \r\n //Preparing return\r\n $return = array();\r\n foreach($selectOBJ as $process){\r\n $result = array();\r\n \r\n //Processing datas\r\n foreach($process as $name => $data){\r\n //We save the data only if it is not an integer\r\n if (!is_int($name)) {\r\n $result[$name] = $data;\r\n }\r\n }\r\n \r\n //Saving result\r\n $return[] = $result;\r\n }\r\n \r\n //Returning result\r\n return $return;\r\n }\r\n catch(Exception $e){\r\n exit($this->echoException($e));\r\n }\r\n catch(PDOException $e){\r\n exit($this->echoPDOException($e));\r\n }\r\n }", "function fetchRecordSet($id=\"\",$condition=\"\",$order=\"theme_id\")\n\t{\n\t\tif($id!=\"\" && $id!= NULL && is_null($id)==false)\n\t\t{\n\t\t$condition = \" and theme_id=\". $id .$condition;\n\t\t}\n\t\tif($order!=\"\" && $order!= NULL && is_null($order)==false)\n\t\t{\n\t\t\t$order = \" order by \" . $order;\n\t\t}\n\t\t$strquery=\"SELECT * FROM \".DB_PREFIX.\"theme WHERE 1=1 \" . $condition . $order;\n\t\t$rs=mysql_query($strquery);\n\t\treturn $rs;\n\t}", "function select_query_i($table, $fields, $where, $orderby = \"\", $orderbyorder = \"\", $limit = \"\", $innerjoin = \"\") {\n global $CONFIG;\n global $query_count;\n global $mysqli_errors;\n global $ramysqli;\n\n if (!$fields) {\n $fields = \"*\";\n }\n $query = \"SELECT \" . $fields . \" FROM \" . db_make_safe_field($table);\n\n if ($innerjoin) {\n $query .= \" INNER JOIN \" . db_escape_string($innerjoin) . \"\";\n }\n\n if ($leftjoin) {\n $query .= \" LEFT OUTER JOIN \" . db_escape_string($innerjoin) . \"\";\n }\n\n if ($where) {\n if (is_array($where)) {\n $criteria = array();\n foreach ($where as $origkey => $value) {\n $key = db_make_safe_field($origkey);\n if (is_array($value)) {\n if ($key == \"default\") {\n $key = \"`default`\";\n }\n\n if ($value['sqltype'] == \"LIKE\") {\n $criteria[] = \"\" . $key . \" LIKE '%\" . db_escape_string($value['value']) . \"%'\";\n continue;\n }\n if ($value['sqltype'] == \"NULL\") {\n $criteria[] = \"\" . $key . \" IS NULL\";\n continue;\n }\n\n if ($value['sqltype'] == \"NEQ\") {\n $criteria[] = \"\" . $key . \"!='\" . db_escape_string($value['value']) . \"'\";\n continue;\n }\n\n if ($value['sqltype'] == \">\" && db_is_valid_amount($value['value'])) {\n $criteria[] = \"\" . $key . \">\" . $value['value'];\n continue;\n }\n\n if ($value['sqltype'] == \"<\" && db_is_valid_amount($value['value'])) {\n $criteria[] = \"\" . $key . \"<\" . $value['value'];\n continue;\n }\n\n if ($value['sqltype'] == \"<=\" && db_is_valid_amount($value['value'])) {\n $criteria[] = \"\" . $origkey . \"<=\" . $value['value'];\n continue;\n }\n\n if ($value['sqltype'] == \">=\" && db_is_valid_amount($value['value'])) {\n $criteria[] = \"\" . $origkey . \">=\" . $value['value'];\n continue;\n }\n\n if ($value['sqltype'] == \"TABLEJOIN\") {\n $criteria[] = \"\" . $key . \"=\" . db_escape_string($value['value']) . \"\";\n continue;\n }\n\n if ($value['sqltype'] == \"IN\") {\n $criteria[] = \"\" . $key . \" IN (\" . db_build_in_array($value['values']) . \")\";\n continue;\n }\n\n exit(\"Invalid input condition\");\n continue;\n }\n\n if (substr($key, 0, 3) == \"MD5\") {\n $key = explode(\"(\", $origkey, 2);\n $key = explode(\")\", $key[1], 2);\n $key = db_make_safe_field($key[0]);\n $key = \"MD5(\" . $key . \")\";\n } else {\n $key = db_build_quoted_field($key);\n }\n\n $criteria[] = \"\" . $key . \"='\" . db_escape_string($value) . \"'\";\n }\n\n $query .= \" WHERE \" . implode(\" AND \", $criteria);\n } else {\n $query .= \" WHERE \" . $where;\n }\n }\n\n\n if ($orderby) {\n $orderbysql = tokenizeOrderby($orderby, $orderbyorder);\n $query .= \" ORDER BY \" . implode(\",\", $orderbysql);\n }\n\n\n if ($limit) {\n if (strpos($limit, \",\")) {\n $limit = explode(\",\", $limit);\n $limit = (int) $limit[0] . \",\" . (int) $limit[1];\n } else {\n $limit = (int) $limit;\n }\n\n $query .= \" LIMIT \" . $limit;\n }\n $result = mysqli_query($ramysqli, $query);\n if (!$result && ($CONFIG['SQLErrorReporting'] || $mysqli_errors)) {\n logActivity(\"SQL Error: \" . mysqli_error($ramysqli) . \" - Full Query: \" . $query);\n }\n\n ++$query_count;\n return $result;\n}", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public function fetchAll( $adStatus = null , $searchString = null )\n {\n\t /*\n\t $active = 1;\n\t $resultSet = $this->tableGateway->select(\n\t\tfunction (Select $select) use ($active) {\n //$select->columns(array('id', 'name', 'type')); \n $select->order('id DESC'); \n //$select->where(array('active'=> $active));\n });\n\t*/\n // return $resultSet;\n\t \n\n\t\n\t\t\n\t\t\n\t\t $adapter = $this->tableGateway->getAdapter();\t\t\n\t\t $sql = new Sql($adapter);\n\t\t $select = $sql->select();\n\t\t $select->from('advertisement_logs');\n\t\t $select->columns(array( 'id','user_id', 'add_id', 'date','status', 'totalClick' => new \\Zend\\Db\\Sql\\Expression('SUM(advertisement_logs.click_count)'), 'totalView' => new \\Zend\\Db\\Sql\\Expression('SUM(advertisement_logs.view_count)') ));\n\t\t $select->join('player', 'advertisement_logs.user_id = player.id ' , array('name' ,'email'),$type = self::JOIN_LEFT);\n\t\t //$select->join('player', 'advertisement_logs.user_id = player.id ' , array('name' ,'email'),$type = self::JOIN_LEFT);\n\t\t \n\t\t //$select->where(array('date'=> $active));\n\t\t\tif( $searchString != null )\n\t\t\t{\n\t\t\t\t$predicate \t\t= new \\Zend\\Db\\Sql\\Where();\n\t\t\t\t$str_arr \t\t= explode(\" - \" , $searchString );\n\t\t\t\t$startDate \t\t= date(\"Y-m-d\" , strtotime($str_arr[0]) );\n\t\t\t\t$endDate \t\t= date(\"Y-m-d\" , strtotime($str_arr[1]) );\n\t\t\t\t$select->where($predicate->greaterThanOrEqualTo('date',$startDate ) );\n\t\t\t\t$select->where($predicate->lessThanOrEqualTo('date',$endDate ) );\n\t\t\t\t//02/03/2015 - 02/18/2015\n\t\t\t}\n\t\t\t\n\t\tif($adStatus != null) {\n\t\t\t\t$select->where(array('status' => $adStatus));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t \n\t\t $select->order('date DESC');\n\t\t $select->group('add_id');\n \n\t\t$statement = $sql->prepareStatementForSqlObject($select);\t\t\t\t\n\t\t$rowset = $statement->execute();\t\t\n \n\t\t$resultSet = new ResultSet();\n\t\t$resultSet->initialize($rowset);\n\t\treturn $resultSet; \n\t\t\n }", "function getItems($where, $value, $approve = NULL){\r\n\tglobal $con;\r\n\tif($approve == NULL) { $sql = 'AND Approve = 1';}else{$sql = '';}\r\n\t$getItems = $con->prepare(\"SELECT * FROM items WHERE $where = ? $sql ORDER BY item_ID DESC\");\r\n\t$getItems->execute(array($value));\t\r\n\t$items = $getItems->fetchAll();\r\n\treturn $items;\r\n\r\n\r\n}", "public function select($filter = [])\n\t {\n\t\t if(isset($filter['filed']))\n\t\t {\n\t\t\t $filed_str = $filter['filed'];\n\t\t }else\n\t\t {\n\t\t\t $filed_str = '*';\n \t\t }\n $sql = \"SELECT $filed_str FROM $this->table\";\n\n\t\t if(isset($filter['where']))\n\t\t {\n\t\t\t $sql .= \" WHERE {$filter['where']}\"; \n\t\t }\n\t\t \n\t\t if(isset($filter['group']))\n\t\t {\n\t\t\t $sql .= \" GROUP BY {$filter['group']}\"; \n\t\t }\n \n\t\t \n\t\t if(isset($filter['having']))\n\t\t {\n\t\t\t $sql .= \" HAVING {$filter['having']}\"; \n\t\t }\n\n\t\t if(isset($filter['order']))\n\t\t {\n\t\t\t $sql .= \" ORDER BY {$filter['order']}\"; \n\t\t }\n\n\t\t if(isset($filter['limit']))\n\t\t {\n\t\t\t $sql .= \" LIMIT {$filter['limit']}\"; \n\t\t }\n\n return $this->dao->fetchAll($sql);\n\n\t }", "public function prepareData($params){\r\n\t\t$available_data = \\DB::table($this->table);\r\n\t\t$recordsTotal = $available_data->count();\r\n\r\n\t\t// seleted columns\r\n\t\t// $select = array('u.*', 'g.name AS gender', 'r.name AS role_name', 'r.id AS role_id');\r\n\t\t// if(@$params['selected_columns'] != ''){\r\n\t\t// \t$select = explode(',', $params['selected_columns']);\r\n\t\t// }\r\n\r\n\t\t// join here\r\n\t\t// $available_data = $available_data->select($select);\r\n\r\n\t\t// condition here\r\n\t\t$filters = $params['filter'];\r\n\t\tforeach($filters as $column => $items){\r\n\t\t\tforeach($items as $item){\r\n\t\t\t\tif(is_array($item)){\r\n\t\t\t\t\tif(!empty($item['value'])){\r\n\t\t\t\t\t\t$available_data = $available_data->where($column, $item['op'], $item['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tif(!empty($items['value'])){\r\n\t\t\t\t\tif(strtolower($items['op']) == 'like'){\r\n\t\t\t\t\t\t$items['value'] = '%' . $items['value'] . '%';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(strtolower($items['op']) != 'in'){\r\n\t\t\t\t\t\t$available_data = $available_data->where($column, $items['op'], $items['value']);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$available_data = $available_data->whereIn($column, $items['value']);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t// }\r\n\t\t}\r\n\t\treturn array(\r\n\t\t\t'recordsTotal' => $recordsTotal,\r\n\t\t\t'data' => $available_data,\r\n\t\t);\r\n\t}", "public function select($tablename,$condition='*'){\n if (!$this->select_db($this->_currentDB))\n return FALSE;\n \tif(!$this->_table_exists($this->_currentDB,$tablename)){\n $errmsg= sprintf(self::$_error_code_list[23],$this->_currentDB.'.'.$tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n if($condition=='*'){\n $result=$this->_select_all_in_table($this->_currentDB,$tablename);\n return $result;\n }\n if(!is_array($condition) || count($condition)!=1 ){\n $errmsg=self::$_error_code_list[19];\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n $field=key($condition);\n \tif ( ($key=$this->_field_exists($this->_currentDB,$tablename,$field)) === FALSE){\n $errmsg= sprintf(self::$_error_code_list[20], $field,$this->_currentDB.'.'.$tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n \t$datf=$this->_table_path($this->_currentDB,$tablename).$this->_data_ext;\n \t$data=$this->_select_by_field($datf,$key,$condition[$field]);\n \tif($data===FALSE){\n $errmsg=sprintf(self::$_error_code_list[21], $tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n if($data==array()){\n return array();\n }\n $data=$this->_unescape_data($data);\n $frame_data=$this->_read_frame($this->_currentDB,$tablename);\n $data=$this->_array_combine($frame_data,$data);\n \treturn $data;\n }", "public function selectByFilter($customerVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($customerVo)) $customerVo = new CustomerVo();\n$sql = \"select * from `customer` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($customerVo->customerId)){ //If isset Vo->element\n$fieldValue=$customerVo->customerId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `customer_id` $key :customerIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `customer_id` $key :customerIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':customerIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':customerIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `customer_id` = :customerIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `customer_id` = :customerIdKey';\n}\n$params[]=array(':customerIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerVo->roleId)){ //If isset Vo->element\n$fieldValue=$customerVo->roleId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `role_id` $key :roleIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `role_id` $key :roleIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':roleIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':roleIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `role_id` = :roleIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `role_id` = :roleIdKey';\n}\n$params[]=array(':roleIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerVo->username)){ //If isset Vo->element\n$fieldValue=$customerVo->username;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `username` $key :usernameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `username` $key :usernameKey\";\n}\nif($type == 'str') {\n $params[] = array(':usernameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':usernameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `username` = :usernameKey';\n$isFirst=false;\n}else{\n$condition.=' and `username` = :usernameKey';\n}\n$params[]=array(':usernameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->password)){ //If isset Vo->element\n$fieldValue=$customerVo->password;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `password` $key :passwordKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `password` $key :passwordKey\";\n}\nif($type == 'str') {\n $params[] = array(':passwordKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':passwordKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `password` = :passwordKey';\n$isFirst=false;\n}else{\n$condition.=' and `password` = :passwordKey';\n}\n$params[]=array(':passwordKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->email)){ //If isset Vo->element\n$fieldValue=$customerVo->email;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `email` $key :emailKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `email` $key :emailKey\";\n}\nif($type == 'str') {\n $params[] = array(':emailKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':emailKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `email` = :emailKey';\n$isFirst=false;\n}else{\n$condition.=' and `email` = :emailKey';\n}\n$params[]=array(':emailKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->languageCode)){ //If isset Vo->element\n$fieldValue=$customerVo->languageCode;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `language_code` $key :languageCodeKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `language_code` $key :languageCodeKey\";\n}\nif($type == 'str') {\n $params[] = array(':languageCodeKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':languageCodeKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `language_code` = :languageCodeKey';\n$isFirst=false;\n}else{\n$condition.=' and `language_code` = :languageCodeKey';\n}\n$params[]=array(':languageCodeKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->crtDate)){ //If isset Vo->element\n$fieldValue=$customerVo->crtDate;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `crt_date` $key :crtDateKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `crt_date` $key :crtDateKey\";\n}\nif($type == 'str') {\n $params[] = array(':crtDateKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':crtDateKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `crt_date` = :crtDateKey';\n$isFirst=false;\n}else{\n$condition.=' and `crt_date` = :crtDateKey';\n}\n$params[]=array(':crtDateKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->crtBy)){ //If isset Vo->element\n$fieldValue=$customerVo->crtBy;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `crt_by` $key :crtByKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `crt_by` $key :crtByKey\";\n}\nif($type == 'str') {\n $params[] = array(':crtByKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':crtByKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `crt_by` = :crtByKey';\n$isFirst=false;\n}else{\n$condition.=' and `crt_by` = :crtByKey';\n}\n$params[]=array(':crtByKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerVo->modDate)){ //If isset Vo->element\n$fieldValue=$customerVo->modDate;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `mod_date` $key :modDateKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `mod_date` $key :modDateKey\";\n}\nif($type == 'str') {\n $params[] = array(':modDateKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':modDateKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `mod_date` = :modDateKey';\n$isFirst=false;\n}else{\n$condition.=' and `mod_date` = :modDateKey';\n}\n$params[]=array(':modDateKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->modBy)){ //If isset Vo->element\n$fieldValue=$customerVo->modBy;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `mod_by` $key :modByKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `mod_by` $key :modByKey\";\n}\nif($type == 'str') {\n $params[] = array(':modByKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':modByKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `mod_by` = :modByKey';\n$isFirst=false;\n}else{\n$condition.=' and `mod_by` = :modByKey';\n}\n$params[]=array(':modByKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerVo->status)){ //If isset Vo->element\n$fieldValue=$customerVo->status;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `status` $key :statusKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `status` $key :statusKey\";\n}\nif($type == 'str') {\n $params[] = array(':statusKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':statusKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `status` = :statusKey';\n$isFirst=false;\n}else{\n$condition.=' and `status` = :statusKey';\n}\n$params[]=array(':statusKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->activeCode)){ //If isset Vo->element\n$fieldValue=$customerVo->activeCode;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `active_code` $key :activeCodeKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `active_code` $key :activeCodeKey\";\n}\nif($type == 'str') {\n $params[] = array(':activeCodeKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':activeCodeKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `active_code` = :activeCodeKey';\n$isFirst=false;\n}else{\n$condition.=' and `active_code` = :activeCodeKey';\n}\n$params[]=array(':activeCodeKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->resetPasswordCode)){ //If isset Vo->element\n$fieldValue=$customerVo->resetPasswordCode;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `reset_password_code` $key :resetPasswordCodeKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `reset_password_code` $key :resetPasswordCodeKey\";\n}\nif($type == 'str') {\n $params[] = array(':resetPasswordCodeKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':resetPasswordCodeKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `reset_password_code` = :resetPasswordCodeKey';\n$isFirst=false;\n}else{\n$condition.=' and `reset_password_code` = :resetPasswordCodeKey';\n}\n$params[]=array(':resetPasswordCodeKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->oauthProvider)){ //If isset Vo->element\n$fieldValue=$customerVo->oauthProvider;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `oauth_provider` $key :oauthProviderKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `oauth_provider` $key :oauthProviderKey\";\n}\nif($type == 'str') {\n $params[] = array(':oauthProviderKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':oauthProviderKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `oauth_provider` = :oauthProviderKey';\n$isFirst=false;\n}else{\n$condition.=' and `oauth_provider` = :oauthProviderKey';\n}\n$params[]=array(':oauthProviderKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerVo->oauthId)){ //If isset Vo->element\n$fieldValue=$customerVo->oauthId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `oauth_id` $key :oauthIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `oauth_id` $key :oauthIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':oauthIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':oauthIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `oauth_id` = :oauthIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `oauth_id` = :oauthIdKey';\n}\n$params[]=array(':oauthIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('CustomerVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "function select_data_by_search($tablename, $search_condition, $contition_array = array(), $data = '*', $sortby = '', $orderby = '', $limit = '', $offset = '', $join_str='') {\n $this->db->select($data);\n if (!empty($join_str)) {\n foreach ($join_str as $join) {\n $this->db->join($join['table'], $join['join_table_id'] . '=' . $join['from_table_id']);\n }\n }\n if(count($contition_array)!=0)\n{\n $this->db->where($contition_array);\n}\n $this->db->where($search_condition);\n\n //Setting Limit for Paging\n if ($limit != '' && $offset == 0) {\n $this->db->limit($limit);\n } else if ($limit != '' && $offset != 0) {\n $this->db->limit($limit, $offset);\n }\n //order by query\n if ($sortby != '' && $orderby != '') {\n $this->db->order_by($sortby, $orderby);\n }\n\n $query = $this->db->get($tablename);\n if ($query->num_rows() > 0) {\n return $query->result_array();\n } else {\n return array();\n }\n }", "public function selectByFilter($routerVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($routerVo)) $routerVo = new RouterVo();\n$sql = \"select * from `router` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($routerVo->routerId)){ //If isset Vo->element\n$fieldValue=$routerVo->routerId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `router_id` $key :routerIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `router_id` $key :routerIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':routerIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':routerIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `router_id` = :routerIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `router_id` = :routerIdKey';\n}\n$params[]=array(':routerIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->layoutId)){ //If isset Vo->element\n$fieldValue=$routerVo->layoutId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `layout_id` $key :layoutIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `layout_id` $key :layoutIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':layoutIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `layout_id` = :layoutIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `layout_id` = :layoutIdKey';\n}\n$params[]=array(':layoutIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($routerVo->pkName)){ //If isset Vo->element\n$fieldValue=$routerVo->pkName;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `pk_name` $key :pkNameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `pk_name` $key :pkNameKey\";\n}\nif($type == 'str') {\n $params[] = array(':pkNameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':pkNameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `pk_name` = :pkNameKey';\n$isFirst=false;\n}else{\n$condition.=' and `pk_name` = :pkNameKey';\n}\n$params[]=array(':pkNameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->prefix)){ //If isset Vo->element\n$fieldValue=$routerVo->prefix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `prefix` $key :prefixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `prefix` $key :prefixKey\";\n}\nif($type == 'str') {\n $params[] = array(':prefixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':prefixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `prefix` = :prefixKey';\n$isFirst=false;\n}else{\n$condition.=' and `prefix` = :prefixKey';\n}\n$params[]=array(':prefixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->suffix)){ //If isset Vo->element\n$fieldValue=$routerVo->suffix;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `suffix` $key :suffixKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `suffix` $key :suffixKey\";\n}\nif($type == 'str') {\n $params[] = array(':suffixKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':suffixKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `suffix` = :suffixKey';\n$isFirst=false;\n}else{\n$condition.=' and `suffix` = :suffixKey';\n}\n$params[]=array(':suffixKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->alias)){ //If isset Vo->element\n$fieldValue=$routerVo->alias;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias` $key :aliasKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias` $key :aliasKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias` = :aliasKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias` = :aliasKey';\n}\n$params[]=array(':aliasKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasBy)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasBy;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_by` $key :aliasByKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_by` $key :aliasByKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasByKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasByKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_by` = :aliasByKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_by` = :aliasByKey';\n}\n$params[]=array(':aliasByKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->aliasList)){ //If isset Vo->element\n$fieldValue=$routerVo->aliasList;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `alias_list` $key :aliasListKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `alias_list` $key :aliasListKey\";\n}\nif($type == 'str') {\n $params[] = array(':aliasListKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':aliasListKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `alias_list` = :aliasListKey';\n$isFirst=false;\n}else{\n$condition.=' and `alias_list` = :aliasListKey';\n}\n$params[]=array(':aliasListKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($routerVo->callback)){ //If isset Vo->element\n$fieldValue=$routerVo->callback;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `callback` $key :callbackKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `callback` $key :callbackKey\";\n}\nif($type == 'str') {\n $params[] = array(':callbackKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':callbackKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `callback` = :callbackKey';\n$isFirst=false;\n}else{\n$condition.=' and `callback` = :callbackKey';\n}\n$params[]=array(':callbackKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('RouterVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "function readAll() {\n $query = \"SELECT \n id, name, description\n FROM\n \" . $this->table_name . \" \n ORDER BY\n name\";\n\n $stmt = $this->conn->prepare($query);\n\n //execute query\n $stmt->execute();\n\n return $stmt;\n }", "function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function fetchList($select,$where = \"\",$order = \"\",$values = null){\n //if( ! is_object($this)) {\n // print_pre(debug_backtrace(),\"fetchList: debug_backtrace\");\n //}\n \n $qstr = \"select $select\";\n if( $where != \"\" ) $qstr .= \" where $where\";\n if( $order != \"\" ) $qstr .= \" order by $order\";\n \n //print \"fetchVal: qstr: $qstr<br>\\n\";\n $result = $this->query(\"$qstr\",$values);\n //print_pre($result,\"dbh\");\n $r = $result->fetchAll(PDO::FETCH_COLUMN);\n //print_pre($r,\"result fetchAll\");\n //print_pre($dbh,\"dbh\");\n return $r;\n }", "public function Select($Condition)\r\n {\r\n global $db;\r\n \r\n if ($Condition == \"\") {\r\n $Sql = \"SELECT * FROM \".$this->TableName;\r\n }\r\n else {\r\n $Sql = \"SELECT * FROM \".$this->TableName.\" \".$Condition;\r\n }\r\n \r\n try{\r\n $query = $db->prepare($Sql);\r\n $query->execute();\r\n if($query->rowCount()>0){\r\n $result['err'] = false;\r\n $result['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n } else {\r\n $result['err'] = true;\r\n $result['msg'] = \"No Records Available\";\r\n }\r\n }catch(PDOException $e){\r\n $result['err'] = true;\r\n $result['msg'] = $e->getMessage();\r\n }\r\n\r\n return $result;\r\n }", "final public function get(string $criterio=\"-\" ,$select = '*'){\n\n return $this->db->query_select(\"SELECT g.nombre,g.id_guarderia, g.rif, g.telefonos,g.costo,e.nombre as 'empleado',e.apellidos as 'apellido'\n e.id_personal, l.id_lugar, l.nombre as 'lugar' FROM guarderia_2 g left outer join personal_2 e on g.id_enc = e.id_personal\n left outer join lugar_2 l on g.id_lugar = l.id_lugar;\");\n\n }", "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function select($q)\n {\n return $this->dbh->query($q, PDO::FETCH_ASSOC)->fetchAll();\n }", "abstract public function query();", "public function cpSelectDsclimit($tablename,$value3, $value1=0,$value2=0) {\n /*** The SQL SELECT statement ***/\n /*\n * Prepare the select statement\n */\n $startvalue=($value1-1)*10;\n $sql=\"SELECT * FROM $tablename \";\n if($value2!=0)\n { $key1= key($value2);\n $sql.=\" where $key1='$value2[$key1]'\";\n }\n \n $sql.= \" ORDER BY $value3 DESC LIMIT $startvalue, 10\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "public function getdata($table,$where,$sort)\n{\n\tif($where!=\"\")\n\t$this->db->where($where);\n if($sort!=\"\")\n\t$this->db->order_by($sort);\n\treturn $this->db->get($table)->result(); \n}", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "public function select($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"SELECT \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$this->genFrom($p['cols']).\" \".$this->genTable($p['tables']).$this->genWhere($p['where']);\t\n\t\treturn $DB->select($statement);\t\n\t}", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "function fetchContestRecords($condition = \"\",$order = \"contest_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\n\t\t$sQuery = \"SELECT contest_id,client_id,contest_title,domain,winner_announce_date FROM \".DB_PREFIX.\"contest WHERE 1 = 1 AND contest_status='1' \" . $condition . \" ORDER BY \".$order;\n\t\t\n\t\t$rs = $this->runquery($sQuery);\n\t\t\n\t\treturn $rs;\n\t}", "function read(){\n //select all data\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function db_select ($db, $table, $columns = null, $where = null, $order = null, $group = null)\n{\n\tif (isset($columns)) {\n\t\tif (is_array($columns))\n\t\t\t$cols = implode ($columns, ',');\n\t\telse\n\t\t\t$cols = $columns;\n\n\t\t$key = $columns[0];\n\t\t$key = 'id';\n\t} else {\n\t\t$cols = '*';\n\t\t$key = 'id';\n\t}\n\n\t$query = \"select {$cols} from {$table}\";\n\n\tif (isset ($where)) {\n\t\tif (is_array ($where))\n\t\t\t$w = implode ($where, ' and ');\n\t\telse\n\t\t\t$w = $where;\n\t\t$query .= ' where ' . $w;\n\t}\n\n\tif (isset ($group)) {\n\t\t$query .= ' group by ' . $group;\n\t}\n\n\tif (isset ($order)) {\n\t\t$query .= ' order by ' . $order;\n\t}\n\n\t//echo \"$query;<br>\";\n\t$result = $db->query($query);\n\n\t$list = array();\n\tif ($result) {\n\t\twhile ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n\t\t\t$list[$row[$key]] = $row;\n\t\t}\n\t}\n\n\t$result->close();\n\treturn $list;\n}", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function create_list_query($order_by, $where)\r\n\t{\r\n\t\t//$custom_join = $this->custom_fields->getJOIN();\r\n $custom_join = null;\r\n\t\t$query = \"\r\n\t\t\tSELECT DISTINCT \r\n\t\t\t\tmain_contract.contract_no as main_contract_name,\r\n\t\t\t\tmain_contract.created_by as main_contract_name_owner,\r\n\t\t\t\taccounts.id as account_id, accounts.name as account_name,\r\n\t\t\t\tcon_type.name as contract_type_name, '-1' AS contract_type_name_owner,\r\n\t\t\t\tCONCAT_WS(' ', if(employee.first_name = '', NULL, employee.first_name), employee.last_name) employee_contact_name,\r\n\t\t\t\temployee.user_name as employee_contact_user_name,\r\n\t\t\t\tCONCAT_WS(' ', if(customer.first_name = '', NULL, customer.first_name), customer.last_name) customer_contact_name,\r\n\t\t\t\tcustomer.assigned_user_id as customer_contact_name_owner,\r\n\t\t\t\tcustomer.phone_work as customer_contact_phone,\r\n\t\t\t\t\r\n\t\t\t\tCASE\r\n\t\t\t\t\tWHEN `$this->table_name`.is_active = 'no'\r\n\t\t\t\t\t\tTHEN 'grey'\r\n\t\t\t\t\tWHEN `$this->table_name`.date_expire = 0\r\n\t\t\t\t\t OR `$this->table_name`.date_expire > DATE_ADD(CURDATE(),INTERVAL 30 DAY)\r\n\t\t\t\t\t\tTHEN 'green'\r\n\t\t\t\t\tWHEN `$this->table_name`.date_expire > CURDATE()\r\n\t\t\t\t\t\tTHEN 'yellow'\r\n\t\t\t\t\tELSE\r\n\t\t\t\t\t\t'red'\r\n\t\t\t\tEND as status_colour,\r\n\r\n\t\t\t\t`\".$this->table_name.\"`.*,\r\n\t\t\t\tSUM(assets.purchase_usdollar * assets.quantity) AS total_purchase,\r\n\t\t\t\tSUM(assets.unit_support_price * assets.quantity) AS total_support_cost\r\n\t\t\";\r\n\t\tif($custom_join) $query .= $custom_join['select'];\r\n\t\t$query .= \" FROM `\".$this->table_name.\"` \";\r\n\t\tif($custom_join) $query .= $custom_join['join'];\r\n\t\t$query .= \"\r\n\t\t\tLEFT JOIN users employee ON (employee.id = employee_contact_id)\r\n\t\t\tLEFT JOIN contacts customer ON (customer.id = customer_contact_id)\r\n\t\t\tLEFT JOIN $this->types_table_name con_type ON (con_type.id = contract_type_id)\r\n\t\t\tLEFT JOIN service_maincontracts main_contract ON (main_contract.id = main_contract_id)\r\n\t\t\tLEFT JOIN accounts ON (accounts.id = main_contract.account_id)\r\n\t\t\tLEFT OUTER JOIN assets ON (`\".$this->table_name.\"`.id = assets.service_subcontract_id)\r\n\t\t\";\r\n\r\n\t\t$where_auto = \" \r\n\t\t\t`\".$this->table_name.\"`.deleted != 1\r\n\t\t\";\r\n\r\n\t\tif($where != \"\")\r\n\t\t\t$query .= \"WHERE $where AND \".$where_auto;\r\n\t\telse\r\n\t\t\t$query .= \"WHERE \".$where_auto;\r\n\r\n\t\t$query .= \"GROUP BY `\".$this->table_name.\"`.id\";\r\n\t\t\t\r\n\t\tif($order_by != \"\")\r\n\t\t\t$query .= \" ORDER BY $order_by\";\r\n\t\telse\r\n\t\t\t$query .= \" ORDER BY vendor_contract\";\r\n\t\t\t\r\n\t\treturn $query;\r\n\t\t\r\n\t}", "function getData($table, $order, $method){\n global $conn;\n $stmt = $conn->prepare(\"SELECT * FROM $table ORDER BY $order $method\");\n $stmt->execute();\n $row = $stmt->fetchAll();\n if($row){\n return $row;\n } else{\n return false;\n }\n}", "public function selectByFilter($customerDetailVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($customerDetailVo)) $customerDetailVo = new CustomerDetailVo();\n$sql = \"select * from `customer_detail` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($customerDetailVo->customerDetailId)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->customerDetailId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `customer_detail_id` $key :customerDetailIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `customer_detail_id` $key :customerDetailIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':customerDetailIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':customerDetailIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `customer_detail_id` = :customerDetailIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `customer_detail_id` = :customerDetailIdKey';\n}\n$params[]=array(':customerDetailIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerDetailVo->customerId)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->customerId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `customer_id` $key :customerIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `customer_id` $key :customerIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':customerIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':customerIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `customer_id` = :customerIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `customer_id` = :customerIdKey';\n}\n$params[]=array(':customerIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerDetailVo->firstName)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->firstName;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `first_name` $key :firstNameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `first_name` $key :firstNameKey\";\n}\nif($type == 'str') {\n $params[] = array(':firstNameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':firstNameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `first_name` = :firstNameKey';\n$isFirst=false;\n}else{\n$condition.=' and `first_name` = :firstNameKey';\n}\n$params[]=array(':firstNameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerDetailVo->lastName)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->lastName;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `last_name` $key :lastNameKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `last_name` $key :lastNameKey\";\n}\nif($type == 'str') {\n $params[] = array(':lastNameKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':lastNameKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `last_name` = :lastNameKey';\n$isFirst=false;\n}else{\n$condition.=' and `last_name` = :lastNameKey';\n}\n$params[]=array(':lastNameKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerDetailVo->phone)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->phone;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `phone` $key :phoneKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `phone` $key :phoneKey\";\n}\nif($type == 'str') {\n $params[] = array(':phoneKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':phoneKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `phone` = :phoneKey';\n$isFirst=false;\n}else{\n$condition.=' and `phone` = :phoneKey';\n}\n$params[]=array(':phoneKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerDetailVo->image)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->image;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `image` $key :imageKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `image` $key :imageKey\";\n}\nif($type == 'str') {\n $params[] = array(':imageKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':imageKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `image` = :imageKey';\n$isFirst=false;\n}else{\n$condition.=' and `image` = :imageKey';\n}\n$params[]=array(':imageKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerDetailVo->gender)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->gender;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `gender` $key :genderKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `gender` $key :genderKey\";\n}\nif($type == 'str') {\n $params[] = array(':genderKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':genderKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `gender` = :genderKey';\n$isFirst=false;\n}else{\n$condition.=' and `gender` = :genderKey';\n}\n$params[]=array(':genderKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($customerDetailVo->birthday)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->birthday;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `birthday` $key :birthdayKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `birthday` $key :birthdayKey\";\n}\nif($type == 'str') {\n $params[] = array(':birthdayKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':birthdayKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `birthday` = :birthdayKey';\n$isFirst=false;\n}else{\n$condition.=' and `birthday` = :birthdayKey';\n}\n$params[]=array(':birthdayKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($customerDetailVo->receiveEmail)){ //If isset Vo->element\n$fieldValue=$customerDetailVo->receiveEmail;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `receive_email` $key :receiveEmailKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `receive_email` $key :receiveEmailKey\";\n}\nif($type == 'str') {\n $params[] = array(':receiveEmailKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':receiveEmailKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `receive_email` = :receiveEmailKey';\n$isFirst=false;\n}else{\n$condition.=' and `receive_email` = :receiveEmailKey';\n}\n$params[]=array(':receiveEmailKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('CustomerDetailVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}", "function select($query,$order_by,$order_is,$limits){\n\t\t// Checking order data\n\t\tif($order_by==''){\n\t\t\t$ord='';\n\t\t} else {\n\t\t\tif($order_is==''){\n\t\t\t\t$ord_is='ASC';\n\t\t\t} else {\n\t\t\t\tif($order_is=='asc'){\n\t\t\t\t\t$ord_is='ASC';\n\t\t\t\t} elseif($order_is=='desc') {\n\t\t\t\t\t$ord_is='DESC';\n\t\t\t\t} else {\n\t\t\t\t\t$ord_is='ASC';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$ord=' ORDER BY `'.$order_by.'` '.$ord_is.'';\n\t\t}\n\t\t// Checking limits data\n\t\tif($limits==''){\n\t\t\t$lim='';\n\t\t} else {\n\t\t\t$lim=' LIMIT '.$limits;\n\t\t}\n\t\t// Checking query type\n\t\t$r=mysql_query($query.$ord.$lim);\n\t\t$f=mysql_fetch_array($r);\n\t\treturn $f;\n\t}", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "private function list_data_sql()\n\t{\n\t\t$this->db\n\t\t\t->from('tweb_penduduk u')\n\t\t\t->join('tweb_keluarga d', 'u.id_kk = d.id', 'left')\n\t\t\t->join('tweb_wil_clusterdesa a', 'd.id_cluster = a.id', 'left')\n\t\t\t->join('tweb_penduduk_sex x', 'u.sex = x.id', 'left')\n\t\t\t->join('tweb_penduduk_agama g', 'u.agama_id = g.id', 'left')\n\t\t\t->join('tweb_status_dasar sd', 'u.status_dasar = sd.id', 'left')\n\t\t\t->join('log_penduduk log', 'u.id = log.id_pend', 'left')\n\t\t\t->join('ref_pindah rp', 'rp.id = log.ref_pindah', 'left')\n\t\t\t->where('u.status_dasar >', 1)\n\t\t\t->where_in('log.id_detail', array(2, 3, 4));\n\n\t\t$this->search_sql();\n\t\t$this->status_dasar_sql();\n\t\t$this->sex_sql();\n\t\t$this->agama_sql();\n\t\t$this->dusun_sql();\n\t\t$this->rw_sql();\n\t\t$this->rt_sql();\n\t}", "function dataSelect() {\n\t\t\t\t$koneksi = $this->koneksi;\n\t\t\t\t// SQL\n\t\t\t\t$query\t\t\t= \"SELECT * FROM pegawai ORDER BY id ASC\";\n\t\t\t\t\n\t\t\t\t$sql\t\t\t= mysqli_query($koneksi,$query);\n\t\t\t\t\n\t\t\t\treturn $sql;\n\t\t\t}", "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 }", "protected function prepareOrderByStatement() {}", "public function get(array $param = array('table'=>'','columns'=>0,'condition'=>[],'orderBy'=>'','direction'=>'','offset'=>0,'limit'=>0)) {\n\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (OPTIONAL) array of columns to be enter e.g. ['column','column',...]\n $arrColumns = isset($param['columns']) ? $param['columns'] : 0;\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n // (OPTIONAL) name of column to be order with\n $orderBy = isset($param['orderBy']) ? $param['orderBy'] : '';\n // (OPTIONAL) 'asc' or 'desc' for ascending or defending\n $direction = isset($param['direction']) ? $param['direction'] : '';\n // (OPTIONAL) offset\n $offset = isset($param['offset']) ? $param['offset'] : 0;\n // (OPTIONAL) limit, REQUIRED with offset\n $limit = isset($param['limit']) ? $param['limit'] : 0;\n\n // $columns = ( count( $arrColumns ) > 0 ) ? \"`\" . implode(\"`,`\", $arrColumns ) . \"`\" : \"*\";\n $columns = ( count( $arrColumns ) > 0 ) ? implode(\",\", $arrColumns ) : \"*\";\n $whereCondition = \"\";\n $arrConditionValues = [];\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $arrConditionValues, $col[1] );\n $whereCondition .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $arrConditionValues, $col[2] );\n $whereCondition .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $whereCondition .= \" AND \";\n }\n }\n\n if( $whereCondition != \"\" ) {\n $whereCondition = \" WHERE \" . substr($whereCondition, 0, -4);\n }\n\n $strOrder = \"\";\n\n if( !empty($orderBy) && !empty($direction) ) {\n $strOrder = \" ORDER BY `\".$orderBy.\"` \".$direction.\" \";\n }\n\n $strLimit = \"\";\n $strOffset = \"\";\n\n if( !empty($limit) ) {\n $strLimit = \" LIMIT \".$limit;\n }\n\n if( !empty($limit) && !empty($offset) ) {\n $strOffset = \" OFFSET \".$offset;\n }\n\n $strQry = \"SELECT \" . $columns . \" FROM `\".$tableName.\"`\" . $whereCondition . $strOrder . $strLimit . $strOffset;\n\n // print_r( $strQry ); die;\n\n $insert_values = $arrConditionValues;\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n $count = $this->stmt->rowCount(); // effected rows if updated with same value\n $result = $this->stmt->fetchAll();\n \n if( count($result) > 0 ) {\n // echo count($result) . ' record(s) found.<br>';\n return [\n 'success' => true,\n 'message' => $count . ' record(s) found.',\n 'data' => $result,\n ];\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n ];\n }\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n ];\n }\n\n $this->stmt = null;\n die;\n }", "public function get_sql_select_data($tablename, $where = '', $feild = '', $limit = '', $order_by = '', $distinct='',$like = '',$like_or = '') {\n\n if (!empty($feild))\n $this->db->select($feild);\n\n if (empty($feild))\n $this->db->select();\n\n if (!empty($where))\n $this->db->where($where);\n\n\n if (!empty($limit))\n $this->db->limit($limit);\n\n if (!empty($like))\n $this->db->like($like);\n\n if (!empty($like_or))\n $this->db->or_like($like_or);\n\n if (!empty($order_by))\n $this->db->order_by($order_by);\n\n if (!empty($distinct))\n $this->db->distinct($distinct);\n\n $this->db->from($tablename);\n\n $query = $this->db->get();\n\n return $query->result();\n}", "public function select($whereCondition, $orderBy = '', $offset = 0, $limit = 0, $fields = []) \n\t{\n\t\t$sql = \"SELECT * FROM `\" . $this->table . '` ';\n\n\t\t//get fields sql\n\t\tif ($fields && is_array($fields)) {\n\t\t\t$sql = \"SELECT \" . $this->_stringFieldsSelect($fields) . ' FROM `' . $this->table . '` ';\n\t\t}\n\n\t\t//get where sql\n\t\t$sql .= $this->_whereCondition($whereCondition);\n\n\t\t//get order by sql\n\t\tif ($orderBy) {\n\t\t\t$sql .= ' ' . $this->_stringOrderBy($orderBy);\n\t\t}\n\n\t\t//get limit sql\n\t\tif ($limit) {\n\t\t\t$sql .= ' LIMIT '. $offset . ',' . $limit;\n\t\t}\n\n\t\t$sql .= ';';\n//echo $sql;exit;\n\t\t$result = $this->_getSelectResult($sql);\n\n\t\treturn $result;\n\t}", "function getAllFromAll($feild , $table , $where = NULL , $and= NULL , $orderBy , $ordering = 'DESC') {\n\n\t\tglobal $con\t;\n\n\t\t$getAll = $con->prepare(\"SELECT $feild FROM $table $where $and ORDER BY $orderBy $ordering\");\n\n\t\t$getAll->execute();\n\n\t\t$all = $getAll->fetchAll();\n\n\t\treturn $all;\n\t}", "function getItem($where, $value, $approve = null)\n{\n global $con;\n\n $sql = $approve == null ? 'AND Item_Approve = 1' : '';\n\n $getItem = $con->prepare(\"Select * From items WHERE $where =? $sql ORDER BY Item_ID DESC\");\n\n $getItem->execute(array($value));\n\n $items = $getItem->fetchAll();\n\n return $items;\n}", "function prepare_read($filter = '', $sort = ''){\n $tables_sql = $this->create_table_list();\n $where_sql = '';\n if($filter != ''){\n $where_sql = \"WHERE 1 = 1 AND \" . $this->substitute_symbols($filter);\n }\n $sort_sql = '';\n if($sort != ''){\n $sort_sql = \"ORDER BY \" . $this->substitute_symbols($sort);\n }elseif(isset($this->sort)){\n $sort_sql = $this->sort;\n }\n $column_sql = implode(', ', $this->column_list);\n $ret_val = \"SELECT $column_sql FROM $tables_sql $where_sql $sort_sql;\";\n return $ret_val;\n }", "function db_read($con,$table,$where = 1){\n\n\tif(is_array($where)){\n\t\t$fild_value = array();\n\t\tforeach ($where as $field => $value) {\n\t\t\t$fild_value[] = \"`\".$field.\"` = '\".$value.\"'\";\n\t\t}\n\t\t$where_string = implode(\" and \", $fild_value);\n\t}else{\n\t\t$where_string = $where;\n\t}\n\n\n\t$sql = \"SELECT * FROM `$table` WHERE \".$where_string;\n\t\n\t$query = mysqli_query($con,$sql);\n\tif($query){\n\t\t$datas = array();\n\t\twhile($data = mysqli_fetch_assoc($query)){\n\t\t\t$datas[] = (object)$data;\n\t\t}\n\t\treturn $datas;\n\t}else{\n\t\treturn mysqli_error($con);\n\t}\n\treturn $sql;\n}", "function getRecords($wheres = '', $orderby = '', $searchby = '', $limit = '', $groupby = '', $select = '') {\n if (!$groupby)\n $this->db->select($this->_configure['table_name'] . '.*');\n $this->db->from($this->_configure['table_name']);\n $wheres[] = array($this->_configure['table_name'] . '.' . $this->_configure['permanent_delete'], 0);\n foreach ($wheres as $key => $where) {\n if (is_array($where))\n $this->db->where($where[0], $where[1]);\n else\n $this->db->where($where);\n }\n\n ## For left join ##\n if (isset($this->_configure['dependent_on'])) {\n foreach ($this->_configure['dependent_on'] as $table => $details) {\n $this->db->join($table, $details['on'], $details['type']);\n foreach ($details['where'] as $w => $v) {\n if (is_array($v))\n $this->db->where($v[0], $v[1]);\n else\n $this->db->where($v);\n }\n if (!$groupby) {\n foreach ($details[\"fetch\"] as $column)\n $this->db->select($table . '.' . $column);\n }\n }\n }\n if (is_array($orderby)) {\n foreach ($orderby as $order)\n $this->db->order_by($order);\n }\n\n if (is_array($searchby)) {\n foreach ($searchby as $sitem)\n $this->db->like($sitem[0], $sitem[1]);\n }\n\n if (is_array($limit))\n $this->db->limit($limit[1], $limit[0]);\n\n if ($groupby) {\n $this->db->group_by($groupby);\n if (is_array($select)) {\n foreach ($select as $column)\n $this->db->select($column);\n }\n }\n $query = $this->db->get();\n //echo $this->db->last_query();\t\t\t\t\t\t\t\t\n return $query->result();\n }", "public function fetchDataFront()\n\t{\n\t\t$this->db->order_by($this->id,$this->order);\n\t\t$this->db->limit(1);\n\t\treturn $this->db->get($this->table)->result();\n\t}", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "public function query($sql) {\n $arrayOfActiveRows = [];\n // select all data from the specified condition\n $dataArray = $this->database->userQuery($sql);\n // foreach data found in this array, we creat active row and store in variable $activeRow and \n // we push into this \n foreach ($dataArray as $data) {\n $activeRow = $this->CreateActiveRowFrom($data);\n array_push($arrayOfActiveRows, $activeRow);\n }\n return $arrayOfActiveRows;\n\n }", "function getFilterRecord($limit,$column_name,$order,$pofno,$dor,$jobtitle,$company,$location,$grade,$salary,$posstatus,$consul){\n\t \n\t $sql = \"SELECT *,SUM(stage='288') As sum1, SUM(stage='289') As sum2, SUM(stage='291') As sum3, SUM(stage='293') As sum4, COUNT(DISTINCT cand_id) As count2, synonym.parentname As compa, a1.parentname As loca FROM pof LEFT JOIN pof_candidates ON pof.pof_id=pof_candidates.pofid LEFT JOIN synonym ON synonym.s_id=pof.client_id LEFT JOIN synonym As a1 ON a1.s_id=pof.location LEFT JOIN pof_cons ON pof.pof_id=pof_cons.pos_id WHERE pof.jobtitle LIKE '%\".$jobtitle.\"%' AND synonym.parentname LIKE '%\".$company.\"%' AND pof.grade LIKE '%\".$grade.\"%' AND pof.sal_t LIKE '%\".$salary.\"%' AND pof.pos_status LIKE '%\".$posstatus.\"%' AND pof_cons.consuls LIKE '%\".$consul.\"%' GROUP BY pof.pof_id ;\";\n\t \t\n\t $q = $this->db->query($sql);\n\t\tif($q->num_rows() > 0)\n\t\t{\n\t\t\tforeach($q->result() as $row)\n\t\t\t{\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t}" ]
[ "0.6651659", "0.65491456", "0.6464496", "0.6437017", "0.64343596", "0.6395387", "0.639199", "0.63619566", "0.636179", "0.634341", "0.6338727", "0.6333585", "0.6313645", "0.63093436", "0.63089454", "0.62782264", "0.62617904", "0.62487125", "0.6204377", "0.619836", "0.6190261", "0.61876225", "0.617039", "0.6148416", "0.61305666", "0.6129814", "0.61043847", "0.6093781", "0.6075975", "0.60759234", "0.6066651", "0.60612285", "0.60518616", "0.60388494", "0.60375386", "0.6034852", "0.60306495", "0.60268384", "0.60205334", "0.6018594", "0.60131717", "0.59966403", "0.5996534", "0.5983714", "0.59646213", "0.5958522", "0.5951271", "0.59507436", "0.59504944", "0.5947675", "0.5939491", "0.59368795", "0.59314704", "0.5913487", "0.5902775", "0.5902547", "0.59014416", "0.5899936", "0.58993834", "0.5890653", "0.5889863", "0.5886382", "0.587931", "0.5873971", "0.58736837", "0.5869892", "0.58695984", "0.5867648", "0.58630043", "0.5862009", "0.5858988", "0.5848745", "0.58432215", "0.5840008", "0.5838788", "0.583604", "0.583412", "0.58303", "0.5826294", "0.5823025", "0.58216405", "0.58135486", "0.581047", "0.5806442", "0.579794", "0.5796886", "0.57939625", "0.5792939", "0.5791078", "0.57907873", "0.57843906", "0.5781132", "0.57800454", "0.5778556", "0.5775174", "0.5772574", "0.5766696", "0.5761678", "0.575996", "0.57548445", "0.57522684" ]
0.0
-1
Make a SQL query string like 'DELETE FROM table WHERE ... LIMIT ...'
private function constructDeleteQuery($conds = null, $limit = null) { $conds = isset($conds) ? $conds : $this->conds; $limit = isset($limit) ? $limit : $this->limit; if (empty($conds)) { $this->setError(-1, 'constructDeleteQuery() requires conditions'); return false; } $condString = ''; $limitString = ''; $tablesUsed = array(); if (!empty($conds)) { $condString = ' WHERE ' . $this->constructCondStringStatic($tablesUsed, $conds); } // SQL delete only has LIMIT x rather than LIMIT y,x if (!empty($limit)) { if ($limit['start'] != 0) { $this->setError(-1, 'constructDeleteQuery() can only take 0-index limit starts'); return false; } $limitString = ' LIMIT ' . $limit['limit']; } return "DELETE FROM " . $this->tableName . "{$condString}{$limitString}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getSQLForDelete()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'DELETE FROM ' . $table . ($this->_sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->_sqlParts['where']) : '');\n\n $query = ($this->_maxResults === null && $this->_firstResult == null)\n ? $query\n : $this->_connection->getAdapter()->applyLimit($query, $this->_firstResult, $this->_maxResults);\n\n return $query;\n }", "function sql_delete($table, $options = array()) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$prefix = var_get('sql/prefix', '');\n\n\t$options = array_merge(array(\n\t\t'where' => '',\n\t), $options);\n\n\t$query = 'DELETE FROM ' . sql_quote($prefix . $table, true);\n\t$query .= !$options['where']? '' : ' WHERE ' . sql_logic($options['where']);\n\t\n\tif( isset($options['limit']) ){\n\t\t$query .= ' LIMIT ' . (int)$options['limit'];\n\t}\n\n\tsql_dump($query);\n\n\t$q = $sql->prepare($query . ';');\n\treturn $q->execute();\n}", "protected function _delete($table)\n\t{\n\t\treturn 'DELETE FROM '.$table.$this->_compile_wh('qb_where')\n\t\t\t.($this->qb_limit ? ' LIMIT '.$this->qb_limit : '');\n\t}", "protected function _sql_delete ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'DELETE FROM ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0];\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "public abstract function getDeleteSQL($from, $joins, $where, $values, $order, $limit);", "public function deleteQuery(): string\n {\n return 'DELETE FROM products WHERE id = :id';\n }", "public function delete( $table, $where='', $orderBy='', $limit=array(), $shutdown=false );", "public function buildDeleteSql() {\r\n $this->sql .= ' FROM ' . $this->sqlStrTables;\r\n $this->setConditions();\r\n $this->setLimit();\r\n }", "function getDeleteSql()\n {\n $str = \"DELETE FROM \";\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "function generateDeleteQuery($tableName,$column,$value)\n{\n $len = strlen($value);\n if( $len <= 1 || $value[0] != \"'\" || $value[$len-1] != \"'\" )\n\treturn \"DELETE FROM $tableName WHERE $column='$value'\";\n else\n\treturn \"DELETE FROM $tableName WHERE $column=$value\";\n}", "public function deleteQuestions()\r\n{\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "function gw_sql_delete($table, $ar_where)\r\n{\r\n\t$ar_w = array();\r\n\tfor (reset($ar_where); list($k, $v) = each($ar_where);)\r\n\t{\r\n\t\tif ($k)\r\n\t\t{\r\n\t\t\t$ar_w[] = '`'.$k.'` = \"'.$v.'\"';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$ar_w[] = $v;\r\n\t\t}\r\n\t}\r\n\t$where = implode(' AND ', $ar_w);\r\n\t$query = 'DELETE FROM `'.$table.'` WHERE '.$where;\r\n\treturn $query;\r\n}", "public function deleteSql(){\n\n $sql = \"DELETE FROM {$this->table} WHERE id = {$this->updateId}\";\n \n return $sql;\n }", "public function deleteQuestion()\r\n {\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE questionid= :questionid\";\r\n\r\n return $query_string;\r\n}", "protected function platformDeleteStatement($table)\n {\n return 'DELETE FROM ' . $table\n . $this->compileWhereHavingStatement('where')\n . $this->compileLimitStatement();\n }", "public function deleteQuiz()\r\n{\r\n $query_string = \"DELETE FROM quizzes \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "public function deleteRecord ($sqlString);", "static public function BuildSQLDelete( $tableName, $whereArray = NULL, $customWhereArray = array() )\r\n\t{\r\n\t\t$sql = \"DELETE FROM `\" . $tableName . \"`\";\r\n\t\tif( !is_null( $whereArray ) || is_array( $customWhereArray ) )\r\n\t\t{\r\n\t\t\tif( is_array( $customWhereArray ) )\r\n\t\t\t{\r\n\t\t\t\t$sql .= self::BuildSQLWhereClause( $whereArray, $customWhereArray );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql .= self::BuildSQLWhereClause( $whereArray );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function deleteRecords($table, $condition, $limit) \n {\n \t$limits = ( $limit == '' ) ? '' : ' LIMIT ' . $limit;\n \t$delete = \"DELETE FROM {$table} WHERE {$condition} {$limits}\";\n \t$this->executeQuery( $delete );\n }", "public function deletePost()\r\n{\r\n $query_string = \"DELETE FROM posts \";\r\n $query_string .= \"WHERE postid= :postid\";\r\n\r\n return $query_string;\r\n}", "public function deletePosts()\r\n{\r\n $query_string = \"DELETE FROM posts \";\r\n $query_string .= \"WHERE postcategory= :postcategory\";\r\n\r\n return $query_string;\r\n}", "public function delete()\r\n {\r\n $this->sql = 'DELETE FROM ' . $this->table .' '.$this->alias. ' '. $this->sql;\r\n $query = R::exec($this->sql, $this->params);\r\n $this->sql = null;\r\n $this->params = [];\r\n return $query;\r\n }", "protected function getDeleteByIdSQL($table_name) : string\n\t{\n\n\t\treturn \"DELETE FROM {$table_name} WHERE id = :id or parent_id = :id\";\n\n\t}", "private function formatDeleteCommand( $where = null )\n {\n $sql = 'DELETE FROM ' . $this->table_name;\n\n if ( $where != null )\n $sql .= ' WHERE ' . $where;\n\n return $sql;\n }", "public function get_delete()\n {\n $del = $this->alias;\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n return \"delete $del $from $join $where $group $order $limit\";\n }", "public function deleteReplies()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replytopic = :replytopic\";\r\n\r\n return $query_string;\r\n}", "function QueryDelete($table, $where='1') {\r\n $q = 'DELETE FROM `' . $this->pre . $table . '` WHERE ' . $where . ';';\r\n return $this->query($q);\r\n }", "public function deleteReply()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replyid = :replyid\";\r\n\r\n return $query_string;\r\n}", "protected function getDelete()\n {\n $query = 'DELETE FROM ' . $this->getElement('from') . PHP_EOL;\n $query .= $this->getElement('where');\n\n return $query;\n }", "public function deleteCategory()\r\n{\r\n $query_string = \"DELETE FROM categories \";\r\n $query_string .= \"WHERE categoryid= :categoryid\";\r\n\r\n return $query_string;\r\n}", "protected function RetDelete() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n $return = \"DELETE FROM `{$this->\n tables[0]}`\";\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n return $return . \";\";\n }", "function dbRowDelete($table_name, $where_clause='')\n{\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add keyword\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // build the query\n $sql = \"DELETE FROM \".$table_name.$whereSQL;\n\n // run and return the query result resource\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}", "public function get_compiled_delete($reset = TRUE)\n {\n $sql = 'DELETE FROM '.$this->table_prefix($this->_table);\n\n if ( ! empty($this->_where))\n {\n // Add deletion conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ($this->_limit !== null)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n return $sql;\n }", "public function queryDelete($table, $where) : int;", "public static function buildDeleteStatement($table, $where)\n{\n\t// Form statement\n\t$stmt = 'DELETE FROM ' . $table . self::buildWhereClause($where);\n\n\t// Return statement\n\treturn $stmt;\n}", "function sqlDeleteGrade()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_grade\n\t\tWHERE grade_id = :grade_id\n\t\t\";\n\n\t\treturn $sql;\n\t}", "public static function getDeleteSQL($id)\n\t{\n\t\t$sql = \"delete from comments\n where id = %d\";\n\t\t$sql = sprintf($sql, $id);\n\n\t\treturn $sql;\n\t}", "function sqlDeleteTeacher()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_teacher\n\t\tWHERE teacher_id = :teacher_id\n\t\t\";\n\n\t\treturn $sql;\n\t}", "function _delete ($table_name) {\n\t\treturn \"DELETE FROM `{$table_name}`\";\n\t}", "public function DELETEquery($table, $where) {\n \n $query = parent::DELETEquery($table, $where);\n \n // log query \n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n $this->logQuery($debugQuery); \n \n return $query;\n \n }", "public function delete($table, $where, $limit = 1) {\n\t\t\t$sth = $this->prepare(\"DELETE FROM $table WHERE $where LIMIT $limit\");\n\t\t\t$sth->execute();\n\t\t}", "public function DELETEquery($table, $where)\n {\n if (is_string($where)) {\n // Table and fieldnames should be \"SQL-injection-safe\" when supplied to this function\n $query = 'DELETE FROM ' . $table . ((string) $where !== '' ? ' WHERE ' . $where : '');\n if ($this->debugOutput || $this->store_lastBuiltQuery) {\n $this->debug_lastBuiltQuery = $query;\n }\n return $query;\n } else {\n throw new \\InvalidArgumentException('TYPO3 Fatal Error: \"Where\" clause argument for DELETE query was not a string in $this->DELETEquery() !', 1270853881);\n }\n }", "public function delete($table, $where='', $limit='', $like=false, $wheretypes){\n\t\t$query = \"DELETE FROM `{$table}` WHERE \";\n\t\tif(is_array($where) && $where != ''){\n\t\t\t// Prepare Variables\n\t\t\t$where = $this->SecureData($where, $wheretypes);\n\n\t\t\tforeach($where as $key=>$value){\n\t\t\t\tif($like){\n\t\t\t\t\t$query .= \"`{$key}` LIKE '%{$value}%' AND \";\n\t\t\t\t}else{\n\t\t\t\t\t$query .= \"`{$key}` = '{$value}' AND \";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = substr($query, 0, -5);\n\t\t}\n\n\t\tif($limit != ''){\n\t\t\t$query .= ' LIMIT ' . $limit;\n\t\t}\n\n\t\treturn $this->executeSQL($query);\n\t}", "function Delete($table_name, $where_clause='')\n{ \n global $mysqli;\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add keyword\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // build the query\n $sql = \"DELETE FROM \".$table_name.$whereSQL;\n\n // run and return the query result resource\n return mysqli_query($mysqli,$sql);\n}", "function dbDelete($table, $where = null, $insertId = false){\n //$table = DB_PREFIX.'_'.$table; //para pegar o prefixo da tabela caso use\n $where = ($where) ? \" WHERE {$where}\" : null;\n $query = \"DELETE FROM {$table}{$where}\";\n return qExecute($query, $insertId);\n }", "public function sql_for_delete() {\n\t\t// Check if model is writable\n\t\t$this->assertModelIsWritable();\n\n\t\t// Destination model\n\t\t$model = $this->model;\n\n\t\t// Cascade deletion calculation for model $model\n\t\tforeach ($model::metaGetRelationships() as $relationshipName => $relationship) {\n\t\t\t// Nexii tuples and children tuple deletion\n\t\t\tif (\n\t\t\t\t($relationship[\"type\"] == \"OneToMany\" or $relationship[\"type\"] == \"ManyToMany\") and\n\t\t\t\tisset($relationship[\"on_master_deletion\"]) and\n\t\t\t\t$relationship[\"on_master_deletion\"] == \"delete\"\n\t\t\t) {\n\t\t\t\t$this->addRelatedModel($relationshipName);\n\t\t\t}\n\t\t}\n\n\t\t// SQL code generation\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/delete/query.twig.sql\");\n\t\t$sql = $sqlT->render([\"query\" => $this]);\n\n\t\t// Return DELETE statement SQL code\n\t\treturn $sql;\n\t}", "public function deleteLoginLogsForUser()\r\n{\r\n $query_string = \"DELETE FROM loginlogs \";\r\n $query_string .= \"WHERE userid = :userid \";\r\n\r\n return $query_string;\r\n}", "function SQL_delete_usuario()\n {\n $query_delete =sprintf(\"DELETE FROM usuario WHERE id_usuario =%s LIMIT 1\",\n $this->GetSQLValueString($this->id, \"int\"));\n return $query_delete;\n }", "public function buildDeleteQuery($table, $whereKey, $whereValue)\n {\n return 'delete:' . $table . ':' . $whereKey . ':' . $whereValue;\n }", "function sqldelete($table,$cond)\n{\n \n\t $sql = \"delete from $table where $cond\";\n\t\n\tmysqli_query($con,$sql);\n\treturn(0);\n}", "function delete($table, $clause) {\t\t\r\n\t\treturn $this->query(\"delete from $table where $clause\");\r\n\t}", "public function prepareQuery($sql) {\n if (preg_match('/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/i', $sql)) {\n $sql = preg_replace(\"/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/\", \"DELETE FROM \\\\1 WHERE 1=1\", $sql);\n }\n return $sql;\n }", "function querySmettiDiSeguire($utente_seguito){\r\n \r\n $sql = 'DELETE FROM seguaci_seguiti '\r\n . 'WHERE utente_seguace=' . \"'\" . $_SESSION['email_utente'] . \"' AND \" \r\n . 'utente_seguito=' . $utente_seguito; \r\n \r\n return $sql;\r\n \r\n}", "public function deleteBySql($table, $sql, $bind = []);", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "public function deleteSystems()\r\n{\r\n $query_string = \"DELETE FROM voting_system \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid \";\r\n\r\n return $query_string;\r\n}", "function delete($table='', ...$wherekeys) { \n if ( empty($table) ) {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n\t\t\n $sql=\"DELETE FROM $table\";\n \n $where = $this->where(...$wherekeys);\n if (is_string($where)) { \n $sql .= $where;\t\t\t\t\t\t\n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->query($sql, true) : $this->query($sql) ; \n } else {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n }", "public function delete($where = [], $limit = null)\n {\n $this->where($where);\n\n if (isset($limit)) {\n $this->limit($limit);\n }\n\n $sqlStatement = $this->platformDeleteStatement(\n $this->conn->protectIdentifiers(\n $this->builderCache->from[ 0 ],\n true,\n $this->conn->protectIdentifiers,\n false\n )\n );\n\n if ($this->testMode) {\n return $sqlStatement;\n }\n\n $sqlBinds = $this->builderCache->binds;\n $this->builderCache->resetModifier();\n\n return $this->conn->query($sqlStatement, $sqlBinds);\n }", "function query_delete($data){\n\t\t$page = $data[0];\n\t\t$table = $data[1];\n\t\t$whercon = $data[2];\n\t\t$query = 'DELETE FROM '.$table.' WHERE '.$whercon; \n\t\tmysql_exe_query(array($query,1)); \n\t\t$content = '<script>location.href=\"'.$page.'\";</script>'; \n\t\treturn $content;\n\t}", "public function compileDeleteWithoutJoins(Builder $builder, $table, $where): string\n {\n return \"delete from {$table} {$where}\";\n }", "public static function delete($sql,$safeMode=false) {\r\n\t\tif($safeMode !== TRUE)return;\r\n\t\treturn self::_DB()->createCommand($sql)->execute();\r\n\t}", "function getLimitSql()\n\t{\n\t\t$sql = \"LIMIT \" . $this->getLimit();\n\t\treturn $sql;\n\t}", "public function delete($id) {\r\n $sql= \"delete from bestelling where id=? limit 1\";\r\n $args=func_get_args();\r\n parent::execPreppedStmt($sql,$args);\r\n }", "private function _getPurgeQueryAuto()\n\t{\n\n\t\t// delete from database\n\t\t$query = 'delete from ' . $this->_db->quoteName($this->_getTableName())\n\t\t\t. ' where ' . $this->_db->quoteName('dateadd') . '=' . $this->_db->Quote('0000-00-00');\n\n\t\treturn $query;\n\t}", "function get_clean_query() {\n\t$q = gzinflate(base64_decode(strtr($_POST['query_csv'], '-_', '+/')));\n\t\n\t$type = strtolower(!empty($_POST['type']) ? $_POST['type'] : 'csv_all');\n\n\t// Remove the offset if removing all information\n\tif(substr($type,-3) === 'all') {\n\t\t$q = preg_replace('/LIMIT\\s+\\d+\\,?\\s+?\\d+/','',$q);\n\t}\n\treturn $q;\n}", "public function delete($table, $where, $limit = 1)\n {\n $this->prepareQuery(\"DELETE FROM $table WHERE $where LIMIT $limit\");\n $this->executeQuery($this->statement);\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "function delete_by( $conds = array() )\n\t{\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\t\t// delete the record\n\t return $this->db->delete( $this->table_name );\n\t //print_r($this->db->last_query());die;\n\t \n \t}", "function delete($spec) {\n\t\tif(isset($spec['join'])){\n\t\t\t$spec['where'] = array(\"{$spec['select'][0]} IN ({$this->select($spec)})\");\n\t\t\t$spec['join'] = null;\n\t\t}\n\t\t$spec['select'] = $spec['order_by'] = $spec['offset'] = null; // irrelevant fields\n\t\treturn $this->quoteIdentifiers($this->aliasFields(\"DELETE \" . $this->compile($spec), false));\n\t}", "protected function _deletePgtSql()\n\t{\n\t\treturn 'DELETE FROM ' . $this->getTable() . ' WHERE pgt_iou = :pgt_iou';\n\t}", "function delete($table, array $conditions);", "protected function deleteFrom(string $tableName) {\n $query = \"DELETE FROM \" . $tableName . \" \";\n $this->query .= $query;\n }", "public function delete(?string $template = null): Query\n {\n if ($this->queryType !== self::DELETE) {\n $this->resetStatement();\n $this->queryType = self::DELETE;\n }\n return $this->template($template ?? 'DELETE FROM {{table}} {{where}}');\n }", "public function deleteSystem()\r\n{\r\n $query_string = \"DELETE FROM voting_system \";\r\n $query_string .= \"WHERE systemid = :systemid \";\r\n\r\n return $query_string;\r\n}", "public function recDelete($id) {\n $query = 'DELETE FROM ' .static::getTable(). ' WHERE ' .static::getColumn(). ' = ' .\"'$id'\";\n $sql = self::getQuery($query);\n return $sql;\n }", "function deleteClause($table)\t{\n\t\tglobal $TCA;\n\t\tif (!strcmp($table,'pages'))\t{\t// Hardcode for pages...:\n\t\t\treturn ' AND deleted=0';\n\t\t} else {\n\t\t\treturn $TCA[$table]['ctrl']['delete'] ? ' AND '.$TCA[$table]['ctrl']['delete'].'=0' : '';\n\t\t}\n\t}", "protected function compileDeleteWithJoinsOrLimit(Builder $query)\n {\n $table = $this->wrapTable($query->from);\n\n $alias = last(preg_split('/\\s+as\\s+/i', $query->from));\n\n $selectSql = $this->compileSelect($query->select($alias.'.ctid'));\n\n return \"delete from {$table} where {$this->wrap('ctid')} in ({$selectSql})\";\n }", "function delete($sql = \"\") {\n\t\t\t$this->time_start();\n\n\t\t\tif ($this->checkup(\"delete\", $sql) != true) {\n\t\t\t\treturn $this->error(\"no delete query: \".$sql);\n\t\t\t}\n\n\t\t\t$conn = $this->CONN;\n\t\t\t$results = $this->one_query($sql);\n\t\t\t$results = $this->affected_rows;// mysql_affected_rows($conn);\n\n\t\t\t$this->time_stop(\"delete\");\n\n\t\t\treturn $results;\n\t\t}", "function delete($table,$where){\n\t\t$r=mysql_query(\"DELETE FROM `$table` WHERE $where\");\n\t}", "private function getDeleteProductsQuery()\n {\n $query = \"DELETE FROM \" . TB_MIXGROUP . \" WHERE mix_id = \" . $this->db->sqltext($this->mix_id);\n return $query;\n }", "public function deleteDefinition()\r\n{\r\n $query_string = \"DELETE FROM glossary \";\r\n $query_string .= \"WHERE wordid = :wordid \";\r\n\r\n return $query_string;\r\n}", "public function delete($infos)\n {\n $tabela = $infos['table'];\n $whereCriteria = $infos['where'];\n\n\n try {\n $this->sql = \"DELETE FROM $tabela \";\n if (!empty($whereCriteria)) {\n $this->sql .= \" WHERE \" . $whereCriteria . \" \";\n }\n return $this->sql . \";\";\n } catch (PhiberException $e) {\n throw new PhiberException(new Internationalization(\"query_processor_error\"));\n }\n }", "public function __toString(): string\n {\n return \"DELETE FROM \".$this->table.$this->getWhere();\n }", "function clearSQL() {}", "public function deleteUserAccount()\r\n{\r\n $query_string = \"DELETE FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "public function deleteSystemType()\r\n{\r\n $query_string = \"DELETE FROM system_type \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid \";\r\n\r\n return $query_string;\r\n}", "public function sql($criteria=NULL)\n {\n if($this->limite == 0 OR $this->offset() == 0){\n\t $sql = $this->sql . \"\";\n\t return $sql;\n\t}\n else{\n $sql = $this->sql . \" LIMIT {$this->limite} OFFSET {$this->offset()} \";\n\treturn $sql;\n }\n }", "function del_condition($value,$table,$field) {\n \n global $prefix,$link;\n \n $sql = mysqli_query($link,\"DELETE FROM `\".$prefix.$table.\"` WHERE `\".$field.\"`='\".$value.\"'\");\n return $sql;\n \n}", "public function compileDeleteWithJoins(Builder $builder, $table, $where): string\n {\n $alias = lastItem(explode(' as ', $table));\n\n $joins = $this->compileJoins($builder, $builder->joins);\n\n return \"delete {$alias} from {$table} {$joins} {$where}\";\n }", "public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}", "function sql_delete($conn, $table, $where) {\n\n $query = \"\n DELETE FROM\n \" . $table .\"\n WHERE\n \".$where.\" \";\n\n //exit($query);\n\n if(_DEBUG==true){\n echo '<div style=\"z-index:100; color:red; background:#F4F4F4; border:solid 1px #E1E1E1; position:fixed; float:right; padding:10px; bottom:0; right:10px;\">' . $query . '</div>';\n }\n\n $result = mysqli_query($conn, $query) or die(mysqli_error($conn));\n\n if(_LOG==true && TABELA_LOG!=NULL ){\n criar_log($conn, $query, TABELA_LOG);\n }\n\n return $result;\n\n}", "public function getInstruction(): string\n {\n $this->sql = \"DELETE FROM {$this->entity}\";\n\n if(isset($this->Criteria))\n $this->sql .= \" WHERE {$this->Criteria->dump()}\";\n\n return \"{$this->sql}\";\n }", "protected abstract function getDeleteStatement();", "function delete( $sql = \"\" )\n\t{\n\t\t$this->time_start();\n\n\t\tif ( $this->checkup( \"delete\", $sql ) != true ) {\n\t\t\treturn $this->error( \"no delete query: \" . $sql);\n\t\t}\n\t\t\n $conn = $this->CONN;\n\t\t$results = mysql_query( $sql, $conn );\n\t\t$results = mysql_affected_rows( $conn );\n\n\t\t$this->time_stop(\"delete\");\n\n\t\treturn $results;\n\t}", "public function SQLDelete($tabela, $condicoes){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\t$query = \"DELETE FROM $tabela WHERE $condicoes\";\n\n\t\t\t$this->lastQuery = $query;\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$dataBefore = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabela\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$condicoes\"));\n\t\t\t}\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t\t$result = mysqli_query($this->connection, $query) or $this->reportQueryError(mysqli_error(), $query, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$result = odbc_exec($this->connection, $query) or $this->reportQueryError(odbc_errormsg(), $query, 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$result = $this->connection->query($query) or $this->reportQueryError(implode(\":\", $this->connection->errorInfo()), $query, 2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$this->audit = false;\n\n\t\t\t\t$this->autoAudit($query, \"\", $dataBefore);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public function delete() \n {\n $this->_data['query'] = 'DELETE';\n $this->_data['from'] = ' FROM '.$this->_data['from'];\n $this->_data['query'] .= $this->_data['from'];\n if (func_num_args() > 0) {\n $this->where(func_get_args());\n }\n return $this;\n }", "static function removeUser() : string\n {\n return \"DELETE\n FROM users\n WHERE id = :id;\";\n }", "public function _delete ($table, $where_params_array = array())\n {\n $query = \"\n DELETE FROM {$table}\n \";\n\n $bind_params_array = array();\n\n // if there are any WHERE parameters then add them to the query and the bind params array\n if ( !empty ($where_params_array) )\n {\n\n $count = 0;\n $query .= \"WHERE\n \";\n foreach ($where_params_array as $key => $value) {\n\n $bind_params_array[$count] = $value;\n\n if ( $count > 0 )\n {\n $query .= \" AND \";\n }\n $query .= \"`{$key}` = ?\n \";\n $count++;\n }\n }\n else\n {\n\n // DELETE all from table has been disabled as a safeguard in case anyone\n // accidentally forgets to pass the second parameter\n //return false;\n }\n\n return $this->queryDatabase ($query, $bind_params_array, false);\n }", "public static function delete($options = array()) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb()); \n// $where = array();\n// foreach (static::$properties as $property) { \n// if (isset($options['where'][$property])) { \n// $where[$property] = $options['where'][$property];\n// }\n// }\n $where = $options['where'];\n if (empty($where)) {\n static::errorParamInvalid();\n return false;\n } \n $delete = $sql->delete()\n ->from($options['table']) \n ->where($where);\n $deleteString = $sql->getSqlStringForSqlObject($delete);\n Log::info('Delete SQL', $deleteString);\n if (static::getDb()->query($deleteString, Adapter::QUERY_MODE_EXECUTE)) {\n return true;\n }\n return false;\n }" ]
[ "0.7873149", "0.7274957", "0.7235103", "0.7146288", "0.6860992", "0.67853296", "0.67409205", "0.6722664", "0.6702783", "0.66968185", "0.6684343", "0.66721", "0.66109973", "0.65454257", "0.653876", "0.6504193", "0.6470632", "0.64695835", "0.64647627", "0.6456595", "0.6454942", "0.64470005", "0.6428427", "0.639791", "0.63743263", "0.63573176", "0.6341604", "0.63221884", "0.6298821", "0.6285509", "0.623851", "0.62285346", "0.6206382", "0.62002736", "0.61776894", "0.61631083", "0.61542565", "0.6144463", "0.6137537", "0.6137237", "0.6136777", "0.6115253", "0.61063313", "0.6095321", "0.6089098", "0.60755235", "0.6072262", "0.60573834", "0.6052315", "0.6049443", "0.60473937", "0.6018004", "0.60145575", "0.6012654", "0.6012371", "0.6012371", "0.59915704", "0.5982847", "0.5891245", "0.5886708", "0.5874458", "0.5863616", "0.5854957", "0.5850396", "0.5838503", "0.5825299", "0.5811755", "0.58104056", "0.58088535", "0.5801", "0.5787387", "0.578422", "0.57818395", "0.5780328", "0.5779733", "0.5766929", "0.5755256", "0.5748546", "0.5735677", "0.5725056", "0.572503", "0.5721419", "0.570541", "0.5703928", "0.57012886", "0.5694553", "0.5687098", "0.5683784", "0.5678647", "0.5674502", "0.5661763", "0.5642439", "0.5641119", "0.55897325", "0.55875355", "0.5569802", "0.55683", "0.5558328", "0.5550329", "0.5548233" ]
0.6825585
5
Make a conds array that would only select the current item based on its primary/unique keys.
public function constructKeyConds() { $conds = array(); // Make a similar $conds array based out of $this->info foreach ($this->keys as $column) { if (!isset($this->info[$column])) { echo "{$column} not set\n"; return false; } $conds[0][] = array($column, $this->info[$column], '='); } return $conds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPrimaryKeyCondition($primaryKeyValue) {\n return array(\n 'where' => \"{$this->_primaryKeyElement} = ?\",\n 'bindings' => array($primaryKeyValue)\n );\n }", "public static function for_select(array $collection, $key, $primary_key = 'id')\n {\n $result = array();\n foreach ($collection as $item) {\n $result[$item->$primary_key] = $item->$key;\n }\n return $result;\n }", "function GetSelArray($items, $sel)\r\n\t{\r\n\t\t$ret = array();\r\n\t\tforeach ($items as $i)\r\n\t\t{\r\n\t\t\t$ret[$i->id] = array($i, $i->id == $sel);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "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 getConnections(){\n $connections = [];\n\n $this->filter('connectionsTarget', [\n 'active = :active AND target = :targetId',\n ':active' => 1,\n ':targetId' => $this->_id\n ]);\n if($this->connectionsTarget){\n foreach($this->connectionsTarget as $connection){\n $connections[$connection->_id] = $connection;\n }\n }\n\n $this->filter('connectionsSource', [\n 'active = :active AND source = :sourceId',\n ':active' => 1,\n ':sourceId' => $this->_id\n ]);\n if($this->connectionsSource){\n foreach($this->connectionsSource as $connection){\n $connections[$connection->_id] = $connection;\n }\n }\n\n return $connections;\n }", "function query_array($sql, $primary_key = null) {\r\n\r\n\t\t$this->query($sql);\r\n\r\n\t\t$return = array();\r\n\r\n\t\twhile ($row = mysql_fetch_assoc($this->result)) {\r\n\t\t\tif (isset($primary_key) && key_exists($primary_key, $row)) {\r\n\t\t\t\t$return[$row[$primary_key]] = $row;\r\n\t\t\t} else {\r\n\t\t\t\t$return[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "public function createKeyArray(){\n\t$keyArray = array();\n\tif (isset($this->id)) $keyArray[\"id\"] = $this->id;\n\tif (isset($this->codice_categoria)) $keyArray[\"codice_categoria\"] = $this->codice_categoria;\n\tif (isset($this->codice)) $keyArray[\"codice\"] = $this->codice;\n\tif (isset($this->descrizione)) $keyArray[\"descrizione\"] = $this->descrizione;\n\treturn $keyArray;\n}", "public static function getPrimaryKeys()\n {\n return array('bindingId');\n }", "protected function getConditions()\n {\n $entityPk = (array)$this->mapper->getConfig()->getPrimaryKey();\n $conditions = [];\n foreach ($entityPk as $col) {\n $val = $this->entityHydrator->get($this->entity, $col);\n if ($val) {\n $conditions[$col] = $val;\n }\n }\n\n // not enough columns? reset\n if (count($conditions) != count($entityPk)) {\n return [];\n }\n\n return $conditions;\n }", "public function getPrimaryKeys();", "public function getPrimaryKeys();", "protected function conditionsContainKey()\n {\n if (empty($this->where)) {\n return false;\n }\n\n $conditionKeys = array_keys($this->where);\n\n $model = $this->model;\n\n $keys = $model->hasCompositeKey() ? $model->getCompositeKey() : [$model->getKeyName()];\n\n $conditionsContainKey = count(array_intersect($conditionKeys, $keys)) === count($keys);\n\n if (!$conditionsContainKey) {\n return false;\n }\n\n $conditionValue = [];\n\n foreach ($keys as $key) {\n $condition = $this->where[$key];\n\n $value = $model->unmarshalItem(array_get($condition, 'AttributeValueList'))[0];\n\n $conditionValue[$key] = $value;\n }\n\n return $conditionValue;\n }", "private function filterDatabaseCategoryToArray()\n {\n\n $dbCategory = Category::all(['id', 'name']);\n //dd($dbTags);\n $category = [];\n foreach ($dbCategory as $t) {\n //I've placed the name as the key in case of additional checking\n $category[$t->name] = $t->id;\n }\n\n return $category;\n }", "function prepSelected($data){\n\t\n\t$current = 0;\n\t$count = count($data);\n\t\n\t$placeholders = ''; $selected = array(); $i = 0;\n\t$keys = array_keys($data); \n\t\n\tforeach($keys as $item){\n\t\tprint_r($data);\n\t\t\n\t\tswitch($item){\n\t\t\tcase $data[$i] == $keys[$i] : array_push($selected, $item);\n\t\t\tbreak;\n\t\t}\n\t\t$i++;\n\t}\n\tprint_r($selected);\n\t\t\n\t//While there are selected items\n\twhile($current < $count){\n\t\t//create the keys\t\n\t\tif($count == 1) { \n\t\t\t$keys .= $selected[$current];\n\t\t} else {\n\t\t\t$keys .= $selected[$current].',';\n\t\t} \t\n\t\t//create the placeholders\t\n\t\tif($count == 1) { \n\t\t\t$placeholders .= '?';\n\t\t} else {\n\t\t\t$placeholders .= '?,';\n\t\t} \t\n\t\t$current++; \n\t}\n\tif($count > 1){\n\t\t$keys = explode(',', $keys);\n\t\t$trash = array_pop($keys);\n\t\t$keys = implode(',', $keys);\n\t\t\t\n\t\t$placeholders = explode(',', $placeholders);\n\t\t$trash = array_pop($placeholders);\n\t\t$placeholders = implode(',', $placeholders);\n\t\t\t\n\t}\n\t\n\n\t\n\treturn $sql_vals = array($keys, $placeholders);\n}", "protected function getPrimaryKeys(\\Traversable $collection, array $connections){\n $primaryKeys = [];\n\n // gather keys\n foreach($collection as $i){\n foreach($connections as $key=>$c){\n /**\n * @var $c ResourceConnection\n */\n $class = $c->getClassName();\n $key = $i->{$c->getSelfKey()};\n\n $primaryKeys[$class][] = $key;\n }\n }\n\n // remove redundant keys\n foreach($primaryKeys as &$v){\n $v = array_unique($v);\n }\n\n return $primaryKeys;\n }", "protected function _entityConditions() {\n\t\tif (!$this->_entity || !($model = $this->_config['model'])) {\n\t\t\treturn [];\n\t\t}\n\t\t$key = $model::key($this->_entity->data());\n\n\t\tif (!$key && $this->type() !== 'create') {\n\t\t\tthrow new ConfigException('No matching primary key found.');\n\t\t}\n\t\tif (is_array($key)) {\n\t\t\treturn $key;\n\t\t}\n\n\t\t$key = $model::meta('key');\n\t\t$val = $this->_entity->{$key};\n\t\treturn $val ? [$key => $val] : [];\n\t}", "protected function getItemsConfs()\n {\n $large = array(\n 'width' => $this->width,\n 'height' => $this->height,\n 'crop' => $this->crop\n );\n\n $small = array_merge($large, array(\n 'width' => $this->thumb_width,\n 'height' => $this->thumb_height\n ));\n\n return array($large, $small);\n }", "function getPrimaryKeys() {\n \treturn $this->db->getPrimaryKeys($this->table);\n }", "private function makePKAttributesArray($array){\n\n \t\t$PKAttributes;\n \t\t$count = 0;\n \t\t$referenceTableKeys = $this->tableNames;\n \t\t$refTableKeyCount = count($referenceTableKeys);\n\n\n \t\tforeach($array as $row){\n \t\t\t$searchElement = $row['table_name'];\n\t if($count !=0 && $searchElement != $tableNames[$count-1] ){\n\t \tfor($i=0;$i<$refTableKeyCount;$i++){\n\t \t\tif($row['table_name'] == $referenceTableKeys[$i] ){\n\t \t\t\t$PKAttributes[$count]=array($row['table_name'] => $row['column_name']);\n\t \t\t}\n\t \t}\n\t \t$tableNames[$count]=$searchElement;\n\t \t$count++;\n\t }\n\t else if ($count == 0){\n\t \tfor($i=0;$i<$refTableKeyCount;$i++){\n\t \t\tif($row['table_name'] == $referenceTableKeys[$i] ){\n\t \t\t\t$PKAttributes[$count]=array($row['table_name'] => $row['column_name']);\n\t \t\t}\n\t \t}\n\t \t$tableNames[0] = $array[0]['table_name'];\n\t \t$count++;\n\t }\n\t }\n\n\t //removes indexed keys and returns a clean array\n\t $PKtemp;\n \t\tforeach ($PKAttributes as $array){\n \t\t\tforeach ($array as$tableName=>$PK){\n \t\t\t\t$PKtemp[$tableName]=$PK;\n \t\t\t}\n \t\t}\n\n \t\t$PKAttributes = $PKtemp;\n\t return $PKAttributes;\n \t}", "protected static function buildConditionByPk($primary_key)\n {\n if (!is_array($primary_key)) {\n throw new InvalidParameterException(\n _s('Primary Key is no array, maybe you wanted to use AbstractModelWithId instead?')\n );\n }\n\n $sql = \" (\";\n\n // add each column to query\n foreach (array_keys($primary_key) as $i => $key) {\n if ($i > 0) {\n $sql .= \" AND \";\n }\n $sql .= \"\\\"\".$key.\"\\\" = :\".$key;\n }\n $sql .= \") \";\n\n return [\n 'sql' => $sql,\n 'params' => $primary_key\n ];\n }", "private function getKeysFilter ($item) {\n $filter = array();\n foreach ($this->keys as $key) {\n $filter[$key] = eq($item->$key);\n }\n return $filter;\n }", "public function selectorProvider()\n {\n return [\n [Book::selectOne($this->getConn())],\n [Book::select($this->getConn())->one()]\n ];\n }", "function getWhereDistinct($table,$col,$where){\n $array=array();\n $conn=connectDB();\n $query=\"SELECT DISTINCT $col FROM $table WHERE $where\";\n //print($query);\n foreach ($conn->query($query) as $row){\n //print_r($row);\n //print_r($col);\n\n array_push($array,$row[$col]);\n }\n return $array;\n }", "function getPrimKeyArr($fk1, $fk2Arr, $pkCol, $fk1Col, $fk2Col, $table)\n\t{\n\t\t//intialize variable\n\t\t$pkIds\t= array();\n\t\t\n\t\tforeach($fk2Arr as $k)\n\t\t{\n\t\t\t$pkIds[] = $this->getPrimKey($fk1, $k, $pkCol, $fk1Col, $fk2Col, $table);\n\t\t}\n\t\t\n\t\t//return\n\t\treturn $pkIds;\n\t\t\n\t}", "public static function getCombo() {\n $conn = self::connect();\n $getQuery = self::getQuery(self::baseQuery());\n $string = $conn['query'].\"fetch_array\";\n while($result = $string($getQuery)) {\n $all[] = $result;\n }\n return @$all;\n }", "public static function getPrimaryKeys()\n {\n return array('bookId');\n }", "public function getPrimaryKeys()\n\t{\n\t\treturn array_keys($this->getArrayCopy());\n\t}", "protected function getActiveCategories()\n {\n $categories = (new \\modules\\catalog\\categories\\CatalogCategories($this->_config));\n return $categories->setSubquery(' AND `statusId` = ?d', 1);\n }", "public static function getPrimaryKeys()\n {\n return array('bookId', 'languageId');\n }", "function GetJoins() { return array(); }", "protected function _prepareSubset() {}", "public function buildPkeyCriteria()\n\t{\n\t\t$criteria = new Criteria(CidadePeer::DATABASE_NAME);\n\t\t$criteria->add(CidadePeer::ID, $this->id);\n\n\t\treturn $criteria;\n\t}", "public function findFirstKItemIdsToBeConnected($k = 0)\n {\n $db = get_db();\n $connected_select = new Omeka_Db_Select;\n $connected_select->from(array('conn' => $db->InciteItemsSubjects), array('item_id'));\n $connected_select->joinInner(array('tagged_trans' => $db->InciteTaggedTranscription), 'conn.tagged_trans_id = tagged_trans.id', array(''));\n $connected_select->where('conn.timestamp_creation > tagged_trans.timestamp_creation');\n $connected_select->group('conn.item_id');\n\n\n //Get id's of all items whose newest tagged_transcriptions are not connected yet.\n $tagged_trans_select = new Omeka_Db_Select;\n $tagged_trans_select->from(array('tagged_trans' => $db->InciteTaggedTranscription), array('item_id'));\n $tagged_trans_select->joinInner(array('trans' => $db->InciteTranscription), 'tagged_trans.item_id = trans.item_id',array(''));\n $tagged_trans_select->where('tagged_trans.timestamp_creation > trans.timestamp_creation');\n $tagged_trans_select->where('tagged_trans.item_id NOT IN ('. $connected_select->__toString() .')');\n $tagged_trans_select->group('tagged_trans.item_id');\n $tagged_trans_select->order('item_id ASC');\n\n if ($k > 0) {\n $tagged_trans_select->limit($k);\n }\n $objects = $this->fetchObjects($tagged_trans_select);\n $ids = array();\n foreach ($objects as $object) {\n $ids[] = $object->item_id;\n }\n return $ids;\n }", "function getCatsselected()\r\n\t{\r\n\t\tif(!isset($this->_item->categories)||!is_array($this->_item->categories)) {\r\n\t\t\t$query = 'SELECT DISTINCT catid FROM #__flexicontent_cats_item_relations WHERE itemid = ' . (int)$this->_id;\r\n\t\t\t$this->_db->setQuery($query);\r\n\t\t\t$used = $this->_db->loadResultArray();\r\n\t\t\treturn $used;\r\n\t\t}\r\n\t\treturn $this->_item->categories;\r\n\t}", "public function getAllUniqueIndexes() {\n return array_merge(\n [ $this->primaryKeys, ],\n $this->uniqueKeys\n );\n }", "private function init_consolidationAndSelect_setArrayConsolidation()\n {\n // LOOP : each filter (table.field)\n foreach ( ( array ) $this->arr_tsFilterTableFields as $tableField )\n {\n list( $table ) = explode( '.', $tableField );\n $tableUid = $table . '.uid';\n\n // CONTINUE : $arrConsolidation contains the current tableUid\n if ( in_array( $tableUid, ( array ) $this->pObj->arrConsolidate[ 'addedTableFields' ] ) )\n {\n continue;\n }\n // CONTINUE : $arrConsolidation contains the current tableUid\n // #47089, 120410, dwildt\n // CONTINUE : select clause contains the current tableUid\n // #50214, 130720, dwildt, 1-\n //$pos = strpos( $this->pObj->conf_sql, $tableUid );\n // #50214, 130720, dwildt, 1+\n $pos = strpos( $this->pObj->conf_sql[ 'select' ], $tableUid );\n if ( !( $pos === false ) )\n {\n continue;\n }\n // CONTINUE : select clause contains the current tableUid\n // #47089, 120410, dwildt\n // Add current tableUid\n $this->pObj->arrConsolidate[ 'addedTableFields' ][] = $tableUid;\n\n // DRS\n if ( $this->pObj->b_drs_filter )\n {\n t3lib_div :: devlog( '[INFO/FILTER] Table ' . $tableUid . ' is added to arrConsolidate[addedTableFields].', $this->pObj->extKey, 0 );\n }\n // DRS\n }\n // LOOP : each filter (table.field)\n }", "protected function _createSubset() {}", "protected function calcIdentityComposite(array $primaryVal) : array\n {\n $primary = [];\n foreach ($this->identityKey as $col) {\n if (! isset($primaryVal[$col])) {\n throw Exception::primaryValueMissing($col);\n }\n if (! is_scalar($primaryVal[$col])) {\n throw Exception::primaryValueNotScalar($col, $primaryVal[$col]);\n }\n $primary[$col] = $primaryVal[$col];\n }\n return $primary;\n }", "public function consumables()\n {\n return $this->belongsToMany(consumable::class);\n }", "protected function addKeyCond()\n {\n $args = func_get_args();\n\n $keyCount = count($this->keys);\n $argCount = count($args);\n\n for ($i = 0; $i < $keyCount && $i < $argCount; $i++) {\n $this->addCond($this->keys[i], $args[$i]);\n }\n\n return $this;\n }", "private static function getPrimaryKeysRelationship(RegistryObject $record)\n {\n $origin = 'PRIMARY-KEY';\n $relations = [];\n $dataSource = $record->datasource;\n $recordClass = $record->class;\n\n if ($dataSource->attr('create_primary_relationships') != DB_TRUE) {\n return [];\n }\n\n // primary_key_1\n $primaryKey = $dataSource->attr('primary_key_1');\n $primaryRecord = RegistryObjectsRepository::getPublishedByKey($primaryKey);\n $relationType = $dataSource->attr(\"${recordClass}_rel_1\");\n if ($primaryKey && $primaryRecord && $relationType && $primaryKey != $record->key) {\n $relations[] = [\n 'origin' => $origin,\n 'toKey' => $primaryRecord->key,\n 'relationType' => $relationType\n ];\n }\n\n // primary_key_2\n $primaryKey = $dataSource->attr('primary_key_2');\n $primaryRecord = RegistryObjectsRepository::getPublishedByKey($primaryKey);\n $relationType = $dataSource->attr(\"${recordClass}_rel_2\");\n if ($primaryKey && $primaryRecord && $relationType && $primaryKey != $record->key) {\n $relations[] = [\n 'origin' => $origin,\n 'toKey' => $primaryRecord->key,\n 'relationType' => $relationType\n ];\n }\n\n return $relations;\n }", "function getCombo( $table, $values, $titles, $where='' ) {\r\n\t\r\n\tglobal $site, $db;\r\n\t\r\n\tif ( $where == '' )\r\n\t\t$where = \"site_key='$site'\";\r\n\t\t\r\n\t$items = $db->getAll( \"select $values, $titles from $table where $where\" );\r\n\t\r\n\t$aValues = array();\r\n\t$aTitles = array();\r\n\t\r\n\tif ( is_array( $items ) && count( $items ) ) {\r\n\t\tforeach ( $items as $idx=>$item ) {\r\n\t\t\t$aValues[] = $item[$values];\r\n\t\t\t$aTitles[] = $item[$titles];\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn array( $aValues, $aTitles );\r\n}", "protected function getActiveCascadingDeletes(){\n return array_filter($this->getCascadingDeletes(), function ($relationship) {\n return ! is_null($this->{$relationship});\n });\n }", "private static function _getPrimaryKeyConstraints(DomElement $parent)\n {\n // Primary key constraints.\n $pks = $parent->getElementsByTagName('primary-key');\n\n $primaryKeys = array();\n foreach ($pks as $pk) {\n $current = array();\n $current['name'] = $pk->getAttribute('name');\n $current['COLUMNS'] = array();\n\n $columns = $pk->getElementsByTagName('column');\n foreach ($columns as $column) {\n $current['COLUMNS'][] = $column->nodeValue;\n }\n\n $primaryKeys[] = $current;\n }\n\n return $primaryKeys;\n\n }", "protected function getConstraintKeys($schemaName, $tableName)\n\t{\n\t\t$this->getDbConnection()->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);\n//\t\tselect decode( a.CONSTRAINT_TYPE, 'P', 'PRIMARY KEY (', 'FOREIGN KEY (' )||b.COLUMN_NAME||')' as consrc,\n\t\t$sql =\n<<<EOD\n\t\tselect b.COLUMN_NAME as consrc,\n\t\t\t a.CONSTRAINT_TYPE as contype\n\t\tfrom ALL_CONSTRAINTS a, ALL_CONS_COLUMNS b\n \t\twhere (a.constraint_name = b.constraint_name AND a.table_name = b.table_name AND a.owner = b.owner)\n\t\tand\t a.TABLE_NAME = '{$tableName}'\n\t\tand a.OWNER = '{$schemaName}'\n\t\tand a.CONSTRAINT_TYPE in ('P','R')\nEOD;\n\t\t$this->getDbConnection()->setActive(true);\n\t\t$command = $this->getDbConnection()->createCommand($sql);\n\t\t//$command->bindValue(':table', $tableName);\n\t\t//$command->bindValue(':schema', $schemaName);\n\t\t$primary = array();\n\t\t$foreign = array();\n\t\tforeach($command->query() as $row)\n\t\t{\n\t\t\tswitch( strtolower( $row['contype'] ) )\n\t\t\t{\n\t\t\t\tcase 'p':\n\t\t\t\t\t$primary = array_merge( $primary, array(strtolower( $row['consrc'] )) );\n\t\t\t\t\t/*\n\t\t\t\t\t$arr = $this->getPrimaryKeys($row['consrc']);\n\t\t\t\t\t$primary = array_merge( $primary, array(strtolower( $arr[0] )) );\n\t\t\t\t\t*/\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'r':\n\t\t\t\t\t$foreign = array_merge( $foreign, array(strtolower( $row['consrc'] )) );\n\t\t\t\t\t/*\n\t\t\t\t\t// if(($fkey = $this->getForeignKeys($row['consrc']))!==null)\n\t\t\t\t\t$fkey = $this->getForeignKeys( $row['consrc'] );\n\t\t\t\t\t$foreign = array_merge( $foreign, array(strtolower( $fkey )) );\n\t\t\t\t\t*/\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn array($primary,$foreign);\n\t}", "abstract public function getPrimary(): array;", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "function select($item, &$array, $row, $sortmode=-1) {\n\t\t$selectarray = array();\n\t\tif (!is_array($array)) return $selectarray;\n\n\t\tforeach ($array as $record) {\n\t\t\tif ($record[$row] == $item) $selectarray[] = $record;\n\t\t}\n\t\tif ($sortmode > -1 && count($selectarray) > 1) {\n\t\t\t$this->sort($selectarray, $sortmode & 15, $sortmode & 16);\n\t\t}\n\t\treturn $selectarray;\n\t}", "public function enableDistinct() {\r\n $this->myCRUD()->enableDistinct();\r\n return $this;\r\n }", "public static function getActiveForSelect()\n {\n $objects_active = self::getActive();\n $objects_select = array(0 => '');\n foreach ($objects_active as $l) {\n $objects_select[$l['id']] = $l['title'];\n }\n return $objects_select;\n }", "public function constructKeyCondString()\n {\n $tablesUsedBlackHole = array();\n return $this->constructCondStringStatic($tablesUsedBlackHole, $this->constructKeyConds());\n }", "private function getUpdateableClause () {\n\t\t$where = new Where;\n\t\tforeach ($this->primaryKeys as $key) {\n\t\t\t$value = $this->retreive($key);\n\t\t\tif ($value){\n\t\t\t\t$where->equals($key, $this->retreive($key));\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"Primary key (\". $key .\") has no value!\");\n\t\t\t}\n\t\t}\n\n\t\treturn $where;\n\t}", "protected function getWhereKeys(){\n\t\t\t$whereKeys = \"1\";\n\t\t\tif($this->keys){\n\t\t\t\t$whereKeys = array();\n\t\t\t\tforeach ($this->keys as $key) {\n\t\t\t\t\t$whereKeys[] = \"$key = :$key\";\n\t\t\t\t}\n\t\t\t\t$whereKeys = implode(\" AND \", $whereKeys);\n\t\t\t}\n\t\t\treturn $whereKeys;\n\t\t}", "protected function _sub_ids($eq=false) {\n $ret = array();\n $ce = reset($this->ids);\n $cb = key($this->ids);\n $doc = $this->doc();\n foreach($doc->ids as $b => $e) {\n if($b < $cb || !$eq && $b == $cb) continue;\n if($b < $ce) {\n $ret[$b] = $e;\n }\n else {\n $ce = next($this->ids);\n if(!$ce) break; // end of context\n $cb = key($this->ids);\n }\n }\n return $ret;\n }", "protected function filter_item_keys(): array {\n\t\t$items = array_keys($this->items);\n\n\t\t// Filter out keys, if keys are specified\n\t\tif ( isset( $this->filter_args[ Filter::in->key() ] ) ) {\n\t\t\t$items = Array_Helper::intersect( $items, $this->filter_args[ Filter::in->key() ] );\n\t\t\tunset( $this->filter_args[ Filter::in->key() ] );\n\t\t}\n\n\t\tif ( isset( $this->filter_args[ Filter::not_in->key() ] ) ) {\n\t\t\t$items = Array_Helper::diff( $items, $this->filter_args[ Filter::not_in->key() ] );\n\t\t\tunset( $this->filter_args[ Filter::not_in->key() ] );\n\t\t}\n\n\t\treturn $items;\n\t}", "function keyById(&$arr){\n\t\t$out = array();\n\t\tforeach ( array_keys($arr) as $key){\n\t\t\t$out[$arr[$key]->getId()] =& $arr[$key];\n\t\t}\n\t\treturn $out;\n\t}", "public function queryAllActive()\n {\n $storeId=Mage::app()->getStore()->getId();\n $results = Mage::getStoreConfig('carriers', $storeId);\n foreach ($results as $key => $value) {\n if(!$value['active']){ unset($results[$key]); }\n }\n return $results;\n }", "public function selectAllConstellationID()\n {\n $selectSQL = \"select distinct(ic_id) from nrd\";\n $result = $this->sdb->query($selectSQL, array());\n $all = array();\n while ($row = $this->sdb->fetchrow($result)) {\n array_push($all, $row['ic_id']);\n }\n return $all;\n }", "public function getConsortialIDs()\n {\n return $this->getFieldArray('035', 'a', true);\n }", "function Select_Record_By_One_Filter($data, $table_name) {\r\n global $con;\r\n $key = array_keys($data);\r\n $value = array_values($data);\r\n $sql = \"select * from $table_name where $key[0] = '$value[0]'\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}", "protected function chooseIdentifierForSearch()\n\t{\n\t\tif( empty($this->myAccountID) )\n\t\t\treturn array( 'col' => 'auth_id', 'val' => $this->myAuthID ) ;\n\t\telse\n\t\t\treturn array( 'col' => 'account_id', 'val' => $this->myAccountID ) ;\n\t}", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(ClientPeer::ID, $keys, Criteria::IN);\n }", "function where(array $array = [], array $key = [], $keepKeys = false)\n{\n $result = [];\n\n foreach ($array as $k => $v) {\n $not = false;\n\n foreach ($key as $j => $w) {\n if (\\objects\\isArray($w)) {\n if (count(array_intersect($w, $v[$j])) == 0) {\n $not = true;\n break;\n }\n } else {\n if (!isset($v[$j]) || $v[$j] != $w) {\n $not = true;\n break;\n }\n }\n }\n\n if ($not == false) {\n if ($keepKeys) {\n $result[$k] = $v;\n } else {\n $result[] = $v;\n }\n }\n }\n\n return $result;\n}", "public function getOtherRequiredPrimaryKeys(array $primaryKeys)\n {\n $pks = [];\n foreach ($this->getPrimaryKey() as $primaryKey) {\n if ($primaryKey->isNotNull() && !$primaryKey->hasDefaultValue() && !in_array(\n $primaryKey,\n $primaryKeys,\n true\n )\n ) {\n $pks = $primaryKey;\n }\n }\n\n return $pks;\n }", "public function getGroupedByMainCategory(): array\n {\n $this->createPDO('select');\n $PDOLink = PDOProcessorBuilder::getProcessor('select', true);\n $PDOLink->setCommand('SELECT id, main_category_id, name FROM meta_subcategory');\n $tempResult = $PDOLink->execute();\n $result = [];\n foreach ($tempResult as $value) {\n if (!isset($result[$value['main_category_id']])) {\n $result[$value['main_category_id']] = [];\n }\n $result[$value['main_category_id']][$value['id']] = $value['name'];\n }\n return $result;\n }", "public function keys()\n {\n return new static(array_keys($this->items));\n }", "public function filterByPrimaryKeys($keys)\n\t{\n\t\tif (empty($keys)) {\n\t\t\treturn $this->add(null, '1<>1', Criteria::CUSTOM);\n\t\t}\n\t\tforeach ($keys as $key) {\n\t\t\t$cton0 = $this->getNewCriterion(Oops_Db_CustomizationPeer::ID_CUSTOMIZATION, $key[0], Criteria::EQUAL);\n\t\t\t$cton1 = $this->getNewCriterion(Oops_Db_CustomizationPeer::ID_CART, $key[1], Criteria::EQUAL);\n\t\t\t$cton0->addAnd($cton1);\n\t\t\t$cton2 = $this->getNewCriterion(Oops_Db_CustomizationPeer::ID_PRODUCT, $key[2], Criteria::EQUAL);\n\t\t\t$cton0->addAnd($cton2);\n\t\t\t$this->addOr($cton0);\n\t\t}\n\n\t\treturn $this;\n\t}", "function construct_common_array($stmt, $rowName)\n {\n $arr = [];\n while($row = $stmt -> fetch()): $arr[] = $row[$rowName]; endwhile;\n return $arr;\n }", "protected function prepareUniqueStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Prepare our statement.\n return $this->connection->prepare(\"SELECT 1 FROM {$this->table} WHERE $clauses LIMIT 1\");\n }", "public function keepItemsInArrayWorksWithOneArgumentDataProvider() {}", "public function intersectKeys(iterable $items): self\n {\n $items = Factory::getArrayForItems($items);\n\n return Factory::create(array_intersect_key($this->items, $items));\n }", "public function getNewChildSelectOptions()\n {\n $productAttributes = $this->_ruleConditionProd->loadAttributeOptions()->getAttributeOption();\n $pAttributes = [];\n $iAttributes = [];\n foreach ($productAttributes as $code => $label) {\n if (strpos($code, 'quote_item_') === 0) {\n $iAttributes[] = [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product::class . '|' . $code,\n 'label' => $label,\n ];\n } else {\n $pAttributes[] = [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product::class . '|' . $code,\n 'label' => $label,\n ];\n }\n }\n\n $conditions = parent::getNewChildSelectOptions();\n $conditions = array_merge_recursive(\n $conditions,\n [\n [\n 'value' => \\Magento\\SalesRule\\Model\\Rule\\Condition\\Product\\Combine::class,\n 'label' => __('Conditions Combination'),\n ],\n ['label' => __('Cart Item Attribute'), 'value' => $iAttributes],\n ['label' => __('Product Attribute'), 'value' => $pAttributes]\n ]\n );\n return $conditions;\n }", "private function makeConstraintSQL($conditions) {\n $keytext = \"\";\n $all_keytext = array();\n $key_conditions = array();\n if (is_array($conditions)) {\n if ($this->is_assoc($conditions)){\n foreach ($conditions as $column_name => $value) {\n\t$final_value = \"\";\n\t$operator = ' = ';\n\tif (is_array($value)) {\n\t $operator = ' IN ';\n\t $final_value .= '(';\n\t foreach ($value as $item)\n\t {\n\t if (is_string($item)) {\n\t\t$item = $this->conn->quote($item);\n\t }\n\t $final_value .= $item . ', ';\n\t }\n\t $final_value = rtrim($final_value, ', ');\n\t $final_value .= ')';\n\t}\n\telse {\n\t if (is_string($value)) {\n\t $value = $this->conn->quote($value);\n\t }\n\t $final_value = $value;\n\t}\n\t$key_conditions[] = strtolower($column_name) . $operator . $final_value;\n }\n }\n else {\n foreach ($conditions as $cond) {\n\tif (is_array($cond)) {\n\t /* create OR clauses for multiple \n\t * arrays of column=>value */\n\t $all_keytext[] = $this->makeConstraintSQL($cond);\n\t}\n }\n }\n \n }\n $keytext = implode(\" AND \", $key_conditions);\n if(count($all_keytext) > 0) {\n $keytext = implode(\" OR \", $all_keytext);\n }\n return $keytext;\n}", "function assoc($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_assoc($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}", "public function getComposites():ActiveQuery\n {\n return $this\n ->hasMany(Composite::class, ['id' => 'compositeId'])\n ->viaTable(CompositeBloc::tableName(), ['blocId' => 'id']);\n }", "public function getEmptyKeyArray(){\n\t$emptyKeyArray = array();\n\t$emptyKeyArray[\"id\"] = \"\";\n\t$emptyKeyArray[\"codice_categoria\"] = \"\";\n\t$emptyKeyArray[\"codice\"] = \"\";\n\t$emptyKeyArray[\"descrizione\"] = \"\";\n\treturn $emptyKeyArray;\n}", "protected function _createCidSet() {}", "function Select_Record_By_Two_Filter($data, $table_name) {\r\n global $con;\r\n $key = array_keys($data);\r\n $value = array_values($data);\r\n $sql = \"select * from $table_name where $key[0] = '$value[0]' AND $key[1] = '$value[1]'\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}", "function createCollectionFilter($colVal) \n{\n\tif (is_array($colVal)) \n\t\t$colArr = $colVal;\n\telse \n\t\t$colArr = explode(\",\",$colVal);\n\n\t//merge all selected collections and their children into one array\n\t$num = count($colArr);\n\t$cv = $colArr;\n\t\n\tfor ($i=0;$i<$num;$i++) \n\t{\n\t\t$subs = DOCMGR_UTIL_COMMON::getChildCollections($cv[$i]);\n\t\tif ($subs) $colArr = array_merge($colArr,$subs);\n\t}\n\t\n\t$colArr = array_values(array_unique($colArr));\n\n\t$sql = \"SELECT object_id AS id FROM docmgr.dm_object_parent WHERE parent_id IN (\".implode(\",\",$colArr).\")\";\n\treturn $sql;\n\n}", "function accesrestreint_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',\".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return array('SUBSELECT','id_article','spip_articles',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function sequenceKey() {\n return array('category_id', TRUE);\n }", "public function buildPkeyCriteria()\n {\n $criteria = new Criteria(MontacargasPeer::DATABASE_NAME);\n $criteria->add(MontacargasPeer::IDMONTACARGAS, $this->idmontacargas);\n\n return $criteria;\n }", "public function intersectByKeysAndItems(array $arr): CollectionInterface;", "public function getActiveClients()\n {\n $clients = array_filter($this->clients, function ($key) {\n return !in_array($key, [0, 'unknown']);\n }, ARRAY_FILTER_USE_KEY);\n\n return $clients;\n }", "function getAllRecordCon($consul){\n\t \t$result = array();\n\t\t$this->db->select('*');\n\t\t$this->db->from('be_users');\n\t\t$this->db->where_in('id',$consul);\n\t\t$array_keys_values = $this->db->get();\n foreach ($array_keys_values->result() as $row)\n {\n $result[$row->id]= $row->username;\n }\n \n return $result;\n\t}", "protected function conditionsContainIndexKey()\n {\n if (empty($this->where)) {\n return false;\n }\n\n foreach ($this->model->getDynamoDbIndexKeys() as $name => $keysInfo) {\n $conditionKeys = array_keys($this->where);\n $keys = array_values($keysInfo);\n if (count(array_intersect($conditionKeys, $keys)) === count($keys)) {\n return [\n 'name' => $name,\n 'keysInfo' => $keysInfo\n ];\n }\n }\n\n return false;\n }", "protected function initialiseFromPrimary()\n {\n foreach ($this->from as $key => $from) {\n if (isset($from->primary)) {\n } else {\n $this->from[$key]->primary = false;\n }\n }\n\n return $this;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "public static function getAvailableCategoryKeys() {}", "public function getProductCollectionFromCategoryBottom() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromFourRow();\n $not_in_array_right = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $custom_array = array(2202,2354,2161);\n $not_in_array = array_merge($not_in_array_left, $not_in_array_right,$not_in_array_parent,$custom_array);\n $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(20)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \n \t}", "public function buildPkeyCriteria()\n {\n $criteria = new Criteria(BangunanPeer::DATABASE_NAME);\n $criteria->add(BangunanPeer::ID_BANGUNAN, $this->id_bangunan);\n\n return $criteria;\n }", "function GetSelMask($items, $sel)\r\n\t{\r\n\t\t$ret = array();\r\n\t\tforeach ($items as $id => $i)\r\n\t\t{\r\n\t\t\t$i->selected = ($id & $sel) > 0;\r\n\t\t\t$ret[$id] = $i;\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function associative()\n\t{\n\t\t$sSQL\t\t= \"SELECT collection, name, value FROM \" . $this->table . \" WHERE _active=1 ORDER BY collection, name\";\n\t\t\n\t\t$this->oDB->query( $sSQL );\n\t\t\n\t\t$aResult\t= $this->oDB->result();\n\n\t\tforeach( $aResult as $sKey => $vValue )\n\t\t{\n\t\t\t$aTmp[ $vValue[ \"collection\" ] ][ $vValue[ \"name\" ] ]\t= $vValue[ \"value\" ];\n\t\t}\n\t\t\n\t\treturn $aTmp;\n\t}", "public function buildPkeyCriteria()\n {\n $criteria = new Criteria(ActionTypePeer::DATABASE_NAME);\n $criteria->add(ActionTypePeer::ID, $this->id);\n\n return $criteria;\n }", "public function intersectByKeys(array $arr): CollectionInterface;", "protected function _getPrimaryKeyAttributes(){\n\t\treturn ActiveRecordMetaData::getPrimaryKeys($this->_source, $this->_schema);\n\t}", "protected function __getArrayCon(array $array){\r\n $strings = '';\r\n $results = array();\r\n foreach($array as $key => $value){\r\n $results[$key] = $value;\r\n $strings .= $key.' = :'.$key.': AND ';\r\n }\r\n return array(\r\n $results, substr($strings,0,-4)\r\n );\r\n }" ]
[ "0.55358374", "0.5387147", "0.53378654", "0.5204719", "0.51963025", "0.5168152", "0.5083065", "0.49945277", "0.4986178", "0.4978455", "0.49631718", "0.49631718", "0.49505052", "0.49331886", "0.49223578", "0.491781", "0.49118742", "0.4880783", "0.48687088", "0.48352072", "0.483037", "0.48293987", "0.47998592", "0.47726887", "0.47685838", "0.4763027", "0.4762881", "0.4743483", "0.47090784", "0.4703707", "0.46924224", "0.46857312", "0.46857145", "0.465924", "0.465775", "0.4651119", "0.46496838", "0.46430594", "0.4634501", "0.46318808", "0.4607077", "0.460278", "0.4600278", "0.4596903", "0.45859665", "0.45825872", "0.45768645", "0.4572681", "0.4572298", "0.454761", "0.4545393", "0.45430902", "0.45428708", "0.45294842", "0.45272312", "0.45256147", "0.45243385", "0.4521558", "0.45209697", "0.45148692", "0.45082587", "0.45029488", "0.44980824", "0.44938526", "0.44774386", "0.44753355", "0.44751912", "0.44709763", "0.44688052", "0.44682172", "0.44680437", "0.44678584", "0.44674382", "0.4467236", "0.446457", "0.44607022", "0.44574788", "0.44483092", "0.44459262", "0.44455528", "0.44404125", "0.44384998", "0.4434106", "0.44328612", "0.4430067", "0.44282737", "0.44255272", "0.4418633", "0.44168562", "0.44168562", "0.4416717", "0.44163072", "0.44114473", "0.44094825", "0.44084102", "0.4403886", "0.4400095", "0.43966272", "0.43938595", "0.43938255" ]
0.63733643
0
Make a WHERE ... string that would only select the current item based on its primary/unique keys.
public function constructKeyCondString() { $tablesUsedBlackHole = array(); return $this->constructCondStringStatic($tablesUsedBlackHole, $this->constructKeyConds()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }", "public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}", "protected function sqlKeyFilter()\n\t{\n\t\treturn \"`id` = @id@\";\n\t}", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "function SqlKeyFilter() {\n\t\treturn \"`rid` = @rid@\";\n\t}", "static function custom_get_one_sql($id) {\n # this is the default functionality\n $primary_key = static::get_primary_key();\n return static::get_sql() . \" WHERE o.`$primary_key`='$id'\";\n }", "protected function getGeneralWhereClause() {}", "function SqlKeyFilter() {\n\t\treturn \"`gjd_id` = @gjd_id@\";\n\t}", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "private function getUpdateableClause () {\n\t\t$where = new Where;\n\t\tforeach ($this->primaryKeys as $key) {\n\t\t\t$value = $this->retreive($key);\n\t\t\tif ($value){\n\t\t\t\t$where->equals($key, $this->retreive($key));\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"Primary key (\". $key .\") has no value!\");\n\t\t\t}\n\t\t}\n\n\t\treturn $where;\n\t}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tif ($this->CurrentFilter <> \"\") {\n\t\t\tif ($sFilter <> \"\") $sFilter = \"(\" . $sFilter . \") AND \";\n\t\t\t$sFilter .= \"(\" . $this->CurrentFilter . \")\";\n\t\t}\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),\n\t\t\t$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);\n\t}", "protected function user_where_clause() {}", "function SqlKeyFilter() {\n\t\treturn \"`C_EVENT_ID` = @C_EVENT_ID@\";\n\t}", "protected function sqlKeyFilter()\n\t{\n\t\treturn \"`IncomeCode` = @IncomeCode@\";\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "function KeyWhere(&$keys, $table = \"\")\n{\n\tglobal $strTableName, $cman;\n\t\n\tif( !$table )\n\t\t$table = $strTableName;\n\t$strWhere=\"\";\n\t\n\t$pSet = new ProjectSettings($table);\n\t$cipherer = new RunnerCipherer($table);\n\t$connection = $cman->byTable( $table );\n\t\n\t$keyFields = $pSet->getTableKeys();\n\tforeach($keyFields as $kf)\n\t{\n\t\tif( strlen($strWhere) )\n\t\t\t$strWhere.= \" and \";\n\t\t\t\n\t\t$value = $cipherer->MakeDBValue($kf, $keys[ $kf ], \"\", true);\n\t\t\n\t\tif( $connection->dbType == nDATABASE_Oracle )\n\t\t\t$valueisnull = $value === \"null\" || $value == \"''\";\n\t\telse\n\t\t\t$valueisnull = $value === \"null\";\n\t\t\n\t\tif( $valueisnull )\n\t\t\t$strWhere.= RunnerPage::_getFieldSQL($kf, $connection, $pSet).\" is null\";\n\t\telse\n\t\t\t$strWhere.= RunnerPage::_getFieldSQLDecrypt($kf, $connection, $pSet, $cipherer).\"=\".$cipherer->MakeDBValue($kf, $keys[ $kf ], \"\", true);\n\t}\n\treturn $strWhere;\n}", "protected function getWhereClause() {}", "function SqlKeyFilter() {\n\t\treturn \"`IDXDAFTAR` = @IDXDAFTAR@\";\n\t}", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}", "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 }", "function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }", "function where($keys, $data) {\n\n $WHERE = array();\n\n foreach ($keys as $key) {\n $index = $key;\n $value = $data[$key];\n $WHERE[] = \"`$index` = '\" . str_replace(\"'\", \"\\'\", $value) . \"'\";\n }\n\n return implode(' AND ', $WHERE);\n}", "protected function prepareUniqueStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Prepare our statement.\n return $this->connection->prepare(\"SELECT 1 FROM {$this->table} WHERE $clauses LIMIT 1\");\n }", "protected function getWhereKeys(){\n\t\t\t$whereKeys = \"1\";\n\t\t\tif($this->keys){\n\t\t\t\t$whereKeys = array();\n\t\t\t\tforeach ($this->keys as $key) {\n\t\t\t\t\t$whereKeys[] = \"$key = :$key\";\n\t\t\t\t}\n\t\t\t\t$whereKeys = implode(\" AND \", $whereKeys);\n\t\t\t}\n\t\t\treturn $whereKeys;\n\t\t}", "protected static function buildSelectionQuery() \n {\n return Query::select()->\n from(self::getTableName());\n }", "public function readByKeyQuery(): string\n {\n return 'SELECT * FROM products WHERE id = :id';\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "function SelectSQL() {\n\t\t$sFilter = $this->getSessionWhere();\n\t\tew_AddFilter($sFilter, $this->CurrentFilter);\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$this->Recordset_Selecting($sFilter);\n\t\t$sSort = $this->getSessionOrderBy();\n\t\treturn ew_BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(), $this->getSqlGroupBy(),\n\t\t\t$this->getSqlHaving(), $this->getSqlOrderBy(), $sFilter, $sSort);\n\t}", "public function SQL_SelectFields($withPrimaryKey=true) {\n $sql = \"\";\n foreach ($this->fields as $f) {\n if ( ($f->isPrimary && $withPrimaryKey) || !$f->isPrimary ) {\n $sql .= (($sql == \"\")?\"\":\", \").$f->name;\n }\n }\n return $sql;\n }", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "function createSelect($_table, $_value, $_colum)\n{\n\n $_prev_par= false;\n $_query = \"SELECT * FROM $_table\";\n\n foreach ($_value as $_key => $_value)\n {\n if ($_value != \"\")\n {\n if ($_prev_par)\n {\n $_query.= \" AND \";\n }\n else\n {\n $_query.= \" WHERE \";\n }\n\n $_query.= $_colum[$_key].\" = '$_value'\";\n $_prev_par = true;\n }\n }\n $_query.=\";\";\n\n return $_query;\n}", "public function whereall() {\n\t\t\treturn 'id=id';\n\t\t}", "public function getSearchSql($params)\n {\n global $key, $previousItemNumber, $date, $expand;\n\n $sql = 'SELECT ' \n . $params['fields'] . ' '\n . 'FROM ' \n . $params['table'] . ' '\n . 'WHERE '\n . '(' . $params['draft'] . \" = '0') \" \n . (($date != 'all') ? 'AND (' : '');\n if ($key != '') {\n if (!strrchr($key, ' ')) {\n $keys = explode(',', $key);\n $and_or = 'OR';\n } else {\n $keys = explode(' ', $key);\n $and_or = 'AND';\n }\n $sql .= $params['title'] . \" LIKE '%\" . $keys[0] . \"%' OR \"\n . $params['comment'] . \" LIKE '%\" . $keys[0] . \"%')\";\n for ($i = 1; $max = sizeof($keys), $i < $max; $i++) {\n $sql .= $and_or . ' '\n . '(' \n . $params['title'] . \" LIKE '%\" . $keys[$i] . \"%'\"\n . ' OR ' \n . $params['comment'] . \" LIKE '%\" . $keys[$i] . \"%'\"\n . ')';\n }\n $sql .= ($date != 'all') \n ? ' AND (' . $params['date'] . \" LIKE '\" . $date . \"%')\" \n : '';\n } else if ($key == '') { // Monthly search\n $sql .= ($date != 'all') \n ? $params['date'] . \" LIKE '\" . $date . \"%')\" \n : '';\n }\n $sql .= (!empty($params['group_by'])) \n ? ' GROUP BY ' . $params['group_by'] \n : '';\n $sql .= ' ORDER BY ' . $params['date'] \n . ' DESC LIMIT ' . $previousItemNumber . ', ' . self::$config['page_max'];\n \n return $sql;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "private static function getWhereString($item, $key, &$where_str, &$parameters, $or = false)\n {\n if (count($item) < 2 || count($item) > 4) return;\n\n if ($or) $where_str .= ' OR ';\n elseif ($key != 0) $where_str .= ' AND ';\n \n if (count($item) < 3):\n $where_str .= \"{$item[0]} = ?\";\n $parameters[] = $item[1];\n else:\n if ((count($item) > 3) && is_array($item[3])):\n $where_str .= (\"{$item[0]} {$item[1]} \" . (in_array($item[1], self::$excludedOperators) ? $item[2] : '?'));\n \n if (!in_array($item[1], self::$excludedOperators))\n $parameters[] = $item[2];\n\n self::getWhereString($item[3], null, $where_str, $parameters, true);\n elseif (is_array($item[2])):\n $where_str .= \"{$item[0]} = ?\";\n $parameters[] = $item[1];\n\n self::getWhereString($item[2], null, $where_str, $parameters, true);\n else:\n $where_str .= (\"{$item[0]} {$item[1]} \" . (in_array($item[1], self::$excludedOperators) ? $item[2] : '?'));\n \n if (!in_array($item[1], self::$excludedOperators))\n $parameters[] = $item[2];\n endif;\n endif;\n }", "function getItems($where, $value, $approve = NULL){\r\n\tglobal $con;\r\n\tif($approve == NULL) { $sql = 'AND Approve = 1';}else{$sql = '';}\r\n\t$getItems = $con->prepare(\"SELECT * FROM items WHERE $where = ? $sql ORDER BY item_ID DESC\");\r\n\t$getItems->execute(array($value));\t\r\n\t$items = $getItems->fetchAll();\r\n\treturn $items;\r\n\r\n\r\n}", "function pk_where($binded=false) {\r\n\t\t$in = $this->session_vars;\r\n\t\t$pk_key = $this->pk_key ();\r\n\t\tfor($i = 0; $i < count ( $pk_key ); $i ++) {\r\n\t\t\tif ($in [$pk_key [$i]] != 'next') {\r\n\t\t\t\tif ($where != '')\r\n\t\t\t\t$where .= ' and ';\r\n\t\t\t\tif(!$binded) $where .= $pk_key [$i] . \"='\" . $in [$pk_key [$i]] . \"'\";\r\n\t\t\t\telse $where .= $pk_key [$i] . \"=:\" .$pk_key [$i] ;\r\n\t\t\t\t$bind[$pk_key [$i]]= $in [$pk_key [$i]];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$return['WHERE']=$where;\r\n\t\t$return['BIND']=$bind;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tif(!$binded) return $return['WHERE'];\r\n\t\telse return $return;\r\n\t}", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "private static function genFetchByParamsQuery($param_map) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $query = \"SELECT * FROM {$fully_qualified_table_name} WHERE \";\n foreach ($param_map as $p_name => $p_value) {\n $transformed_key_name = self::transformForPreparedStatement($p_name);\n $query .= $p_name .'=' . $transformed_key_name;\n $query .= ' AND ';\n }\n \n $query = substr($query, 0, -5);\n return $query;\n }", "private function buildFindQuery(?string $filter = null): string\n {\n // means product_name and not product_id\n $sql = 'SELECT o, i, p FROM App\\Entity\\Order o LEFT JOIN o.inventory i LEFT JOIN i.product p';\n\n if (isset($filter)) {\n $sql = $sql . ' WHERE i.sku = :filter OR i.productId = :filter';\n }\n\n return $sql;\n }", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "function accesrestreint_documents_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('IN','$primary','('.sql_get_select('zzz.id_document','spip_documents_liens as zzz',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','zzz.objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('zzz.id_objet','NOT',$_publique).\"),\r\n\t\t\tarray('AND','zzz.objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t\t),\r\n\t\t\tarray('AND','zzz.objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t))\"\r\n\t.\",'','','','',\\$connect).')')\";\r\n\t/*return \"array('IN','$primary',array('SUBSELECT','id_document','spip_documents_liens',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('id_objet').\"),\r\n\t\t\tarray('AND','objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('id_objet').\")\r\n\t\t),\r\n\t\t\tarray('AND','objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('id_objet').\")\r\n\t))\r\n\t))\";*/\r\n}", "function accesrestreint_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',\".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return array('SUBSELECT','id_article','spip_articles',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function getItem($where, $value, $approve = null)\n{\n global $con;\n\n $sql = $approve == null ? 'AND Item_Approve = 1' : '';\n\n $getItem = $con->prepare(\"Select * From items WHERE $where =? $sql ORDER BY Item_ID DESC\");\n\n $getItem->execute(array($value));\n\n $items = $getItem->fetchAll();\n\n return $items;\n}", "protected static function buildConditionByPk($primary_key)\n {\n if (!is_array($primary_key)) {\n throw new InvalidParameterException(\n _s('Primary Key is no array, maybe you wanted to use AbstractModelWithId instead?')\n );\n }\n\n $sql = \" (\";\n\n // add each column to query\n foreach (array_keys($primary_key) as $i => $key) {\n if ($i > 0) {\n $sql .= \" AND \";\n }\n $sql .= \"\\\"\".$key.\"\\\" = :\".$key;\n }\n $sql .= \") \";\n\n return [\n 'sql' => $sql,\n 'params' => $primary_key\n ];\n }", "function accesrestreint_syndic_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',\".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_syndic','spip_syndic',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "private static function filterParams($params=[])\n { \n $where = '';\n if (!empty($params)) {\n $where = 'WHERE ';\n foreach ($params as $index=>$value) {\n $where .= $index.' = ? AND '; \n }\n $where = trim($where,'AND ');//delete and\n }\n $query = \"SELECT * FROM \".static::tableName().\" $where\";\n return $query;\n }", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "function translated_plain_where($base, $field) {\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 \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public static function find($primary_key) {\n $table_name = self::table_name();\n return $table_name::unique([\"id\" => intval($primary_key)]); // convert to where struct and pass\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "function assoc($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_assoc($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "function BuildKeyFilter() {\r\n\t\tglobal $objForm, $rekeningju;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $rekeningju->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "function Select_Record_By_One_Filter($data, $table_name) {\r\n global $con;\r\n $key = array_keys($data);\r\n $value = array_values($data);\r\n $sql = \"select * from $table_name where $key[0] = '$value[0]'\";\r\n try {\r\n $stmt = $con->query($sql);\r\n return $stmt;\r\n } catch (PDOException $e) {\r\n print $e->getMessage();\r\n }\r\n}", "function build_select_query($c, $w)\n{\n $where_temp = array();\n $query = array();\n $columns = '';\n $where = '';\n foreach ($w as $k => $v)\n {\n array_push($where_temp, \"`$k` = '$v'\");\n }\n\n $where = implode(\" AND \", $where_temp);\n $columns = implode(\",\", $c);\n array_push($query, $columns);\n array_push($query, $where);\n return $query;\n}", "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}", "protected function getWhere(): string\n {\n return ($this->where && !$this->where->isEmpty() ? \"\\r\\nWHERE \".$this->where : \"\");\n }", "private function makeWhere(QueryParams $params)\r\n\t{\r\n\t\t// Add where clause\r\n\t\t$sql = ' WHERE 1 = 1';\r\n\t\tforeach($params as $param)\r\n\t\t{\r\n\t\t\t$key = $param->fieldName;\r\n\t\t\t$val = $param->fieldValue;\r\n\t\t\t\r\n\t\t\t// Always add slashes\r\n\t\t\tif (!is_array($val))\r\n\t\t\t{\r\n\t\t\t\t$val = addslashes((string)$val);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shortKey = $key;\r\n\t\r\n\t\t\t// Convert foreign field alias to table alias.fieldname\r\n\t\t\tif ($this->isForeignField($key))\r\n\t\t\t{\r\n\t\t\t\t$field = $this->getFieldByAlias($key);\r\n\t\r\n\t\t\t\t// Find table alias\r\n\t\t\t\tif (($alias = $this->tableHasAlias($field->table, $this->tableAliases)) !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$key = $alias.'.`'.$field->foreignFieldName.'`';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// No alias for table\r\n\t\t\t\t\t$key = '`'.$field->table.'`.`'.$field->name.'`';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Find table alias\r\n\t\t\t\tif (($alias = $this->tableHasAlias($this->name, $this->tableAliases)) !== false)\r\n\t\t\t\t{\r\n\t\t\t\t\t$key = $alias.'.`'.$key.'`';\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// No alias for table\r\n\t\t\t\t\t//$key = '`'.$field->GetTable().'`.`'.$field->GetName().'`';\r\n\t\t\t\t\t$key = '`'.$key.'`';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tswitch ($param->operator)\r\n\t\t\t{\r\n\t\t\t\tcase 'NOT NULL':\r\n\t\t\t\t\t$sql .= \" AND $key IS NOT NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'NULL':\r\n\t\t\t\t\t$sql .= \" AND $key IS NULL\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'IN':\r\n\t\t\t\t\t$sql .= \" AND $key IN (\" . implode(',', $param->fieldValue) . \")\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase '=':\r\n\t\t\t\tcase '>':\r\n\t\t\t\tcase '<':\r\n\t\t\t\tcase '>=':\r\n\t\t\t\tcase '<=':\r\n\t\t\t\tcase '!=':\r\n\t\t\t\tcase 'LIKE':\r\n\t\t\t\t\t$sql .= \" AND $key \" . $param->operator .\" :\" . $shortKey . \" \";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "function todos_get_unassigned_wheres_sql() {\n\t\n\t$dbprefix = elgg_get_config('dbprefix');\n\t$assignee_id = add_metastring('assignee');\n\t\n\t$where = \"NOT EXISTS (\n\t\tSELECT 1 FROM {$dbprefix}metadata mda\n\t\tWHERE mda.entity_guid = e.guid\n\t\t\tAND mda.name_id = {$assignee_id}\n\t)\";\n\t\n\treturn $where;\n}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BasicSearchWhere() {\n\tglobal $Security, $dpp_proveedores;\n\t$sSearchStr = \"\";\n\t$sSearchKeyword = ew_StripSlashes(@$_GET[EW_TABLE_BASIC_SEARCH]);\n\t$sSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\tif ($sSearchKeyword <> \"\") {\n\t\t$sSearch = trim($sSearchKeyword);\n\t\tif ($sSearchType <> \"\") {\n\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t$sSearchStr .= \"(\" . BasicSearchSQL($sKeyword) . \")\";\n\t\t\t}\n\t\t} else {\n\t\t\t$sSearchStr = BasicSearchSQL($sSearch);\n\t\t}\n\t}\n\tif ($sSearchKeyword <> \"\") {\n\t\t$dpp_proveedores->setBasicSearchKeyword($sSearchKeyword);\n\t\t$dpp_proveedores->setBasicSearchType($sSearchType);\n\t}\n\treturn $sSearchStr;\n}", "abstract function get_sql_filter($data);", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "function BuildKeyFilter() {\r\n\t\tglobal $objForm;\r\n\t\t$sWrkFilter = \"\";\r\n\r\n\t\t// Update row index and get row key\r\n\t\t$rowindex = 1;\r\n\t\t$objForm->Index = $rowindex;\r\n\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\twhile ($sThisKey <> \"\") {\r\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\r\n\t\t\t\t$sFilter = $this->KeyFilter();\r\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\r\n\t\t\t\t$sWrkFilter .= $sFilter;\r\n\t\t\t} else {\r\n\t\t\t\t$sWrkFilter = \"0=1\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Update row index and get row key\r\n\t\t\t$rowindex++; // next row\r\n\t\t\t$objForm->Index = $rowindex;\r\n\t\t\t$sThisKey = strval($objForm->GetValue(\"k_key\"));\r\n\t\t}\r\n\t\treturn $sWrkFilter;\r\n\t}", "private function _createSQLSelect(array $params){\n\t\t$select = 'SELECT ';\n\t\tif(isset($params['columns'])){\n\t\t\t$this->clear();\n\t\t\t$select.= $params['columns'];\n\t\t} else {\n\t\t\t$select.= join(', ', $this->_getAttributes());\n\t\t}\n\t\tif($this->_schema){\n\t\t\t$select.= ' FROM '.$this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$select.= ' FROM '.$this->_source;\n\t\t}\n\t\t$return = 'n';\n\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\tif(isset($params['conditions'])&&$params['conditions']){\n\t\t\t$select.= ' WHERE '.$params['conditions'].' ';\n\t\t} else {\n\t\t\tif(!isset($primaryKeys[0])){\n\t\t\t\tif($this->isView==true){\n\t\t\t\t\t$primaryKeys[0] = 'id';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params[0])){\n\t\t\t\tif(is_numeric($params[0])){\n\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].' = '.$this->_db->addQuotes($params[0]);\n\t\t\t\t\t\t$return = '1';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif($params[0]===''){\n\t\t\t\t\t\tif(isset($primaryKeys[0])){\n\t\t\t\t\t\t\t$params['conditions'] = $primaryKeys[0].\" = ''\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ActiveRecordException('No se ha definido una llave primaria para este objeto');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params['conditions'] = $params[0];\n\t\t\t\t\t}\n\t\t\t\t\t$return = 'n';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$select.= ' WHERE '.$params['conditions'];\n\t\t\t}\n\t\t}\n\t\tif(isset($params['group'])&&$params['group']) {\n\t\t\t$select.= ' GROUP BY '.$params['group'];\n\t\t}\n\t\tif(isset($params['order'])&&$params['order']) {\n\t\t\t$select.= ' ORDER BY '.$params['order'];\n\t\t}\n\t\tif(isset($params['limit'])&&$params['limit']) {\n\t\t\t$select = $this->_limit($select, $params['limit']);\n\t\t}\n\t\tif(isset($params['for_update'])&&$params['for_update']==true){\n\t\t\t$select = $this->_db->forUpdate($select);\n\t\t}\n\t\tif(isset($params['shared_lock'])&&$params['shared_lock']==true){\n\t\t\t$select = $this->_db->sharedLock($select);\n\t\t}\n\t\treturn array('return' => $return, 'sql' => $select);\n\t}", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "function where_this($id = null) {\n\t\tif (!$id) {\n\t\t\t$id = $this->id;\n\t\t}\n\n\t\treturn \" WHERE \".$this->id_field.\" = '\".$this->db->escape($id).\"'\";\n\t}", "function GetString()\r\n\t{\r\n\t\tif (!trim($this->_strWhere))\r\n\t\t{\r\n\t\t\t$arrWhere = Array();\r\n\t\t\tforeach($this->_arrWhere AS $strKey=>$strValue)\r\n\t\t\t{\r\n\t\t\t\t$arrWhere[] = \"$strKey = <$strKey>\";\r\n\t\t\t}\r\n\t\t\t$strWhere = trim(implode(\" AND \", $arrWhere));\r\n\t\t\treturn $strWhere;\r\n\t\t}\r\n\r\n\t\treturn $this->_strWhere;\r\n\t}", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "public static function createWhereStatement($arr_filter) {\n\n\n\t\t/**\n\t\t * @var $ilDB \\ilDBInterface\n\t\t */\n\t\t$ilDB = $GLOBALS['DIC']->database();\n\t\t$where = array();\n\n\n\t\t$where[] = '(question.assisted_exercise_id = ' . $ilDB->quote($arr_filter['obj_id'], 'integer') . ')';\n\n\t\tif(!empty($arr_filter['firstname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.firstname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['firstname']\t. \"%\");\n\n\t\t}\n\n\t\tif(!empty($arr_filter['lastname'])) {\n\t\t\t$where[] = $ilDB->like(\"usr.lastname\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['lastname']\t. \"%\");\n\t\t}\n\n\t\tif(!empty($arr_filter['title'])) {\n\t\t\t$where[] = $ilDB->like(\"question.title\", \"text\", \"%\"\n\t\t\t\t. $arr_filter['title']\t. \"%\");\n\n\t\t}\n\n\n\t\tif($arr_filter['isassessed'] == 1) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(0, 'integer') . ' OR answer.is_assessed is Null)';\n\t\t}\n\t\tif($arr_filter['isassessed'] == 2) {\n\t\t\t$where[] = '(answer.is_assessed = ' . $ilDB->quote(1, 'integer') . ')';\n\t\t}\n\n\n\n\t\tif (!empty($where)) {\n\t\t\treturn ' WHERE ' . implode(' AND ', $where) . ' ';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "function simplenews_build_subscription_filter_query(SelectQueryInterface $query) {\n if (isset($_SESSION['simplenews_subscriptions_filter'])) {\n foreach ($_SESSION['simplenews_subscriptions_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->condition('su.' . $key, $value);\n }\n break;\n case 'email':\n if (!empty($value)) {\n $query->condition('sn.mail', '%' . $value . '%', 'LIKE');\n }\n break;\n }\n }\n }\n}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "function BuildKeyFilter() {\n\t\tglobal $objForm;\n\t\t$sWrkFilter = \"\";\n\n\t\t// Update row index and get row key\n\t\t$rowindex = 1;\n\t\t$objForm->Index = $rowindex;\n\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\twhile ($sThisKey <> \"\") {\n\t\t\tif ($this->SetupKeyValues($sThisKey)) {\n\t\t\t\t$sFilter = $this->KeyFilter();\n\t\t\t\tif ($sWrkFilter <> \"\") $sWrkFilter .= \" OR \";\n\t\t\t\t$sWrkFilter .= $sFilter;\n\t\t\t} else {\n\t\t\t\t$sWrkFilter = \"0=1\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Update row index and get row key\n\t\t\t$rowindex++; // Next row\n\t\t\t$objForm->Index = $rowindex;\n\t\t\t$sThisKey = strval($objForm->GetValue($this->FormKeyName));\n\t\t}\n\t\treturn $sWrkFilter;\n\t}", "public function getWhereClauseForEnabledFieldsIncludesDeletedCheckInBackend() {}", "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}", "public function filtrar(&$filtro)\n {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_identification\n\t\t\t\tWHERE idf_id=?\";\n\t\t$this->db->query($sql, array($this->idf_id));\n\t\treturn $query;\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "public function loadDefaultWhere()\n {\n if ($this->data) {\n if (static::$primaryKey === null) {\n return $this;\n }\n $primaryKey = is_array(static::$primaryKey) ? static::$primaryKey : [static::$primaryKey];\n $cond = '';\n $values = [];\n foreach ($primaryKey as $field) {\n $cond .= ($cond !== '' ? ' AND ' : '') . $field . ' = ?';\n $values[] = $this->data[$field] ?? null;\n }\n $this->where($cond, $values);\n }\n return $this;\n }", "public function where($table,$column,$data = \"\");", "function array_to_where_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_where = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_where[] = \"`$k`='$v'\";\n\t}\n\t$s_where = implode(' AND ', $a_where);\n\treturn $s_where;\n}", "protected function _buildItemsQuery() {\n\n $query=\"SELECT b.id, b.title, b.alias, b.state, b.create_date, b.public_date, u.name AS author_name, c.title AS category_title, c.alias AS category_alias\n FROM `#__blog` AS b\n LEFT JOIN `#__categories` AS c\n ON b.category_id = c.id \n LEFT JOIN `#__users` AS u\n ON b.author_id = u.id\";\n\n return $query;\n\n }", "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif ($SF[\"id_min\"]) \t\t\t\t$sql .= \" AND id >= \".intval($SF[\"id_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"id_max\"])\t\t\t \t$sql .= \" AND id <= \".intval($SF[\"id_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_min\"]) \t\t\t$sql .= \" AND add_date >= \".strtotime($SF[\"date_min\"]).\" \\r\\n\";\n\t\tif ($SF[\"date_max\"])\t\t\t$sql .= \" AND add_date <= \".strtotime($SF[\"date_max\"]).\" \\r\\n\";\n\t\tif ($SF[\"user_id\"])\t\t\t \t$sql .= \" AND user_id = \".intval($SF[\"user_id\"]).\" \\r\\n\";\n\t\tif ($SF[\"cat_id\"])\t\t\t \t$sql .= \" AND cat_id = \".intval($SF[\"cat_id\"]).\" \\r\\n\";\n\t\tif (strlen($SF[\"title\"]))\t\t$sql .= \" AND title LIKE '\"._es($SF[\"title\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"summary\"]))\t\t$sql .= \" AND summary LIKE '\"._es($SF[\"summary\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND full_text LIKE '\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (!empty($SF[\"status\"]) && isset($this->_articles_statuses[$SF[\"status\"]])) {\n\t\t \t$sql .= \" AND status = '\"._es($SF[\"status\"]).\"' \\r\\n\";\n\t\t}\n\t\tif (strlen($SF[\"nick\"]) || strlen($SF[\"account_type\"])) {\n\t\t\tif (strlen($SF[\"nick\"])) \t$users_sql .= \" AND nick LIKE '\"._es($SF[\"nick\"]).\"%' \\r\\n\";\n\t\t\tif ($SF[\"account_type\"])\t$users_sql .= \" AND `group` = \".intval($SF[\"account_type\"]).\" \\r\\n\";\n\t\t}\n\t\t// Add subquery to users table\n\t\tif (!empty($users_sql)) {\n\t\t\t$sql .= \" AND user_id IN( SELECT id FROM \".db('user').\" WHERE 1=1 \".$users_sql.\") \\r\\n\";\n\t\t}\n\t\t// Sorting here\n\t\tif ($SF[\"sort_by\"])\t\t\t \t$sql .= \" ORDER BY \".$this->_sort_by[$SF[\"sort_by\"]].\" \\r\\n\";\n\t\tif ($SF[\"sort_by\"] && strlen($SF[\"sort_order\"])) \t$sql .= \" \".$SF[\"sort_order\"].\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}" ]
[ "0.7495507", "0.7102242", "0.68260115", "0.663702", "0.6525636", "0.6458779", "0.628164", "0.6240374", "0.6108009", "0.6096895", "0.60840106", "0.602252", "0.5979882", "0.5955615", "0.5937948", "0.59300387", "0.5908719", "0.5906052", "0.5904672", "0.5898202", "0.5895751", "0.58651316", "0.58013695", "0.5781904", "0.5778057", "0.57449394", "0.5701052", "0.5698741", "0.5690451", "0.5689417", "0.5689417", "0.56653196", "0.5658384", "0.5637256", "0.56313485", "0.56194013", "0.5609746", "0.55962557", "0.55943197", "0.5591467", "0.55821687", "0.5582081", "0.55796653", "0.5574383", "0.5560138", "0.5551127", "0.5535462", "0.5533148", "0.5507254", "0.5493585", "0.5479602", "0.5462972", "0.54553294", "0.54438436", "0.5440841", "0.54390717", "0.5436837", "0.5435925", "0.5425231", "0.5423893", "0.541899", "0.54128414", "0.540339", "0.54030514", "0.539408", "0.5392433", "0.539223", "0.53837335", "0.53827536", "0.53827536", "0.53827536", "0.538266", "0.5366435", "0.53663605", "0.5355129", "0.53536767", "0.5351796", "0.5350523", "0.5342631", "0.53353506", "0.53302515", "0.5328727", "0.5328727", "0.5328727", "0.5328727", "0.5328727", "0.5328727", "0.5319207", "0.53103083", "0.5309374", "0.5293616", "0.5287028", "0.52791566", "0.52768207", "0.5274128", "0.5263236", "0.52574724", "0.5257368", "0.5251826", "0.52465135" ]
0.52662385
95
Delete the current item based on the information in $this>info
public function deleteItem() { $conds = $this->constructKeyConds(); $query = $this->constructDeleteQuery($conds, array('start' => 0, 'limit' => 1)); if ($query === false) { return false; } $result = $this->query($query); if ($result !== false) { unset($this->info); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteThisItem(){\n $this->deleteFiles(self::DATA_DIRECTORY.$this->_page.\"/items/\".$this->_id);\n // Supprimer l'item de $this->_collectionAdministrator->_data\n $this->_collectionAdministrator->removeItem($this->_id);\n }", "public function delete(){\n foreach ( $this->playeractiveitems as $playeractiveitem ){\n $playeractiveitem->delete();\n }\n parent::delete();\n }", "abstract function del ($item);", "public function delete_info($i_id) {\n \n }", "public function deleteItem($item);", "abstract public function delete($item);", "public function delete()\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->remove_item($this->item['id']);\n }", "function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }", "function deleteItem()\r\n\t{\r\n\t\t$this->content_obj->deleteItem();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function delete_info($i_id)\r\n { \r\n }", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "function delete(){\n\t\t$sql = \"DELETE FROM `svg_info` WHERE `id`='\".addslashes($this->id).\"'\";\n\n\t\t$this->connection->send_query($sql);\n\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "function deleteItemFromDB()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->carousel_model->delete($result);\n }\n }", "public function Delete($item)\n {\n $item->Delete();\n }", "public function destroy()\n {\n $this->items = array();\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "function delete()\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\r\n\t\t// Delete current item\r\n\t\t$sql = \"delete from tbl_Pistol_CompetitionDay\r\n\t\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r(\"SQL: \" . $sql);\r\n\t\t\t\r\n\t\tmysqli_query($dbh,$sql);\r\n\t\tif (mysqli_errno($dbh)!=0) {\r\n\t\t\tprint_r(mysqli_error($dbh));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->clear(); // Clear current object\r\n\r\n\t}", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "public function onDeleteDetail( $param )\n {\n $data = $this->form->getData();\n \n // reset items\n $data->detail_idMatriz = '';\n $data->detail_identMatriz = '';\n $data->detail_pesoMatriz = '';\n \n // clear form data\n $this->form->setData( $data );\n \n // read session items\n $items = TSession::getValue(__CLASS__.'_items');\n \n // delete the item from session\n unset($items[ $param['item_key'] ] );\n TSession::setValue(__CLASS__.'_items', $items);\n \n // reload items\n $this->onReload( $param );\n }", "public function deleted(Item $item)\n {\n //\n }", "public function deleted(Item $item)\n {\n //\n }", "public function delete()\n\t{\n\t\t// Check for request forgeries\n\t\tJRequest::checkToken('request') or die(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get items to remove from the request.\n\t\t$cid[] = JFactory::getApplication()->input->get('a_id', 0, 'int');\n\n\t\tif (!is_array($cid) || count($cid) < 1)\n\t\t{\n\t\t\tJLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the model.\n\t\t\t$model = $this->getModel();\n\n\t\t\t// Remove the item.\n\t\t\tif ($model->delete($cid))\n\t\t\t{\n\t\t\t\t$this->setMessage(JText::_($this->text_prefix . '_ITEM_DELETED'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->setMessage($model->getError());\n\t\t\t}\n\t\t}\n\n\t\t$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . '&id=' . $this->getRedirectToListAppend(), false));\n\t}", "public function delete()\n {\n $sql = \"DELETE FROM \" . TB_USAGE . \" WHERE mix_id = {$this->db->sqltext($this->mix_id)}\";\n $this->db->exec($sql);\n\n //\tremove everything from cache\n $cache = VOCApp::getInstance()->getCache();\n if ($cache) {\n $cache->flush();\n }\n }", "public function deleteItem(Item $item) {\n\t\t$id = $item->getId();\n unset($this->items[$id]);\n }", "public function destroy(Info $info)\n {\n //\n }", "public function destroy(Info $info)\n {\n //\n }", "public function remove($item);", "abstract public function doDelete($item);", "public function actionDelete()\n {\n extract(Yii::$app->request->post());\n $this->findModel($list, $item)->delete();\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "function deleteItemFromDB()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $result = $_POST['itemInfo'];\n echo $this->coupon_model->delete($result);\n }\n }", "public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }", "function delArticle($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\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->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function deleteItem( $id ) {\n\t}", "public function removeItem()\n {\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $aArticles = $this->_getActionIds('oxarticles.oxid');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n $sArticleTable = $this->_getViewName('oxarticles');\n\n if (1 === intval(\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('all'))) {\n $aArticles = $this->_getAll($this->_addFilter(\"SELECT $sArticleTable.OXID \" . $this->_getQuery()));\n }\n\n foreach ($aArticles as $sArticleID) {\n $sArticleID = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($sArticleID);\n $sDeleteConnection = \"DELETE FROM $sJoinTable WHERE $sJoinTable.PROJECT_ID = $sProjectId AND $sJoinTable.OXARTICLEID = $sArticleID\";\n \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->execute($sDeleteConnection);\n }\n return;\n }", "abstract public function removeItem($name);", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "public function destroy(Item $item)\n {\n //\n }", "public function destroy(Item $item)\n {\n //\n }", "public function destroy(Item $item)\n {\n //\n }", "public function destroy(Item $item)\n {\n //\n }", "public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "protected function delete() {\n\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function remove($item) {\n unset($this->items[$item->id()]);\n }", "public function delete()\n\t{\n\t\tif ( !is_array( $this->_id ) )\n\t\t\tthrow new \\RuntimeException( 'item does not exist (anymore)' );\n\n\n\t\t/*\n\t\t * wrap deletion of item and its tight relations in a transaction\n\t\t */\n\n\t\t$item = $this;\n\t\t$set = static::set();\n\t\t$relations = static::$relations;\n\t\t$class = get_called_class();\n\n\t\tif ( !$this->_source->transaction()->wrap( function( connection $connection ) use ( $item, $set, $relations, $class )\n\t\t{\n\t\t\t// cache information on item to delete\n\t\t\t$idValues = array_values( $item->id() );\n\t\t\t$record = count( $relations ) ? $item->load() : array();\n\n\n\t\t\t/*\n\t\t\t * step 1) actually delete current item\n\t\t\t */\n\n\t\t\t$qSet = $connection->qualifyDatasetName( $set );\n\t\t\tif ( $connection->test( sprintf( 'DELETE FROM %s WHERE %s', $qSet, $item->filter() ), $idValues ) === false )\n\t\t\t\tthrow new datasource_exception( $connection, 'failed to delete requested model instance' );\n\n\n\t\t\t/*\n\t\t\t * step 2) update all related items\n\t\t\t */\n\n\t\t\t// on deleting item relations have to be updated\n\t\t\t// - always null references on current item to be deleted\n\t\t\tforeach ( $relations as $relationName => $relationSpec ) {\n\t\t\t\t// detect if relation is \"tight\"\n\t\t\t\t$isTightlyBound = in_array( 'tight', (array) @$relationSpec['options'] ) ||\n\t\t\t\t @$relationSpec['options']['tight'];\n\n\t\t\t\t// get first reference in relation\n\t\t\t\t/** @var model_relation $relation */\n\t\t\t\t$relation = call_user_func( array( $class, \"relation\" ), $relationName );\n\t\t\t\t$firstNode = $relation->nodeAtIndex( 0 );\n\t\t\t\t$secondNode = $relation->nodeAtIndex( 1 );\n\t\t\t\t$secondNodeSet = $secondNode->getName( true );\n\n\t\t\t\t// prepare collection of information on second node\n\t\t\t\t$onSecond = array(\n\t\t\t\t\t'null' => array(),\n\t\t\t\t 'filter' => array(\n\t\t\t\t\t 'properties' => array(),\n\t\t\t\t 'values' => array(),\n\t\t\t\t )\n\t\t\t\t);\n\n\t\t\t\t// extract reusable code to prepare filter for selecting record\n\t\t\t\t// of second node actually related to deleted item\n\t\t\t\t$getFilter = function() use ( &$onSecond, $connection, $firstNode, $secondNode, $record ) {\n\t\t\t\t\t// retrieve _qualified and quoted_ names of predecessor's properties\n\t\t\t\t\t$onSecond['filter']['properties'] = $secondNode->getPredecessorNames( $connection );\n\t\t\t\t\tforeach ( $firstNode->getSuccessorNames() as $property )\n\t\t\t\t\t\t$onSecond['filter']['values'][] = @$record[$property];\n\t\t\t\t};\n\n\t\t\t\t// inspect type of relationship between first and second node of\n\t\t\t\t// current relation\n\t\t\t\tif ( $secondNode->canBindOnPredecessor() ) {\n\t\t\t\t\t// second node in relation is referencing first one\n\t\t\t\t\t// -> there are items of second node's model referring to\n\t\t\t\t\t// item removed above\n\n\t\t\t\t\t// -> find records of all those items ...\n\t\t\t\t\t$getFilter();\n\n\t\t\t\t\t// ... at least for nulling their references on deleted item\n\t\t\t\t\t$onSecond['null'] = $onSecond['filter']['properties'];\n\t\t\t\t} else {\n\t\t\t\t\t// first node in relation is referencing second one\n\t\t\t\t\t// -> deleted item was referencing item of second node's model\n\t\t\t\t\t// -> there is basically no need to update any foreign\n\t\t\t\t\t// references on deleted item\n\n\t\t\t\t\tif ( $isTightlyBound )\n\t\t\t\t\t\t// relation is marked as \"tight\"\n\t\t\t\t\t\t// -> need to delete item referenced by deleted item\n\t\t\t\t\t\t$getFilter();\n\t\t\t\t}\n\n\n\t\t\t\t// convert filtering properties of second node into set of assignments\n\t\t\t\t$filter = array_map( function( $name ) { return \"$name=?\"; }, $onSecond['filter']['properties'] );\n\n\t\t\t\tif ( $isTightlyBound ) {\n\t\t\t\t\t// in tight relation immediately related elements are\n\t\t\t\t\t// deleted as well\n\n\t\t\t\t\t$secondModel = $secondNode->getModel();\n\n\t\t\t\t\tif ( $secondModel->isVirtual() ) {\n\t\t\t\t\t\t// second model is virtual, only\n\t\t\t\t\t\t// -> it's okay to simply delete matching records in datasource\n\t\t\t\t\t\t$qSet = $connection->qualifyDatasetName( $secondNodeSet );\n\t\t\t\t\t\t$term = implode( ' AND ', $filter );\n\n\t\t\t\t\t\tif ( !$connection->test( \"DELETE FROM $qSet WHERE $term\", $onSecond['filter']['values'] ) )\n\t\t\t\t\t\t\tthrow new datasource_exception( $connection, 'failed to delete instances of tightly related items in relation ' . $relationName );\n\n\t\t\t\t\t\t// TODO: add support for tightly bound relation in opposite reference of this virtual node\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// query data source for IDs of all tightly related items\n\t\t\t\t\t\t$query = $connection->createQuery( $secondNodeSet );\n\n\t\t\t\t\t\t// - select related items using properties involved in relation\n\t\t\t\t\t\tforeach ( $onSecond['filter']['properties'] as $index => $name )\n\t\t\t\t\t\t\t$query->addFilter( \"$name=?\", true, $onSecond['filter']['values'][$index] );\n\n\t\t\t\t\t\t// - fetch all properties used to identify items\n\t\t\t\t\t\t$ids = $secondModel->getIdProperties();\n\t\t\t\t\t\tforeach ( $ids as $index => $name )\n\t\t\t\t\t\t\t$query->addProperty( $connection->quoteName( $name ), \"i$index\" );\n\n\t\t\t\t\t\t// iterate over all matches for deleting every one\n\t\t\t\t\t\t$matches = $query->execute();\n\t\t\t\t\t\t$iCount = count( $ids );\n\n\t\t\t\t\t\twhile ( $match = $matches->row() ) {\n\t\t\t\t\t\t\t// extract properly sorted ID from matching record\n\t\t\t\t\t\t\t$id = array();\n\t\t\t\t\t\t\tfor ( $i = 0; $i < $iCount; $i++ )\n\t\t\t\t\t\t\t\t$id[$ids[$i]] = $match[\"i$i\"];\n\n\t\t\t\t\t\t\t// select item of model and delete it\n\t\t\t\t\t\t\t$secondModel\n\t\t\t\t\t\t\t\t->selectInstance( $connection, $id )\n\t\t\t\t\t\t\t\t->delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ( count( $onSecond['null'] ) ) {\n\t\t\t\t\t// need to null foreign references on deleted item\n\t\t\t\t\t$values = array_merge(\n\t\t\t\t\t\t\t\t\tarray_pad( array(), count( $onSecond['filter']['values'] ), null ),\n\t\t\t\t\t\t\t\t\t$onSecond['filter']['values']\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t$qSet = $connection->qualifyDatasetName( $secondNodeSet );\n\t\t\t\t\t$matching = implode( ' AND ', $filter );\n\t\t\t\t\t$setting = implode( ',', $filter );\n\n\t\t\t\t\tif ( !$connection->test( \"UPDATE $qSet SET $setting WHERE $matching\", $values ) )\n\t\t\t\t\t\tthrow new datasource_exception( $connection, 'failed to null references on deleted item in relation ' . $relationName );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} ) )\n\t\t\tthrow new datasource_exception( $this->_source, 'failed to completely delete item and its tightly bound relations' );\n\n\n\t\t// drop that item now ...\n\t\t$this->_id = null;\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "public function destroy(Info $info)\n {\n Info::find($info->id)->delete();\n return back()->with('delete_info', 'Info deleted successfully!!');\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function destroy(Info $info)\n {\n Info::destroy($info->id);\n return redirect('/info');\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public static function onDeleteItem( $param )\n {\n $data = new stdClass;\n $data->nome_atleta = '';\n $data->cpf = '';\n $data->id_atleta = '';\n $data->ja_jogou = '';\n \n // clear form data\n TForm::sendData('form_Equipe', $data );\n \n // read session items\n $sale_items = TSession::getValue('sale_items');\n $excluidos = array();\n \n $id_atleta = $param['id_atleta'];\n\n if (is_numeric($id_atleta)) \n {\n TTransaction::open('futapp');\n $atleta = new AtletaEquipe($id_atleta);\n TTransaction::close();\n\n if (isset($atleta->ja_jogou) && $atleta->ja_jogou == 't')\n {\n new TMessage('error','atleta ja jogou');\n return;\n }\n }\n\n $excluidos[] = $id_atleta;\n\n unset($sale_items[ $id_atleta ] );\n \n // store the product list back to the session\n TSession::setValue('sale_items', $sale_items);\n\n TSession::setValue('atletas_excluidos', $excluidos);\n \n // delete item from screen\n TScript::create(\"ttable_remove_row_by_id('products_list', '{$id_atleta}')\");\n }", "public static function delete() {\n\n\n\t\t}", "public function del() {\n\t\t\tif (!empty($this->params['form']['items'])) {\n\t\t\t\t/* Convert string with ids to array */\n\t\t\t\t$allIds = explode(',', $this->params['form']['items']);\n\t\t\t\t$allIds = Sanitize::clean($allIds);\n\t\t\t\t\n\t\t\t\t/* Remove menu item(s) from tree */\n\t\t\t\t/* @todo Check if this could be done with a single method call/db request instead */\n\t\t\t\tforeach ($allIds AS $id) {\n\t\t\t\t\t$this->MyMenu->removefromtree($id, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Get list of menu items */\n\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function onFinderAfterDelete($context, $item) {\n WidgetkitK2WidgetkitHelper::delete($item);\n }", "public final function delete() {\n }", "function delete()\n {\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete()\n {\n $this->_checkItem();\n\n $service = $this->getService();\n $entry = $service->getGbaseItemEntry( $this->getItem()->getGbaseItemId() );\n return $service->deleteGbaseItem($entry, $this->getDryRun());\n }", "public function del()\n {\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "public function delete()\n {\n $items = (new Item)->readList('id_feed = ?', [$this->id]);\n foreach ($items as $item) { /** @var Item $item */\n $item->delete();\n }\n\n return parent::delete();\n }", "public function remove_information($i_id=0)\r\n {}", "public function remove_information($i_id=0)\r\n {}", "public function destroy(Information $information)\n {\n //\n }", "public function onAfterContentSave($item, $isNew) {\n// WidgetkitK2WidgetkitHelper::delete($item->id);\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function destroy() {\n\n /* Right mgmt start */\n $rightId = 77;\n $currentChannelId = $this->rightObj->getCurrnetChannelId($rightId);\n if (!$this->rightObj->checkRights($currentChannelId, $rightId))\n return 'You are not authorized to access.';\n /* Right mgmt end */\n\n\n if (isset($_GET['option'])) {\n $id = $_GET['option'];\n }\n $delArr = explode(',', $id);\n\n foreach ($delArr as $d) {\n $valid = '0';\n $deleteAl = [\n\n 'valid' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine')\n ->where('magazine_id', $d)\n ->update($deleteAl);\n \n $deleteAl = [\n\n 'status' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine_list')\n ->where('m_id', $d)\n ->update($deleteAl); \n\n }\n return;\n }", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "function delCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function deleting()\n {\n # code...\n }", "public function destroy($id) //passar o id do item + o id_user\n {\n //\n }", "function delVako($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function onDeleteView($info)\n {\n $db = Core::$db;\n $L = $this->getLangStrings();\n\n if (!isset($info[\"view_id\"]) || !is_numeric($info[\"view_id\"])) {\n return;\n }\n\n $db->query(\"\n SELECT published_form_id, form_id\n FROM {PREFIX}module_form_builder_forms\n WHERE view_id = :view_id\n \");\n $db->bind(\"view_id\", $info[\"view_id\"]);\n $db->execute();\n\n $rows = $db->fetchAll();\n foreach ($rows as $row) {\n $published_form_id = $row[\"published_form_id\"];\n $form_id = $row[\"form_id\"];\n\n // always attempt to delete the published form as well as the config first. If that fails, just delete the configuration\n list($success, $message) = Forms::deletePublishedForm($form_id, $published_form_id, \"yes\", $L);\n if (!$success) {\n Forms::deletePublishedForm($form_id, $published_form_id, \"yes\", $L, true);\n }\n }\n }", "public function delete()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->delete($this->db->quoteName(\"#__crowdf_intentions\"))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n\n $this->reset();\n }", "public function removeItem()\n\t{\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t$id = \"\";\n\t\tif($this->request->is(array('POST')))\n\t\t{\n\t\t\t$data = $this->request->data;\n\t\t\t$cateId = $data['cate_id'];\n\t\t\t$row = $data['row'];\n\t\t\t$id= '';\n\t\t\tif($this->Session->check('item_'.$cateId))\n\t\t\t{\n\t\t\t\t$itemId = $this->Session->read('item_'.$cateId);\n\t\t\t\tif(!empty($itemId))\n\t\t\t\t{\n\t\t\t\t\t$i = $row*2 -2;\n\t\t\t\t\tif(isset($itemId[$i+1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i+1]);\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($itemId[$i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->Session->write('item_'.$cateId,$itemId);\n\t\t\t\t\t$id = implode(',',$itemId);\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $id;\n\t\t\texit;\n\t}", "public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function InfoDel($opcion, $departamento, $info)\n\t{\n\t\t$descripciones=DB::table('descripcioncultura')\n\t\t\t->where('id_foto',$info)\n\t\t\t->get();\n\n\t\tif(!count($descripciones)==0){\n\t\t\tforeach ($descripciones as $key) {\n\t\t\t\t$traduccion=descripcioncultura::find($key->id);\n \n\t\t\t\t$traduccion->delete();\n\t\t\t}\n\t\t}\n\t\t$foto=fotocultura::find($info);\n\t\tFile::delete('img/'.$foto->img);\n\t\t$foto->delete();\n\t\tSession::flash('message', 'Informacion Eliminada');\n\t\treturn Redirect::back();\n\t}", "function OnDeleteItem(){\n if (! $this->error) {\n $data = array($this->key_field => $this->item_id);\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n }\n\n if ($this->disabled_delete) {\n $this->OnAfterError();\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=LIBRARY_DISABLED_DELETE\" . \"&\" . $this->restore);\n }\n $errors = $this->HasChildNodes(array($this->item_id));\n if (! strlen($errors)) {\n $this->OnBeforeDeleteItem();\n $this->Storage->Delete($data);\n $this->DeleteNotOrdinaryFields();\n $this->OnAfterDeleteItem();\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE=MSG_ITEM_DELETED\" . \"&\" . $this->restore);\n }\n else {\n $this->OnAfterError();\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"\" . $errors . \"\" . \"&\" . $this->restore);\n }\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $res[] = $db->query( \"DELETE FROM eZTodo_Priority WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "public function remove()\n\t{\n\t\t$this->todo = 3 ;\n\t}", "public static function delete() {\n\t\tself::$_db->delete()->from('baskets')->where(array('slug' => self::$_slug))->go();\n\t\tSession::destroy('dime_basket');\n\t}", "public function deleteItem($key);", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function deleteinfo(Request $request)\n {\n\n Info::where(['id' => $request->id])->update(['is_deleted' => 1]);\n }", "public function DELETE() {\n #\n }", "public function deleteOperation(){\n if($this->type == \"IN\"){\n $this->inventory->setQuantity($this->inventory->getQuantity() - $this->getQuantity());\n }else{\n $this->inventory->setQuantity($this->inventory->getQuantity() + $this->getQuantity());\n }\n }", "public function ___deleted(Saveable $item) { \n\t\t$this->log(\"Deleted\", $item);\n\t}", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function deleted($item)\n {\n $this->elastic->delete($item->getTable(), $item->id);\n }" ]
[ "0.7426119", "0.6627709", "0.66195846", "0.6565616", "0.6506273", "0.6499278", "0.6470164", "0.6462146", "0.6451459", "0.64426357", "0.64385825", "0.6424672", "0.64176846", "0.63925326", "0.6377421", "0.6363033", "0.63576055", "0.63096297", "0.6288139", "0.62419826", "0.6212427", "0.6212427", "0.6204918", "0.6171801", "0.61604124", "0.6144905", "0.6144905", "0.6141494", "0.6124285", "0.61128426", "0.604824", "0.60479563", "0.6041471", "0.60160947", "0.6005988", "0.600113", "0.6000672", "0.5994395", "0.5984722", "0.5983332", "0.594709", "0.5939667", "0.5939667", "0.5939667", "0.5939667", "0.59231603", "0.5913383", "0.59126806", "0.59080154", "0.59055704", "0.5889764", "0.5879277", "0.5877661", "0.5875548", "0.5875541", "0.58734024", "0.5871416", "0.58631474", "0.58510584", "0.58470654", "0.5844802", "0.58423233", "0.5838637", "0.5837115", "0.58352906", "0.5828762", "0.5828754", "0.5827007", "0.58254737", "0.58254737", "0.5824676", "0.58243227", "0.58188987", "0.5818286", "0.58182615", "0.58124745", "0.58088076", "0.5804417", "0.5802123", "0.5800652", "0.57996726", "0.579128", "0.57883596", "0.57720786", "0.57707626", "0.57655454", "0.57548815", "0.5747572", "0.5745001", "0.5739608", "0.573682", "0.57362163", "0.57362133", "0.5731341", "0.5723106", "0.5722118", "0.5717655", "0.5716597", "0.57153004", "0.5715277" ]
0.59836316
39
Constructs the query string for the commit.
public function constructCommitQuery() { $allKeysSet = count(array_diff($this->keys, array_keys($this->info))) === 0; // If all keys set, default to update; otherwise, default to insert $columnsString = ''; $valuesString = ''; $updateString = ''; $tablesUsed = array(); // Not needed; only support for one table right now foreach ($this->info as $column => $value) { if (!in_array($column, $this->noCommitColumns) && !isset($this->columnAliases[$column])) { $value = $this->connObj->escapeString($value); $canonical = $this->canonicalizeColumn($column, false, $tablesUsed, false); $columnsString .= "{$canonical}, "; $valuesString .= "'{$value}', "; } } $tablesUsed = array(); $columnsString = substr($columnsString, 0, -2); $valuesString = substr($valuesString, 0, -2); $updateString = $this->constructUpdateString($tablesUsed); // Update or insert with one query! if ($this->connObj->canUseOnDuplicateKeyUpdate()) { return "INSERT INTO " . $this->tableName . " ({$columnsString}) VALUES ({$valuesString}) " . "ON DUPLICATE KEY UPDATE {$updateString}"; } $insertQuery = "INSERT INTO " . $this->tableName . " ({$columnsString}) VALUES ({$valuesString})"; if ($allKeysSet && !empty($this->keys)) { // Check if we have an existing row in the database $tablesUsedBlackHole = array(); // Waste variable $whereString = $this->constructKeyCondString(); $columnsString = $this->constructSelectColumnsStringStatic($tablesUsedBlackHole, $this->keys); $selectQuery = "SELECT {$columnsString} FROM {$this->tableName} WHERE {$whereString}"; $result = $this->query($selectQuery); if ($result !== false && $this->connObj->fetchResult($result) !== false) { return "UPDATE {$this->tableName} SET {$updateString} WHERE {$whereString}"; } else { return $insertQuery; } } else { return $insertQuery; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildQueryString()\n {\n $parameters = $this->_queryParameters;\n $parameters['USER'] = $this->_username;\n $parameters['PWD'] = $this->_password;\n $parameters['SIGNATURE'] = $this->_signature;\n $parameters['VERSION'] = self::VERSION;\n $parameters['METHOD'] = $this::METHOD;\n return http_build_query($parameters);\n }", "public function buildQueryString();", "private function buildQueryString(){\n if(count($this->querystrings) == 0){\n return \"\";\n }\n else{\n $querystring = \"?\";\n\n foreach($this->querystrings as $index => $value){\n if($index > 0){\n $querystring .= \"&\";\n }\n $querystring .= $value;\n }\n\n return $querystring;\n }\n }", "abstract protected function buildQuery(): string;", "private function getQueryString() : string\n {\n return http_build_query($this->parameters);\n }", "protected function getQuery(): string\n {\n return http_build_query($this->query);\n }", "public function buildRequestQuery()\n\t{\n\t\t$query_string = '';\n\t\tforeach ($this->returnItems() as $index => $item) {\n\t\t\t$query_string .= '&' . $item->toQueryString($index++);\n\t\t}\n\t\treturn $query_string;\n\t}", "public function getQueryString() {\n\t\t\t// Crackle permits duplicate keys, so we cannot use PHP's http_build_query()\n\t\t\t$parts = array();\n\t\t\tforeach ($this->getPairs() as $pair) {\n\t\t\t\t$parts[] = urlencode($pair->getKey()) . '=' . urlencode($pair->getValue());\n\t\t\t}\n\t\t\treturn implode('&', $parts);\n\t\t}", "public function buildQuery(): string {\n if ($this->queryHasOption || strlen($this->finalQueryString) > 0) {\n throw new \\Exception('You can only use this instance of ODataQueryBuilder for a single query! Please create a new builder for a new query.', 500);\n }\n\n $this->appendServiceUrlToQuery();\n $this->appendEntitySetsToQuery();\n $this->appendFiltersToQuery();\n $this->appendSearchToQuery();\n $this->appendSelectsToQuery();\n $this->appendExpandsToQuery();\n $this->appendOrderByToQuery();\n $this->appendSkipToQuery();\n $this->appendTopToQuery();\n $this->appendCountToQuery();\n\n //remove the ? if the query has no query options.\n if (!$this->queryHasOption) {\n $this->finalQueryString = substr($this->finalQueryString, 0, -1);\n }\n\n return $this->finalQueryString;\n }", "private function _buildUri(): string {\n return !empty($this->query) ? $this->uri.'?'.http_build_query($this->query) : $this->uri;\n }", "public function getQueryString()\n {\n $location = $this->getLocation();\n\n if (!empty($location)) {\n $this->updateQuery($location, 'l');\n }\n\n return http_build_query($this->queryParams);\n }", "public function getQueryString(): string\n {\n $param1 = $this->getQueryStringPart($this->parameters[0]);\n $param2 = $this->getQueryStringPart($this->parameters[1]);\n $param3 = $this->getQueryStringPart($this->parameters[2]);\n return $param1 . ' BETWEEN ' . $param2 . ' AND ' . $param3;\n }", "public function getQueryParametersAsString() {\n return $this->queryParameters || $this->query ? http_build_query($this->getQueryParameters()) : null;\n }", "protected function doAsQueryString() : string\n {\n $strInlineFragmentDirectives = '';\n if ($this->directives !== []) {\n $strDirectives = [];\n foreach ($this->directives as $directive) {\n $strDirectives[] = $directive->asQueryString();\n }\n $strInlineFragmentDirectives = \\sprintf(' %s', \\implode(' ', $strDirectives));\n }\n // Generate the string for the body of the fragment\n $strInlineFragmentFieldsOrFragmentBonds = '';\n if ($this->fieldsOrFragmentBonds !== []) {\n $strFieldsOrFragmentBonds = [];\n foreach ($this->fieldsOrFragmentBonds as $fieldsOrFragmentBond) {\n $strFieldsOrFragmentBonds[] = $fieldsOrFragmentBond->asQueryString();\n }\n $strInlineFragmentFieldsOrFragmentBonds = \\sprintf(' %s ', \\implode(' ', $strFieldsOrFragmentBonds));\n }\n return \\sprintf('...on %s%s {%s}', $this->typeName, $strInlineFragmentDirectives, $strInlineFragmentFieldsOrFragmentBonds);\n }", "public function getQueryString(): string\n {\n return http_build_query(\n $this->imageApiOptions->toArray(),\n '',\n '&',\n PHP_QUERY_RFC3986\n );\n }", "public static function queryString(): string\n\t{\n\t\treturn static::$queryString;\n\t}", "protected function get_url_query(): string {\n if ($this->has_params()) {\n return $this->get_params_as_query();\n }\n return '';\n }", "protected function _buildQueryString($params = array()) {\n if (!is_array($params)) {\n $params = array();\n }\n return count($params) ? http_build_query($params) : \"\";\n }", "public function get_corrected_query_string() {\n\t\treturn '';\n\t}", "private function get_query_string()\n {\n $query_string = '';\n foreach (explode('&', $_SERVER['QUERY_STRING']) as $key)\n {\n if( !preg_match('/org_openpsa_qbpager/', $key)\n && $key != '')\n {\n $query_string .= '&amp;'.$key;\n }\n }\n return $query_string;\n }", "public function queryString() : string;", "public function queryString()\n\t{\n\t\treturn substr($this->fullUri(), strpos($this->fullUri(), '?'), strlen($this->fullUri()) - 1);\n\t}", "public function queryString();", "public function getQueryString()\n {\n $options = [\n 'w' => $this->width,\n 'h' => $this->height,\n 'fm' => $this->format,\n 'q' => $this->quality\n ];\n\n if ($this->quality !== null || $this->progressive) {\n $options['fm'] = 'jpg';\n }\n if ($this->progressive) {\n $options['fl'] = 'progressive';\n }\n\n return http_build_query($options, '', '&', PHP_QUERY_RFC3986);\n }", "abstract protected function queryString(): string;", "protected function genQuery(){\n $secretKey = $this->store->getSecretAccessKey();\n \n unset($this->options['Signature']);\n $this->options['Timestamp'] = $this->genTime();\n $this->options['Signature'] = $this->_signParameters($this->options, $secretKey);\n return $this->_getParametersAsString($this->options);\n }", "public function build() {\n\n //foreach ($data as $key => $value)\n //$data[$key] = urlencode($value);\n\n return http_build_query(Utils::translateKeys($this->query, $this->translationTable, 'strtoupper'), '', '&');\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getQuery(): string\n {\n return $this->query;\n }", "public function getPostQueryString()\n {\n return http_build_query($this->postParams);\n }", "private static function build_query($query_array) {\n\t\t\treturn http_build_query($query_array, '', '&', PHP_QUERY_RFC3986);\n\t\t}", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "public function buildQuery(array $queryParams)\r\n {\r\n if($this->_params['action'] == 'onepage'){\r\n return '';\r\n }\r\n\r\n foreach($queryParams as $param => $value){\r\n $this->setParam($param, $value);\r\n }\r\n\r\n $request = '?' . $this->getRequest();\r\n return $request;\r\n }", "public function build_http_query($params) {\n\t\tif (!$params) return '';\n\n\t\t// Urlencode both keys and values\n\t\t$keys = $this->urlencode_rfc3986(array_keys($params));\n\t\t$values = $this->urlencode_rfc3986(array_values($params));\n\t\t$params = array_combine($keys, $values);\n\n\t\t// Parameters are sorted by name, using lexicographical byte value ordering.\n\t\t// Ref: Spec: 9.1.1 (1)\n\t\tuksort($params, 'strcmp');\n\n\t\t$pairs = array();\n\t\tforeach ($params as $parameter => $value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t// If two or more parameters share the same name, they are sorted by their value\n\t\t\t\t// Ref: Spec: 9.1.1 (1)\n\t\t\t\tnatsort($value);\n\n\t\t\t\tforeach ($value as $duplicate_value) {\n\t\t\t \t\t$pairs[] = $parameter . '=' . $duplicate_value;\n\t\t\t\t}\n\t\t \t} else {\n\t\t\t $pairs[] = $parameter . '=' . $value;\n\t\t\t}\n\t\t}\n\n\t\t// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)\n\t\t// Each name-value pair is separated by an '&' character (ASCII code 38)\n\t\treturn implode('&', $pairs);\n\t}", "public function getQueryString() {\n\t\t\n\t}", "public function getQuery(): string\r\n {\r\n return $this->query;\r\n }", "public function getQueryAsString();", "private function generateQueryString(array $queryParams)\n {\n $queryString = http_build_query($queryParams, null, \"&\", PHP_QUERY_RFC3986);\n $queryString = preg_replace(\"/%5B[0-9]*%5D=/\", \"=\", $queryString);\n\n return $queryString;\n }", "public function build() {\n return implode('&', $this->uriParams);\n }", "public function __toString(){\r\n\t\treturn $this->queryString();\r\n\t}", "public function formatQueryString ($exclude=null )\n\t{\n\t\tparent::formatQueryString($exclude);\n\t\t$gqs = $this->gallery->formatQueryString($exclude);\n\t\t$this->queryString .= preg_replace(\"/^\\?/\", \"&\", $gqs);\n\t\treturn ($this->queryString);\n\t}", "public function getQueryString()\n {\n return $this->getRequest()->getQueryString();\n }", "function buildQueryString($params, $htmlEncode = false) {\n\t// Convert the key-value pairs in $params into a flat array of pairs separated by equals signs\n\t$paramsProcessed = array();\n\tforeach ($params as $key => $val) {\n\t\tif (!empty($val)) {\n\t\t\t$paramsProcessed[] = \"$key=$val\";\n\t\t}\n\t}\n\n\t// Join them up into a query string\n\t$separator = $htmlEncode ? '&amp;' : '&';\n\t$queryString = '?' . join($separator, $paramsProcessed);\n\n\treturn $queryString;\n}", "private function createQueryString(iterable $data): string\n {\n $query = '';\n\n foreach ($data as $name => $value) {\n $query .= $this->createQueryParam($name, $value);\n }\n\n return $query;\n }", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "public function getQueryString()\n {\n return $this->query_string;\n }", "private function buildQuery(): void\n {\n $this->query = self::CREATE_TABLE;\n\n if ($this->ifNotExists) {\n $this->query .= self::IF_NOT_EXISTS;\n }\n\n $this->query .= $this->table . self::OPENING_BRACKET;\n\n $this->query .= join(', ', $this->columns);\n\n if (!empty($this->keys)) {\n $this->query .= ',' . join(',', $this->keys);\n }\n\n $this->query .= self::CLOSING_BRACKET;\n\n if (!empty($this->engine)) {\n $this->query .= self::ENGINE . $this->engine;\n }\n\n if (!empty($this->charset)) {\n $this->query .= self::CHARSET . $this->charset;\n }\n }", "protected function buildRequestUri()\n {\n $requestParameters = array();\n\n // add entity\n if (!empty($this->defaultOptions['entity'])) {\n $tmp = array_keys($this->defaultOptions['entity']);\n $key = array_pop($tmp);\n $requestParameters[] = 'entity=' . $this->defaultOptions['entity'][$key];\n }\n\n // add media type\n if (!empty($this->defaultOptions['mediaType'])) {\n $requestParameters[] = 'media=' . $this->defaultOptions['mediaType'];\n }\n\n // add attribute\n if (!empty($this->defaultOptions['attribute'])) {\n $requestParameters[] = 'attribute=' . $this->defaultOptions['attribute'];\n }\n\n // add language\n if (!empty($this->defaultOptions['language'])) {\n $requestParameters[] = 'lang=' . $this->defaultOptions['language'];\n }\n\n // add limit\n if ($this->defaultOptions['limit'] <> 100) {\n $requestParameters[] = 'limit=' . $this->defaultOptions['limit'];\n }\n\n // add country\n if ($this->defaultOptions['country'] != 'us') {\n $requestParameters[] = 'country=' . $this->defaultOptions['country'];\n }\n\n // add callback\n if (!empty($this->defaultOptions['callback'])) {\n $requestParameters[] = 'callback=' . $this->defaultOptions['callback'];\n }\n\n // add version\n if ($this->defaultOptions['version'] <> 2) {\n $requestParameters[] = 'version=' . $this->defaultOptions['version'];\n }\n\n // add explicity\n if ($this->defaultOptions['explicit'] != 'yes') {\n $requestParameters[] = 'explicit=' . $this->defaultOptions['explicit'];\n }\n\n return implode('&', $requestParameters);\n }", "public function getQuery() {\n $query = $this->getArgument(self::QUERY_NAME, '');\n if ($query) {\n// $query = str_replace(Url::getBaseUrl(), '', $query);\n $query = str_replace('?' . self::QUERY_NAME . '=', '', $query);\n $query = ltrim($query, Request::QUERY_SEPARATOR);\n $query = rtrim($query, Request::QUERY_SEPARATOR);\n }\n\n return $query;\n }", "private function _create_query_string( $url, $query ) {\n\t\t$query_string = '';\n\n\t\tforeach ( $query as $var => $value ) {\n\n\t\t\tif( $var ) {\n\n\t\t\t\t// check, if required vars have a value\n\t\t\t\tif( $var[0] == '*' && $value === null ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// only add to query if there is a value\n\t\t\t\tif( $value !== null && $value !== '' ) {\n\t\t\t\t\t$query_string .= '&' . ltrim( $var, '*' ) . '=' . urlencode( $value );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $url . ltrim( $query_string, '&' );\n\t}", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "function constructQuery($query){\n\t\tif(!is_array($query)) die (\"constructQuery requires an array as its argument.\");\n\t\t\n\t\t$url_ext = \"?\";\n\t\tforeach($query as $k => $v){\n\t\t\t$url_ext .=$k.\"=\".$v.\"&\";\n\t\t}\n\t\t$url_ext = substr($url_ext, 0, -1);//chop last ampersand off\n\t\t\n\t\treturn $url_ext;\n\t\n\t}", "private function concatQueryString()\n\t{\n\t\t$query = '';\n\n\t\t// Priority to select\n\t\tif ($this->isSelectQuery())\n\t\t{\n\t\t\t// Create select query\n\t\t\t$query .= 'SELECT ' . $this->formatSelects();\n\t\t\t$query .= ' FROM ' . $this->formatFroms();\n\t\t\tif (sizeof($this->joins) > 0) $query .= $this->formatJoins();\n\t\t\tif (sizeof($this->wheres) > 0) $query .= ' WHERE ' . $this->formatWheres();\n\t\t\tif ($this->order != '') $query .= ' ORDER BY ' . $this->order;\n\t\t\tif ($this->limit != '') $query .= ' LIMIT ' . $this->limit;\n\t\t}\n\n\t\t// Second priority to insert\n\t\tif ($this->isInsertQuery())\n\t\t{\n\t\t\tif ($this->insert_replace_if_exists && $this->insert_ignore)\n\t\t\t\tthrow(new QueryNotValidException(\"REPLACE and IGNORE cannot be used together\"));\n\n\t\t\t// Create insert query\n\t\t\t$query .= $this->insert_replace_if_exists ? 'REPLACE INTO' : 'INSERT INTO';\n\t\t\tif ($this->insert_low_priority) $query .= ' LOW_PRIORITY';\n\t\t\tif ($this->insert_delayed) $query .= ' DELAYED';\n\t\t\tif ($this->insert_ignore) $query .= ' IGNORE';\n\t\t\t$query .= ' ' . $this->insert_table . ' SET';\n\t\t\t$count = 0;\n\t\t\tforeach ($this->inserts as $key => $value)\n\t\t\t{\n\t\t\t\t$query .= ($count > 0 ? ',' : '') . ' ' . $key . '=' . $value;\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\treturn $query;\n\t}", "private function InitializeQueryParameters()\n\t{\n\t\t$this->queryParameters = array(\n\t\t\t'project' => 'p',\n\t\t\t'action' => 'a',\n\t\t\t'hash' => 'h',\n\t\t\t'hashbase' => 'hb',\n\t\t\t'hashparent' => 'hp',\n\t\t\t'graphtype' => 'g',\n\t\t\t'output' => 'o',\n\t\t\t'format' => 'fmt',\n\t\t\t'tag' => 't',\n\t\t\t'page' => 'pg',\n\t\t\t'search' => 's',\n\t\t\t'searchtype' => 'st',\n\t\t\t'diffmode' => 'd',\n\t\t\t'file' => 'f',\n\t\t\t'mark' => 'm',\n\t\t\t'prefix' => 'prefix',\n\t\t\t'sort' => 'sort',\n\t\t\t'lang' => 'l',\n\t\t\t'redirect' => 'redirect'\n\t\t);\n\t}", "public function get_query_string()\n \t{\n \t\t$queryStr = array();\n \t\t$queryStr[\"task\"] = $this->task_name;\n \t\t$queryStr[\"resp\"] = $this->resp;\n \t\t$queryStr[\"by\"] = $this->by;\n \t\t\n \t\t\n \t\tswitch($this->by)\n \t\t{\n \t\t\t\n \t\t\tcase UshApiLib_Incidents_Bys::BY_CATEGORY_ID:\n \t\t\tcase UshApiLib_Incidents_Bys::BY_INCIDENT_ID:\n \t\t\tcase UshApiLib_Incidents_Bys::BY_LOCATION_ID:\n \t\t\tcase UshApiLib_Incidents_Bys::INCIDENTS_SINCE_ID:\n \t\t\t\t$queryStr[\"id\"] = $this->id;\n \t\t\t\tbreak;\n \t\t\t\t\n \t\t\tcase UshApiLib_Incidents_Bys::BY_CATEGORY_NAME:\n \t\t\tcase UshApiLib_Incidents_Bys::BY_LOCATION_NAME:\n \t\t\t\t$queryStr[\"name\"] = $this->name;\n \t\t\t\tbreak;\n \t\t\t\n \t\t\tcase UshApiLib_Incidents_Bys::BY_BOUNDS:\n \t\t\t\tif($this->c != null)\n \t\t\t\t{\n \t\t\t\t\t$queryStr[\"c\"] = $this->c;\n \t\t\t\t}\n \t\t\t\t$queryStr[\"sw\"] = $this->sw;\n \t\t\t\t$queryStr[\"ne\"] = $this->ne;\n \t\t}\n \t\t\n \t\tif($this->orderField != null)\n \t\t{\n \t\t\t$queryStr[\"orderfield\"] = $this->orderField;\n \t\t}\n \t\t\n \t\tif($this->sort !== null)\n \t\t{\n \t\t\t$queryStr[\"sort\"] = $this->sort;\n \t\t}\n \t\t\n \t\tif($this->limit != null)\n \t\t{\n \t\t\t$queryStr[\"limit\"] = $this->limit;\n \t\t}\n\t\t\n\t\treturn $queryStr;\n \t\t\n \t}", "public function __toString(): string\n {\n $this->buildQuery();\n return $this->query;\n }", "public function getQueryString()\n\t{\n\t\treturn $this->queryString;\n\t}", "function buildQueryString($params, $parent=\"\")\n{\n\t$query = \"\";\n\n\tforeach ($params as $key => $value)\n\t{\n\t\tif (!empty($query))\n\t\t$query .= '&';\n\n\t\tif (!empty($parent))\n\t\t$key = \"{$parent}[{$key}]\";\n\n\t\tif (!is_array($value))\n\t\t{\n\t\t\t$query .= \"$key=\".rawurlencode($value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query .= buildQueryString($value, $key);\n\t\t}\n\t}\n\n\treturn $query;\n}", "public function generateQuery(): string\n {\n $query = $this->template;\n $query = str_replace('{{columns}}', $this->generateColumns(), $query);\n $query = str_replace('{{pagination}}', $this->generatePagination(), $query);\n $query = str_replace('{{tables}}', $this->generateTables(), $query);\n $matches = [];\n $i = preg_match('/{{where(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateWhere($prepend), $query);\n }\n $i = preg_match('/{{sort(\\|([a-zA-Z .,\\-]*))?}}/', $query, $matches);\n if ($i) {\n $prepend = $matches[2] ?? null;\n $query = str_replace($matches[0], $this->generateSort($prepend), $query);\n }\n return $query;\n }", "private function getQueryUrl(): string\n {\n return $this->getBaseUrl() . 'query';\n }", "public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }", "public static function addQueryArg() {\n\t\t$ret = '';\n\t\tif ( is_array( func_get_arg(0) ) ) {\n\t\t\tif ( @func_num_args() < 2 || false === @func_get_arg( 1 ) )\n\t\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\telse\n\t\t\t\t$uri = @func_get_arg( 1 );\n\t\t} else {\n\t\t\tif ( @func_num_args() < 3 || false === @func_get_arg( 2 ) )\n\t\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\telse\n\t\t\t\t$uri = @func_get_arg( 2 );\n\t\t}\n\t\n\t\tif ( $frag = strstr( $uri, '#' ) )\n\t\t\t$uri = substr( $uri, 0, -strlen( $frag ) );\n\t\telse\n\t\t\t$frag = '';\n\t\n\t\tif ( preg_match( '|^https?://|i', $uri, $matches ) ) {\n\t\t\t$protocol = $matches[0];\n\t\t\t$uri = substr( $uri, strlen( $protocol ) );\n\t\t} else {\n\t\t\t$protocol = '';\n\t\t}\n\t\n\t\tif ( strpos( $uri, '?' ) !== false ) {\n\t\t\t$parts = explode( '?', $uri, 2 );\n\t\t\tif ( 1 == count( $parts ) ) {\n\t\t\t\t$base = '?';\n\t\t\t\t$query = $parts[0];\n\t\t\t} else {\n\t\t\t\t$base = $parts[0] . '?';\n\t\t\t\t$query = $parts[1];\n\t\t\t}\n\t\t} elseif ( !empty( $protocol ) || strpos( $uri, '=' ) === false ) {\n\t\t\t$base = $uri . '?';\n\t\t\t$query = '';\n\t\t} else {\n\t\t\t$base = '';\n\t\t\t$query = $uri;\n\t\t}\n\t\n\t\tparse_str( $query, $qs );\n\t\t//$qs = urlencode_deep( $qs ); // this re-URL-encodes things that were already in the query string\n\t\tif ( is_array( func_get_arg( 0 ) ) ) {\n\t\t\t$kayvees = func_get_arg( 0 );\n\t\t\t$qs = array_merge( $qs, $kayvees );\n\t\t} else {\n\t\t\t$qs[func_get_arg( 0 )] = func_get_arg( 1 );\n\t\t}\n\t\n\t\tforeach ( (array) $qs as $k => $v ) {\n\t\t\tif ( $v === false )\n\t\t\t\tunset( $qs[$k] );\n\t\t}\n\t\n\t\t$ret = http_build_query( $qs );\n\t\t$ret = trim( $ret, '?' );\n\t\t$ret = preg_replace( '#=(&|$)#', '$1', $ret );\n\t\t$ret = $protocol . $base . $ret . $frag;\n\t\t$ret = rtrim( $ret, '?' );\n\t\treturn $ret;\n\t}", "public function __toString()\n {\n $query = '';\n if (count($this->options)) {\n $query = [];\n foreach ($this->options as $key => $value) {\n if (is_array($value)) {\n $value = implode(',', $value);\n }\n $query[] = '$' . $key . '=' . $value;\n }\n $query = '?' . implode('&', $query);\n }\n\n return $query;\n }", "public static function setQueryString(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$queryString = substr(static::$fullUrl, strpos(static::$fullUrl, '?') + 1, strlen(static::$fullUrl));\n\t\t} else {\n\t\t\tstatic::$queryString = '';\n\t\t}\n\n\t}", "private static function buildQueryString($args) {\n if (!$args || count($args) === 0)\n return null;\n\n $queryString = [];\n foreach ($args as $k => $v)\n $queryString[] = urlencode($k) . '=' . urlencode($v);\n\n return '?' . join('&', $queryString);\n }", "public function getQueryString()\n {\n return parse_str($this->partials['query']);\n }", "public function formatQuery(string $query): string;", "public function getQuery(): string\n {\n return (string) $this->query;\n }", "private function build_query(){\n if(!isset($this->keyword)){\n throw new Exception('Missing keyword search: http://.../github/search/<keyword>');\n }\n $this->query = $this->url.'?q='.$this->keyword;\n $this->query .= '&page='.intval($this->page_number);\n $this->query .= '&per_page='.intval($this->results_per_page);\n if($this->sort_by[0]) $this->query .= '&sort='.$this->sort_by; //TODO: sanitize a mozna lepsi podminka\n return $this;\n }", "public function build_pbs_querystring($args) {\n $querystring = !empty($args) ? \"?\" . http_build_query($args) : \"\";\n // PBS's endpoints don't like encoded entities.\n $querystring = str_replace(\"%3A\", \":\", $querystring);\n $querystring = str_replace(\"%3D\", \"=\", $querystring);\n $querystring = str_replace(\"%26\", \"&\", $querystring);\n $querystring = str_replace(\"%2C\", \",\", $querystring);\n $querystring = str_replace(\"%28\", \"(\", $querystring);\n $querystring = str_replace(\"%29\", \")\", $querystring);\n // special case for audience-scope[x], platform-slug[x], etc\n $querystring = preg_replace(\"/(%5B\\d%5D)/\", \"\", $querystring);\n return $querystring;\n }", "#[Pure]\nfunction http_build_str(array $query, $prefix = null, $arg_separator = null) {}", "private function makeQuery($gid) {\n\t\t$query = 'editions:' . $gid . '';\n\n\t\treturn urlencode($query);\n\t}", "function BuildQuery ( $array = NULL )\n\t{\n\t\tif ( count( $array ) == 0 ) {\n\t\t\treturn '';\n\t\t} else {\n\t\t\t$query = http_build_query( $array );\n\t\t\treturn $query;\n\t\t}\n\t}", "public function buildUrlQueryString( $url = null, array $paramsToUpdate = array(), $anchor = null )\n {\n $url = ( $url === null ) ? OW_URL_HOME . $this->getRequestUri() : trim($url);\n\n $requestUrlArray = parse_url($url);\n\n $currentParams = array();\n\n if ( isset($requestUrlArray['query']) )\n {\n parse_str($requestUrlArray['query'], $currentParams);\n }\n\n $currentParams = array_merge($currentParams, $paramsToUpdate);\n\n $scheme = empty($requestUrlArray[\"scheme\"]) ? \"\" : $requestUrlArray[\"scheme\"] . \":\";\n $host = empty($requestUrlArray[\"host\"]) ? \"\" : \"//\" . $requestUrlArray[\"host\"];\n $port = empty($requestUrlArray[\"port\"]) ? \"\" : \":\" . (int) $requestUrlArray[\"port\"];\n $path = empty($requestUrlArray[\"path\"]) ? \"\" : $requestUrlArray[\"path\"];\n $queryString = empty($currentParams) ? \"\" : \"?\" . http_build_query($currentParams);\n $anchor = ($anchor === null) ? \"\" : \"#\" . trim($anchor);\n\n return $scheme . $host . $port . $path . $queryString . $anchor;\n }", "public function getQueryString(int $pageNumber = null): string\n {\n $array = [\n $this->getPageDetails()->getQueryString($pageNumber),\n $this->getIncludes()->getQueryString(),\n $this->getSortDetails()->getQueryString(),\n $this->getFiltersDetails()->getQueryString(),\n $this->getFields()->getQueryString(),\n $this->getExcludes()->getQueryString(),\n ];\n\n return implode('&', array_filter($array));\n }", "public function sql(){\n $str = \"\";\n foreach($this->params as $key => $val){\n if($val != false){\n $str .= \"$key $val \";\n }\n }\n return $str;\n }", "function hashtags_querystring( $query ) {\n\n\t\tif ( ! bp_is_activity_component() || ! isset( $_GET['s'] ) || empty( $_GET['s'] ) ) {\n\t\t\treturn $query;\n\t\t}\n\n\t\tif ( ! empty( $query ) ) {\n\t $query .= '&';\n\t }\n\n\t\t// Query String.\n\t\t$query .= 'display_comments=true&search_terms=' . $_GET['s'];\n\n\t\treturn $query;\n\t}", "public function getQuery(){\n $sql = \"select %s from %s %s %s %s %s %s\";\n\n return sprintf($sql, $this->param, $this->table,\n empty($this->join) ? '' : implode($this->join),\n empty($this->where) ? '' : 'where '. $this->where,\n empty($this->having)? '' : 'having '. $this->having,\n empty($this->order) ? '' : 'order by '. $this->order,\n empty($this->setOperations) ? '' : implode($this->setOperations)\n );\n }", "public function getQueryText()\n\t{\n\t\tif (empty($this->queryText)) {\n\t\t\t$this->queryText = $this->getParam('q');\n\t\t}\n\t\t$queryText = str_replace(':', '', $this->queryText);\n\t\treturn $queryText;\n\t}", "function setQueryString($params=NULL){\r\n\t\tif(!$params) $params = array();\r\n\t\t$this->params = $params;\r\n\t\t$this->queryString = http_build_query($params,'','&');\r\n\t\t//Debug::show(\"Setting the query as :$\".$this->queryString);\r\n\t\t//if($params['q']== '') Debug::backTrace();\r\n\t}", "function buildQueryString($q) {\r\n\t\t$i=0;\r\n\t\tforeach($q['RuleValuePair'] as $rule_id=>$value) {\r\n\t\t\t#Sintax for \"AND\", empty logical means \"AND\" as well, by default\r\n\t\t\tif(eregi('and',$q['logical'][$i]) || $q['logical'][$i]=='') {\r\n\t\t\t\t$AND[$i] = TRUE;\r\n\t\t\t} elseif(eregi('or',$q['logical'][$i])) {\r\n\t\t\t\t$OR[$i] = TRUE;\r\n\t\t\t} elseif(eregi('not', $q['logical'][$i])) {\r\n\t\t\t\t$NOT[$i] = TRUE;\r\n\t\t\t}\r\n\t\t\t#There is a small difference in MySQL and Postgres\r\n\t\t\t$regex = $GLOBALS['regexp'];\r\n\r\n\t\t\t#Basic query string\r\n\t\t\t$sql[$i] = \"select resource_id from s3db_statement where rule_id='\".$rule_id.\"' and value \".$logical.$regex.\"'\".$value.\"'\";\r\n\t\r\n\t\t\t#Increment the queries\r\n\t\t\t#Case when only one thing is queried\r\n\t\t\tif(count($q['RuleValuePair'])==1) {\r\n\t\t\t\t$sqlComplete .= \"\".$sql[$i].\"\";\r\n\t\t\t} else {\r\n\t\t\t\tif($i==0) {\r\n\t\t\t\t\tif($AND[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($NOT[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($OR[$i]) { $sqlComplete = \"(\".$sql[0].\")\"; }\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($AND[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t\telseif($OR[$i-1]) { $sqlComplete = \"(\".$sql[$i].\") union \".$sqlComplete.\"\"; }\r\n\t\t\t\t\telseif($NOT[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id not in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $sqlComplete;\r\n\t}", "protected function _buildQuery( $params ) {\n if (!is_array($params)) {\n // POST string body is sent as-is\n return $params;\n }\n $namevals = array();\n foreach ($params as $name => $value) {\n if (is_array($value)) {\n if ($value === array_values($value)) {\n // encode a numerically indexed array as a[]=&a[]=\n foreach ($value as $val)\n $namevals[] = \"{$name}[]=$val\";\n }\n else {\n foreach ($value as $nam => $val)\n $namevals[] = \"{$name}[$nam]=$val\";\n }\n }\n else {\n $namevals[] = \"$name=$value\";\n }\n }\n return implode('&', $namevals);\n }", "public final function getQuery() {\n return $this->queryString;\n }", "public function toAql(): string\n {\n $query = $this->query;\n\n foreach ($this->queryParameters as $parameter) {\n if (!$this->container->has($parameter)) {\n throw new StatementException(\"Parameter ($parameter) was not defined for this statement\");\n }\n\n $query = str_replace($parameter, $this->output($parameter), $query);\n }\n\n return utf8_encode($query);\n }", "public function getQueryString():string;", "public function __toString() {\n\t\treturn $this->getQuery();\n\t}", "public function uriWithQuery(): string\n {\n return $this->uri() . '?' . $this->server('query_string');\n }", "protected function buildQuery(array $parameters)\n {\n\t// no parameters?\n\tif(empty($parameters)) return '';\n\n\t// encode the keys\n\t$keys = self::urlencode_rfc3986(array_keys($parameters));\n\n\t// encode the values\n\t$values = self::urlencode_rfc3986(array_values($parameters));\n\n\t// reset the parameters\n\t$parameters = array_combine($keys, $values);\n\n\t// sort parameters by key\n\tuksort($parameters, 'strcmp');\n\n\t// loop parameters\n\tforeach ($parameters as $key => $value) {\n\t // sort by value\n\t if(is_array($value)) $parameters[$key] = natsort($value);\n\t}\n\n\t// process parameters\n\tforeach ($parameters as $key => $value) {\n\t $chunks[] = $key . '=' . str_replace('%25', '%', $value);\n\t}\n\n\t// return\n\treturn implode('&', $chunks);\n }", "protected function buildHttpQuery( $aParams ) {\n\t\t// than urlencoding all the parts ourselves in a loop\n\t\t$sQueryString = http_build_query( $aParams, null, $this->_queryStringDelimiter );\n\n\t\t// because http_build_query treats arrays differently than we want to, correct the query\n\t\t// string by changing foo[#]=bar (# being an actual number) parameter strings to just\n\t\t// multiple foo=bar strings. This regex should always work since '=' will be urlencoded\n\t\t// anywhere else the regex isn't expecting it\n\t\t$sQueryString = preg_replace( '/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $sQueryString );\n\n\t\treturn $this->_queryDelimiter.$sQueryString;\n\t}", "public function getQueryString()\n {\n return isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';\n }", "function kc_http_build_query(array $query, $parent = '') {\n $params = array();\n\n foreach ($query as $key => $value) {\n $key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key));\n\n // Recurse into children.\n if (is_array($value)) {\n $params[] = kc_http_build_query($value, $key);\n }\n // If a query parameter value is NULL, only append its key.\n elseif (!isset($value)) {\n $params[] = $key;\n }\n else {\n // For better readability of paths in query strings, we decode slashes.\n $params[] = $key . '=' . str_replace('%2F', '/', rawurlencode($value));\n }\n }\n\n return implode('&', $params);\n}", "public function buildSearchQuery()\n {\n return $this->createSearchQuery()->getQuery();\n }", "public function getQueryString()\n {\n return rtrim((string) $this->request->getRequestUri(), '/');\n }", "private function buildSearchURL($q){\n\t\t$this->searchURL = $this->baseURL;\n\t\t$this->searchURL .= \"?version=\".$this->version;\n\t\t$this->searchURL .= \"&recordSchema=\".$this->recordSchema;\n\t\t$this->searchURL .= \"&query=\".$q;\n\t\t$this->searchURL .= \"&operation=searchRetrieve\";\n\t\t// optinal parameters\n\t\tif(isset($this->recordPacking)) $this->searchURL .= \"&recordPacking=\".$this->recordPacking;\n\t\tif(isset($this->startRecord)) $this->searchURL .= \"&startRecord=\".$this->startRecord;\n\t\tif(isset($this->maximumRecords)) $this->searchURL .= \"&maximumRecords=\".$this->maximumRecords;\n\t}", "public function parameterize():String {\n\n\t\treturn http_build_query($this->data);\n\n\t}", "private function buildQuery()\n {\n $params = JComponentHelper::getParams('com_easybookreloaded');\n\n // If type is feed, then the order has to be DESC to get the latest entries in the feed reader\n $document = JFactory::getDocument();\n\n if($document->getType() == 'feed')\n {\n $order = 'DESC';\n }\n else\n {\n $order = $params->get('entries_order', 'DESC');\n }\n\n // Check whether limit is already set - e.g. from feed function\n $limit = JFactory::getApplication()->input->getInt('limit', 0);\n\n if(empty($limit))\n {\n $limit = (int)$params->get('entries_perpage', 5);\n }\n\n $start = JFactory::getApplication()->input->getInt('limitstart', 0);\n\n if(_EASYBOOK_CANEDIT)\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n else\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" WHERE \".$this->_db->quoteName('published').\" = 1 ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n\n return $query;\n }", "private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// gidnumber\n\t\tif (isset($filters['gidNumber']))\n\t\t{\n\t\t\t$where[] = \"gidNumber=\" . $this->_db->quote($filters['gidNumber']);\n\t\t}\n\n\t\t// action\n\t\tif (isset($filters['action']))\n\t\t{\n\t\t\t$where[] = \"action=\" . $this->_db->quote($filters['action']);\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql = \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getRequestUri() {\n\t\t$final = '';\n\t\tif($this->path) {\n\t\t\t$final .= $this->path;\n\t\t}\n\t\tif($this->query) {\n\t\t\t$final .= '?' . $this->query;\n\t\t}\n\t\treturn $final;\n\t}", "private function getQueryString($options=array(), $prepend='?') {\n // parse query string into array\n $query = array();\n parse_str($_SERVER['QUERY_STRING'], $query);\n // Modify the existing query string with new options\n $query = array_merge($query, $options);\n\n // Return the modified querystring\n return $prepend . htmlentities(http_build_query($query));\n }" ]
[ "0.73859465", "0.7332044", "0.70931953", "0.70317686", "0.6987832", "0.6734787", "0.66038376", "0.653089", "0.6506781", "0.6458222", "0.6431051", "0.6344529", "0.632547", "0.6322155", "0.6238228", "0.6176744", "0.61284035", "0.60377264", "0.6033923", "0.6027038", "0.602541", "0.60092545", "0.5996959", "0.5985607", "0.5981801", "0.5964179", "0.59618455", "0.5959923", "0.5959923", "0.5959923", "0.59567666", "0.59526205", "0.5951591", "0.59434074", "0.59392965", "0.5938334", "0.59343576", "0.5916555", "0.59135413", "0.59112656", "0.5889568", "0.5855088", "0.58480895", "0.5846858", "0.58385056", "0.58314383", "0.58280635", "0.5815385", "0.5809308", "0.5786766", "0.57804114", "0.5778054", "0.57535285", "0.5751212", "0.5739027", "0.5723505", "0.57209575", "0.57195914", "0.5717575", "0.57165885", "0.5708942", "0.5702267", "0.57008964", "0.5690858", "0.5684968", "0.56803644", "0.5667503", "0.5661704", "0.5654588", "0.56497824", "0.56478447", "0.56413484", "0.56181705", "0.56170565", "0.5614058", "0.56086457", "0.55836093", "0.55741876", "0.5572165", "0.5568305", "0.55571234", "0.55567026", "0.5545728", "0.55253994", "0.5523641", "0.5519413", "0.5515906", "0.5502169", "0.54968673", "0.54951227", "0.5493417", "0.5491929", "0.5482986", "0.54815507", "0.54803014", "0.5462838", "0.54624015", "0.5432358", "0.54302704", "0.5427458" ]
0.60976166
17
Commits the changed/new infoarray as a row to the database.
public function commit() { if (empty($this->info)) { return true; } //global $argv, $netId; if (isset($argv) || $netId == 'zpx2') var_dump($this->constructCommitQuery()); $success = $this->query($this->constructCommitQuery()); if ($success) { $this->retrieved = true; // Use updates from now on if (count($this->keys) === 1) { // One ID column $idColumn = $this->keys[0]; if (empty($this->info[$idColumn])) { // We're doing an insert $this->insertId = $this->connObj->getInsertId(); if ($this->insertId != 0) { // Insert was successful $this->info[$idColumn] = $this->insertId; } } } } return $success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commitUpdate();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "protected function commit()\n\t{\n\t\t$this->db->commit();\n\t}", "public abstract function commit();", "protected function commit( $table, $data ) {\n\t\t$db_file = $this->root_directory . DIRECTORY_SEPARATOR . $table . '.json';\n\t\tfile_put_contents( $db_file, json_encode( array_values( $data ) ) );\n\t}", "public function commit()\n {\n $this->getActivePdo()->commit();\n }", "public static function commit()\n {\n }", "public function commit() {}", "public function commit()\n{\n\t$this->query('COMMIT');\n}", "public function committed();", "public function commit()\n {\n $this->connection->commit();\n }", "function commit() {\n\t\t\tself::$db->commit();\n\t\t\t$this->begin_executed = false;\n\t\t}", "function commit();", "function commit() ;", "public function commit()\n {\n $this->getConnection()->commit();\n }", "public function commit()\n {\n }", "public function commit()\n {\n }", "function commit(): void;", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->transaction->commit();\n }\n\n $this->transactions--;\n\n $this->fireConnectionEvent('committed');\n }", "abstract protected function commit_changes($changes);", "function commit() {\n\t\tif (!$this->error) return OciCommit($this->conn);\n\t}", "function Commit()\n\t{\n\t\t// save the all changes!! (append data & update the indexes)\n\t\tif (!$this->fd || $this->mode != 'w' || $this->dat_buffer == '') return;\n\n\t\t// 1. load all unloaded index_buffer\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\tif (isset($this->key_buffer[$i])) continue;\n\t\t\t$this->key_buffer[$i] = '';\n\t\t\tif (!isset($this->key_index[$i]) || $this->key_index[$i]['len'] == 0) continue;\n\t\t\tfseek($this->fd, $this->key_index[$i]['off'], SEEK_SET);\n\t\t\t$this->key_buffer[$i] = fread($this->fd, $this->key_index[$i]['len']);\n\t\t}\n\n\t\t// 2. save the append data\n\t\tif ($this->dat_buffer != '')\n\t\t{\n\t\t\tfseek($this->fd, $this->key_index[0]['off'], SEEK_SET);\n\t\t\tfwrite($this->fd, $this->dat_buffer);\n\t\t\tunset($this->dat_buffer);\n\t\t\t$this->dat_buffer = '';\n\t\t}\n\t\t// 3. save the key_buffer\n\t\t$off = $this->dat_offset;\n\t\t$kbuf = '';\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\t// check the index modified or not\n\t\t\t$kblen = strlen($this->key_buffer[$i]);\n\t\t\tif (!isset($this->put_pool[$i]))\n\t\t\t{\n\t\t\t\tif ($kblen > 0)\n\t\t\t\t\tfwrite($this->fd, $this->key_buffer[$i], $kblen);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// modified!!\n\t\t\t\t$size = $i + 9;\t\t// record_size\n\n\t\t\t\t// sort the put_pool by key\n\t\t\t\t$pool = &$this->put_pool[$i];\n\t\t\t\tksort($pool);\n\n\t\t\t\t$buffer = '';\n\t\t\t\t$o = $n = 0;\n\t\t\t\twhile ($o < $kblen)\n\t\t\t\t{\n\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\tif (!$pval)\n\t\t\t\t\t{\n\t\t\t\t\t\t// end of pool\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$okey = substr($this->key_buffer[$i], $o + 8, $size - 8);\n\t\t\t\t\t$cmp = strcmp($pval['key'], $okey);\n\n\t\t\t\t\t// 直到找到大于的?\n\t\t\t\t\twhile ($cmp < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t\t$n += $size;\n\n\t\t\t\t\t\t// find the next\n\t\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\t\tif (!$pval) $cmp = 1;\t// set > 0\n\t\t\t\t\t\telse $cmp = strcmp($pval['key'], $okey);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($cmp == 0)\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\telse if ($cmp > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o, $size);\n\t\t\t\t\t\tif ($pval && !prev($pool)) end($pool);\n\t\t\t\t\t}\n\t\t\t\t\t$o += $size;\n\t\t\t\t}\n\n\t\t\t\t// other pool data\n\t\t\t\twhile ($pval = each($pool))\n\t\t\t\t{\n\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t$n += $size;\n\t\t\t\t}\n\n\t\t\t\t// save to disk\n\t\t\t\t$kblen += $n;\n\t\t\t\tfwrite($this->fd, $buffer, $kblen);\n\n\t\t\t\t// delete the pool\n\t\t\t\tunset($buffer, $pool);\n\t\t\t\tunset($this->put_pool[$i]);\n\t\t\t}\n\n\t\t\t$kbuf .= pack('VV', $off, $kblen);\n\t\t\t$this->key_index[$i] = array('off' => $off, 'len' => $kblen);\n\t\t\t$off += $kblen;\n\t\t\tunset($this->key_buffer[$i]);\n\t\t}\n\t\t// 4. save the head offset & length (key_index)\n\t\tfseek($this->fd, 32, SEEK_SET);\n\t\tfwrite($this->fd, $kbuf);\n\t\tunset($kbuf);\n\n\t\t// 5. flush the fd\n\t\tfflush($this->fd);\n\t}", "public function commit() {\n\t\t$this->execute(\"COMMIT; SET autocommit = 1;\");\n\t}", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->getPdo()->commit();\n }\n\n $this->transactions--;\n }", "public function commit()\n {\n return $this->update($this->columns, $this->table)->where($this->clauses)->execute();\n }", "public function commit(): void\n {\n if ($this->transactions == 1) {\n $this->call('commit');\n }\n\n $this->transactions = max(0, $this->transactions - 1);\n }", "public function commit()\n\t{\n $this->neoeloquent->commit();\n\t}", "public function commit(): void\n {\n $this->eventDispatcher->dispatchPreFlush();\n\n if (\n $this->objectsToPersist === [] &&\n $this->objectsToUpdate === [] &&\n $this->objectsToRemove === []\n ) {\n return; // Nothing to do.\n }\n\n $objects = array_merge(\n $this->objectsToPersist,\n $this->objectsToUpdate,\n $this->objectsToRemove,\n );\n $this->eventDispatcher->dispatchPreFlushLifecycleCallbacks($objects);\n\n $this->eventDispatcher->dispatchOnFlush();\n\n $this->persister->executePersists();\n $this->persister->executeUpdates();\n $this->persister->executeRemoves();\n\n $this->eventDispatcher->dispatchPostFlush();\n\n $this->objectsToPersist = [];\n $this->objectsToUpdate = [];\n $this->objectsToRemove = [];\n $this->objectChangeSets = new ChangeSets();\n }", "public function commit()\n {\n if ($this->store->transactions == 1) {\n $this->store->commit();\n }\n\n --$this->transactions;\n }", "public function commit()\n {\n if ($this->hasActiveTransaction) {\n parent::commit();\n $this->hasActiveTransaction = false;\n }\n }", "protected function _commit() {\n $this->dataSource->commit($this);\n }", "public function commit()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->commit();\r\n }\r\n --$this->_txns;\r\n }", "public static function commit() {\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->commit();\n\t\t}\n\t}", "public function commit() {\n return true;\n }", "public function transactionCommit()\n\t{\n\t\treturn;\n\t}", "public function commit()\n {\n return true;\n }", "public function commit()\n\t{\n\t\tforeach ($this->arrayItemsDeferred as $key => $item) {\n\t\t\tif($this->save($item) === true) {\n\t\t\t\tunset($this->arrayItemsDeferred[$key]);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}", "protected function commit(array $ranks): void\n {\n $this->ranks = $ranks;\n\n $this->save();\n }", "public function commit()\r\n {\r\n\t\treturn false;\r\n }", "function commitChanges() {\r\n\t\tglobal $file;\r\n\t\tglobal $expenses;\r\n\r\n\t\tsortExpensesDate();\r\n\t\trenumber(&$expenses);\r\n\r\n\t\t$xmlString = toXML();\r\n\r\n\t\t$fp = fopen($file.\".bak\", \"w\");\r\n\t\tflock($fp, LOCK_EX);\r\n\t\tfputs($fp, $xmlString);\r\n\t\tflock($fp, LOCK_UN);\r\n\t\tfclose($fp);\r\n\r\n\t\tswapFiles();\r\n\t}", "protected function commitTransaction()\n {\n $this->container->make('db')->commit();\n }", "public function commit() {\n\t\treturn false;\n\t}", "public function commit() {\r\n \r\n $this->validate();\r\n \r\n $data = array(\r\n \"category_id\" => $this->Category instanceof Category ? $this->Category->id : 10,\r\n \"title\" => $this->name,\r\n \"url\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"mime\" => $this->mime,\r\n \"description\" => $this->desc,\r\n \"date\" => $this->Date->format(\"Y-m-d h:i:s\"),\r\n \"hits\" => $this->hits,\r\n \"user_id\" => $this->user_id,\r\n \"filepath\" => $this->filepath,\r\n \"object_id\" => filter_var($this->object_id, FILTER_VALIDATE_INT) ? $this->object_id : 0,\r\n \"approved\" => $this->approved,\r\n \"active\" => $this->active,\r\n \"extra_data\" => json_encode($this->extra_data),\r\n \"url\" => $this->approved ? str_replace(dirname(dirname(__FILE__)), RP_PROTOCOL.\"://\" . RP_HOST, $this->filepath) : \"\"\r\n );\r\n \r\n /**\r\n * Commit the changes\r\n */\r\n \r\n if (empty($this->id)) {\r\n $data['active'] = 1;\r\n $data['category_id'] = $this->cat_id;\r\n $data['filesize'] = empty($this->filesize) ? 0 : $this->filesize; \r\n \r\n $this->db->insert(\"download_items\", $data);\r\n $this->id = $this->db->lastInsertId();\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n return $this->id;\r\n }\r\n \r\n $where = array(\r\n \"id = ?\" => $this->id\r\n );\r\n \r\n $this->db->update(\"download_items\", $data, $where);\r\n \r\n $this->url = Utility\\DownloadUtility::buildUrls($this); \r\n \r\n }", "public function commit() {\n //commiting and storing the response\n $commit = $this->mysqli->commit();\n\n //setting autocommit to on again\n $this->mysqli->autocommit(true);\n\n //now returning the commit result\n return $commit;\n }", "public function commit(){\n $this->db->exec('RELEASE xyz;');\n }", "#[ReturnTypeWillChange]\n\tpublic function commit ()\n\t{\n\t\t$this->exec('COMMIT TRANSACTION');\n\t\treturn true;\n\t}", "public function commit()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->commit();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "public function commit() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_ids || count($this->_ids) == 0) {\n if ($this->size() == 0) {\n return; \n }\n }\n \n foreach ($this->_ids as $id => $action) {\n try {\n $db->beginTransaction();\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"id=? \".\n \"AND \".$this->_dbqp.\"op=?\";\n $db->query($sql, array($id, $action)); \n $sql = \"INSERT INTO \".$this->_dbtp.\"queue (\".$this->_dbqp.\"id,\".$this->_dbqp.\"op) VALUES (?,?)\";\n $db->query($sql, array($id, $action));\n $db->commit();\n }\n catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n return false;\n }\n unset($this->_ids[$id]);\n }\n\n // reset cached object ids\n $this->_ids = array();\n $this->triggerUpdate(); \n return true;\n }", "public function transactionCommit()\n {\n $this->connectionManager->commit();\n $this->connectionManager->autocommit(true);\n }", "public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }", "protected function commit() {\n $this->get_search_client()->commit();\n }", "public function commit() {\n if (!$this->changed())\n return;\n\n $this->db->startTransaction();\n\n try {\n if ($this->tagGroupId === null) {\n $this->tagGroupId = $this->createGroup();\n }\n\n //insert new tags\n if (!empty($this->tags['new'])) {\n $existing = $this->tagIdsByTaglist($this->tags['new']);\n $toInsert = array_udiff($this->tags['new'], $existing, 'strcasecmp');\n $existing = array_keys($existing); //leave only keys\n \n $inserted = array();\n if (!empty($toInsert))\n $inserted = array_keys($this->insertTags($toInsert));\n\n $this->insertIntoGroup(array_merge($existing, $inserted));\n }\n\n //delete old ones\n if (!empty($this->tags['del'])) {\n $toDelete = $this->tags['del'];\n $this->deleteFromGroup($toDelete);\n }\n } catch (SQLException $e) {\n $this->db->rollback();\n return false;\n throw $e;\n }\n\n $this->db->commit();\n\n $this->tags['new'] = array();\n $this->tags['del'] = array();\n\n return true;\n }", "public function commit(): void\n {\n $ret = $this->mysqli->commit();\n if (!$ret) $this->mySqlError('mysqli::commit');\n }", "public function commit()\n\t{\n\t\t$recordArray = $this->dataSet;\n\n\t\tif (count($recordArray) >= 1)\n\t\t{\n\t\t\t// Process data in batch\n\t\t\t$dataBatch\t= array();\n\t\t\t$count\t\t= 0;\n\n\t\t\tforeach ($recordArray as $k => $obj)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Push data into array\n\t\t\t\t\tarray_push($dataBatch, $obj);\n\n\t\t\t\t\tif (count($dataBatch) == $this->batchSize)\n\t\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData1[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$processedData = $processedData1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (exception $e)\n\t\t\t\t{\n\t\t\t\t\tdie('Error occured while inserting records into Algolia! - ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Insert records in Algolia if record array is less than batchSize\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (count($dataBatch) < $this->batchSize && count($dataBatch) > 0)\n\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData2[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($processedData1) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData = array_merge($processedData1, $processedData2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData = $processedData2;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (exception $e)\n\t\t\t{\n\t\t\t\treturn 'Error occured while inserting records into Algolia! - ' . $e->getMessage();\n\t\t\t}\n\n\t\treturn $processedData;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function commit()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"COMMIT;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "public function commit()\n {\n return $this->connection->commit();\n }", "function submitInspectorUpdate($conn, $dataArray){\n\n\t$sql = \"UPDATE inspector SET FirstName = :firstName, LastName = :lastName, Email = :email, Phone = :phone, Cell = :cell WHERE InspectorId = :inspectorID\";\t\n\t\n\t$sth = $conn->prepare($sql);\n\tforeach($dataArray as $dataItem){\n\t\n\t\t$sth->bindParam(':inspectorID', $dataItem['inspectorID'], PDO::PARAM_INT, 11);\n\t\t$sth->bindParam(':firstName', $dataItem['firstName'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':lastName', $dataItem['lastName'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':email', $dataItem['email'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':phone', $dataItem['phone'], PDO::PARAM_STR, 25);\n\t\t$sth->bindParam(':cell', $dataItem['cell'], PDO::PARAM_STR, 25);\n\t\t$sth->execute();\n\t}\n\t\n\t$sth->closeCursor();\n\t$return = ['message' => 'Successfully changed the costing table'];\n\treturn $return;\n}", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function commit() {\n $result = parent::commit();\n $this->activeTransaction = false;\n return $result;\n }", "public function postCommitHook($status, $table, $id, $record, $oldRecord, $pObj);", "public static function commits(array $logs);", "public function commit()\n {\n $this->voucherService->addVoucher($this->voucher);\n \n }", "public function commit() {\r\n\t\t\tif($this->mysqli) {\r\n\t\t\t\treturn $this->db->commit();\r\n\t\t\t} else {\r\n\t\t\t\t//no transaction support in mysql module...\r\n\t\t\t\tmysql_query('COMMIT;', $db);\r\n\t\t\t}\r\n\t\t\t$this->stopTransaction();\r\n\t\t}", "abstract public function commitTransaction();", "function commit()\n {\n return $this->pdo->commit();\n }", "public function saveToDb()\n\t{\n\t\t$db = \\App\\Db::getInstance('admin');\n\t\t$tablesData = array_intersect_key($this->getData(), $this->changes);\n\t\tforeach ($tablesData as $key => $value) {\n\t\t\t$db->createCommand()->update($this->baseTable, ['value' => $value], ['type' => $this->type, 'name' => $key])->execute();\n\t\t}\n\t}", "public function commit():bool;", "public function commit( $which = 'default' )\n\t{\n\t\t$this->getHandle( $which )->commit();\n\t}", "public function commit()\n\t{\n\t\t// Make sure the database is connected\n\t\t$this->_connection or $this->connect();\n\n\t\treturn (bool) $this->_connection->query('COMMIT');\n\t}", "public function commitTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"COMMIT\");\n\t}", "function submitCostingChanges($conn, $dataArray){\n\t//do checking of values, make sure okay to submit\n\n\t\n\t$sql = \"UPDATE levelfour SET UnitOfMeasure = :unitOfMeasure, Cost = :cost, ExpectedLifespan = :lifespan WHERE LevelFourId = :levelFourID\";\t\n\t$sth = $conn->prepare($sql);\n\tforeach($dataArray as $dataItem){\n\t\n\t\t$sth->bindParam(':levelFourID', $dataItem['levelFourID'], PDO::PARAM_INT, 11);\n\t\t$sth->bindParam(':unitOfMeasure', $dataItem['unitOfMeasure'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':cost', $dataItem['cost'], PDO::PARAM_INT);\n\t\t$sth->bindParam(':lifespan', $dataItem['lifespan'], PDO::PARAM_INT, 11);\n\t\t\n\t\t$sth->execute();\n\t}\n\t$sth->closeCursor();\n\t$return = ['message' => 'Successfully changed the costing table'];\n\treturn $return;\n\n}", "public function commit() {\n if ($this->tx_active) {\n $this->x('COMMIT');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }", "public function commit()\n {\n // my code\n $builder = new EventsBuilder();\n $builder->createEventType(self::EVENT_TYPE, 'ru', function (EventType $event) {\n $event\n ->name(self::EVENT_NAME)\n ->sort(10)\n ->description('#NAME# - Имя\n#EMAIL# - Email\n#PHONE# - Телефон\n#MESSAGE# - Сообщение\n#FILE# - Ссылка на файл');\n $event\n ->addEventMessage('#DEFAULT_EMAIL_FROM#', '#EMAIL_TO#', 's1')\n ->subject('#SITE_NAME#: Новое сообщение')\n ->body('Информационное сообщение сайта #SITE_NAME#\n------------------------------------------\nВам было отправлено новое сообщение:\n\nИмя: #NAME#\nEmail: #EMAIL#\nТелефон: #PHONE#\nСсылка на файл: #FILE#\n\nСообщение: \n#MESSAGE#\n\n------------------------------------------\nСообщение сгенерировано автоматически.')\n ->bodyType(EventMessage::BODY_TYPE_TEXT)\n ->active();\n });\n }", "public function commitEvents();", "function addToAuditLog($jsonArray, $oldinfo, $id, $type ){\n\t\t\t\n\t\t\t$array = array(); \n\n\t\t\tforeach ($jsonArray as $key => $value) {\n\n\t\t\t\t\t$k = $key;\n\t\t\t\t\tif ($k == 'Reference') {continue; } //skip the reference\n\t\t\t\t\tif ($k == 'Comments') {continue; } //skip the reference\n\t\t\t\t\tif ($k == 'Name'){ $k = 'FullName'; } //cuz Name is stored as FullName in db\n\n\t\t\t\t\t//compare the json assoc array value and the old db value\n\t\t\t\t\tif ($oldinfo[0][$k] != $value){\n\t\t\t\t\t\t$delta = new DELTA();\n\n\t\t\t\t\t\t$delta->FieldName = $k;\n\t\t\t\t\t\t$delta->OldValue = $oldinfo[0][$k];\n\t\t\t\t\t\t$delta->NewValue = $value;\n\n\t\t\t\t\t\tarray_push($array, $delta);\n\n\t\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif (count($array) > 0 ){\n\t\t\t\t//create the database object\n\t\t\t\t$database = createDb();\n\n\t\t\t\t$database->insert(\"AuditLog\", [\n\t\t\t\t\t\"ChangeText\" => json_encode($array),\n\t\t\t\t\t\"Type\"\t\t\t=>\t$type,\n\t\t\t\t\t\"Id\"\t\t\t=>\t$id\n\t\t\t\t]);\n\t\t\t}\n\n\t}", "public function saveData(array $data) {\n $fields = $this->info(Zend_Db_Table_Abstract::COLS);\n foreach ($data as $field => $value) \n {\n if (!in_array($field, $fields)) \n {\n unset($data[$field]);\n }\n }\n\n $data['created'] = date('Y-m-d H:i:s');\n $data['modified'] = date('Y-m-d H:i:s'); \t\t\n return $this->insert($data);\n }", "public function saveData(array $data) {\n $fields = $this->info(Zend_Db_Table_Abstract::COLS);\n foreach ($data as $field => $value) \n {\n if (!in_array($field, $fields)) \n {\n unset($data[$field]);\n }\n }\n\n $data['created'] = date('Y-m-d H:i:s');\n $data['modified'] = date('Y-m-d H:i:s'); \t\t\n return $this->insert($data);\n }", "public function commit()\n {\n return $this->pdo->commit();\n }", "public function save()\n {\n array_push($this->table, $this->value);\n }", "public function commit(){\n\t\t$qUpdate = $this->dbh->prepare($this->modify);\n\t\t$qUpdate->bindValue(':mod',$this->modpath);\n\t\t$qUpdate->execute();\n\t\tif($qUpdate->rowCount() == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function populateCommitsNMods($portfolio, $dataBaseConnection){\n foreach ($portfolio->getCommits() as $commit) {\n $insQuery = \"INSERT INTO `cs242Assig3`.`commits` (`revision`, `author`, `date_time`, `message`) \" .\n \"VALUES ({$commit->getRevisionNumber()}, '{$commit->getAuthor()}', '{$commit->getDateTime()->getOrigTimeStr()}', '\" . addslashes($commit->getMessage()). \"')\";\n\n $stmt = $dataBaseConnection->prepare($insQuery);\n\n if ($stmt->execute() == false) {\n echo \"error inserting commitModifications\" . Utils::newLine();\n die();\n }\n foreach ($commit->getModifications() as $mod) {\n $insQuery = \"INSERT INTO `cs242Assig3`.`commitModifications` (`revision`, `action`, `kind`, `path`) \" .\n \"VALUES ({$commit->getRevisionNumber()}, '{$mod->getAction()}', '{$mod->getKind()}', '{$mod->getPath()}')\";\n\n $stmt = $dataBaseConnection->prepare($insQuery);\n if ($stmt->execute() == false) {\n echo \"error inserting commitModifications\" . Utils::newLine();\n die();\n }\n }\n }\n echo \"sucessfully added commit, commidMod records\" . Utils::newLine();\n}", "public function commitTransaction() {\n\t\t//noop\n\t}", "function commit()\n\t{\n\t\tif($this->m_link_id)\n\t\t{\n\t\t\tatkdebug(\"Commit\");\n\t\t\tmysqli_commit($this->m_link_id);\n\t\t}\n\t\treturn true;\n\t}", "public function write(): void\n {\n $this->writeAndReturnAffectedNumber();\n }", "public static function commitTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->commit();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}", "public function save($array){\n\t\tif(!is_array($array))return false;\n\t\t$query = \"Insert into \".$this->table.$this->generateInsertString($array);\n\t\t$result = $this->db->executeQuery($query);\n\t\techo json_encode($result);\n\t}", "public function commit(): bool\n {\n $this->hasActiveTransaction = false;\n\n return $this->db->commit();\n }", "public function commitIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->commit();\n $this->_log($this->index->count() . ' documents indexed.');\n }", "public function commit(): AdapterInterface;", "public function afterSaveCommit(): void\n {\n }", "public function commit()\n {\n throw new Exception('transactions are not yet supported');\n $this->db->commit_delegated_transaction();\n }", "private function saveDb()\n\t{\n\t\t//format our sql statements w/ the valid fields\n\t\t$fields = array();\n\t\t\n\t\t//loop thru all our dirty fields.\n\t\tforeach ($this->dirtyFields AS $key => $foo)\n\t\t{\n\t\t\t//get our value.\n\t\t\tif (isset($this->data[$key]) && $key != 'id')\n\t\t\t{\n\t\t\t\t$val = $this->data[$key];\n\n\t\t\t\t//slashes replacement..\n\t\t\t\t$val = str_replace(\"\\\\\\\\\", \"\\\\\", $val);\n\t\t\t\t$val = str_replace(\"\\'\", \"'\", $val);\n\t\t\t\t$val = str_replace(\"\\\\\\\"\", \"\\\"\", $val);\n\n\t\t\t\t//add it if we have it...\n\t\t\t\t$fields[] = \"`$key` = '\" . addslashes($val) . \"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t//update if we have an id....\n\t\tif (count($fields))\n\t\t{\n\t\t\t//now make our array\n\t\t\t$sqlFields = implode(\",\\n\", $fields) . \"\\n\";\n\t\t\t\n\t\t\t//update it?\n\t\t\tif ($this->id)\n\t\t\t{\n\t\t\t\t$sql = \"UPDATE $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\t\t\t\t$sql .= \"WHERE id = '$this->id'\\n\";\n\t\t\t\t$sql .= \"LIMIT 1\";\n\n\t\t\t\tdb()->execute($sql);\n\t\t\t}\n\t\t\t//otherwise insert it...\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO $this->tableName SET\\n\";\n\t\t\t\t$sql .= $sqlFields;\n\n\t\t\t\t$this->id = db()->insert($sql);\n\t\t\t}\n\t\t}\n\t}", "public function flushUpdates();", "public function save()\n {\n $pdo = $this->getDbConnection();\n $valuesRow = $this->prepareValuesRow();\n\n $pdo->exec(\"REPLACE INTO {$this->dbTable} (`key`, `value`) VALUES {$valuesRow}\");\n }", "protected function write(array $record): void\n {\n if (!$this->initialized) {\n $this->initialize();\n }\n\n /**\n * reset $fields with default values\n */\n $this->fields = $this->defaultFields;\n $record['context'] = array_merge($this->defaultContextFields, $record['context']);\n\n //'context' contains the array\n $contentArray = [\n 'id' => base64_encode(Uuid::uuid4()->getBytes()),\n 'channel' => $record['channel'],\n 'level' => $record['level'],\n 'level_name' => $record['level_name'],\n 'message' => $record['message'],\n 'trace' => $record['context']['trace'],\n 'payload' => is_null($record['context']['payload']) ? null : json_encode($record['context']['payload']),\n 'time' => $record['datetime']->format('Y-m-d H:i:s')\n ];\n\n // unset array keys that are passed put not defined to be stored, to prevent sql errors\n foreach ($contentArray as $key => $context) {\n if (!in_array($key, $this->fields)) {\n unset($contentArray[$key]);\n unset($this->fields[array_search($key, $this->fields)]);\n continue;\n }\n\n if ($context === null) {\n unset($contentArray[$key]);\n unset($this->fields[array_search($key, $this->fields)]);\n }\n }\n\n $this->prepareStatement();\n $this->statement->execute($contentArray);\n }" ]
[ "0.6855631", "0.6781917", "0.6781917", "0.6781917", "0.6781917", "0.6781917", "0.65932184", "0.65522164", "0.65137947", "0.6506611", "0.6496943", "0.6495435", "0.6447389", "0.64282674", "0.6330514", "0.6315976", "0.62946033", "0.62919927", "0.6284801", "0.62705016", "0.62705016", "0.6205168", "0.61403644", "0.6138246", "0.6096649", "0.6047566", "0.6022819", "0.6014305", "0.60009795", "0.59964174", "0.59818417", "0.5981171", "0.5971199", "0.59587955", "0.5945963", "0.5921061", "0.5904665", "0.5844247", "0.58382493", "0.5796393", "0.57931525", "0.5787431", "0.5764153", "0.5754089", "0.57450444", "0.57215637", "0.5720359", "0.5699378", "0.56587976", "0.56487715", "0.56382966", "0.56354207", "0.5631009", "0.5617812", "0.5604941", "0.5601446", "0.5582613", "0.55774355", "0.55646926", "0.55579454", "0.5548228", "0.5534111", "0.55228835", "0.55197835", "0.5519562", "0.55194247", "0.55172753", "0.54819214", "0.5480746", "0.54538", "0.5447179", "0.5445085", "0.54369575", "0.5436504", "0.54254144", "0.54176486", "0.53767455", "0.53739893", "0.5373165", "0.5365705", "0.5360795", "0.5360795", "0.5355761", "0.534064", "0.5338159", "0.53068334", "0.530203", "0.52630734", "0.5259886", "0.525144", "0.52434176", "0.52348906", "0.52297145", "0.5229344", "0.5223711", "0.52129203", "0.52057576", "0.51982963", "0.51916194", "0.51896447" ]
0.6092273
25
Constructs the SQL query for an UPDATE command
public function constructUpdateQuery() { $tablesUsed = array(); $updateString = $this->constructUpdateString($tablesUsed, true); $condString = $this->constructCondString($tablesUsed); return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getSQLForUpdate()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->_sqlParts['set'])\n . ($this->_sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->_sqlParts['where']) : '');\n\n $query = ($this->_maxResults === null && $this->_firstResult == null)\n ? $query\n : $this->_connection->getAdapter()->applyLimit($query, $this->_firstResult, $this->_maxResults);\n\n return $query;\n }", "protected function _sql_update ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'UPDATE ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0] . \"\\nSET \";\n /*\n Fields and values.\n */\n foreach ($this->aFields as $k => $f)\n {\n $sql .= $f . ' = ' . $this->aValues[$k] . ', ';\n }\n $sql = rtrim($sql, ', ');\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Return SQL.\n */\n return $sql;\n }", "public function updateSql(){\n\n $sql = \"UPDATE {$this->table} SET \";\n $i = 0;\n $size = sizeof($this->requestUpdateValues);\n\n foreach ($this->requestUpdateValues as $key=>$value) {\n $sql .= \"{$key} = {$this->params['columnName_Pdo'][$key]} \";\n $i++;\n if($i < $size) { $sql .= ' , '; }\n }\n \n $sql .= \" WHERE id IN ({$this->updateIds}) \";\n \n return $sql;\n }", "protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}", "function getUpdateSql()\n {\n $str = 'UPDATE ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . ' SET ';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str .= ',';\n }\n $str = $str . \" \" . $k . \"=\" . $this->prepareForQuery($this->$k);\n\n\n }\n }\n $str .= \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }", "protected function updateSql()\n {\n $sql = \"UPDATE \" . $this->dbName . \".\" . $this->table . \" SET \";\n $preparedPlaceholders = $this->prepareNamedPlaceholder();\n\n $sql.= $preparedPlaceholders . \" WHERE \" . $this->tablePK . \"=:id;\";\n\n $this->query = $sql;\n }", "public function updateQuery(): string\n {\n return 'UPDATE products \n SET name = :name, quantity = :quantity, price = :price, msrp = :msrp \n WHERE id = :id';\n }", "public function buildUpdate()\n {\n $sql = 'UPDATE ' . $this->getTableSql() \n . ( $this->driver->type != 'sqlite' ? $this->getTableAlias() : '' )\n . ' SET '\n . $this->buildSetterSql()\n . $this->buildJoinSql()\n . $this->buildConditionSql()\n ;\n\n /* only supported in mysql, sqlite */\n if ( $this->driver->type == 'mysql' || $this->driver->type == 'sqlite' ) {\n $sql .= $this->buildLimitSql();\n }\n\n if ( $this->driver->trim ) {\n return trim($sql);\n }\n return $sql;\n }", "public function getForUpdateSQL();", "public function get_update()\n {\n $table = self::quote_name($this->table);\n $alias = $this->alias ? $this->alias: '';\n $where = $this->get_where();\n $limit = $this->get_limit();\n $set = self::prepare_set($this->set);\n return \"update $table $alias set $set $where $limit\";\n }", "protected function getUpdate()\n {\n $this->update_columns = $this->columns;\n\n $from = $this->getElement('from');\n $from = substr($from, 5, 999);\n\n $query_string = 'UPDATE ' . $from . PHP_EOL;\n $query_string .= 'SET ' . $this->getElement('update_columns') . PHP_EOL;\n $query_string .= $this->getElement('where');\n\n $this->sql = $query_string;\n\n return $this->sql;\n }", "protected function prepareUpdateStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Fields to update.\n $fields = [];\n foreach (array_diff($this->columns, $this->uniqueColumns) as $field) {\n $fields[] = \"$field = :$field\";\n }\n $fields = implode(',', $fields);\n\n // Prepare our statement.\n return $this->connection->prepare(\"UPDATE {$this->table} SET $fields WHERE $clauses\");\n }", "public function SQL_UPDATE() {\r\n\t}", "public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "public function update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "private function formatUpdateCommand( $where = null )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'UPDATE ' . $this->table_name . ' SET ';\n $sql_clues = '';\n $this->quote( );\n $i = 0;\n\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_clues .= ' ' . $k . '=' . $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n $sql_clues .= ',';\n $i++;\n }\n\n $sql .= $sql_clues;\n\n if ( $where != null )\n $sql .= ' WHERE ' . $where;\n return $sql;\n }", "function generateUpdateQuery($tableName, $columns, $rowData)\n{\n //Genereate the SET part of the query\n $i = 0;\n $set = \"\";\n\n for($i = 0; $i < count($columns); $i=$i+1)\n {\n\t//Check if the data value has been put inside single-quotes and add\n\t//them if needed\n\t$len = strlen($rowData[$i]);\n\tif( $len <= 1 || $rowData[$i][0] != \"'\" || $rowData[$i][$len-1] != \"'\" )\n\t $set = $set . $columns[$i] . \"='\" . $rowData[$i] . \"'\";\n\telse\n\t $set = $set . $columns[$i] . \"=\" . $rowData[$i];\n\n\tif ($i+1 < count($columns))\n\t $set = $set . \",\";\n }\n\n $len = strlen($rowData[0]);\n if( $len <= 1 || $rowData[0][0] != \"'\" || $rowData[0][$len-1] != \"'\" )\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"='\" . $rowData[0] . \"'\";\n else\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"=\" . $rowData[0];\n}", "public function sql_for_update($fieldsToUpdate) {\n\t\t// Checking and escaping of fields\n\t\t$cleanedFieldsToUpdate = $this->cleanFieldsToUpdate($fieldsToUpdate);\n\n\t\t// UPDATE statement\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/update/query.twig.sql\");\n\t\t$sql = $sqlT->render([\"query\" => $this, \"fieldsToUpdate\" => $cleanedFieldsToUpdate]);\n\n\t\t// Return of UPDATE statement SQL code\n\t\treturn $sql;\n\t}", "function update($where_clause=null)\n {\n $db = $this->getDb();\n \n $sets = array();\n $values = array();\n// Kint::dump($this->fields);\n foreach( array_keys( $this->fields ) as $field )\n {\n //echo \"<br> field \".Kint::dump($field,'Field',false);\n if(!is_null($where_clause) && $field == $this->id_name){\n \techo \"Skipping primary key '$field' & $this->id_name since there is another WC '$where_clause' \";\n \tcontinue;\n }\t\n if('0'==$field ){\n \tcontinue;\n }\n elseif(is_int($field)){\n \t//Kint::dump($field);\n \t//Kint::dump(array_keys($this->fields));\n \tcontinue;\n }\n elseif (!isset($this->fields[$field]))\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n }\n elseif ($field == 'updated')\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n } \n else{\t\n \t$sets []= $field.'=?';\n \t$values []= $this->fields[ $field ];\n }\n }\n $set = join( \", \", $sets );\n \n if(is_null($where_clause)){\n \tif($this->id<0)\n \t\tdie(kint::dump('ERROR: this->id was not set on DBObject',$this));\n \t//$values []= $this->id;\n \t$where_clause = $this->id_name.'='.$this->id; \t\n }\n if(!str_contains($set, 'updated')){\n \t$set .= ',updated = null ';\n }\n\t$sql = 'UPDATE '.$this->table.' SET '.$set.\n \t' WHERE '.$where_clause;\n\t//$this->execute($sql,$values);\n\t//die ('SQL in Update<br/>'.$sql.'<br/>'.var_dump($values));\n //Kint::dump('UpdateSQL',$sql);\n //die('TEST');\n $cmd = 'prepare';\n\ttry{\n\t\t$sth = $db->prepare( $sql );\n\t\t$cmd = 'execute';\n\t\t$this->execute( $sth, $values );\n\t}\n catch(exception $e){\n \t$debug=Zend_Debug::dump('Statement with error',$sql);\t\n \tdie(__LINE__.'Exception in DBObject::'.$cmd.'() while cmd='.$cmd.' SQL='.$sql\n \t\t.' with values <br>'.$values\n \t\t.__LINE__.'Exception:<br>'.nl2br($e)\n \t\t.'<hr/>'.$debug);\n } \t\n }", "public function update( $sql, $params=array());", "private function create_update_sql($arr) {\n return implode(\" = ?, \\n\", array_keys($arr)).' = ?';\n }", "function QueryUpdate($table, $data, $where='1') {\r\n $q = \"UPDATE `\" . $this->pre . $table . \"` SET \";\r\n\r\n foreach ($data as $key => $val) {\r\n if (strtolower($val) == 'null')\r\n $q.= \"`$key` = NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $q.= \"`$key` = NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $q.= \"`$key` = UNIX_TIMESTAMP(), \";\r\n else\r\n $q.= \"`$key`='\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q = rtrim($q, ', ') . ' WHERE ' . $where . ';';\r\n\r\n //echoLine( $q );\r\n\r\n return $this->query($q);\r\n }", "function _update ($table_name) {\n\t\treturn \"UPDATE `{$table_name}`\";\n\t}", "public static function buildUpdateStatement($table, array $params, $where)\n{\n\t// Form UPDATE statement\n\t$stmt = 'UPDATE ' . $table\n\t . ' SET ' . implode(' = ?,', array_keys($params)) . ' = ?'\n\t . self::buildWhereClause($where);\n\n\t// Return statement\n\treturn $stmt;\n}", "function buildUpdate($params)\n {\n $result = '';\n $setStatement = '';\n $fieldList = $this->getFieldList($params['table']);\n reset($fieldList);\n\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $setStatement .= \"`\" . current($fieldList) . \"` = '\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildUpdate #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $setStatement = preg_replace(\"/,\\s*$/\", \"\", $setStatement);\n\n $result = \"UPDATE \" . $params[\"table\"] . \" SET \" . $setStatement;\n\n if (isset($params['where']))\n {\n $result .= \" WHERE \" . $params['where'] . \";\" ;\n }\n else\n {\n $result .= \";\";\n }\n\n return $result;\n }", "public function updateSQL() {\n $query = \"UPDATE TempRota SET e_id = %s WHERE shift_name = '%s' AND rdate = '%s'\";\n $q = \"\";\n if ($this->eid == \"-1\")\n $q = sprintf($query, \"NULL\", $this->shift_name, $this->rdate);\n else {\n $q = sprintf($query, $this->eid, $this->shift_name, $this->rdate);\n\n $quick_query = \"UPDATE Employees \"\n .\"SET fair_hours = fair_hours + (SELECT TIME_TO_SEC(TIMEDIFF(end_time, start_time))/3600 FROM ShiftType WHERE shift_name = '%s') \" \n .\"WHERE e_id = %s\";\n QFunc::getQuery(sprintf($quick_query, $this->shift_name, $this->eid));\n }\n QFunc::getQuery($q);\n }", "function update_query($table_name, $condition, $data = null, $unescaped_data = null) {\r\n\t\t$values = array();\r\n\r\n\t\tif (isset($data)) {\r\n\t\t\tforeach($data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = '\".$this->escape($value).\"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isset($unescaped_data)) {\r\n\t\t\tforeach($unescaped_data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = \".$value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!count($values)) {\r\n\t\t\ttrigger_error(\"No data in update_query\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = \"UPDATE `$table_name` SET \".implode(', ',$values).\" WHERE \".$condition;\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "public function UPDATEquery($table, $where, $fields_values, $no_quote_fields=FALSE) {\n \n $query = parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n \n // log query\n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n $this->logQuery($debugQuery);\n \n return $query;\n \n }", "private function getUpdateMixQuery()\n {\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n $query = \"UPDATE \" . TB_USAGE . \" SET \";\n $query .= \"equipment_id={$this->db->sqltext($this->equipment_id)}, \";\n $query .= \"apmethod_id=\" . ((empty($this->apmethod_id)) ? \"NULL\" : \"{$this->db->sqltext($this->apmethod_id)}\") . \", \";\n $query .= \"voc={$this->db->sqltext($this->voc)}, \";\n $query .= \"voclx={$this->db->sqltext($this->voclx)}, \";\n $query .= \"vocwx={$this->db->sqltext($this->vocwx)}, \";\n $query .= \"waste_percent=\" . ((empty($this->waste_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->waste_percent)}\") . \", \";\n $query .= \"recycle_percent=\" . ((empty($this->recycle_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->recycle_percent)}\") . \", \";\n $query .= \"description='{$this->db->sqltext($this->description)}', \";\n $query .= \"rule_id={$this->db->sqltext($this->rule_id)}, \";\n $query .= \"exempt_rule = \" . ((empty($this->exempt_rule)) ? \"NULL\" : \"'{$this->db->sqltext($this->exempt_rule)}'\") . \", \";\n $query .= \"notes = \" . ((empty($this->notes)) ? \"NULL\" : \"'{$this->db->sqltext($this->notes)}'\") . \", \";\n $query .= \"creation_time = {$this->db->sqltext($this->creation_time)}, \";\n $query .= \"spent_time = {$spentTime}, \";\n $query .= \"iteration = {$this->db->sqltext($this->iteration)}, \";\n $query .= \"parent_id = \" . ((empty($this->parent_id)) ? \"NULL\" : $this->db->sqltext($this->parent_id)) . \", \";\n $query .= \"pfp_id = {$pfpId}, \";\n $query .= \"last_update_time = NOW() \";\n $query .= \" WHERE mix_id ={$this->db->sqltext($this->mix_id)}\";\n return $query;\n }", "public function getUpdateQuery($model)\n {\n $data = $model->getData();\n $fields = array_keys($data[0]);\n $valueFields = [];\n $conditions = [];\n $primaryKey = $model->getDescription()->getPrimaryKey();\n\n foreach ($fields as $field) {\n $quotedField = $this->db->quoteIdentifier($field);\n\n if (array_search($field, $primaryKey) !== false) {\n $conditions[] = \"{$quotedField} = :{$field}\";\n } else {\n $valueFields[] = \"{$quotedField} = :{$field}\";\n }\n }\n\n return 'UPDATE '.\n $model->getDBStoreInformation()['quoted_table'].\n ' SET '.implode(', ', $valueFields).\n ' WHERE '.implode(' AND ', $conditions);\n }", "function prepare_update($id = '', $data = []){\n // if there is no data to set, then return an empty string\n if($data == [] || $id == ''){\n return '';\n }\n $set_sql = '';\n $where_sql = '';\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n\n $where_sql = $this->create_where($id, []);\n \n return \"UPDATE {$this->table_name} $set_sql $where_sql;\";\n }", "function sql_update($table, $fields = array(), $where = null, $join = null, $limit = null, $offset = null) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$prefix = var_get('sql/prefix', '');\n\n\t$query = 'UPDATE ' . sql_quote($prefix . $table, true);\n\t\n\t$sql_fields = array();\n\tforeach ($fields as $key => $value) {\n\t\tif( is_numeric($key) && is_string($value) ){\n\t\t\t$sql_fields[] = $value;\t\n\t\t}else{\n\t\t\t$sql_fields[] = $key . ' = ' . sql_quote($value);\n\t\t}\n\t}\n\t$query .= ' SET ' . implode(', ', $sql_fields) . ' ';\n\n\tif( $join ){\n\t\tif( is_string($join) ){\n\t\t\t$query .= ' ' . $join;\n\t\t}elseif( is_array($join) ){\n\t\t\t$query .= ' ' . sql_join($join, $table);\n\t\t}\n\t}\n\n\t$query .= !$where ? '' : ' WHERE ' . sql_logic($where);\n\n\t// LIMIT CLAUSE\n\tif( !is_null($limit) ){\n\t\t$query .= ' LIMIT ' . (int)$limit;\n\t\tif( !is_null($offset) ){\n\t\t\t$query .= ' OFFSET ' . (int)$offset;\n\t\t}\n\t}\n\n\tsql_dump($query);\n\n\t$q = $sql->prepare($query . ';');\n\treturn $q->execute();\n}", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public static function sqlUpdate($table_id, $data, $rowId) {\n\t\t$data = self::preUpdate($data);\n\t\t$rowId = Zend_Gdata_Fusion_Utils::escape_value($rowId);\n\t\treturn 'UPDATE ' . $table_id . ' SET ' . implode(', ', $data) . ' WHERE ROWID = \\'' . $rowId . '\\';';\n\t}", "public function getSqlUpdateString()\n {\n return $this->sqlUpdateString;\n }", "function update($table_name, $email, $and_statement = '') {\r\n\t\t\r\n\t\t$query = 'UPDATE ' . $table_name . ' SET ';\r\n\t\t\r\n\t\t/*\r\n\t\t$last = end(array_keys($column_array));\r\n\t\t\r\n\t\tforeach($column_array as $key=>$val){\r\n\t\t\t\r\n\t\t\t//no quotes for mysql functions like CURDATE()\r\n\t\t\tif(strpos($val,'()') !== false)\r\n\t\t\t\t$query .= $key . ' = ' . $val;\r\n\t\t\telse\r\n\t\t\t\t$query .= $key . ' = \"' . $val . '\"';\r\n\t\t\t\r\n\t\t\tif($key != $last) \r\n\t\t\t\t$query .= ',';\r\n\t\t\t\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t$query .= '`subscribed` = 0';\r\n\t\t\r\n\t\t$query .= ' WHERE email = \"' . $email . '\"';\r\n\t\t\r\n\t\tif($and_statement != '')\r\n\t\t\t$query .= ' ' . $and_statement;\r\n\t\t\r\n\t\t$query .= ';';\r\n\t\t\r\n\t\t$this->query .= $query;\r\n\t}", "public function updateQuestion()\r\n{\r\n $query_string = \"UPDATE questions \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizid = :quizid, \";\r\n $query_string .= \"question = :question, \";\r\n $query_string .= \"choice1 = :choice1, \";\r\n $query_string .= \"choice2 = :choice2, \";\r\n $query_string .= \"choice3 = :choice3, \";\r\n $query_string .= \"choice4 = :choice4, \";\r\n $query_string .= \"ans = :ans \";\r\n $query_string .= \"WHERE questionid = :questionid \";\r\n\r\n return $query_string;\r\n}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function queryUpdate($table, $data, $where) : int;", "protected final function simple_update_query ( $sql )\n\t{\n\t\t//----------\n\t\t// Tables\n\t\t//----------\n\n\t\t$_tables = array();\n\t\tif ( !isset( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif ( !is_array( $sql['tables'] ) )\n\t\t{\n\t\t\t$sql['tables'] = array( $sql['tables'] );\n\t\t}\n\t\tif ( !count( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $sql['tables'] as $_table )\n\t\t{\n\t\t\t# If \"table name aliases\" are used\n\t\t\tif ( is_array( $_table ) and count( $_table ) )\n\t\t\t{\n\t\t\t\tforeach ( $_table as $_alias=>$_table_name )\n\t\t\t\t{\n\t\t\t\t\tif ( is_numeric( $_alias ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true );\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$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true )\n\t\t\t\t\t\t\t. \" AS \"\n\t\t\t\t\t\t\t. $this->db->quoteIdentifier( $_alias, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t# If its just an array of strings - i.e. no \"table name aliases\"\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table ), true );\n\t\t\t}\n\t\t}\n\n\t\t//---------\n\t\t// \"SET\"\n\t\t//---------\n\n\t\tif ( !count( $sql['set'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$_set = array();\n\t\tforeach ( $sql['set'] as $_col => $_val )\n\t\t{\n\t\t\tif ( $_val instanceof Zend_Db_Expr )\n\t\t\t{\n\t\t\t\t$_val = $_val->__toString();\n\t\t\t\tunset( $sql['set'][ $_col ] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_val = \"?\";\n\t\t\t}\n\t\t\t$_set[] = $this->db->quoteIdentifier( $_col, true ) . ' = ' . $_val;\n\t\t}\n\n\t\t//-----------\n\t\t// \"WHERE\"\n\t\t//-----------\n\n\t\t$_where = ! is_array( $sql['where'] ) ? array( $sql['where'] ) : $sql['where'];\n\n\t\tforeach ($_where as $_cond => &$_term) {\n # is $_cond an int? (i.e. Not a condition)\n if ( is_int( $_cond ) ) {\n # $_term is the full condition\n if ( $_term instanceof Zend_Db_Expr ) {\n $_term = $_term->__toString();\n }\n } else {\n # $_cond is the condition with placeholder,\n # and $_term is quoted into the condition\n $_term = $this->db->quoteInto( $_cond, $_term );\n }\n $_term = '(' . $_term . ')';\n }\n\n $_where = implode(' AND ', $_where);\n\n\t\t//------------------------------\n\t\t// Build the UPDATE statement\n\t\t//------------------------------\n\n\t\t$this->cur_query = \"UPDATE \"\n\t\t\t. implode( \", \" , $_tables )\n\t\t\t. \" SET \" . implode( \", \" , $_set )\n\t\t\t. ( $_where ? \" WHERE \" . $_where : \"\" );\n\n\t\t//----------------------------------------------------------------\n\t\t// Execute the statement and return the number of affected rows\n\t\t//----------------------------------------------------------------\n\n\t\ttry\n\t\t{\n\t\t\t$stmt = $this->db->query( $this->cur_query, array_values( $sql['set'] ) );\n\t\t\t$result = $stmt->rowCount();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch ( Zend_Db_Exception $e )\n\t\t{\n\t\t\t$this->Registry->exception_handler( $e );\n\t\t\treturn false;\n\t\t}\n\t}", "static function sql_to_update($table, $data, $wheredata)\n {\n $sql = \"UPDATE `$table` SET \";\n //fields\n $fields = \"\";\n if (is_array($data)){\n $counter = count($data);\n foreach ($data as $key=>$value)\n {\n $counter--;\n if (is_numeric($value)) {\n $fields .= \"`\" . $key . \"` = 0\" . $value . \"\" . (($counter == 0) ? \"\": \",\");\n } elseif (strpos($value, \"'\") !== false){//tim thay '\n $fields .= \"`\" . $key . \"` = \\\"\" . $value . \"\\\"\" . (($counter == 0) ? \"\": \",\");\n } else {\n $fields .= \"`\" . $key . \"` = '\" . $value . \"'\" . (($counter == 0) ? \"\": \",\");\n }\n } \n } else $fields = $data;\n \n //where\n $where = \" WHERE true\";\n if (empty($wheredata)) {\n $where = \"\";\n } elseif (is_array($wheredata)) {\n $counter = count($wheredata);\n foreach ($wheredata as $key=>$value)\n {\n $counter--;\n if ($key == \"time\") $key = \"`\" . $key . \"`\";\n if (is_numeric($value)) {\n $where .= \" AND (\" . $key . \" = \" . $value . \")\";\n }elseif (strpos($value, \"'\") !== false){//tim thay '\n $where .= \" AND (\" . $key . \" = \\\"\" . $value . \"\\\")\";\n } else {\n $where .= \" AND (\" . $key . \" = '\" . $value . \"')\";\n }\n }\n } else $where = \" WHERE \" . $wheredata . \" \";\n $sql .= $fields . $where;\n \n return $sql;\n }", "function update( $table = '', $data = NULL, $where = NULL, $format = NULL, $where_format = NULL )\n\t{\n\t\t//check all necessary arguments\n\t\tif( !$table || !$data || !$where )\n\t\t\treturn FALSE;\n\t\t\n\t\t//prepare a list to store the insert args as they come\n\t\t$arg_list = array();\n\t\t\n\t\t//begin building the query\n\t\t$query = 'UPDATE';\t\t\t\n\t\t\n\t\t//set the table name in the query\n\t\tif( is_array( $table ) ) //allow for different prefix\n\t\t{\n\t\t\t$query .= $table[0];\n\t\t\t$arg_list[] = $table[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query .= ' %t';\n\t\t\t$arg_list[] = $table;\n\t\t}\n\t\t\n\t\t$query .= ' SET';\n\t\t\n\t\t//add each piece of data to the query\n\t\t$i=0;\n\t\tforeach( $data as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $data ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ' WHERE';\n\t\t\n\t\t//add each where condition to the query\n\t\t$i=0;\n\t\tforeach( $where as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $where_format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$where_format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $where ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ';';\n\t\t\n\t\t//prepare/sanitze the query\n\t\t$query = $this->prepare( $query, $arg_list );\n\n\t\t//execute the query and return the results\n\t\treturn $this->query( $query );\n\t}", "function to_str() {\n //\n //Test if this sql has an elias \n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //the update statement \n $smt=\"\"\n //This is an update statement \n .\"UPDATE \\n\"\n //\n //Get the root from expression as the source table of this update \n //statement \n . \"{$this->root->fromexp()} \\n\"\n . \"SET \\n\"\n //\n //get the values as key values pairs \n .\"{$this->str_values()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\"\n //\n //include an ellias if any \n .\"$alias\";\n //\n //Return the sql statement\n return $smt;\n }", "public function get_compiled_update($reset = TRUE)\n {\n $sql = 'UPDATE '.(isset($this->_atts['ignore']) && $this->_atts['ignore'] ? ' IGNORE ' : ' ').\n $this->table_prefix($this->_table);\n if ( ! empty($this->_join))\n {\n // Add tables to join\n $sql .= ' '.$this->_compile_join($this->_join);\n }\n\n // Add the columns to update\n $sql .= ' SET '.$this->_compile_set($this->_set);\n\n if ( ! empty($this->_where))\n {\n // Add selection conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ($this->_limit !== null)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n return $sql;\n }", "function build_update($table,$arr,$where) {\n\t$str = \"UPDATE `\".$table.\"` SET \";\n\t$keys = array_keys($arr);\n\tfor($a=0;$a<count($keys);$a++) {\n\t\t$updates[] = \"`\".$keys[$a].\"`='\".str_replace(\"'\",\"''\",$arr[$keys[$a]]).\"'\";\n\t}\n\n\t$str .= implode(',',$updates).' WHERE '.$where;\n\n\treturn $str;\n}", "static public function BuildSQLUpdate( $tableName, $valuesArray, $whereArray = NULL )\r\n\t{\r\n\t\t$sql = \"\";\r\n\t\tforeach( $valuesArray as $key => $value )\r\n\t\t{\r\n\t\t\tif( strlen( $sql ) == 0 )\r\n\t\t\t{\r\n\t\t\t\t$sql = \"`\" . $key . \"` = \" . $value;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql .= \", `\" . $key . \"` = \" . $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sql = \"UPDATE `\" . $tableName . \"` SET \" . $sql;\r\n\t\tif( is_array( $whereArray ) )\r\n\t\t{\r\n\t\t\t$sql .= self::BuildSQLWhereClause( $whereArray );\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function update(array $param = array('table'=>'','data'=>[],'condition'=>[])) {\n\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (REQUIRED) associated array of columns and data e.g. ['column'=>'value','column'=>'value',...]\n $arrData = isset($param['data']) ? $param['data'] : [];\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n if( count( $arrData ) < 1 ) {\n echo \"data missing\";\n die;\n }\n\n $insert_values = [];\n $strColumns = \"\";\n $strWhere = \"\";\n\n if( count( $arrData ) > 0 ) {\n foreach($arrData as $key => $val){\n $strColumns .= \" `\".$key.\"` = ?, \";\n array_push($insert_values,$val);\n }\n $strColumns = substr($strColumns, 0, -2);\n }\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $insert_values, $col[1] );\n $strWhere .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $insert_values, $col[2] );\n $strWhere .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $strWhere .= \" AND \";\n }\n $strWhere = ' WHERE ' . substr($strWhere, 0, -4);\n }\n \n\n $strQry = \"UPDATE `\".$tableName.\"` SET \" . $strColumns . $strWhere . \";\";\n\n // print_r( $strQry ); \n // print_r( $insert_values ); die;\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n // $count = $this->stmt->rowCount(); // effected rows if updated with same value you will get zero\n // if( $count > 0 ) {\n // echo $count . ' record(s) updated successfully.';\n return [\n 'success' => true,\n 'message' => 'Record(s) updated successfully.',\n 'data' => null,\n 'code' => '001'\n ];\n // } else {\n // return [\n // 'success' => false,\n // 'message' => 'fails to get record(s)',\n // 'data' => null,\n // 'code' => '002'\n // ];\n // }\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n 'code' => '003'\n ];\n }\n $this->stmt = null;\n }", "private function buildQueryUpdate($id, $status)\n {\n $query = 'UPDATE ' . self::$table . ' SET ' . self::$fields['status'] . ' = :new_status, ' . self::$fields['date_update'] . ' = :new_date_update, ' . self::$fields['pending_id'] . ' = :new_pending_id' . ' WHERE ' . self::$fields['id'] . ' = :id';\n\n $this->bind[':new_status'] = (int) $status;\n $this->bind[':new_date_update'] = (new \\DateTimeImmutable('now', new \\DateTimeZone('UTC')))->format('Y-m-d H:i:s');\n $this->bind[':new_pending_id'] = null;\n $this->bind[':id'] = $id;\n\n return $query;\n }", "protected function RetUpdate() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n if (!is_array($this->\n values) ||\n !count($this->\n values)) {\n\n throw new \\Exception(\"Error: Values not properly provided in QueryHelper.\");\n }\n\n $return = \"UPDATE `{$this->\n tables[0]}` SET \";\n\n $updatesArr = [];\n\n foreach ($this->\n values as $column => $value) {\n\n if (is_string($value)) {\n\n $value = $this->\n connection->\n GetConn()->\n real_escape_string($value);\n $updatesArr[] = \"`{$column}`='{$value}'\";\n } else if (isset($value['function'])) {\n\n $updatesArr[] = \"`{$column}`=\" . $value['function'];\n }\n }\n\n $return .= implode(\", \", $updatesArr);\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n return $return . \";\";\n }", "public function updateSystemInformation()\r\n{\r\n $query_string = \"UPDATE voting_system \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"systemname = :systemname, \";\r\n $query_string .= \"systemtypeid = :systemtypeid, \";\r\n $query_string .= \"systemsummary = :systemsummary, \";\r\n $query_string .= \"systeminformation = :systeminformation \";\r\n $query_string .= \"WHERE systemid = :systemid\";\r\n\r\n return $query_string;\r\n}", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "public function update($table, $data){//,$id\n $q=\"UPDATE `$table` SET \";\n\n $r=\"\";\n foreach($data as $key=>$val){\n $r.=\"`\".$key.\"`\".\"='$val',\";\n }\n $r=rtrim($r,\", \");\n //echo $r;\n $q1 = $q .$r. ' WHERE '.\"1\";\n\n \n if($q1)\n {\n $this->database_query($q1);\n }\n}", "public static function GetUpdateQuery($table, $keys_and_values, $conditions)\r\n\t{\r\n\t\t$q = new QSqlQuery();\r\n\t\t$q->update()->{$table}->set();\r\n\r\n\t\tforeach ($keys_and_values as $key => $value)\r\n\t\t\t$q->{$key}->eq()->val($value);\r\n\r\n\t\t$q->where();\r\n\t\t\r\n\t\t$pos = 0;\r\n\t\tforeach ($conditions as $key => $value)\r\n\t\t{\r\n\t\t\tif ($pos > 0)\r\n\t\t\t\t$q->and();\r\n\t\t\t$q->{$key}->eq()->val($value);\r\n\t\t\t$pos++;\r\n\t\t}\r\n\t\treturn $q;\r\n\t}", "public function UPDATEquery($table, $where, $fields_values, $no_quote_fields = false)\n {\n // Table and fieldnames should be \"SQL-injection-safe\" when supplied to this\n // function (contrary to values in the arrays which may be insecure).\n if (is_string($where)) {\n $fields = [];\n if (is_array($fields_values) && ! empty($fields_values)) {\n // Quote and escape values\n $nArr = $this->fullQuoteArray($fields_values, $table, $no_quote_fields, true);\n foreach ($nArr as $k => $v) {\n $fields[] = $k . '=' . $v;\n }\n }\n // Build query\n $query = 'UPDATE ' . $table . ' SET ' . implode(',', $fields) . ((string) $where !== '' ? ' WHERE ' . $where : '');\n if ($this->debugOutput || $this->store_lastBuiltQuery) {\n $this->debug_lastBuiltQuery = $query;\n }\n return $query;\n } else {\n throw new \\InvalidArgumentException('TYPO3 Fatal Error: \"Where\" clause argument for UPDATE query was not a string in $this->UPDATEquery() !', 1270853880);\n }\n }", "public function forUpdate($sql){\n\t\treturn $sql.' FOR UPDATE';\n\t}", "final protected function queryUpdate(CDFIDataConnection $db, $tableName = null, $whereColumn = null, $skipKeys = null)\n\t\t{\n\t\t\t// note: whereColumn can be null - be warned!\n\n\t\t\t// get the table name\n\t\t\t$tableName = $this->requireTableName($tableName);\n\n\t\t\t// build list of setters\n\t\t\t$sets = array();\n\t\t\tforeach($this->getColumnNames($skipKeys) as $key)\n\t\t\t\t$sets[] = $key . '=' . CDFIDataConnection_TokenCharacter; // foo=?\n\n\t\t\t// build sql\n\t\t\t$sql = sprintf('update `%s` set %s ', $tableName, implode(',', $sets));\n\n\t\t\t// append an additional parameter for the where clause\n\t\t\t$where = $this->findColumn($whereColumn);\n\t\t\tif($where != null)\n\t\t\t{\n\t\t\t\t$db->AddParameter($where->getDataType(), $where->getValue());\n\t\t\t\t$sql .= sprintf(' where `%s`=', $where->getName()) . CDFIDataConnection_TokenCharacter;\n\t\t\t}\n\n\t\t\t// pass query on to processor\n\t\t\t$db->Query($sql);\n\t\t}", "public function createUpdateSql(): \\Hx\\Db\\Sql\\UpdateInterface;", "public function update(?string $template = null): Query\n {\n if ($this->queryType !== self::UPDATE) {\n $this->resetStatement();\n $this->queryType = self::UPDATE;\n }\n return $this->template($template ?? 'UPDATE {{table}} SET {{columns}} {{where}}');\n }", "protected function _obterUpdateSql($nomeTabela, array $campos, $where)\n {\n $sql = \"UPDATE $nomeTabela SET \";\n foreach ($campos as $campo=>$valor) {\n $sql .= \"$campo = \".self::_obterDadoTratado($valor).\", \";\n }\n\n $sql = substr($sql, 0, -2);\n $sql .= \" WHERE $where\";\n\n return $sql;\n }", "public function buildUpdate(Query $query) {\n return $this->renderStatement(Query::UPDATE, [\n 'fields' => $this->formatFields($query),\n 'table' => $this->formatTable($query->getTable(), $query->getAlias()),\n 'joins' => $this->formatJoins($query->getJoins()),\n 'where' => $this->formatWhere($query->getWhere()),\n 'orderBy' => $this->formatOrderBy($query->getOrderBy()),\n 'limit' => $this->formatLimit($query->getLimit()),\n ] + $this->formatAttributes($query->getAttributes()));\n }", "function dbRowUpdate($table_name, $form_data, $where_clause='')\n{\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}", "public function SQLUpdate($tabela, $colsvals, $condicoes = \"\", $innerJoins = \"\"){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$condicoesAudit = $condicoes;\n\t\t\t\t\n\t\t\t\t$tabelaAudit = \"$tabela\".(($innerJoins != \"\") ? \"INNER JOIN $innerJoins\" : \"\");\n\n\t\t\t\t$dataBefore = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabelaAudit\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$condicoesAudit\"));\n\t\t\t} \n\n\t\t\t$condicoes = ($condicoes != \"\") ? \"WHERE $condicoes\" : \"\";\n\t\t\t\n\t\t\tif($this->SQLType == 1){\n\t\t\t\t\n\t\t\t\t$innerJoins = ($innerJoins != \"\") ? \"INNER JOIN $innerJoins\" : \"\";\n\t\t\t\t$query = \"UPDATE $tabela $innerJoins SET $colsvals $condicoes\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$innerJoins = ($innerJoins != \"\") ? \"FROM $tabela INNER JOIN $innerJoins\" : \"\";\n\t\t\t\t$query = \"UPDATE $tabela SET $colsvals $innerJoins $condicoes\";\n\t\t\t}\n\n\t\t\t$this->lastQuery = $query;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t$result = mysqli_query($this->connection, $query) or $this->reportQueryError(mysqli_error(), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\t$result = odbc_exec($this->connection, $query) or $this->reportQueryError(odbc_errormsg(), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$result = $this->connection->query($query) or $this->reportQueryError(implode(\":\", $this->connection->errorInfo()), $query, 2,$this->failedToUpdate);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif($this->audit){\n\n\t\t\t\t$dataAfter = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabelaAudit\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$condicoesAudit\"));\n\n\t\t\t\t$this->audit = false;\n\n\t\t\t\t$this->autoAudit($query, $dataAfter, $dataBefore);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public static function update($sql) {\r\n\t\treturn self::_DB()->createCommand($sql)->execute();\r\n\t}", "function dbupdate($table, $fields, $where = [1=>0], $funcs = null ) {\r\n\tglobal $msq;\r\n\t$parts = [];\r\n\tforeach ($fields as $k => $v)\r\n\t\t$parts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\tif ($funcs != null) {\r\n\t\tforeach ($funcs as $k => $v) {\r\n\t\t\t$parts []= $k.' = '.$v;\r\n\t\t}\r\n\t}\r\n\t$whparts = [];\r\n\tforeach ($where as $k => $v)\r\n\t\t$whparts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\t$q = \"update \".$table.\" set \".implode(\", \",$parts).\" where \".implode(\" and \",$whparts);\r\n\treturn dbcommit($q);\r\n}", "public function updateRecord ($sqlString);", "function dbUpdate($table, array $data, $where = null, $insertId = false){\n foreach ($data as $key => $value){ //Percorre os campos lendo o índice e o valor do array data\n $fields[] = \"{$key} = '{$value}'\"; //Atribui os índices e seus respectivos valor para um array\n }\n $fields = implode(', ', $fields); //Separa cada campo com vírgula\n //$table = DB_PREFIX.'_'.$table; //para pegar o prefixo da tabela caso use \n $where = ($where) ? \" WHERE {$where}\" : null; //Serve apenas para definir se haverá espaço entre fields e where\n $query = \"UPDATE $table SET {$fields}{$where}\"; //por isso, aqui não vai espaço\n return qExecute($query, $insertId);\n }", "function adv_update($table, array $data, array $where);", "public function get_update_qry($vals){\n foreach($_POST AS $key => $value) { $_POST[$key] = $this->prep_sql($value); }\n\n $base = \"INSERT INTO `people` ( `first_name` , `last_name` , `address` \";\n $base .= \", `email` , `phone` , `social` , `username` , `password` ) \";\n $fmt_str = \"VALUES( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' );\";\n $res = sprintf($fmt_str, // can't just unpack?...hrm\n\t $vals[$this->new_post_vars[0]],\n \t $vals[$this->new_post_vars[1]],\n \t $vals[$this->new_post_vars[2]],\n \t $vals[$this->new_post_vars[3]],\n \t $vals[$this->new_post_vars[4]],\n \t $vals[$this->new_post_vars[5]],\n \t $vals[$this->new_post_vars[6]],\n \t $vals[$this->new_post_vars[7]]);\n $fin = $base . $res;\n return $fin;\n }", "public function updateQuiz()\r\n{\r\n $query_string = \"UPDATE quizzes \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizname = :quizname, \";\r\n $query_string .= \"quizdescription = :quizdescription \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public static function update($options = array()) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb()); \n $set = array();\n $where = array();\n foreach (static::$properties as $property) {\n if (isset($options['set'][$property])) { \n $set[$property] = $options['set'][$property];\n }\n if (isset($options['where'][$property])) { \n $where[$property] = $options['where'][$property];\n }\n }\n if (empty($set) || empty($options['where'])) {\n static::errorParamInvalid('set/where');\n return false;\n } \n if (in_array('updated', static::$properties)) {\n $set['updated'] = new Expression('UNIX_TIMESTAMP()'); \n }\n $update = $sql->update()\n ->table($options['table'])\n ->set($set);\n if (!empty($where)) {\n $update->where($where);\n }\n foreach ($options['where'] as $where) {\n if ($where instanceof Expression) {\n $update->where($where);\n }\n }\n $updateString = $sql->getSqlStringForSqlObject($update); \n Log::info('Update SQL', $updateString);\n if (static::getDb()->query($updateString, Adapter::QUERY_MODE_EXECUTE)) {\n return true;\n }\n return false;\n }", "public function updateBySql($table, $sql, $bind = []);", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "public function fromUpdateQuery(\\Yana\\Db\\Queries\\IsUpdateQuery $query): string;", "protected function execUpdate($table, $where, $fields_values)\n {\n $no_quote_fields = FALSE;\n $GLOBALS[\"TYPO3_DB\"]->exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n }", "public function update($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"UPDATE \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']).$this->genWhere($p['where']);\t\n\t\t$DB->alter($statement);\t\n\t}", "private static function prepareUpdate($toupdate) {\n $updates = \"\";\n $keys = array_keys($toupdate);\n for($i = 0; $i < count($keys); $i++) {\n $updates .= $keys[$i] . \"=?\";\n $updates .= ($i < count($keys) - 1 ? \", \" : \" \");\n }\n $updates .= \"WHERE id=?\";\n return $updates;\n }", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "protected abstract function getUpdateStatement(array $columns);", "abstract function update (\\Database\\Query\\Query $query);", "static function Update($table,$param,$param_value,$condition){\n mysql_query(\"update $table set $param = $param_value where $condition\");\n }", "function updateData($table, $where, $fields)\n {\n $sql = \"\";\n $condition = \"\";\n $val = \"\";\n foreach ($where as $key => $value) {\n $condition .= \"$key = ?\";\n }\n foreach ($fields as $key => $value) {\n $val .= \"$key = ? , \";\n }\n $val = substr($val, 0, -2);\n $sql .= \"update $table set $val where $condition\";\n // print_r($sql);\n // exit;\n $result = $this->conn->prepare($sql);\n $temp = array_merge(array_values($fields), array_values($where));\n if ($result->execute($temp)) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }", "public function compileUpdateWithoutJoins(Builder $builder, $table, $columns, $where): string\n {\n return \"update {$table} set {$columns} {$where}\";\n }", "public function constructCommitQuery()\n {\n $allKeysSet = count(array_diff($this->keys, array_keys($this->info))) === 0;\n // If all keys set, default to update; otherwise, default to insert\n\n $columnsString = '';\n $valuesString = '';\n $updateString = '';\n\n $tablesUsed = array(); // Not needed; only support for one table right now\n\n foreach ($this->info as $column => $value) {\n if (!in_array($column, $this->noCommitColumns) &&\n !isset($this->columnAliases[$column])) {\n $value = $this->connObj->escapeString($value);\n $canonical = $this->canonicalizeColumn($column, false, $tablesUsed, false);\n $columnsString .= \"{$canonical}, \";\n $valuesString .= \"'{$value}', \";\n }\n }\n\n $tablesUsed = array();\n $columnsString = substr($columnsString, 0, -2);\n $valuesString = substr($valuesString, 0, -2);\n $updateString = $this->constructUpdateString($tablesUsed);\n\n // Update or insert with one query!\n if ($this->connObj->canUseOnDuplicateKeyUpdate()) {\n return \"INSERT INTO \" . $this->tableName .\n \" ({$columnsString}) VALUES ({$valuesString}) \" .\n \"ON DUPLICATE KEY UPDATE {$updateString}\";\n }\n\n $insertQuery = \"INSERT INTO \" . $this->tableName . \" ({$columnsString}) VALUES ({$valuesString})\";\n if ($allKeysSet && !empty($this->keys)) {\n // Check if we have an existing row in the database\n $tablesUsedBlackHole = array(); // Waste variable\n\n $whereString = $this->constructKeyCondString();\n\n $columnsString = $this->constructSelectColumnsStringStatic($tablesUsedBlackHole, $this->keys);\n $selectQuery = \"SELECT {$columnsString} FROM {$this->tableName} WHERE {$whereString}\";\n $result = $this->query($selectQuery);\n\n if ($result !== false && $this->connObj->fetchResult($result) !== false) {\n return \"UPDATE {$this->tableName} SET {$updateString} WHERE {$whereString}\";\n } else {\n return $insertQuery;\n }\n } else {\n return $insertQuery;\n }\n }", "function SQL_update ($var1,$var2,$var3,$var4,$var5,$var6 = null){\n\t/* Var definition\n\tvar1: Table_name\n\tvar2: Column to update\n\tvar3: Value to set\n\tvar4: Column to match\n\tvar5: Value to match\n\tvar6: Optional extra argument\n\t*/\n\tif ($var1 == null or $var2 == null or $var3 == null or $var4 == null or $var5 == null) {kernel_log(\"Missing argument for 'SQL_update'\",3);return;}\n\tif (gettype($var1) != \"string\" or gettype($var2) != \"string\" or gettype($var3) != \"string\" or gettype($var4) != \"string\" or gettype($var5) != \"string\") { kernel_log(\"Invalid argument type for 'SQL_update'\",3);return;}\n\t$return = null;\n\t\n\t$query = \"UPDATE $var1 SET $var2=$var3 WHERE $var4=$var5\";\n\tif ($var6 != null) {$query .= \" $var6\";}\n\t$return = sql_query($query);\n\treturn $return;\n}", "function Update($table_name, $form_data, $where_clause='')\n{ \n global $mysqli;\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n return mysqli_query($mysqli,$sql);\n}", "public function update($tblUpdate);", "function update($tbl, $dataArray, $conditional=null)\n\t{\n\t\tforeach($dataArray as $k=>$v){\n\t\t\t$updsql .= \"$k='\".$this->real_escape_string($v).\"', \";\n\t\t}\n\t\t$updsql = substr ($updsql, 0, strlen($updsql) - 2);\n\t\tif($conditional != ''){\n\t\t\t$updsql.= \"WHERE {$conditional}\";\n\t\t}\n\t\t$sql = \"UPDATE {$tbl} SET {$updsql}\";\n\t\t$this->query($sql);\n\t}", "public static function getUpdateSQL($id, $content)\n\t{\n\t\t$sql = \"update comments\n set content = %s\n where id = %d\";\n\t\t$sql = sprintf($sql, $content, $id);\n\n\t\treturn $sql;\n\t}", "function update($table, $id, $data){\n global $conn;\n$sql = \"UPDATE $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$sql = $sql . \" WHERE id=?\";\n$data['id'] = $id;\n$stmt = executeQuery($sql, $data);\nreturn $stmt->affected_rows;\n}", "public function update_table (array $data, array $condition){\n\n $value = \"\";\n $cvalue = \"\";\n if ($data){\n // shell array $data\n foreach($data as $key => $val){\n\n if (count($data)> 1){\n\n $value .= \"$key = '$val' AND \";\n }else {\n\n $value .= \"$key = '$val'\";\n }\n }\n \n // // remove the last AND\n $words = explode( \" \", $value );\n $cnt = count($words);\n if($words[$cnt-2] == \"AND\") {\n\n array_splice( $words, -2 );\n }\n \n $value = implode( \" \", $words );\n }\n\n if ($condition){\n // shell array $data\n foreach($condition as $ckey => $cval){\n\n if (count($condition)> 1){\n\n $cvalue .= \"$ckey = '$cval' AND \";\n }else {\n\n $cvalue .= \"$ckey = '$cval'\";\n }\n }\n \n // // remove the last AND\n $cwords = explode( \" \", $cvalue );\n $ccnt = count($cwords);\n if($cwords[$ccnt-2] == \"AND\") {\n\n array_splice( $cwords, -2 );\n }\n \n $cvalue = implode( \" \", $cwords );\n }\n \n $sql =\"UPDATE \".$this->_table.\" SET \".$value.\" WHERE \".$cvalue;\n //echo $sql; die();\n // send $sql to function sql to executate\n $res = $this->_pdo->exec($sql); //or var_dump($this->_pdo->errorInfo());;\n }", "public function update( $cond, $params ) {\t\n \t\n \t$query = \"UPDATE stat SET \";\n\n if (!empty($params)){\n \t$conditions = array();\n \t\tforeach($params as $key=>$value){\n \t\t\t$conditions[] = $key.\"=?\";\n \t\t}\n \t\t$query.= join(\", \", $conditions);\n \t\t$values = array_values($params);\n \t} \t\n \t\n if (!empty($cond)){\n \t\t$query .= \" WHERE \";\n \t\t$conditions = array();\n \t\tforeach($cond as $key=>$value){\n \t\t\t$conditions[] = $key.\"=?\";\n \t\t}\n \t\t$query.= join(\" AND \", $conditions);\n \t\t$values = array_merge($values, array_values($cond));\n \t} \t\n\n \treturn $this->db->execute( $query, $values ); \n }", "public function deleteSql(){\n\n $sql = \"DELETE FROM {$this->table} WHERE id = {$this->updateId}\";\n \n return $sql;\n }", "function update() {\n $col_names = array('first_name', 'last_name', 'category_id', 'active');\n $dat_param = array(':fn', ':ln', ':ci', ':ac');\n $sani_type = array('str', 'str', 'int', 'flag');\n $sub_check = array(false, false, false, false);\n $dat_types = array(PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_INT);\n\n $any_sub = false;\n\n //make sure non-optional data is set\n if (!isset($this->id)) throw new Exception('id must be provided');\n if (!isset($this->updated_by)) throw new Exception('updated_by must be provided'); \n\n $update_string = \"updated_by=:ub\";\n \n //check if updateable data exists, sanitize it, build up the update string:\n //a) loop through the updateable parameters\n for ($i = 0; $i < count($col_names); $i++) {\n\n //b) if it is set, attempt to sanitize/check it for update\n if (isset($this->{$col_names[$i]})) {\n $any_sub = true;\n $sub_check[$i] = true;\n $update_string .= \", {$col_names[$i]}={$dat_param[$i]}\";\n\n //c) sanitize/check by type\n if ($sani_type[$i] === 'str') {\n $this->{$col_names[$i]} = htmlspecialchars(strip_tags($this->{$col_names[$i]}));\n\n } elseif ($sani_type[$i] === 'flag') {\n if ( !($this->{$col_names[$i]} === 0 || $this->{$col_names[$i]} === 1) ) {\n throw new Exception(\"{$col_names[$i]} must be either 0 or 1\");\n }\n } elseif ($sani_type[$i] === 'int') {\n if (filter_var($this->{$col_names[$i]}, FILTER_VALIDATE_INT) === false) {\n throw new Exception('category_id does not conform');\n }\n }\n }\n } \n\n if (!$any_sub) throw new Exception('no data was submitted for staff member update.');\n \n $sql = \"UPDATE \n {$this->table_name}\n SET\n {$update_string}\n WHERE\n id=:id\";\n\n $stmt = $this->conn->prepare($sql);\n \n //bind the non-optional data to the query\n $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);\n $stmt->bindParam(':ub', $this->updated_by, PDO::PARAM_STR);\n\n //if the data was found and sanitized, then bind the data to the parameter\n for ($i=0; $i < count($col_names); $i++) { \n if ($sub_check[$i] === true) {\n $stmt->bindParam($dat_param[$i], $this->{$col_names[$i]}, $dat_types[$i]);\n }\n }\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function executeUpdate($sql){\n $statement = $this->setQuery($sql);\n if(isset($statement)){\n $statement->execute($sql);\n } \n }", "public function toSql()\n {\n if ($this->isEmpty()) {\n return '';\n }\n\n $params = $this->getParams();\n\n $sql = array('SET');\n $set = array();\n\n foreach ($params as $column => $value) {\n $set[] = implode(' = ', array(\n $column, $this->getBuilder()->getHelper()->toDbValue($value)\n ));\n }\n\n $sql[] = implode(', ', $set);\n\n return implode(' ', $sql);\n }", "function UpdateQuery($table, $values, $where=\"\", $useNullValues=false)\n\t{\n\t\t$fields = array();\n\t\t$lobVals = array();\n\t\t$lobDesc = array();\n\t\tforeach ($values as $k => $v) {\n\n\t\t\tif (strlen($v) > 4000) {\n\t\t\t\t$lobVals[':'.$k] = $v;\n\t\t\t\t$lobDesc[':'.$k] = oci_new_descriptor($this->connection, OCI_D_LOB);\n\t\t\t\t$v = ':'.$k;\n\t\t\t} else {\n\t\t\t\tif ($useNullValues) {\n\t\t\t\t\tif (is_null($v)) {\n\t\t\t\t\t\t$v = \" \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$v = \"'\" . $this->Quote($v) . \"'\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$v = \"'\" . $this->Quote($v) . \"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$fields[] = sprintf(\"%s=%s\", $k, $v);\n\t\t}\n\n\t\t$fields = implode(\",\", $fields);\n\t\t\n\t\t\n\t\t\n\t\tif ($where != \"\") {\n\t\t\t$fields .= sprintf(\" WHERE %s\", $where);\n\t\t}\n\n\t\t$query = sprintf('UPDATE [|PREFIX|]%s SET %s', $table, $fields);\n\t\t\n\t\tif ($this->TablePrefix !== null) {\n\t\t\t$query = str_replace(\"[|PREFIX|]\", $this->TablePrefix, $query);\n\t\t} else {\n\t\t\t$query = str_replace(\"[|PREFIX|]\", '', $query);\n\t\t}\n\t\t\n\t\t$resource = oci_parse($this->connection, $query);\n\t\tif (!$resource) {\n\t\t\t$e = oci_error($this->connection);\n\t\t\t$this->SetError($e['message']);\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($lobDesc as $k => $v) {\n\t\t\toci_bind_by_name($resource, $k, $lobDesc[$k], -1, OCI_B_CLOB);\n\t\t\t$lobDesc[$k]->WriteTemporary($lobVals[$k]);\n\t\t}\n\n\t\t$result = oci_execute($resource);\n\n\t\tforeach ($lobDesc as $k => $v) {\n\t\t\t$lobDesc[$k]->close();\n\t\t\t$lobDesc[$k]->free();\n\t\t}\n\n\t\t\n\t\tif (!$result) {\n\t\t\t$e = oci_error($resource);\n\t\t\t$this->SetError($e['message']);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn oci_commit($this->connection);\n\t}", "public function db_update_string()\n {\n $key = $this->key;\n $value = $this->value;\n $string = $key . \" = \\\"\" . addslashes($value) . \"\\\",\";\n return $string;\n }", "public function forUpdate(string $sqlQuery) : string\n {\n return $sqlQuery.' WITH (UPDLOCK) ';\n }" ]
[ "0.8253633", "0.7971857", "0.7802655", "0.7786781", "0.7688645", "0.76818156", "0.76603186", "0.75075066", "0.73677105", "0.73103786", "0.72683394", "0.70863855", "0.7064653", "0.70244", "0.7005596", "0.6950035", "0.6910473", "0.6900122", "0.67475307", "0.67123723", "0.6694958", "0.6655865", "0.6599593", "0.6575393", "0.65653676", "0.6545125", "0.6514052", "0.6508683", "0.6498023", "0.64887506", "0.6469772", "0.6466005", "0.6464138", "0.6452385", "0.64477926", "0.6437671", "0.6416354", "0.64014727", "0.6371583", "0.63627446", "0.6359511", "0.63433397", "0.63007957", "0.62945294", "0.62749547", "0.6273769", "0.626126", "0.6259079", "0.624552", "0.62382865", "0.62347305", "0.6227735", "0.6224554", "0.6212079", "0.62119085", "0.6189953", "0.61877847", "0.6187621", "0.61848086", "0.6179324", "0.6163957", "0.6163281", "0.6137333", "0.6124443", "0.6092317", "0.6092143", "0.60887223", "0.608859", "0.60835654", "0.6083488", "0.6079", "0.6072681", "0.6071048", "0.6070949", "0.6048107", "0.6025372", "0.60088396", "0.60056186", "0.59799635", "0.5962541", "0.59608155", "0.59566444", "0.5954591", "0.59393185", "0.5934803", "0.59343976", "0.5931126", "0.59248227", "0.5923807", "0.59115946", "0.5906598", "0.5899132", "0.5882569", "0.5881303", "0.588097", "0.58779335", "0.58516705", "0.58499014", "0.5847452", "0.58428735" ]
0.8514049
0
Commits the infoarray's data to all rows matching added conditions.
public function update() { if (empty($this->info)) { return true; } $success = $this->query($this->constructUpdateQuery()); $this->numRows = $this->conn->affected_rows; return $success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commit()\n {\n return $this->update($this->columns, $this->table)->where($this->clauses)->execute();\n }", "public function commit()\n\t{\n\t\t$recordArray = $this->dataSet;\n\n\t\tif (count($recordArray) >= 1)\n\t\t{\n\t\t\t// Process data in batch\n\t\t\t$dataBatch\t= array();\n\t\t\t$count\t\t= 0;\n\n\t\t\tforeach ($recordArray as $k => $obj)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Push data into array\n\t\t\t\t\tarray_push($dataBatch, $obj);\n\n\t\t\t\t\tif (count($dataBatch) == $this->batchSize)\n\t\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData1[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$processedData = $processedData1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (exception $e)\n\t\t\t\t{\n\t\t\t\t\tdie('Error occured while inserting records into Algolia! - ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Insert records in Algolia if record array is less than batchSize\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (count($dataBatch) < $this->batchSize && count($dataBatch) > 0)\n\t\t\t\t{\n\t\t\t\t\t\t$processData\t= $this->algoliaADIndex->saveObjects($dataBatch);\n\t\t\t\t\t\t$dataBatch\t\t= array();\n\t\t\t\t\t\t$count\t\t\t+= count($processData['objectIDs']);\n\n\t\t\t\t\t\tforeach ($processData['objectIDs'] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData2[] = $val;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($processedData1) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData = array_merge($processedData1, $processedData2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$processedData = $processedData2;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (exception $e)\n\t\t\t{\n\t\t\t\treturn 'Error occured while inserting records into Algolia! - ' . $e->getMessage();\n\t\t\t}\n\n\t\treturn $processedData;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "function Commit()\n\t{\n\t\t// save the all changes!! (append data & update the indexes)\n\t\tif (!$this->fd || $this->mode != 'w' || $this->dat_buffer == '') return;\n\n\t\t// 1. load all unloaded index_buffer\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\tif (isset($this->key_buffer[$i])) continue;\n\t\t\t$this->key_buffer[$i] = '';\n\t\t\tif (!isset($this->key_index[$i]) || $this->key_index[$i]['len'] == 0) continue;\n\t\t\tfseek($this->fd, $this->key_index[$i]['off'], SEEK_SET);\n\t\t\t$this->key_buffer[$i] = fread($this->fd, $this->key_index[$i]['len']);\n\t\t}\n\n\t\t// 2. save the append data\n\t\tif ($this->dat_buffer != '')\n\t\t{\n\t\t\tfseek($this->fd, $this->key_index[0]['off'], SEEK_SET);\n\t\t\tfwrite($this->fd, $this->dat_buffer);\n\t\t\tunset($this->dat_buffer);\n\t\t\t$this->dat_buffer = '';\n\t\t}\n\t\t// 3. save the key_buffer\n\t\t$off = $this->dat_offset;\n\t\t$kbuf = '';\n\t\tfor ($i = 0; $i < $this->max_klen; $i++)\n\t\t{\n\t\t\t// check the index modified or not\n\t\t\t$kblen = strlen($this->key_buffer[$i]);\n\t\t\tif (!isset($this->put_pool[$i]))\n\t\t\t{\n\t\t\t\tif ($kblen > 0)\n\t\t\t\t\tfwrite($this->fd, $this->key_buffer[$i], $kblen);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// modified!!\n\t\t\t\t$size = $i + 9;\t\t// record_size\n\n\t\t\t\t// sort the put_pool by key\n\t\t\t\t$pool = &$this->put_pool[$i];\n\t\t\t\tksort($pool);\n\n\t\t\t\t$buffer = '';\n\t\t\t\t$o = $n = 0;\n\t\t\t\twhile ($o < $kblen)\n\t\t\t\t{\n\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\tif (!$pval)\n\t\t\t\t\t{\n\t\t\t\t\t\t// end of pool\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$okey = substr($this->key_buffer[$i], $o + 8, $size - 8);\n\t\t\t\t\t$cmp = strcmp($pval['key'], $okey);\n\n\t\t\t\t\t// 直到找到大于的?\n\t\t\t\t\twhile ($cmp < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t\t$n += $size;\n\n\t\t\t\t\t\t// find the next\n\t\t\t\t\t\t$pval = each($pool);\n\t\t\t\t\t\tif (!$pval) $cmp = 1;\t// set > 0\n\t\t\t\t\t\telse $cmp = strcmp($pval['key'], $okey);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($cmp == 0)\n\t\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\telse if ($cmp > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$buffer .= substr($this->key_buffer[$i], $o, $size);\n\t\t\t\t\t\tif ($pval && !prev($pool)) end($pool);\n\t\t\t\t\t}\n\t\t\t\t\t$o += $size;\n\t\t\t\t}\n\n\t\t\t\t// other pool data\n\t\t\t\twhile ($pval = each($pool))\n\t\t\t\t{\n\t\t\t\t\t$buffer .= pack('VVa*', $pval['value']['off'], $pval['value']['len'], $pval['key']);\n\t\t\t\t\t$n += $size;\n\t\t\t\t}\n\n\t\t\t\t// save to disk\n\t\t\t\t$kblen += $n;\n\t\t\t\tfwrite($this->fd, $buffer, $kblen);\n\n\t\t\t\t// delete the pool\n\t\t\t\tunset($buffer, $pool);\n\t\t\t\tunset($this->put_pool[$i]);\n\t\t\t}\n\n\t\t\t$kbuf .= pack('VV', $off, $kblen);\n\t\t\t$this->key_index[$i] = array('off' => $off, 'len' => $kblen);\n\t\t\t$off += $kblen;\n\t\t\tunset($this->key_buffer[$i]);\n\t\t}\n\t\t// 4. save the head offset & length (key_index)\n\t\tfseek($this->fd, 32, SEEK_SET);\n\t\tfwrite($this->fd, $kbuf);\n\t\tunset($kbuf);\n\n\t\t// 5. flush the fd\n\t\tfflush($this->fd);\n\t}", "protected function merge(array $data)\n {\n foreach ($data as $value) {\n DB::connection('c2')->table($this->table->to)\n ->where($this->table->matchKeys[1], $value[$this->table->matchKeys[0]])\n ->update($this->except($value, $this->table->matchKeys[0]));\n }\n }", "public function commit()\n\t{\n\t\tforeach ($this->arrayItemsDeferred as $key => $item) {\n\t\t\tif($this->save($item) === true) {\n\t\t\t\tunset($this->arrayItemsDeferred[$key]);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function update($tbl, $dataArray, $conditional=null)\n\t{\n\t\tforeach($dataArray as $k=>$v){\n\t\t\t$updsql .= \"$k='\".$this->real_escape_string($v).\"', \";\n\t\t}\n\t\t$updsql = substr ($updsql, 0, strlen($updsql) - 2);\n\t\tif($conditional != ''){\n\t\t\t$updsql.= \"WHERE {$conditional}\";\n\t\t}\n\t\t$sql = \"UPDATE {$tbl} SET {$updsql}\";\n\t\t$this->query($sql);\n\t}", "public function modify_data($tablename, $vararray, $cond) {\n $str = \"UPDATE `\".$tablename.\"` SET \";\n $fixed = false;\n foreach($vararray as $row) {\n if ($fixed) $str .= \", \";\n if ($row['key'] == 'id' || $row['key'] == 'status') {\n $row['key'] = $tablename.\"_\".$row['key'];\n }\n $str .= \"`\".$row['key'].\"` = '\".$row['val'].\"'\"; \n $fixed = true;\n }\n $str .= \" WHERE \".$cond.\";\\nCOMMIT;\\n\";\n try {\n $result = $this->conn->query($str);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "function commit() {\n\t\t\tself::$db->commit();\n\t\t\t$this->begin_executed = false;\n\t\t}", "protected function commit()\n\t{\n\t\t$this->db->commit();\n\t}", "public function UpdateRelatedData($Ref_Data,$TableName){\n //echo \"<br>test: updating reference data to tablename={$TableName}<br>\";\n set_time_limit(0); \n include_once 'db_conn.php';\n include_once 'cls_codes.php';\n if(is_array($Ref_Data)){\n for($i=0;$i < count($Ref_Data);$i++){\n $LedgerTableName=cls_misc::ConvertToTableName($Ref_Data[$i]);\n $SQL_UpdateRelatedData=\"SELECT sum(pen_fee) as pen_fee,OR_num,OR_date,sum(bill_amnt) as bill_amnt,sum(total) as total,sum(loans_MLP) as loans_MLP,sum(loans_MF) as loans_MF,sum(misc) as misc_fee FROM {$LedgerTableName} where (OR_date is not null and OR_date <> '' and OR_date <> '0000-00-00') or (OR_num <> '' and OR_num is not null and OR_num <> '00000000') group by OR_num order by OR_num asc\";\n $e=new Exception();\n $QRY_UpdateRelatedData=mysql_query($SQL_UpdateRelatedData) or die(mysql_error().\"-\".$e->getFile().\"-\".$e->getLine());\n while($row_UpdateRelatedData=mysql_fetch_array($QRY_UpdateRelatedData)){\n $payee=$Ref_Data[$i];\n $or_date=$row_UpdateRelatedData['OR_date'];\n $or_num=$row_UpdateRelatedData['OR_num'];\n $pen_fee=$row_UpdateRelatedData['pen_fee'];\n $bill_amnt=$row_UpdateRelatedData['bill_amnt'];\n $loans_MLP=$row_UpdateRelatedData['loans_MLP'];\n $loans_MF=$row_UpdateRelatedData['loans_MF'];\n $misc_fee=$row_UpdateRelatedData['misc'];\n $total=$row_UpdateRelatedData['total'];\n $address_brgy=cls_user_get::ProfileValue('acct_no',$Ref_Data[$i],'address_brgy');\n //insert here to get OR duplication before entry\n $SQL_strCheckEntry=\"select * from {$TableName} where OR_num='{$or_num}'\";\n $e=new Exception();\n $QRY_strCheckEntry=mysql_query($SQL_strCheckEntry) or die(mysql_error());\n if(mysql_numrows($QRY_strCheckEntry)==0){\n //insert the data if no duplication\n $SQL_InsUpdateRelatedData=\"insert into {$TableName}(Payee,address_brgy,OR_date,OR_num,meter_fee,MLP,water_bill,penalty_fee,misc_fee,total)values('{$payee}','{$address_brgy}','{$or_date}','{$or_num}','{$loans_MF}','{$loans_MLP}','{$bill_amnt}','{$pen_fee}','{$misc_fee}','{$total}')\";\n $QRY_InsUpdateRelatedData=mysql_query($SQL_InsUpdateRelatedData) or die(\"Error:\".mysql_error().\"__Source File:\".$e->getFile().\"__Line:\".$e->getLine());\n }\n }\n //unset($QRY_UpdateRelatedData);\n //unset($QRY_InsUpdateRelatedData);\n }\n }\n}", "function flush(){\n\t\t$this->last_result = array();\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "public function commit()\n {\n $this->getActivePdo()->commit();\n }", "public function flush() {\n if ($this->c_owner) {\n if ($this->update('owner', $this->owner, Project::$tableName)) {\n $this->c_owner = false;\n }\n }\n if ($this->c_name) {\n if ($this->update('name', $this->name, Project::$tableName)) {\n $this->c_name = false;\n }\n }\n if ($this->c_description) {\n if ($this->update('description', $this->description, Project::$tableName)) {\n $this->c_description = false;\n }\n }\n \n if ($this->c_deadline) {\n if ($this->update('deadline', $this->deadline, Project::$tableName)) {\n $this->c_deadline = false;\n }\n }\n if ($this->c_time) {\n if ($this->update('time', $this->time, Project::$tableName)) {\n $this->c_time = false;\n }\n }\n }", "protected function commit( $table, $data ) {\n\t\t$db_file = $this->root_directory . DIRECTORY_SEPARATOR . $table . '.json';\n\t\tfile_put_contents( $db_file, json_encode( array_values( $data ) ) );\n\t}", "public static function commit()\n {\n }", "public function commitUpdate();", "function store() {\r\n $this->reindex();\r\n //---------------------\r\n if (($handle = fopen($this->_origin, \"w\")) !== FALSE) {\r\n fputcsv($handle, $this->_fields);\r\n foreach ($this->_data as $key => $record)\r\n fputcsv($handle, array_values((array) $record));\r\n fclose($handle);\r\n }\r\n }", "protected function _commit() {\n $this->dataSource->commit($this);\n }", "protected function commit() {\n $this->get_search_client()->commit();\n }", "public function commit()\n {\n if (empty($this->info)) {\n return true;\n }\n //global $argv, $netId; if (isset($argv) || $netId == 'zpx2') var_dump($this->constructCommitQuery());\n $success = $this->query($this->constructCommitQuery());\n\n if ($success) {\n $this->retrieved = true;\n // Use updates from now on\n\n if (count($this->keys) === 1) {\n // One ID column\n $idColumn = $this->keys[0];\n\n if (empty($this->info[$idColumn])) {\n // We're doing an insert\n $this->insertId = $this->connObj->getInsertId();\n\n if ($this->insertId != 0) {\n // Insert was successful\n $this->info[$idColumn] = $this->insertId;\n }\n }\n }\n }\n return $success;\n }", "public function update(array $param = array('table'=>'','data'=>[],'condition'=>[])) {\n\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (REQUIRED) associated array of columns and data e.g. ['column'=>'value','column'=>'value',...]\n $arrData = isset($param['data']) ? $param['data'] : [];\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n if( count( $arrData ) < 1 ) {\n echo \"data missing\";\n die;\n }\n\n $insert_values = [];\n $strColumns = \"\";\n $strWhere = \"\";\n\n if( count( $arrData ) > 0 ) {\n foreach($arrData as $key => $val){\n $strColumns .= \" `\".$key.\"` = ?, \";\n array_push($insert_values,$val);\n }\n $strColumns = substr($strColumns, 0, -2);\n }\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $insert_values, $col[1] );\n $strWhere .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $insert_values, $col[2] );\n $strWhere .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $strWhere .= \" AND \";\n }\n $strWhere = ' WHERE ' . substr($strWhere, 0, -4);\n }\n \n\n $strQry = \"UPDATE `\".$tableName.\"` SET \" . $strColumns . $strWhere . \";\";\n\n // print_r( $strQry ); \n // print_r( $insert_values ); die;\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n // $count = $this->stmt->rowCount(); // effected rows if updated with same value you will get zero\n // if( $count > 0 ) {\n // echo $count . ' record(s) updated successfully.';\n return [\n 'success' => true,\n 'message' => 'Record(s) updated successfully.',\n 'data' => null,\n 'code' => '001'\n ];\n // } else {\n // return [\n // 'success' => false,\n // 'message' => 'fails to get record(s)',\n // 'data' => null,\n // 'code' => '002'\n // ];\n // }\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n 'code' => '003'\n ];\n }\n $this->stmt = null;\n }", "function updateData($table, $where, $fields)\n {\n $sql = \"\";\n $condition = \"\";\n $val = \"\";\n foreach ($where as $key => $value) {\n $condition .= \"$key = ?\";\n }\n foreach ($fields as $key => $value) {\n $val .= \"$key = ? , \";\n }\n $val = substr($val, 0, -2);\n $sql .= \"update $table set $val where $condition\";\n // print_r($sql);\n // exit;\n $result = $this->conn->prepare($sql);\n $temp = array_merge(array_values($fields), array_values($where));\n if ($result->execute($temp)) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }", "public function commit()\n{\n\t$this->query('COMMIT');\n}", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "function flush() {\n\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\n\t\t}", "public function updateData($table, $data, $condition=1){\r\n\t\t$i = 0;\r\n\t\t$columnValueSet = \"\";\r\n\t\tforeach($data as $key=>$value){\r\n\t\t\t$comma = ($i<count($data)-1 ? \", \" : \"\");\r\n\t\t\t$columnValueSet .= $key. \"='\".$value.\"'\".$comma;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$sql = \"update $table set $columnValueSet where $condition\";\r\n\t\t// echo $sql;\r\n\t\t$this->execteQuery($sql);\r\n\t}", "function batch_update($datas)\n\t{\n\t\t$ci = &get_instance();\n\t\t$ci->db->trans_strict(TRUE);\n\t\t$ci->db->trans_start();\n\n\t\tif (IS_LOCAL) $ci->load->helper('logger');\n\n\t\tforeach($datas as $table => $data) {\n\t\t\t$ci->db->update($table, $data[0], $data[1]);\n\n\t\t\tif (IS_LOCAL)\tlogme('UPDATE_QUERY', 'info', $ci->db->last_query());\n\t\t}\n\n\t\t$ci->db->trans_complete();\n\t\tif ($ci->db->trans_status() === FALSE)\n\t\t{\n\t\t\tif (IS_LOCAL)\tlogme('ERROR_QUERY', 'info', 'Database Error: '.$ci->db->error()['message']);\n\t\t\treturn [FALSE, ['message' => F::_err_msg('err_commit_data')]];\n\t\t}\n\n\t\treturn [TRUE, NULL];\n\t}", "public function update_table (array $data, array $condition){\n\n $value = \"\";\n $cvalue = \"\";\n if ($data){\n // shell array $data\n foreach($data as $key => $val){\n\n if (count($data)> 1){\n\n $value .= \"$key = '$val' AND \";\n }else {\n\n $value .= \"$key = '$val'\";\n }\n }\n \n // // remove the last AND\n $words = explode( \" \", $value );\n $cnt = count($words);\n if($words[$cnt-2] == \"AND\") {\n\n array_splice( $words, -2 );\n }\n \n $value = implode( \" \", $words );\n }\n\n if ($condition){\n // shell array $data\n foreach($condition as $ckey => $cval){\n\n if (count($condition)> 1){\n\n $cvalue .= \"$ckey = '$cval' AND \";\n }else {\n\n $cvalue .= \"$ckey = '$cval'\";\n }\n }\n \n // // remove the last AND\n $cwords = explode( \" \", $cvalue );\n $ccnt = count($cwords);\n if($cwords[$ccnt-2] == \"AND\") {\n\n array_splice( $cwords, -2 );\n }\n \n $cvalue = implode( \" \", $cwords );\n }\n \n $sql =\"UPDATE \".$this->_table.\" SET \".$value.\" WHERE \".$cvalue;\n //echo $sql; die();\n // send $sql to function sql to executate\n $res = $this->_pdo->exec($sql); //or var_dump($this->_pdo->errorInfo());;\n }", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "function commit() {\n\t\tif (!$this->error) return OciCommit($this->conn);\n\t}", "public function update(array $data, array $where);", "public abstract function commit();", "public function update($infos)\n {\n\n $tabela = $infos['table'];\n// $conditions = $infos['conditions'];\n// $conjunctions = $infos['conjunctions'];\n $campos = $infos['fields'];\n $camposV = $infos['values'];\n $whereCriteria = $infos['where'];\n\n try {\n $camposNome = [];\n for ($i = 0; $i < count($campos); $i++) {\n if ($camposV[$i] != null) {\n $camposNome[$i] = $campos[$i];\n }\n }\n//\n// $nomeCampos = [];\n// $camposNome = array_values($camposNome);\n $this->sql = \"UPDATE $tabela SET \";\n//\n for ($i = 0; $i < count($camposNome); $i++) {\n if ($i != count($camposNome) - 1) {\n $this->sql .= $camposNome[$i] . \" = :\" . $camposNome[$i] . \", \";\n } else if ($i == count($camposNome) - 1) {\n $this->sql .= $camposNome[$i] . \" = :\" . $camposNome[$i];\n }\n }\n//\n// if ($conditions != null && $whereCriteria == null) {\n// $condWithIntIndex = array_keys($conditions);\n// for ($i = 0; $i < count($conditions); $i++) {\n// $nomeCampos[$i] = $condWithIntIndex[$i];\n// }\n// $valoresCampos = [];\n// for ($j = 0; $j < count($conditions); $j++) {\n// $valoresCampos[$j] = $conditions[$nomeCampos[$j]];\n// }\n//\n// $this->sql .= \" WHERE \";\n//\n// for ($x = 0; $x < count($nomeCampos); $x++) {\n// if ($x != count($nomeCampos) - 1) {\n// $this->sql .= $nomeCampos[$x] . \" = :condition_$nomeCampos[$x] $conjunctions[$x] \";\n// } else if ($x == count($nomeCampos) - 1) {\n// $this->sql .= $nomeCampos[$x] . \" = :condition_$nomeCampos[$x]\";\n// }\n// }\n// } else if ($conditions == null && $whereCriteria != null) {\n if (!empty($whereCriteria)) {\n $this->sql .= \" WHERE \" . $whereCriteria . \" \";\n }\n// }\n return $this->sql . \";\";\n } catch (PhiberException $e) {\n throw new PhiberException(new Internationalization(\"query_processor_error\"));\n }\n\n }", "public function commit()\n {\n if ($this->hasActiveTransaction) {\n parent::commit();\n $this->hasActiveTransaction = false;\n }\n }", "public function commit()\n {\n $this->connection->commit();\n }", "function submitCostingChanges($conn, $dataArray){\n\t//do checking of values, make sure okay to submit\n\n\t\n\t$sql = \"UPDATE levelfour SET UnitOfMeasure = :unitOfMeasure, Cost = :cost, ExpectedLifespan = :lifespan WHERE LevelFourId = :levelFourID\";\t\n\t$sth = $conn->prepare($sql);\n\tforeach($dataArray as $dataItem){\n\t\n\t\t$sth->bindParam(':levelFourID', $dataItem['levelFourID'], PDO::PARAM_INT, 11);\n\t\t$sth->bindParam(':unitOfMeasure', $dataItem['unitOfMeasure'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':cost', $dataItem['cost'], PDO::PARAM_INT);\n\t\t$sth->bindParam(':lifespan', $dataItem['lifespan'], PDO::PARAM_INT, 11);\n\t\t\n\t\t$sth->execute();\n\t}\n\t$sth->closeCursor();\n\t$return = ['message' => 'Successfully changed the costing table'];\n\treturn $return;\n\n}", "public function commit()\r\n {\r\n\t\treturn false;\r\n }", "public function committed();", "public function saveConditions()\n {\n foreach($this->reportsConditions as $k => $v) {\n $v->save();\n }\n }", "public function commit() {\n\t\treturn false;\n\t}", "public function writeAll( array $data ) {\n\n\t\t$this->_data = $data;\n\t}", "public static function flush() {\n self::$last_result = array();\n self::$col_info = null;\n self::$last_query = null;\n }", "function saveInfo(){\n mysql_query(\"UPDATE resolution SET text='$this->text' WHERE id='$this->clauseId'\") or die(mysql_error());\n mysql_query(\"UPDATE resolution SET nextId='$this->nextId' WHERE id='$this->clauseId'\") or die(mysql_error());\n if($this->subClause==array()){\n mysql_query(\"UPDATE resolution SET subId='0' WHERE id='$this->clauseId'\") or die(mysql_error());\n }else{\n $subId=$this->subClause[0]->clauseId;\n mysql_query(\"UPDATE resolution SET subId='$subId' WHERE id='$this->clauseId'\") or die(mysql_error());\n foreach($this->subClause as $subClause){\n $subClause->saveInfo();\n }\n }\n }", "private function writeMergedCells(): void\n {\n $mergeCells = $this->phpSheet->getMergeCells();\n $countMergeCells = count($mergeCells);\n\n if ($countMergeCells == 0) {\n return;\n }\n\n // maximum allowed number of merged cells per record\n $maxCountMergeCellsPerRecord = 1027;\n\n // record identifier\n $record = 0x00E5;\n\n // counter for total number of merged cells treated so far by the writer\n $i = 0;\n\n // counter for number of merged cells written in record currently being written\n $j = 0;\n\n // initialize record data\n $recordData = '';\n\n // loop through the merged cells\n foreach ($mergeCells as $mergeCell) {\n ++$i;\n ++$j;\n\n // extract the row and column indexes\n $range = Coordinate::splitRange($mergeCell);\n [$first, $last] = $range[0];\n [$firstColumn, $firstRow] = Coordinate::indexesFromString($first);\n [$lastColumn, $lastRow] = Coordinate::indexesFromString($last);\n\n $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, $firstColumn - 1, $lastColumn - 1);\n\n // flush record if we have reached limit for number of merged cells, or reached final merged cell\n if ($j == $maxCountMergeCellsPerRecord || $i == $countMergeCells) {\n $recordData = pack('v', $j) . $recordData;\n $length = strlen($recordData);\n $header = pack('vv', $record, $length);\n $this->append($header . $recordData);\n\n // initialize for next record, if any\n $recordData = '';\n $j = 0;\n }\n }\n }", "public function updateWhere(Array $query, Array $data)\r\n {\r\n }", "function update($tab, $data, $cond)\n{\n\t$fields = '';\n\tif (is_array($data)) {\n\t\t$sep = '';\n\t\tforeach($data as $k => $v) {\n\t\t\t//if ($k == '' or $v == '') continue;\n\t\t\tif (is_null($v)) $v = 'NULL'; else $v = \"'\".$this->escape($v).\"'\";\n\t\t\t$fields .= $sep.$this->drv->quote($k).\"=$v\";\n\t\t\t$sep = ',';\n\t\t}\n\t}\n\telse $fields = $data;\n\t\n\t$args = (func_num_args() > 3)? array_slice(func_get_args(),3) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\t$sql = \"UPDATE $tab set $fields WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}", "public function commit() {}", "public function update($table,$data,$conditions){\r\n if(!empty($data) && is_array($data)){\r\n $colvalSet = '';\r\n $whereSql = '';\r\n $i = 0;\r\n if(!array_key_exists('modified',$data)){\r\n $data['modified'] = date(\"Y-m-d H:i:s\");\r\n }\r\n foreach($data as $key=>$val){\r\n $pre = ($i > 0)?', ':'';\r\n $colvalSet .= $pre.$key.\"='\".$val.\"'\";\r\n $i++;\r\n }\r\n if(!empty($conditions)&& is_array($conditions)){\r\n $whereSql .= ' WHERE ';\r\n $i = 0;\r\n foreach($conditions as $key => $value){\r\n $pre = ($i > 0)?' AND ':'';\r\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\r\n $i++;\r\n }\r\n }\r\n $sql = \"UPDATE \".$table.\" SET \".$colvalSet.$whereSql;\r\n $query = $this->db->prepare($sql);\r\n $update = $query->execute();\r\n return $update?$query->rowCount():false;\r\n }else{\r\n return false;\r\n }\r\n }", "public function update($table, $dataArray, $protectFields = null, $conCat = null)\r\n\t\t{\r\n\t\t\t$sqlValues = \"\";\t\t\t\r\n\t\t\t$tableCols = $this->getColumnNames($table);\r\n\r\n\t\t\t$dataArray = Bunch::asArray($dataArray, \"\\n\", true);\r\n\r\n\t\t\tif($protectFields != null) $protectFields = Bunch::asArray($protectFields);\r\n\t\t\tif($conCat != null) $conCat = Bunch::asArray($conCat);\r\n\r\n\t\t\tforeach($dataArray as $field => $value)\r\n\t\t\t{\r\n\t\t\t\tif($protectFields == null or !in_array($field, $protectFields)){\r\n\t\t\t\t\tif(in_array($field, $tableCols)){\r\n\t\t\t\t\t\tif(is_array($value)) $value = implode(',', $value);\r\n\t\t\t\t\t\tif($conCat != null and in_array($field, $conCat)){\r\n\t\t\t\t\t\t\t$sqlValues .= \"`{$field}` = concat({$field}, '{$value}'),\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse $sqlValues .= \"`{$field}` = '{$value}',\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$sqlValues = Text::groom(',', $sqlValues); //remove last comma\r\n\r\n\t\t\tif($this->_where != \"\" or $this->_where == 'false'){\r\n\t\t\t\t$sqlUpdate = \"UPDATE `{$this->_prefix}{$table}` SET {$sqlValues}\";\r\n\t\t\t\tif($this->_where != 'false') $sqlUpdate .= $this->_where;\r\n\t\t\t}\r\n\t\t\telse echo \"Warning, DB Update has no where clause, this will overwrite all rows, please make sure that the where clause has been addressed, to avoid this error, please us where('false')\";\r\n\r\n\t\t\t$this->_query = $this->_prepare($sqlUpdate);\r\n\t\t\t$eStatus = $this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\t\t\t$this->close();\r\n\r\n\t\t\treturn $eStatus;\r\n\t\t}", "public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}", "function commit() ;", "public function update(Array $data, $where = array()) {\n if (!is_array($where)) {\n $where = array(self::PRI_INDEX => $where);\n }\n $this->db->update(self::TABLE_NAME, $data, $where);\n return $this->db->affected_rows();\n }", "public function commit()\n {\n if ($this->store->transactions == 1) {\n $this->store->commit();\n }\n\n --$this->transactions;\n }", "public function saveData(array $data) {\n $fields = $this->info(Zend_Db_Table_Abstract::COLS);\n foreach ($data as $field => $value) \n {\n if (!in_array($field, $fields)) \n {\n unset($data[$field]);\n }\n }\n\n $data['created'] = date('Y-m-d H:i:s');\n $data['modified'] = date('Y-m-d H:i:s'); \t\t\n return $this->insert($data);\n }", "public function saveData(array $data) {\n $fields = $this->info(Zend_Db_Table_Abstract::COLS);\n foreach ($data as $field => $value) \n {\n if (!in_array($field, $fields)) \n {\n unset($data[$field]);\n }\n }\n\n $data['created'] = date('Y-m-d H:i:s');\n $data['modified'] = date('Y-m-d H:i:s'); \t\t\n return $this->insert($data);\n }", "function submitInspectorUpdate($conn, $dataArray){\n\n\t$sql = \"UPDATE inspector SET FirstName = :firstName, LastName = :lastName, Email = :email, Phone = :phone, Cell = :cell WHERE InspectorId = :inspectorID\";\t\n\t\n\t$sth = $conn->prepare($sql);\n\tforeach($dataArray as $dataItem){\n\t\n\t\t$sth->bindParam(':inspectorID', $dataItem['inspectorID'], PDO::PARAM_INT, 11);\n\t\t$sth->bindParam(':firstName', $dataItem['firstName'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':lastName', $dataItem['lastName'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':email', $dataItem['email'], PDO::PARAM_STR, 45);\n\t\t$sth->bindParam(':phone', $dataItem['phone'], PDO::PARAM_STR, 25);\n\t\t$sth->bindParam(':cell', $dataItem['cell'], PDO::PARAM_STR, 25);\n\t\t$sth->execute();\n\t}\n\t\n\t$sth->closeCursor();\n\t$return = ['message' => 'Successfully changed the costing table'];\n\treturn $return;\n}", "public function commit(): void\n {\n if ($this->transactions == 1) {\n $this->call('commit');\n }\n\n $this->transactions = max(0, $this->transactions - 1);\n }", "public function transactionCommit()\n\t{\n\t\treturn;\n\t}", "public function flushUpdates();", "public function commit()\n {\n $this->getConnection()->commit();\n }", "public function commit() {\n return true;\n }", "public function UpdateData($table,$data,$conditions){\n\t\tif(!empty($data) && is_array($data)){\n\t\t\t$colvalSet = '';\n\t\t\t$whereSql = '';\n\t\t\t$i = 0;\n\t\t \n\t\t\tforeach($data as $key=>$val){\n\t\t\t\t$pre = ($i > 0)?', ':'';\n\t\t\t\t$colvalSet .= $pre.$key.\"='\".$val.\"'\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tif(!empty($conditions)&& is_array($conditions)){\n\t\t\t\t$whereSql .= ' WHERE ';\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($conditions as $key => $value){\n\t\t\t\t\t$pre = ($i > 0)?' AND ':'';\n\t\t\t\t\t$whereSql .= $pre.$key.\" = '\".$value.\"'\";\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql = \"UPDATE \".$table.\" SET \".$colvalSet.$whereSql;\n\t\t\t//echo $sql;exit;\n\t\t\t$query = $this->db->prepare($sql);\n\t\t\t$update = $query->execute();\n\t\t\treturn $update?$query->rowCount():false;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function save_all()\n {\n $total = FSInput::get('total', 0, 'int');\n if (!$total)\n return true;\n $field_change = FSInput::get('field_change');\n if (!$field_change)\n return false;\n $field_change_arr = explode(',', $field_change);\n $total_field_change = count($field_change_arr);\n $record_change_success = 0;\n for ($i = 0; $i < $total; $i++){\n $row = array();\n $update = 0;\n foreach ($field_change_arr as $field_item)\n {\n $field_value_original = FSInput::get($field_item . '_' . $i . '_original');\n $field_value_new = FSInput::get($field_item . '_' . $i);\n if (is_array($field_value_new))\n {\n $field_value_new = count($field_value_new) ? ',' . implode(',', $field_value_new) .\n ',' : '';\n }\n if ($field_value_original != $field_value_new)\n {\n $update = 1;\n $row[$field_item] = $field_value_new;\n }\n }\n if ($update)\n {\n $id = FSInput::get('id_' . $i, 0, 'int');\n $str_update = '';\n global $db;\n $j = 0;\n foreach ($row as $key => $value)\n {\n if ($j > 0)\n $str_update .= ',';\n $str_update .= \"`\" . $key . \"` = '\" . $value . \"'\";\n $j++;\n }\n $sql = ' UPDATE ' . $this->table_name . ' SET ';\n $sql .= $str_update;\n $sql .= ' WHERE id = ' . $id . ' ';\n $db->query($sql);\n $rows = $db->affected_rows();\n if (!$rows)\n return false;\n $record_change_success++;\n }\n }\n return $record_change_success;\n }", "public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }", "public function commit() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_ids || count($this->_ids) == 0) {\n if ($this->size() == 0) {\n return; \n }\n }\n \n foreach ($this->_ids as $id => $action) {\n try {\n $db->beginTransaction();\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"id=? \".\n \"AND \".$this->_dbqp.\"op=?\";\n $db->query($sql, array($id, $action)); \n $sql = \"INSERT INTO \".$this->_dbtp.\"queue (\".$this->_dbqp.\"id,\".$this->_dbqp.\"op) VALUES (?,?)\";\n $db->query($sql, array($id, $action));\n $db->commit();\n }\n catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n return false;\n }\n unset($this->_ids[$id]);\n }\n\n // reset cached object ids\n $this->_ids = array();\n $this->triggerUpdate(); \n return true;\n }", "public static function commit() {\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->commit();\n\t\t}\n\t}", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function update($table,$data,$conditions){\r\n if(!empty($data) && is_array($data)){\r\n $colvalSet = '';\r\n $whereSql = '';\r\n $i = 0;\r\n foreach($data as $key=>$val){\r\n $pre = ($i > 0)?', ':'';\r\n $colvalSet .= $pre.$key.\"='\".$val.\"'\";\r\n $i++;\r\n }\r\n if(!empty($conditions)&& is_array($conditions)){\r\n $whereSql .= ' WHERE ';\r\n $i = 0;\r\n foreach($conditions as $key => $value){\r\n $pre = ($i > 0)?' AND ':'';\r\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\r\n $i++;\r\n }\r\n }\r\n $sql = \"UPDATE \".$table.\" SET \".$colvalSet.$whereSql;\r\n $query = $this->db->prepare($sql);\r\n $update = $query->execute();\r\n return $update?$query->rowCount():false;\r\n }else{\r\n return false;\r\n }\r\n }", "function updateTable($final_result){\n\t\t$where = '1';\n\t\t$this->delete($where);\n\n\t\t//update table\n\t\tforeach ($final_result as $key => $value) {\n\t\t\t$row = $this->createRow();\n\t\t\t$row->y =$key;\n\t\t\t$row->x = $value;\n\t\t\t$row->save();\n\t\t}\n\t}", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->getPdo()->commit();\n }\n\n $this->transactions--;\n }", "protected function rewriteData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$fields = array('someval_facebook_valid', 'someval_facebook_type', 'someval_facebook_friends_or_likes',\n\t\t\t\t\t\t'someval_twitter_valid', 'someval_twitter_tweets', 'someval_twitter_followers', 'someval_twitter_following');\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\t\t\t$query = $db->getQuery(true);\n\n\t\t\t$query->update($db->qn('#__accountdata'))\n\t\t\t\t\t->where('bid = ' . $elm->bid);\n\n\t\t\tforeach ($fields as $f)\n\t\t\t{\n\t\t\t\t$query->set($db->qn($f) . ' = ' . $db->q($elm->$f));\n\t\t\t}\n\n\t\t\t$db->setQuery($query);\n\n\t\t\tif (!$db->execute())\n\t\t\t{\n\t\t\t\tLog::add('Something went wrong for bid=:' . $elm->bid);\n\t\t\t}\n\t\t}\n\t}", "public function update($table,$data,$conditions){\n if(!empty($data) && is_array($data)){\n $colvalSet = '';\n $whereSql = '';\n $i = 0;\n \n foreach($data as $key=>$val){\n $pre = ($i > 0)?', ':'';\n $colvalSet .= $pre.$key.\"='\".$val.\"'\";\n $i++;\n }\n if(!empty($conditions)&& is_array($conditions)){\n $whereSql .= ' WHERE ';\n $i = 0;\n foreach($conditions as $key => $value){\n $pre = ($i > 0)?' AND ':'';\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\n $i++;\n }\n }\n $query = \"UPDATE \".$table.\" SET \".$colvalSet.$whereSql;\n $update = $this->db->query($query);\n return $update?$this->db->affected_rows:false;\n }else{\n return false;\n }\n }", "public function update($table,$data,$conditions){\n if(!empty($data) && is_array($data)){\n $colvalSet = '';\n $whereSql = '';\n $i = 0;\n \n foreach($data as $key=>$val){\n $pre = ($i > 0)?', ':'';\n $colvalSet .= $pre.$key.\"='\".$val.\"'\";\n $i++;\n }\n if(!empty($conditions)&& is_array($conditions)){\n $whereSql .= ' WHERE ';\n $i = 0;\n foreach($conditions as $key => $value){\n $pre = ($i > 0)?' AND ':'';\n $whereSql .= $pre.$key.\" = '\".$value.\"'\";\n $i++;\n }\n }\n $query = \"UPDATE \".$table.\" SET \".$colvalSet.$whereSql;\n $update = $this->db->query($query);\n return $update?$this->db->affected_rows:false;\n }else{\n return false;\n }\n }", "public function update(Array $data, $where = array()) {\n if (!is_array($where)) {\n $where = array(self::PRI_INDEX => $where);\n }\n $this->db->update(self::TABLE_NAME, $data, $where);\n $this->db->affected_rows();\n return true;\n }", "public function commit(): void\n {\n $this->eventDispatcher->dispatchPreFlush();\n\n if (\n $this->objectsToPersist === [] &&\n $this->objectsToUpdate === [] &&\n $this->objectsToRemove === []\n ) {\n return; // Nothing to do.\n }\n\n $objects = array_merge(\n $this->objectsToPersist,\n $this->objectsToUpdate,\n $this->objectsToRemove,\n );\n $this->eventDispatcher->dispatchPreFlushLifecycleCallbacks($objects);\n\n $this->eventDispatcher->dispatchOnFlush();\n\n $this->persister->executePersists();\n $this->persister->executeUpdates();\n $this->persister->executeRemoves();\n\n $this->eventDispatcher->dispatchPostFlush();\n\n $this->objectsToPersist = [];\n $this->objectsToUpdate = [];\n $this->objectsToRemove = [];\n $this->objectChangeSets = new ChangeSets();\n }", "function s_m_put_txt_data_update($rows, $ref_id_db_arr, $ref_data, $store_id_db_arr, $store_data){\r\n // if update is needed, use column names in $store_id_db_arr to overwrit with $store_data\r\n for($r = 0; $r < count($rows); $r++){\r\n $update_this = 1;\r\n for($k = 0; $k < count($ref_id_db_arr); $k++){\r\n // notice: only = is supported\r\n if($rows[$r][$ref_id_db_arr[$k]] != $ref_data[$k]){\r\n $update_this = 0;\r\n break;\r\n }\r\n }\r\n if($update_this == 1){\r\n // yes, update (some) columns of this row\r\n for($k = 0; $k < count($store_id_db_arr); $k++){\r\n $rows[$r][$store_id_db_arr[$k]] = $store_data[$k];\r\n }\r\n }\r\n }\r\n return $rows;\r\n}", "public function commonInsertUpdate($table='',$mode='',$excludeArr='',$dataArr='',$condition=''){\n\t\t$inputArr = array();\n\t\tforeach ($this->input->post() as $key => $val){\n\t\t\tif (!in_array($key, $excludeArr)){\n\t\t\t\t$inputArr[$key] = $val;\n\t\t\t}\n\t\t}\n\t\t$finalArr = array_merge($inputArr,$dataArr);\n\t\tif ($mode == 'insert'){\n\t\t\treturn $this->db->insert($table,$finalArr);\n\t\t}else if ($mode == 'update'){\n\t\t\tif(!empty($finalArr)){\n\t\t\t\t$this->db->where($condition);\n\t\t\t\treturn $this->db->update($table,$finalArr);\n\t\t\t}\n\t\t}\n\t}", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n $this->setParamaters();\n\t\t}", "public function processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, $tce) {\n\t\tif ($table == 'tx_czsimplecal_domain_model_event') {\n\t\t\t//if: an event was changed\n\t\t\t$indexer = t3lib_div::makeInstance('Tx_CzSimpleCal_Indexer_Event');\n\t\t\t\n\t\t\tif($status == 'new') {\n\t\t\t\t// if: record is new\n\t\t\t\t$indexer->create($tce->substNEWwithIDs[$id]);\n\t\t\t} elseif($this->haveFieldsChanged(Tx_CzSimpleCal_Domain_Model_Event::getFieldsRequiringReindexing(), $fieldArray)) {\n\t\t\t\t//if: record was updated and a value that requires re-indexing was changed\n\t\t\t\t$indexer->update($id);\n\t\t\t}\n\t\t}\n\t}", "private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }", "public function flush() {\n\t\t$this->last_result = null;\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "public function commit()\n {\n return true;\n }", "function updateFields($table,$postedArray,$condition) \t{\n\t\tforeach($postedArray as $key=>$val){\n\t\t\t$postedArray[$key] = mysql_real_escape_string($postedArray[$key]); \n\t\t}\n\t\treturn $this->update($this->tablePrefix.$table, $postedArray,$condition);\n\t}", "public function commit(){\n\t\t$qUpdate = $this->dbh->prepare($this->modify);\n\t\t$qUpdate->bindValue(':mod',$this->modpath);\n\t\t$qUpdate->execute();\n\t\tif($qUpdate->rowCount() == 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function updateData(array $data);", "public function commit()\n\t{\n $this->neoeloquent->commit();\n\t}", "function UpdateRows() {\n\t\tglobal $Language;\n\t\t$conn = &$this->Connection();\n\t\t$conn->BeginTrans();\n\n\t\t// Get old recordset\n\t\t$this->CurrentFilter = $this->GetKeyFilter();\n\t\t$sSql = $this->SQL();\n\t\t$rsold = $conn->Execute($sSql);\n\n\t\t// Update all rows\n\t\t$sKey = \"\";\n\t\tforeach ($this->RecKeys as $key) {\n\t\t\tif ($this->SetupKeyValues($key)) {\n\t\t\t\t$sThisKey = $key;\n\t\t\t\t$this->SendEmail = FALSE; // Do not send email on update success\n\t\t\t\t$this->UpdateCount += 1; // Update record count for records being updated\n\t\t\t\t$UpdateRows = $this->EditRow(); // Update this row\n\t\t\t} else {\n\t\t\t\t$UpdateRows = FALSE;\n\t\t\t}\n\t\t\tif (!$UpdateRows)\n\t\t\t\tbreak; // Update failed\n\t\t\tif ($sKey <> \"\") $sKey .= \", \";\n\t\t\t$sKey .= $sThisKey;\n\t\t}\n\n\t\t// Check if all rows updated\n\t\tif ($UpdateRows) {\n\t\t\t$conn->CommitTrans(); // Commit transaction\n\n\t\t\t// Get new recordset\n\t\t\t$rsnew = $conn->Execute($sSql);\n\t\t} else {\n\t\t\t$conn->RollbackTrans(); // Rollback transaction\n\t\t}\n\t\treturn $UpdateRows;\n\t}", "public function flushQuery();", "public function update_application($arr_data,$arr_where){\n\n\t\t$this->db->where($arr_where);\n\t\treturn $this->db->update($this->_table,$arr_data);\n\n\t}", "public function commit() {\n $result = parent::commit();\n $this->activeTransaction = false;\n return $result;\n }", "public function commit()\n {\n }", "public function commit()\n {\n }", "private function flush() {\n\t\t$this->_error = '';\n\t\t$this->_last_result = array();\n\t}", "function updateRecords($userData,$result,$database,$table,$where_clause,$where_reference,$remarks)\r\n{\r\n mysql_selectdb($database);\r\n \r\n foreach($userData as $field => $userInfo)\r\n {\r\n \r\n if(\r\n $userInfo > \"\" &&\r\n $field != \"XXX\" &&\r\n $field != \"submit\")\r\n {\r\n \r\n if($userInfo != $result[$field])\r\n {\r\n $query = \"UPDATE `$table` SET `$field` = $userInfo WHERE `$where_clause` = $where_reference\";\r\n $sql = mysql_query($query) or die (\"Bad Query:$query<br>\".mysql_error());\r\n saveSQL($query,$table.'_update.sql',$remarks);\r\n }## CHANGE\r\n }##USERINFO > \"\"\r\n }##FOR EACH \r\n}", "public function update(array $data, $where){\n\n if(null == $where){\n throw new Zend_Exception('No where clause specified');\n }\n\n if ($this->_adapter === null) {\n throw new Zend_Exception('No master adapter specified');\n }\n\n $this->_setAdapter($this->_adapter);\n $numAffectedRows = parent::update($data, $where);\n return $numAffectedRows;\n }", "function update($bd,$where,$data){\n$data_one = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\"=:\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key.\"=:\".$key;\n\t\t}\n\t\t$i++;\n}\nforeach ($where as $key => $value) {\n\t$campo_where = $key;\n\t$value_where = $value;\n}\n $sql = \"UPDATE \".$bd.\" SET \".$data_one.\" WHERE \".$campo_where.\"=\".$value_where.\"\";\n $conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n$stmt = null;\nreturn $dato;\n}" ]
[ "0.576749", "0.5715289", "0.54680413", "0.5444664", "0.5424169", "0.5363721", "0.53413916", "0.5291764", "0.52774066", "0.52626884", "0.5213627", "0.5208665", "0.5202105", "0.518054", "0.51755995", "0.5122708", "0.51213986", "0.51179826", "0.5105358", "0.50979245", "0.50718164", "0.5043782", "0.5037672", "0.50309825", "0.50238955", "0.50238955", "0.50238955", "0.50238955", "0.50238955", "0.4993028", "0.49904308", "0.49846742", "0.49768013", "0.497607", "0.49697882", "0.4960424", "0.4956195", "0.4933773", "0.49319097", "0.49216697", "0.4920884", "0.4920337", "0.49138948", "0.49127325", "0.48949662", "0.48923898", "0.4889622", "0.48797986", "0.48662448", "0.48525316", "0.48517713", "0.48506263", "0.48355183", "0.48283485", "0.48283145", "0.48266026", "0.4820167", "0.48161098", "0.48129153", "0.48129153", "0.48128676", "0.48097178", "0.47970933", "0.47904855", "0.47831714", "0.47823113", "0.47804034", "0.47724745", "0.47711363", "0.47704375", "0.47654992", "0.47651437", "0.4763271", "0.47628492", "0.47606948", "0.4758626", "0.4758316", "0.4758316", "0.47530589", "0.47526008", "0.4745452", "0.47447485", "0.4733787", "0.4729032", "0.47280735", "0.47274727", "0.472501", "0.47239998", "0.4715999", "0.47057265", "0.4691785", "0.46862814", "0.468337", "0.46810827", "0.46787038", "0.46736187", "0.46736187", "0.46730095", "0.46570686", "0.4655916", "0.46558422" ]
0.0
-1
/ Standard base class functions.
public function __get($name) { if ($name === 'insertId') { return $this->insertId; } if ($name === 'lastQuery') { return $this->lastQuery; } if ($name === 'numRows') { return $this->numRows; } return parent::__get($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct()\t{}", "abstract protected function __construct();", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();", "abstract function __construct();", "private function __construct( )\n {\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(){}", "final private function __construct() {}", "final private function __construct() {}", "private function __construct () {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct()\n\t{\n\t\t\n\t}", "final private function __construct(){\r\r\n\t}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "private function __construct()\r\n {}", "private function __construct() {\r\n\t\t\r\n\t}", "private final function __construct() {}", "final function __construct() { \n\t}" ]
[ "0.71504986", "0.706722", "0.69954854", "0.69954854", "0.69954854", "0.6973175", "0.6950263", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69348943", "0.69279206", "0.69279206", "0.69254756", "0.6912597", "0.6912597", "0.6912597", "0.69078296", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.69075054", "0.6905713", "0.6905713", "0.6887999", "0.68677676", "0.68667597", "0.68667597", "0.68667597", "0.68667597", "0.68667597", "0.68667597", "0.68611467", "0.68548024", "0.6853306", "0.6852579" ]
0.0
-1
Get all retrieved rows and store them in an array. If the key of the table is an ID, uses the ID as the array key unless otherwise specified.
public function getResults($keyColumn = false) { $results = array(); if (count($this->keys) == 1 && !$keyColumn) { $keyColumn = $this->keys[0]; } while ($this->nextItem()) { if ($keyColumn) { $results[$this->info[$keyColumn]] = $this->info; } else { $results[] = $this->info; } } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetAllRows() : ARRAY\r\n {\r\n return($this->preparedStatement->fetchAll(\\PDO::FETCH_ASSOC));\r\n }", "function getRows($table_name)\n {\n $sql = sprintf(\"SELECT * FROM %s\", $table_name);\n $rows = array();\n\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n\n return $rows;\n }", "function loadRowList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_array( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row[$key]] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}", "public function array_load_all($table_name) {\n\t\t$array = array();\n\t\t$result = mysqli_query($this->link, \"SELECT * FROM \".$this->db_prefix.$table_name);\n\t\tif ($result) {\n\t\t\twhile($row = mysqli_fetch_assoc($result)) {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public function fetchRowset()\n\t{\n\t\t$this->_query();\n\n\t\treturn $this->stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t}", "public function getAllRows() {\n\t\t$rows = array();\n\t\t\n\t\tfor($x = 0; $x < $this->getNumRows(); $x++) {\n\t\t\t$rows[] = mysqli_fetch_assoc($this->_result);\n\t\t}\n\t\treturn $rows;\n\t}", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "function GetRows()\n {\n $arr = [];\n for ($i = 0, mysqli_data_seek($this->rs, 0); $this->Next(); $i++) $arr[$i] = $this->row;\n return $arr;\n }", "public function getDataFromDb($table) {\r\n $sql_query = \"SELECT * FROM $table\";\r\n $result = $this->mysqli->query($sql_query);\r\n if ($result->num_rows > 0) {\r\n while(($resultArray[] = $result->fetch_assoc())|| array_pop($resultArray));\r\n $result->free();\r\n return $resultArray;\r\n }\r\n }", "public function fetchAll() {\n\t\t$rows = array();//Default\n\t\t//SQL\n\t\t$sql = \"SELECT * FROM `$this->table` WHERE 1 ORDER BY sort_order, uuid ASC\";\n\t\t// excecute SQL statement\n\t\t$result = mysqli_query ( $this->adapter, $sql );\n\t\tif (mysqli_num_rows($result) > 0) {\n\t\t\t// output data of each row\n\t\t\twhile($row = mysqli_fetch_assoc($result)){\n\t\t\t\t$row['done'] = $row['done'] == 0 ? false : true;\n\t\t\t\t$rows[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rows;\t\t\n\t}", "public function getAll(): array\n {\n $this->setReqSql(\"SELECT * FROM {$this->table}\");\n return $this->outCast($this->fetchAll());\n }", "public function getRows()\n {\n \treturn $this->previouslyExecuted->fetch_array(MYSQLI_ASSOC);\n }", "public function fetch_all_array(){\n $data = array();\n while( ($r = oci_fetch_assoc($this->result)) != false ){\n $data[] = $r;\n }\n return $data;\n }", "function query_array($sql, $primary_key = null) {\r\n\r\n\t\t$this->query($sql);\r\n\r\n\t\t$return = array();\r\n\r\n\t\twhile ($row = mysql_fetch_assoc($this->result)) {\r\n\t\t\tif (isset($primary_key) && key_exists($primary_key, $row)) {\r\n\t\t\t\t$return[$row[$primary_key]] = $row;\r\n\t\t\t} else {\r\n\t\t\t\t$return[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public function fetchRow() : array\n\t{\n\t\treturn $this->handle->fetchRow($this->result);\n\t}", "public function getRows();", "public function getRows();", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "public static function find_all(){\n $result = array();\n static::setConnection();\n $keyColumn = static::$keyColumn;\n $table = static::$table;\n $sql = \"SELECT * FROM \".$table.\" ORDER BY \".$keyColumn.\" DESC\";\n $res = mysqli_query(static::$conn,$sql);\n while($row = mysqli_fetch_object($res,get_called_class())){\n $result[] = $row;\n }\n return $result;\n }", "public function rowArray($id = 0) {\n return isset($this->result_array[$id]) ? $this->result_array[$id] : false;\n }", "public function get_all() {\n $sql =<<<SQL\nSELECT id from $this->tableName\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute();\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return $statement->fetch(PDO::FETCH_ASSOC);\n }", "public function getRows()\n {\n return $this->last->fetch_array(MYSQLI_ASSOC);\n \n }", "public function GetSingleRow() : ARRAY\r\n {\r\n return($this->preparedStatement->fetch(\\PDO::FETCH_ASSOC));\r\n }", "public function fetchAll(string $table = null): array\n {\n if($table) {\n $this->table($table);\n }\n $sql = $this->fetchStatement();\n\n $query = $this->query($sql, $this->bindings);\n\n $results = $query->fetchAll();\n\n $this->rows = $query->rowCount();\n\n $this->reset();\n\n return $results;\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \" . self::table . \";\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }", "abstract protected function getRows();", "public function fetch_array()\n\t{\n\t\t$array = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$array[] = $value;\n\t\t\t}\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$array = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $array;\n\t}", "function getAllData($table){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM $table\";\n\t\t\t$query = $this->executeQuery($sql);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}", "public function arrayResultsWithKey($key='id'){\n\t\tif(isset($this->arrayedResult)){\n\t\t\tunset($this->arrayedResult);\n\t\t}\n\t\t$this->arrayedResult = array();\n\t\twhile($row = mysqli_fetch_assoc($this->result)){\n\t\t\tforeach($row as $theKey => $theValue){\n\t\t\t\t$this->arrayedResult[$row[$key]][$theKey] = $theValue;\n\t\t\t}\n\t\t}\n\t\treturn $this->arrayedResult;\n\t}", "abstract public function getRowAsArray();", "abstract public function get_rows();", "public function rows(string $query = null): array;", "public function getResultArray(): array\n {\n if (! empty($this->resultArray)) {\n return $this->resultArray;\n }\n\n // In the event that query caching is on, the result_id variable\n // will not be a valid resource so we'll simply return an empty\n // array.\n if (! $this->isValidResultId()) {\n return [];\n }\n\n if ($this->resultObject) {\n foreach ($this->resultObject as $row) {\n $this->resultArray[] = (array) $row;\n }\n\n return $this->resultArray;\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n\n while ($row = $this->fetchAssoc()) {\n $this->resultArray[] = $row;\n }\n\n return $this->resultArray;\n }", "function getArray( $rID ) {\r\n\t\t\r\n\t\tif( !$this->queried ) {\r\n\t\t\t$this->error( \"Database hasn't been queried yet\" );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ret = array();\r\n\t\twhile( $thing = mysqli_fetch_assoc( $this->results[ $rID ] ) )\r\n\t\t\t$ret[] = $thing;\r\n\t\t\t\r\n\t\treturn $ret;\r\n\t\t\r\n\t}", "function get_rows($database_connection, $table_name) {\r\n\r\n $rows = array();\r\n $sql = \"SELECT * FROM {$table_name}\";\r\n $result = mysqli_query($database_connection, $sql);\r\n\r\n if(mysqli_num_rows($result) > 0) {\r\n while($row = mysqli_fetch_assoc($result)) {\r\n array_push($rows, $row);\r\n }\r\n }\r\n\r\n return $rows;\r\n }", "function getArrayOfRows($dbQuery) {\n return mysqli_fetch_array($dbQuery, MYSQL_ASSOC);\n}", "function getAllRows($query, $params = [])\r\n{\r\n $statement = performQuery($query, $params);\r\n\r\n if ($statement === false) {\r\n return [];\r\n }\r\n\r\n return $statement->fetchAll(PDO::FETCH_ASSOC);\r\n}", "public function table_get_all($table);", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "public function fetchAll()\n {\n $this->execute();\n return $this->dbStmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function get_keyed_rows() {\n\t\tif (!isset($this->keyed_rows)) {\n\t\t\t$this->get_array();\n\t\t\tif (empty($this->header) || empty($this->data)) {\n\t\t\t\t$this->keyed_rows = array();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach ($this->data as $i => $row) {\n\t\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($row as $k => $v) {\n\t\t\t\t\t\t$this->keyed_rows[$i][$this->header[$k]] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->keyed_rows;\n\t}", "public function getMultipleRecords() {\n $i = 0;\n $output = [];\n $_this = $this;\n while($row = $_this->fetchAssoc()){\n $output[\"data\"][$i] = $row;\n $i++;\n }\n return $output;\n }", "function db_select_into_array( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( ! is_object( $this->dataset_obj )) return NULL;\n\n while( $this->db_fetch_next_row() ) {\n $this->dataset_array[] = $this->curr_row_array;\n }\n\n $this->dataset_obj->free(); # We don't need this any more as we have all the same data in an array\n\n return $this->dataset_array;\n }", "public final function rowsArray($table, $where, $limit = -1, $page = 1) \n {\n return AutoRecord::loadRowsWhere($this, $table, $where, $limit, $page);\n }", "protected function tableRows()\n {\n $tbody = DB::table($this->argument('table'))->get();\n\n return $tbody->map(function ($field) {\n return $this->selectRowByField($field);\n });\n }", "public function All()\n {\n $query = \"SELECT * FROM $this->table\";\n $result = $this->query($query);\n return $this->convertArray($result);\n }", "protected function dbFetchAll() {\r\n\r\n //@@TODO RESOURCE CHECK IS_A ?\r\n\r\n $return_array = array();\r\n\r\n while ($row = $this->query_result->fetch_array(MYSQLI_ASSOC)) {\r\n $return_array[] = $this->dbOutArray($row);\r\n }\r\n return $return_array;\r\n }", "public function getData($table, $id = null, $valueId = null)\n {\n if ($id == null && $valueId == null) {\n $query = \"SELECT * FROM \".$table;\n }else{\n $query = \"SELECT * FROM \".$table.\" WHERE $id ='\".$valueId.\"'\";\n }\n\n $result = $this->conn->query($query);\n $rows = [];\n\n while ($row = $result->fetch_object()) {\n $rows[] = $row;\n }\n \n return $rows;\n }", "public function getAllData($table){\n $sql = \"select * from $table\";\n $this->execute($sql);\n if($this->num_rows() == 0){\n $data = 0;\n }\n else {\n while($datas = $this->getData()){\n $data[] = $datas;\n }\n }\n return $data;\n }", "public function getAll()\r\n {\r\n $stmt = $this->conn->prepare(\"SELECT * FROM $this->table ORDER BY id DESC\");\r\n $stmt->execute();\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function fetch_array()\n {\n return mysql_fetch_array($this->_queryResource, MYSQL_ASSOC);\n }", "function GetAllRows($handle = false)\n {\n if ($handle) $handle = $this->_lastHandle;\n $ret = array();\n switch ($this->_DB) {\n case 'mysql':\n while ($row = mysqli_fetch_assoc($handle)) {\n $ret[] = $row;\n }\n break;\n }\n return $ret;\n }", "public function fetchAllToArray()\n {\n $resultSet = $this->getDbTable()->fetchAll()->toArray();\n return $resultSet;\n }", "public function fetchAll(): array\n {\n if (!$this->wasExecuted()) {\n $this->exec();\n }\n\n return $this->getAdapter()->getStatement()->fetchAll(\\PDO::FETCH_ASSOC);\n }", "function getALL(){\n\t\t$result=$this->rstemp;\n\t\t$rows = array();\n\t\twhile($row=mysql_fetch_assoc($result)){\n\t\t\t $rows[]=$row;\n\t\t\t}\n\t\t\treturn $rows;\n\n\t\t\n\t}", "public function selectAll($table){\n $requete = \"SELECT * FROM $table\";\n $result = array();\n foreach($this->_dbh->query($requete) as $raw){\n array_push($result,$raw);\n }\n return $result;\n }", "function fetchAll()\n {\n $rows=array();\n if ($this->consulta)\n {\n //la funcion oci_fetch_array devuelve cada fila de la consulta en forma de array\n while($row = oci_fetch_array($this->consulta, OCI_BOTH))\n { //luego cada fila (como un array) se agrega a otro array... creando un array de 2 dimsnesiones\n $rows[]=$row;\n }\n }\n return $rows;\n }", "public function fetchArray();", "public function fetchArray();", "public function fetchAll($table = null)\n {\n if ($table){\n $this->table = $table;\n }\n\n $sql = $this->fetchStatement();\n\n $query = $this->query($sql , $this->bindings);\n $results = $query->fetchAll();\n $this->rows = $query->rowCount();\n\n $this->reset();\n return $results;\n }", "public function fetchAll($table = null)\n\t{\n\t\tif ($table)\n\t\t{\n\t\t\t$this->table = $table;\n\t\t}\n\t\t\n\t\t$sql = $this->fetchStatement();\n\t\t\n\t\t$query = $this->query($sql, $this->bindings);\n\t\t\n\t\t$results = $query->fetchAll();\n\t\t\n\t\t$this->rows = $query->rowCount();\n\t\t\n\t\t$this->reset();\n\t\t\n\t\treturn $results;\n\t}", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public function fetchArray() : array\n\t{\n\t\treturn $this->handle->fetchArray($this->result);\n\t}", "public function fetchAll($key = '')\n\t{\n\t\t//$this -> error();\n\t\t$dbName = $this -> databaseName;\n\t\treturn $dbName() -> fetchAll($key);\n\t}", "public function fetchAll()\n\t{\n\t\t$aReturn = Array();\n\t\twhile( $oRecord = $this->next() )\n\t\t\tarray_push( $aReturn, $oRecord );\n\t\t$this->rewind();\n\t\treturn $aReturn;\n\t}", "public function get_all()\n {\n $sql = <<<SQL\n SELECT \n pigeon_keys.id as keys_id, pigeon_keys.users_id, profiles.first_name, profiles.last_name, users.username, pigeon_keys.key, pigeon_keys.level, pigeon_keys.date_created\n FROM \n profiles , users, {$this->rest_keys_table} pigeon_keys\n WHERE\n pigeon_keys.users_id = users.id\n AND\n profiles.user_id = users.id\nSQL;\n\n return $this->db->query($sql)->result_array();\n\n }", "function all($table)\n {\n $sql = \"SELECT * FROM $table\";\n $statement = $this->pdo->prepare($sql);\n $statement->execute();\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n }", "public function fetch_all($assoc=MYSQLI_ASSOC){\n\t\t$output=array();\n\t\twhile($row=$this->fetch($assoc)){\n\t\t\t$output[]=$row;\n\t\t}\n\t\t\n\t\t@$this->qresult->data_seek(0);\n\t\t@$this->qresult->field_seek(0);\n\t\t\n\t\treturn $output;\n\t}", "protected function hydrateAllData()\n {\n return $this->_stmt->fetchAll(PDO::FETCH_KEY_PAIR);\n }", "function all($table, $con)\n {\n $sql = \"SELECT * FROM $table\";\n $qry = mysqli_query($con, $sql);\n $res = mysqli_fetch_all($qry, MYSQLI_ASSOC);\n return !empty($res) ? $res : [];\n }", "function getALL(): array\n {\n try {\n if ($this->conn->isConnected()) {\n $sql = 'SELECT * FROM shinycoffee.item';\n $stmt = $this->db->query($sql);\n $stmt->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Item', [0, 0, 0, 0, 0]);\n $stmt->execute();\n $temp = $stmt->fetchAll();\n return $temp;\n }\n } catch (PDOException $e) {\n return [];\n }\n }", "public function getRows($sql,$params = null){\n $result = $this->getResult($sql,$params);\n $rows = [];\n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n\n $result->close();\n\n return $rows;\n }", "public function get_rows() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->rows = $this->get_array();\n\t\t\t// Take out the header\n\t\t\tarray_shift($this->rows);\n\t\t}\n\t\telse {\n\t\t\treset($this->rows);\n\t\t}\n\t\treturn $this->rows;\n\t}", "function database_load_all_assoc($key_column)\n {\n if( !is_resource($this->_last_resource) )\n {\n return FALSE;\n }\n \n $resource = $this->_last_resource;\n $return_data = array();\n while( $data = $this->database_fetch_assoc($resource) )\n {\n $return_data[$data[$key_column]] = $data;\n }\n \n return $return_data;\n\t}", "public function getArray()\n {\n return mysqli_fetch_array($this->resulset);\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "function getRawData($tableName, $tableHeadArr) {\n $getTableDataSqlQuery = \"SELECT * FROM \" . $tableName;\n $sqlResult = oswQuery($getTableDataSqlQuery);\n $allRows = array();\n while ($oneSqlRow = oci_fetch_array($sqlResult)) {\n $oneRow = array();\n foreach ($tableHeadArr as $oneCol) {\n $oneRow[$oneCol] = $oneSqlRow[$tableHeadArr];\n }\n $allRows[] = $oneRow;\n }\n return $allRows;\n }", "public function fetchAll() {\n\n if (!$this->results) {\n\n $this->results = [];\n while ($row = $this->nextRow()) {\n $this->results[] = $row;\n }\n\n }\n\n return $this->results;\n }", "public function get_all() {\n $where = func_get_args();\n $this->_set_where($where);\n\n $this->_callbacks('before_get', array($where));\n\n if ($this->result_mode == 'object') {\n $result = $this->db->get($this->_table())->result();\n } else {\n $result = $this->db->get($this->_table())->result_array();\n }\n\n foreach ($result as &$row) {\n $row = $this->_callbacks('after_get', array($row));\n }\n\n return $result;\n }", "public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }", "public abstract function fetchAll($table);", "function fetch_array()\r\n\t\t{\r\n\t\t\tif ($this->affected_rows <> 0)\r\n\t\t\t{\r\n\t\t\t\t$this->row_data = mysql_fetch_array($this->result);\t\t\r\n\t\t\t}\r\n\t\t}", "public function fetchAll() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = $data;\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "function loadObjectList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_object( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row->$key] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}", "function loadResultArray($numinarray = 0) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_row( $cur )) {\n\t\t\t$array[] = $row[$numinarray];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}", "static function selectAll() : Array {\r\n $selectAll = \"SELECT * FROM Orders;\";\r\n\r\n self::$db->query($selectAll);\r\n self::$db->execute();\r\n return self::$db->resultSet();\r\n }", "function getData($table)\n {\n $record = array();\n $sql = \"select * from $table\";\n $result = $this->conn->prepare($sql);\n $result->execute();\n if ($result->rowCount() > 0) {\n while ($row = $result->fetch(PDO::FETCH_ASSOC)) {\n $record[] = $row;\n }\n return $record;\n } else {\n return $record = false;\n }\n $this->conn = null;\n }", "public function readAllEavData($table, $key, $id)\n {\n $sql = \"SELECT * FROM \".$this->database.\".\".$table.\" WHERE 1 AND \".$key.\" = $id\";\n // echo $sql;\n return $this->query($sql);\n }", "public function fetch_array()\n\t{\n\t\tif($this->num_rows() < 1)\n\t\t\treturn false;\n\n\t\t$data = $this->result_metadata();\n\t\t$fields = array();\n\t\t$out = array();\n\n\t\t$fields[0] = &$this;\n\t\t$count = 0;\n\n\t\twhile($field = $data->fetch_field()) {\n\t\t\t$fields[$count] = &$out[$field->name];\n\t\t\t$count++;\n\t\t}\n\n\t\tcall_user_func_array(array($this, 'bind_result'), $fields);\n\n\t\treturn ($this->fetch()) ? $out : false;\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "public function getAllResult() {\n $rowsArray = array();\n while($row = mysql_fetch_array($this->result)) {\n $rowsArray[] = $row;\n }\n return $rowsArray;\n }", "public function get_rows($table_name,$sql_extra=''){\n\t\tif($this->query(\"SELECT * FROM `$table_name` $sql_extra ;\")){\n\t\t\treturn $this->fetch_all();\n\t\t}\n\t}", "public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}", "public function fetchAll()\r\n {\r\n $this->query();\r\n return $this->sth->fetchAll();\r\n }", "public function getRows($q){ // get array of rows objects\r\t\t$this->connect();\t//connect if not connected \r\t\t$query=$this->query($q);\r\t\t$result=array();\r\t\twhile ($data=sqlite_fetch_object($query)){\r\t\t\t$result[]=$data;\r\t\t}\r\t\treturn $result;\r\t}", "public function fetchArray() {\n return mysqli_fetch_array($this->result);\n }", "public function fetchAll(): array\n {\n $fetchMode = defined('MDB2_FETCHMODE_ASSOC') ? \\MDB2_FETCHMODE_ASSOC : 2;\n $result = $this->_getResult()->fetchAll($fetchMode); // Returns an array on success and an \\PEAR_Error object on failure\n return is_array($result) ? $result : array();\n }", "function fetch_array()\n {\n return mysqli_fetch_array($this->_queryResource);\n }", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "function get_rows($keys,$sql_select='*',$type='array',$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql_where = '';\r\n if ($keys) {\r\n $sql_wheres = array();\r\n foreach ($keys as $key=>$val) {\r\n if (is_array($val)) { //multivalue, handle with sql \"in\" operator\r\n $val2 = array();\r\n foreach ($val as $v) {\r\n if (is_array($v)) die('getrows: array in array does not supported');\r\n $val2[] = \"'$v'\";\r\n }\r\n $val2 = join(',',$val2);\r\n $sql_wheres[] = \"`$key` in ($val2)\";\r\n }\r\n else {\r\n $sql_wheres[] = \"`$key`='$val'\";\r\n }\r\n }\r\n $sql_where = ' where '.join(' and ',$sql_wheres);\r\n }\r\n $sql = 'select '.$sql_select.' from '.$db_table.$sql_where;\r\n\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $rows = array();\r\n if ($type == 'array') {\r\n while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {\r\n $rows[] = $row;\r\n }\r\n }\r\n else {\r\n while ($row = mysql_fetch_row($res)) {\r\n $rows[] = $row;\r\n }\r\n }\r\n return $rows;\r\n }" ]
[ "0.7296987", "0.7132874", "0.7028495", "0.7027521", "0.69747263", "0.69264346", "0.6901102", "0.6841047", "0.6806235", "0.679625", "0.67825735", "0.67781913", "0.67627704", "0.6757009", "0.6750001", "0.6749854", "0.67046726", "0.67046726", "0.6688301", "0.6655022", "0.6647463", "0.6647279", "0.6641138", "0.6633132", "0.6632314", "0.66112936", "0.65804", "0.65719974", "0.65675104", "0.65600884", "0.654711", "0.6535221", "0.65149385", "0.6513741", "0.6513183", "0.65088034", "0.6508055", "0.64785856", "0.6477974", "0.6473973", "0.6460984", "0.6457801", "0.6455278", "0.6454968", "0.6452119", "0.6438251", "0.6437147", "0.643516", "0.6433979", "0.6400216", "0.6399619", "0.6393983", "0.63851386", "0.6380141", "0.63735443", "0.6371209", "0.6365129", "0.63643193", "0.6363531", "0.6363531", "0.6356265", "0.6335037", "0.6322943", "0.6322869", "0.63202727", "0.63200134", "0.6313552", "0.6312834", "0.63086903", "0.6307657", "0.6306658", "0.63025975", "0.62955356", "0.6295415", "0.6292694", "0.62923044", "0.62919736", "0.6291942", "0.6265788", "0.62566954", "0.6256097", "0.6255444", "0.6251808", "0.62515074", "0.6250668", "0.6250641", "0.6247532", "0.62465507", "0.62462366", "0.62366396", "0.62228453", "0.6219426", "0.62152964", "0.6205636", "0.62031674", "0.6191979", "0.61846906", "0.61807656", "0.618042", "0.6178067", "0.6175514" ]
0.0
-1
When only one column is being returned in the results, flatten it into a 1D array of only values from that column.
public static function flattenResults($results, $column) { $newResults = array(); foreach ($results as $result) { $newResults[] = $result[$column]; } return $newResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valuesFlat($column)\n {\n $data = $this->query->select(\n $this->filter,\n $this->order,\n [$column],\n $this->limitOffset,\n PDO::FETCH_NUM\n );\n\n foreach ($data as &$item) {\n $item = $item[0];\n }\n unset($item);\n\n return $data;\n }", "public function scalarArray()\n {\n if($this->result_array) {\n $arr = array();\n $keys = array_keys($this->result_array[0]);\n foreach($this->result_array as $v) {\n $arr[] = $v[$keys[0]];\n }\n return $arr;\n }\n return [];\n }", "function mysql_fetch_array_1d($res) {\n\twhile($row=mysql_fetch_array($res)) {\n\t\tif (!(empty($row[0]))){\n\t\t\t$return[] = $row[0];\n\t\t}\n }\n return $return;\n}", "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "public function getResultOnlyAColumn($column)\n {\n $arr = [];\n $data = $this->queryData();\n while ($row = $data->fetch_assoc()) {\n array_push($arr, $row[$column]);\n }\n Apps_Class_Log::writeFlowLog(\"getResultOnlyAColumn lấy tất cả giá trị của cột \".$column.\" database.php\");\n return $arr;\n }", "public function result_column($column)\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row[$column];\n }\n\n $this->free_result();\n\n return $output;\n }", "protected function _getValues()\n {\n $values = $this->getColumn()->getValues();\n return $this->_converter->toFlatArray($values);\n }", "public function getValues($column)\n\t{\n\t\t$arr = array();\n\t\tforeach($this as $item) {\n\t\t\tif($item->$column !== NULL) {\n\t\t\t\t$arr[(string)$item->$column] = $item->$column;\n\t\t\t}\n\t\t}\n\t\treturn array_values($arr);\n\t}", "public function getRowsAsArray(){\n $fieldNames=$this->getFieldNames();\n $result=[];\n if (!empty($this->valuesRows)){\n foreach($this->valuesRows as $valuesRow){\n $rowArr=[];\n foreach($fieldNames as $i=>$fieldName){\n if (isset($valuesRow[$i])){\n $rowArr[$fieldName]=$valuesRow[$i];\n }\n }\n $result[]=$rowArr;\n }\n }\n return $result;\n }", "public function GetSingleRow() : ARRAY\r\n {\r\n return($this->preparedStatement->fetch(\\PDO::FETCH_ASSOC));\r\n }", "public static function extract(array $array, string $column): array\n {\n if (empty($array)) {\n return [];\n }\n\n $values = array_map(\n fn ($item) => self::getProperty($item, $column),\n $array\n );\n\n $values = array_filter(\n array_unique($values),\n fn ($item) => $item !== null\n );\n\n return array_values($values);\n }", "public function testResultColumnReturnsEmptyArray(): void\n {\n $value = $this->class->result_column('column');\n\n $this->assertIsArray($value);\n $this->assertEmpty($value);\n }", "abstract public function getRowAsArray();", "public function toColumn(): array\n {\n return $this->pdoStatement->fetchAll(\\PDO::FETCH_COLUMN, 0);\n }", "public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "private function getPivotRowArray($column, $array) {\n $list = [];\n foreach ($array AS $key => $value) {\n if($key != $column) {\n $list[] = $value;\n }\n }\n\n unset($array, $key, $value, $column);\n return $list;\n }", "function array_pluck(iterable $arrays, $column): array\n{\n $plucked = [];\n foreach ($arrays as $array) {\n if (is_array($array)) {\n foreach ($array as $key => $value) {\n if ($key === $column) {\n $plucked[] = $value;\n continue 2;\n }\n }\n }\n $plucked[] = null;\n }\n\n return $plucked;\n}", "public function toNonEmptyArray(): array;", "public function pluck($column)\n {\n $columns = func_get_args();\n $argv_count = func_num_args();\n \n $collection = $this->take();\n $values = [];\n \n if ($collection->any()) {\n if ($argv_count == 1) {\n foreach ($collection as $model)\n $values[] = $model->$column;\n } else {\n foreach ($collection as $model) {\n $row_values = [];\n foreach ($columns as $column) {\n $row_values[] = $model->$column;\n }\n $values[] = $row_values;\n }\n }\n }\n \n return $values;\n }", "public function allFlattened(): array;", "public function result_array()\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row;\n }\n\n $this->free_result();\n\n return $output;\n }", "public function resultToArray() {\n $array = array();\n\n if (is_array($this->_result)) {\n foreach ($this->_result as $res) {\n if (is_array($res)) {\n $array[] = $res;\n } else {\n $array[] = $this->fromObjectToArray($res);\n }\n }\n } else {\n $array[] = $this->fromObjectToArray($this->_result);\n }\n\n return $array;\n }", "public function toArray()\n {\n return collect($this->columns)->toArray();\n }", "public function getArray()\n\t{\n\t\treturn $this->row;\n\t}", "public function getCol() : array\n\t{\n\t\treturn $this->fetchAllFromColumn();\n\t}", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "public function fetchAllToArray()\n {\n $resultSet = $this->getDbTable()->fetchAll()->toArray();\n return $resultSet;\n }", "public function getArray()\n {\n return mysqli_fetch_array($this->resulset);\n }", "function sqlToArray($sqlResult){\n $arr = [];\n while ($line = mysqli_fetch_array($sqlResult)) {\n $arr [] = $line[0];\n }\n return $arr;\n}", "public static function collapse($array)\n {\n $results = [];\n\n foreach ($array as $values) {\n if ($values instanceof Collection) {\n $values = $values->all();\n } elseif (!is_array($values)) {\n continue;\n }\n\n $results = array_merge($results, $values);\n }\n\n return $results;\n }", "public function getArrayRows()\n {\n $result = [];\n /** @var \\Magento\\Framework\\Data\\Form\\Element\\AbstractElement */\n $element = $this->getElement();\n $aValue = $element->getValue(); // get values\n if (is_array($aValue) === false) { // no array given? -> value from config.xml\n $aValue = json_decode($aValue, true); // convert string to array\n }\n if ($aValue && is_array($aValue)) {\n foreach ($aValue as $rowId => $row) {\n $rowColumnValues = [];\n foreach ($row as $key => $value) {\n $row[$key] = $value;\n $rowColumnValues[$this->_getCellInputElementId($rowId, $key)] = $row[$key]; // add value the row\n }\n $row['_id'] = $rowId;\n $row['column_values'] = $rowColumnValues;\n $result[$rowId] = new \\Magento\\Framework\\DataObject($row);\n $this->_prepareArrayRow($result[$rowId]);\n }\n }\n return $result;\n }", "public function fetchArray() {\n return mysqli_fetch_array($this->result);\n }", "public function getArrayValues($sql,$params = null){\n $result = $this->getResult($sql,$params);\n $arr = [];\n while ($row = $result->fetch_row()) {\n $arr[] = $row[0];\n }\n\n $result->close();\n\n return $arr;\n }", "public function toArray(): array\n {\n return (array) $this->result();\n }", "public function fetch_array()\n\t{\n\t\t$array = array();\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $value) {\n\t\t\t\t$array[] = $value;\n\t\t\t}\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$array[$key] = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$array = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $array;\n\t}", "public function getResultArray(): array\n {\n if (! empty($this->resultArray)) {\n return $this->resultArray;\n }\n\n // In the event that query caching is on, the result_id variable\n // will not be a valid resource so we'll simply return an empty\n // array.\n if (! $this->isValidResultId()) {\n return [];\n }\n\n if ($this->resultObject) {\n foreach ($this->resultObject as $row) {\n $this->resultArray[] = (array) $row;\n }\n\n return $this->resultArray;\n }\n\n if ($this->rowData !== null) {\n $this->dataSeek();\n }\n\n while ($row = $this->fetchAssoc()) {\n $this->resultArray[] = $row;\n }\n\n return $this->resultArray;\n }", "private function getColumnValues()\n {\n return array_slice($this->_args, 2);\n }", "function resultSet2array($myrst) {\n $resultset = null;\n $row = 0;\n while ($myrow = mysql_fetch_array($myrst)) {\n $col = 0;\n foreach ($myrow as $column) {\n $resultset[$row][$col]=$myrow[$col++];\n }\n $row++;\n }\n return $resultset;\n}", "function pluck($array, $key) {\n $values = array();\n\n foreach ($array as $row) {\n if (isset($row[$key])) {\n // Found a value in this row\n $values[] = $row[$key];\n }\n }\n\n return $values;\n}", "public function GetAllRows() : ARRAY\r\n {\r\n return($this->preparedStatement->fetchAll(\\PDO::FETCH_ASSOC));\r\n }", "public static function collapse($array)\n {\n $results = [];\n\n foreach ($array as $values) {\n if ($values instanceof Collection) {\n $values = $values->all();\n }\n\n $results = array_merge($results, $values);\n }\n\n return $results;\n }", "public function toArray($keepNulls = false, $keepNested = true);", "public function getColumns(): array;", "function distinct_value($conn,$column_name,$table_name,$where)\r\n\t{\r\n\t$result=array();\r\n\t\t$qry=\"SELECT DISTINCT `$column_name` as dis_value FROM `$table_name` $where\";\r\n\t\t$res=mysql_query($qry);\r\n\t while($row=mysql_fetch_array($res))\r\n\t\t{\r\n\t\t$result[]=$row['dis_value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function obtenerArray(){\r\n\t\treturn mysql_fetch_array( $this->rs() );\r\n\t}", "public function fetch_all_array(){\n $data = array();\n while( ($r = oci_fetch_assoc($this->result)) != false ){\n $data[] = $r;\n }\n return $data;\n }", "public static function toArray($result) { \n $data = array();\n while ($row = $result->current()) {\n if (!empty($row)) {\n $data[] = (array) $row;\n }\n $result->next();\n }\n return $data;\n }", "public function toArray($columns=null) {}", "public function fetch_array() {\n\t\treturn $this->FetchArray();\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 getColumns(){\n $rows = array();\n return $rows; \n }", "public function getAsArray();", "function cutColumn($rows, $colname, $addNull = true) {\n $colValues = array();\n for ($i = 0; $i < count($rows); $i++) {\n if (isset($rows[$i][$colname]))\n $colValues[] = $rows[$i][$colname];\n else if ($addNull) $colValues[] = null;\n }\n return $colValues;\n}", "function cutColumn($rows, $colname, $addNull = true) {\n $colValues = array();\n for ($i = 0; $i < count($rows); $i++) {\n if (isset($rows[$i][$colname]))\n $colValues[] = $rows[$i][$colname];\n else if ($addNull) $colValues[] = null;\n }\n return $colValues;\n}", "public function toArray(): array\n {\n $output = $this->data;\n $output = $this->filterNotItems($output);\n $output = $this->filterOnlyItems($output);\n $output = $this->filterEmpty($output);\n $output = $this->executeConvertEmpty($output);\n $output = $this->filterTemplate($output);\n return $this->pluckItems($output);\n }", "public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }", "public function toMergedArray(): array;", "function distinctOptionsInColumn($csvArray) {\n\n $distinctValuesArray = array();\n\n for($i = 0; $i < count($csvArray) ; $i++) {\n if($csvArray[$i][0] != NULL && $csvArray[$i][0] != \"\" && trim($csvArray[$i][0]) != \"\" && trim($csvArray[$i][0]) != NULL)\n array_push($distinctValuesArray, $csvArray[$i][0]);\n }\n\n $distinctValuesArray = array_unique($distinctValuesArray);\n $tempArray = array();\n foreach ($distinctValuesArray as $key => $value) {\n array_push($tempArray, $value);\n }\n\n $distinctValuesArray = $tempArray;\n\n return $distinctValuesArray;\n}", "public function getDataAllColumns() : array{\n\n $columns = [];\n foreach ($this->configs->fields as $k => $value) {\n $columns[$k] = array_column($this->model->getValuesColumn($value),$value);\n }\n return $columns;\n }", "function convertToArray( $result ){\n $resultArray = array();\n\n for( $count=0; $row = $result->fetch_assoc(); $count++ ) {\n $resultArray[$count] = $row;\n }\n\n return $resultArray;\n }", "public function getResultArray() : ?array{\n return $this->results;\n }", "static function result2Array(&$result) {\n $return_array = array();\n if (@mysql_num_rows($result) != 0) {\n while ($row = mysql_fetch_assoc($result)) {\n $keys = array_keys($row);\n $return_array[] = $row[$keys[0]];\n }\n mysql_free_result($result);\n }\n return $return_array;\n }", "function resultToArray($result) {\n $rows = array();\n while($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n return $rows;\n }", "public function getColumnData($column = null)\n\t{\n\t\tif (!in_array($column, $this->productColumns)) return \"Request not a tablecolumn\";\n\t\n\t\t$results = [];\n\n\t\t$stmt = $this->pdo->prepare(\"SELECT DISTINCT $column FROM product LIMIT 10\");\n\n\t\ttry {\n\t\t\t$stmt->execute();\n\t\t\t$db_column_select = $stmt->fetchAll();\n\t\t\tforeach ($db_column_select as $k => $row) {\n\t\t\t\t$results['columnData'][] = $row[$column];\n\t\t\t}\n\t\t\treturn $results; \n\t\t} catch (PDOException $Exception) {\n\t\t\tthrow new MyDatabaseException( $Exception->getMessage(), (int)$Exception->getCode() );\n\t\t}\n\n\t}", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function fetchAllFromColumn(int $column = 0) : array\n\t{\n\t\treturn $this->handle->fetchAllFromColumn($this->result, $column);\n\t}", "function FetchArray() {\n\t\t\t$this->ConnectServer();\n\t\t\t$array = pg_fetch_array($this->result, NULL, PGSQL_ASSOC);\n\t\t\t$this->DisconnectServer();\n\t\t\treturn $array;\n\t\t}", "protected abstract function getSourceDataAsArray(): ?array;", "public function result_array()\n\t{\n\t\tif (count($this->result_array) > 0)\n\t\t{\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (count($this->result_object) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->result_object); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$this->result_array[$i] = (array) $this->result_object[$i];\n\t\t\t}\n\n\t\t\treturn $this->result_array;\n\t\t}\n\t\telseif (is_array($this->row_data))\n\t\t{\n\t\t\tif (count($this->row_data) === 0)\n\t\t\t{\n\t\t\t\treturn $this->result_array;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row_index = count($this->row_data);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row_index = 0;\n\t\t\t$this->row_data = array();\n\t\t}\n\n\t\t$row = NULL;\n\t\twhile ($row = $this->_fetch_assoc())\n\t\t{\n\t\t\t$this->row_data[$row_index++] = $row;\n\t\t}\n\n\t\t// Un-comment the following line, in case it becomes needed\n\t\t// $this->_data_seek();\n\t\treturn $this->result_array = $this->row_data;\n\t}", "public function getToArrayValuesNotNull()\r\n\t\t{\r\n\t\t\t$arrayValues = $this->getToArrayValues();\r\n\t\t\t$arrayValues = $this->OutNullArray($arrayValues);\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "function sql_new_fetch_into_array($query) {\n\treturn sql_fetch_column($query);\n}", "public function convertArray($PDOResult)\n {\n while ($row = $PDOResult->fetch(PDO::FETCH_ASSOC)) {\n $this->array[] = $row;\n }\n return $this->array;\n }", "public function first(){\n return (!empty($this->_result)) ? $this->_result[0] : [];\n }", "function get_values ($resultset) {\n\t\t$data = array();\n\t\tfor ($i=0; $i<mysqli_num_rows($resultset); $i++) {\n\t\t\t$row = mysqli_fetch_assoc($resultset);\n\t\t\tarray_push($data,$row);\n\t\t}\n\t\treturn $data;\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 }", "public function toColumn() {\r\n\t\treturn $this->PDOStatement->fetchAll(PDO::FETCH_COLUMN,0);\r\n\t}", "public function get_array_of($result, $field ){\n\t\t\t$arr = array();\n\t\t\tif(is_array($field)) {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\t$temp_arr = array();\n\t\t\t\t\tforeach($field as $temp_field){\n\t\t\t\t\t\t//array_push($temp_arr, $row[$temp_field]);\n\t\t\t\t\t\t$temp_arr[$temp_field] = $row[$temp_field];\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($arr, $temp_arr);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}else {\n\t\t\t\twhile($row = mysql_fetch_array($result)){\n\t\t\t\t\tarray_push($arr, $row[$field]);\n\t\t\t\t}\n\t\t\t\treturn $arr;\n\t\t\t}\n\t\t}", "public function toEntityArray()\n {\n $return = [];\n foreach ($this as $row) {\n $return[] = $row;\n }\n return $return;\n }", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; is_array($this->last_result) && $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "function db_result_to_array($result) {\n $res_array = array();\n \n for ($count=0; $row = $result->fetch_assoc(); $count++) {\n $res_array[$count] = $row;\n }\n \n return $res_array;\n }", "public function getValues($row){\n $data = array();\n while( ($obj = oci_fetch_assoc($this->result)) != false ){\n $data[] = $obj[$row];\n }\n return $data;\n }", "public function asArray() {\n\t\treturn $this->_sth->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function results()\n {\n //by default data get as array/stdclasses\n\n // to trunit to arrays of arrays\n // return json_decode(json_encode($this->_results), true);\n return $this->_results;\n // gives array data with column name and itsvalue not index array\n }", "function resultToArray($result) {\n\t\t$rows = array();\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$rows[] = $row;\n\t\t}\n\t\treturn $rows;\n\t}", "function pluck($col, $array)\n{\n $res = array();\n foreach ($array as $k => $row) {\n $res[$k] = $row[$col];\n }\n return $res;\n}", "public function fetch(){\n\n $rows = [];\n\n while($row = $this->result->fetch(PDO::FETCH_ASSOC)) {\n $rows[]=$row;\n }\n\n $this->result=null;\n\n return $rows;\n\n }", "function db_result_to_array($result) {\r\n $res_array = array();\r\n\r\n for ($count = 0; $row = $result->fetch_assoc(); $count++) {\r\n $res_array[$count] = $row;\r\n }\r\n return $res_array;\r\n }", "public function fetchArray() : array\n\t{\n\t\treturn $this->handle->fetchArray($this->result);\n\t}", "function array_pluck($array, $column) {\n return array_map(function($obj) use ($column) {\n return isset($obj[$column]) ? $obj[$column] : null;\n }, $array);\n}", "private function getPivotArray($column = null, $row = null) {\n $list = [];\n foreach ($this->array AS $key => $value) {\n if($key != $row) {\n $list[] = $this->getPivotRowArray($column, $value);\n }\n }\n\n unset($key, $value);\n return ['pivot' => $this->array[$row][$column], 'adj' => ['array' => $list, 'result' => (new self($list))->getResult()]];\n }", "public function toArray(): array\n {\n $data = [];\n foreach ($this->table as $y => $Vector) {\n $data[$y] = $Vector->toArray();\n }\n return $data;\n }", "public function toArray() {\n $return = array();\n foreach($this as $value) {\n $return[] = $value;\n }\n return $return;\n }", "public static function col($query = null , $x = 0) {\n $query && self::query($query);\n $new_array = array();\n // Extract the column values\n for ( $i=0; $i < count(self::$last_result); $i++ ) {\n $new_array[$i] = self::value(null, $x, $i);\n }\n return $new_array;\n }", "function array_flatten($array)\n\t{\n\t\t$return = array();\n\n\t\tarray_walk_recursive($array, function($x) use (&$return) { $return[] = $x; });\n\n\t\treturn $return;\n\t}" ]
[ "0.7277876", "0.6710271", "0.6674784", "0.6564006", "0.6530707", "0.63191986", "0.6316958", "0.62488335", "0.617803", "0.6157886", "0.60896796", "0.60742337", "0.60679305", "0.5965105", "0.5961317", "0.5960217", "0.5949252", "0.5894487", "0.5859114", "0.58452016", "0.5836234", "0.58348924", "0.58244395", "0.5803713", "0.5795852", "0.57774043", "0.57554466", "0.57238543", "0.57217497", "0.57217014", "0.5694209", "0.569048", "0.5688842", "0.568556", "0.56670564", "0.5666988", "0.5653936", "0.5644987", "0.5631446", "0.56254727", "0.5619522", "0.5600192", "0.5590444", "0.5574548", "0.5565689", "0.5564177", "0.55450225", "0.5541979", "0.5539777", "0.5522308", "0.5520032", "0.5507758", "0.55027145", "0.5500847", "0.5500847", "0.5498152", "0.5497227", "0.5492966", "0.5481733", "0.5476193", "0.5472672", "0.5464025", "0.54636854", "0.54616237", "0.5461473", "0.5452713", "0.5452713", "0.5452713", "0.5452713", "0.5452713", "0.5452713", "0.5452628", "0.54513764", "0.5451296", "0.5439086", "0.54329264", "0.5428597", "0.54261863", "0.5423934", "0.54197794", "0.5419732", "0.5410525", "0.54103035", "0.5409907", "0.54035354", "0.5401069", "0.539604", "0.5389236", "0.5388558", "0.538838", "0.5387466", "0.5385795", "0.5384823", "0.53808624", "0.53730595", "0.53689706", "0.5368349", "0.53674406", "0.5366595", "0.5366372" ]
0.6690043
2
Relation with episodes, 1 movie many episodes
public function episodes() { return $this->hasMany(Episode::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function episodes()\n {\n return $this->hasMany('App\\Models\\Episode');\n }", "public function episodes()\n {\n return $this->hasMany('App\\Episode','tvmazeid','tvmazeid');\n }", "public function movies()\n {\n return $this->hasMany('App\\Movie');\n }", "public function moviesDirected(){\n return $this->belongsToMany('App\\Movie', 'director_movie', 'id_director', 'id_movie'); \n }", "public function moviesActed(){\n return $this->belongsToMany('App\\Movie', 'actor_movie', 'id_actor', 'id_movie'); \n }", "public function movies()\n {\n return $this->belongsToMany('App\\Core\\Movies\\Movie');\n }", "public function actors()\n {\n return $this->hasMany(Actor_Movie::class);\n }", "public function videos()// minuscula_plural_modeloforeano\n {\n return $this->hasMany('App\\Video');//direccion modeloforeano\n }", "public function downloads() {\n\t\treturn $this->hasMany('\\App\\Models\\Download', 'episode_id', 'id');\n\t}", "public function videos()\n {\n return $this->hasMany('App\\Video');\n }", "public function movie()\n {\n return $this->belongsTo('App\\Movie');\n }", "public function videos()\n {\n return $this->hasMany('App\\Video', 'artist');\n }", "public function film() {\n return $this->hasOne('Movie');\n }", "public function movie()\n {\n return $this->belongsTo('App\\Movie');\n }", "public function movie()\n {\n return $this->belongsTo(Movie::class);\n }", "public function movie()\n {\n return $this->belongsTo(Movie::class);\n }", "public function videos()\n {\n return $this->hasManyThrough('App\\Video', 'App\\Modulo');\n }", "public function videos()//minuscula_plural_modeloforaneo\n {\n return $this->hasMany('App\\Video');//direccion de modeloforaneo\n }", "public function movies()\n {\n return $this->morphedByMany('App\\Movie', 'source_genre');\n }", "public function getMovies()\n {\n return $this->hasOne(Movies::className(), ['id' => 'movies_id']);\n }", "public function movies()\n {\n return $this->belongsToMany(Movie::class, 'movie_genre')->withTimestamps();\n }", "public function views()\n {\n $lastYear = Carbon::now()\n ->addMonth()\n ->startOfMonth()\n ->subYear();\n\n return $this->hasMany(EpisodeView::class)\n ->where('created_at', '>=', $lastYear);\n }", "public function run()\n {\n //Episode Movie\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Hiding'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Bold'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episodes'=> 'Episode 4',\n 'title'=> 'I Am Home'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Love'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Goodbye'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Hello'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episodes'=> 'Episode 3',\n 'title'=> 'The Bride'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episodes'=> 'Episode 4',\n 'title'=> 'The Sword'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Tan'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Twist'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Children'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Book'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episodes'=> 'Episode 4',\n 'title'=> 'You'\n ]);\n //Episode Kids\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Movie'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Ending'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Sponge'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Patrick'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episodes'=> 'Episode 4',\n 'title'=> 'Squidward'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episodes'=> 'Episode 2',\n 'title'=> 'King Bob'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episodes'=> 'Episode 3',\n 'title'=> 'SuperVillain'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Fairies'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Crocker'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Naruto'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Sasuke'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episodes'=> 'Episode 4',\n 'title'=> 'End'\n ]);\n //Episode tv Show\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Twist'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Phoebe'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episodes'=> 'Episode 4',\n 'title'=> 'Ending'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Missing'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episodes'=> 'Episode 3',\n 'title'=> 'i am back'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Lightning Struck'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episodes'=> 'Episode 3',\n 'title'=> 'I Am FLASH'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episodes'=> 'Episode 4',\n 'title'=> 'Lights out'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Beginning'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Runningman Forever'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episodes'=> 'Episode 4',\n 'title'=> 'New Member'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episodes'=> 'Episode 1',\n 'title'=> 'Pilot'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episodes'=> 'Episode 2',\n 'title'=> 'Brother'\n ]);\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episodes'=> 'Episode 3',\n 'title'=> 'Special Guest'\n ]);\n }", "public function emotion()\n {\n return $this->belongsTo(Emotion::class);\n }", "public function videos()\n {\n \treturn $this->belongsToMany( Video::class );\n }", "public function setVideoEpisode($attributes = []);", "public function actors()\n {\n return $this->belongsToMany(Actor::class, 'film_actor', 'film_id', 'actor_id');\n }", "public function getEpisodes()\n {\n $episodes = [];\n $episode_ids = [];\n $key = self::$prefix['id'].$this->id.\":episodes\";\n\n if (Cache::exists($key)) {\n $episode_ids = Cache::fetch($key);\n foreach ($episode_ids as $episode_id) {\n $episodes[] = CartoonEpisode::get($episode_id);\n }\n } else {\n if ($data = Functions::api_fetch(\"/cartoon/$this->id/episodes\")) {\n foreach ($data as $episode) {\n $episode_ids[] = $episode->id;\n $episodes[] = new CartoonEpisode($episode);\n }\n if($this->status === 'ongoing'){\n Cache::save($key, $episode_ids, DEFAULT_EXPIRE_TIME);\n } else {\n Cache::save($key, $episode_ids);\n }\n }\n }\n return $episodes;\n }", "public function esport()\n {\n return $this->belongsTo('App\\Esport','title'); // FK title references id\n }", "public function videos()\n\t{\n\t\treturn $this->hasMany('App\\PropertyVideos');\n\t}", "public function getEpisodes(){\n $result = array();\n $episodes = $this->getEpisodeIds();\n if($episodes){\n foreach ($episodes as $Id):\n $episode = $this->getEpisode($Id);\n array_push($result, $episode);\n endforeach;\n return $result;\n }\n else{return false;}\n }", "public function testEpisodechannelRelationship()\n {\n $this->createUser(1);\n $this->createChannel();\n $episode = $this->createEpisode();\n\n $this->assertEquals($episode->channel_id, $episode->channel->id);\n }", "public function run()\n {\n DB::table('episodes')->insert([\n ['movie_id' => 1, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 1, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 1, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 1, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 1, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 1, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 1, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 1, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 1, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 1, 'episode' => 10, 'title' => 'Episode 10'],\n ['movie_id' => 1, 'episode' => 11, 'title' => 'Episode 11'],\n ['movie_id' => 1, 'episode' => 12, 'title' => 'Episode 12'],\n ['movie_id' => 1, 'episode' => 13, 'title' => 'Episode 13'],\n ['movie_id' => 1, 'episode' => 14, 'title' => 'Episode 14'],\n ['movie_id' => 1, 'episode' => 15, 'title' => 'Episode 15'],\n ['movie_id' => 1, 'episode' => 16, 'title' => 'Episode 16'],\n\n ['movie_id' => 2, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 2, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 2, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 2, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 2, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 2, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 2, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 2, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 2, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 2, 'episode' => 10, 'title' => 'Episode 10'],\n ['movie_id' => 2, 'episode' => 11, 'title' => 'Episode 11'],\n ['movie_id' => 2, 'episode' => 12, 'title' => 'Episode 12'],\n ['movie_id' => 2, 'episode' => 13, 'title' => 'Episode 13'],\n ['movie_id' => 2, 'episode' => 14, 'title' => 'Episode 14'],\n\n ['movie_id' => 3, 'episode' => 1, 'title' => 'Pilot'],\n ['movie_id' => 3, 'episode' => 2, 'title' => 'Ice Pick'],\n ['movie_id' => 3, 'episode' => 3, 'title' => 'Angel of Mercy'],\n ['movie_id' => 3, 'episode' => 4, 'title' => 'Angel of Mercy: Part Two'],\n ['movie_id' => 3, 'episode' => 5, 'title' => 'The Dance'],\n ['movie_id' => 3, 'episode' => 6, 'title' => 'Got No Strings'],\n ['movie_id' => 3, 'episode' => 7, 'title' => 'The Bucket List'],\n ['movie_id' => 3, 'episode' => 8, 'title' => 'Mildred and Edmund'],\n\n ['movie_id' => 4, 'episode' => 1, 'title' => 'Pilot'],\n ['movie_id' => 4, 'episode' => 2, 'title' => 'Start-up'],\n ['movie_id' => 4, 'episode' => 3, 'title' => 'Angel'],\n ['movie_id' => 4, 'episode' => 4, 'title' => 'Family'],\n ['movie_id' => 4, 'episode' => 5, 'title' => 'Friends'],\n ['movie_id' => 4, 'episode' => 6, 'title' => 'Sandbox'],\n ['movie_id' => 4, 'episode' => 7, 'title' => 'I Love You'],\n ['movie_id' => 4, 'episode' => 8, 'title' => 'Release'],\n\n ['movie_id' => 5, 'episode' => 1, 'title' => 'Friendship'],\n ['movie_id' => 5, 'episode' => 2, 'title' => 'Magic'],\n ['movie_id' => 5, 'episode' => 3, 'title' => 'Ice Cream'],\n ['movie_id' => 5, 'episode' => 4, 'title' => 'Fashion'],\n ['movie_id' => 5, 'episode' => 5, 'title' => 'Sundaes'],\n ['movie_id' => 5, 'episode' => 6, 'title' => 'Sunshine'],\n ['movie_id' => 5, 'episode' => 7, 'title' => 'Moonlight'],\n ['movie_id' => 5, 'episode' => 8, 'title' => 'Princess Duties'],\n ['movie_id' => 5, 'episode' => 9, 'title' => 'Royal Family'],\n ['movie_id' => 5, 'episode' => 10, 'title' => 'Birthday Surprise'],\n\n ['movie_id' => 6, 'episode' => 1, 'title' => 'Mickey'],\n ['movie_id' => 6, 'episode' => 2, 'title' => 'Minnie'],\n ['movie_id' => 6, 'episode' => 3, 'title' => 'Donald Duck'],\n ['movie_id' => 6, 'episode' => 4, 'title' => 'Daisy'],\n ['movie_id' => 6, 'episode' => 5, 'title' => 'Goofy'],\n ['movie_id' => 6, 'episode' => 6, 'title' => 'Clarabel'],\n ['movie_id' => 6, 'episode' => 7, 'title' => 'Pluto'],\n ['movie_id' => 6, 'episode' => 8, 'title' => 'Mickey & Friends'],\n\n ['movie_id' => 7, 'episode' => 1, 'title' => 'Boss'],\n ['movie_id' => 7, 'episode' => 2, 'title' => 'Baby'],\n ['movie_id' => 7, 'episode' => 3, 'title' => 'Back in Business'],\n ['movie_id' => 7, 'episode' => 4, 'title' => 'Pacifier'],\n ['movie_id' => 7, 'episode' => 5, 'title' => 'Grandparents'],\n ['movie_id' => 7, 'episode' => 6, 'title' => 'Friends and Foes'],\n ['movie_id' => 7, 'episode' => 7, 'title' => 'Milkshake'],\n ['movie_id' => 7, 'episode' => 8, 'title' => 'Cat Trouble'],\n ['movie_id' => 7, 'episode' => 9, 'title' => 'Suits'],\n ['movie_id' => 7, 'episode' => 10, 'title' => 'Little People'],\n\n ['movie_id' => 8, 'episode' => 1, 'title' => 'Meet the Babies'],\n ['movie_id' => 8, 'episode' => 2, 'title' => 'Sing A Long'],\n ['movie_id' => 8, 'episode' => 3, 'title' => 'Playtime'],\n ['movie_id' => 8, 'episode' => 4, 'title' => 'Outer Space'],\n ['movie_id' => 8, 'episode' => 5, 'title' => 'Lullaby'],\n ['movie_id' => 8, 'episode' => 6, 'title' => 'Colorful Day'],\n ['movie_id' => 8, 'episode' => 7, 'title' => 'Rainy Weather'],\n\n ['movie_id' => 9, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 9, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 9, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 9, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 9, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 9, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 9, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 9, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 9, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 9, 'episode' => 10, 'title' => 'Episode 10'],\n ['movie_id' => 9, 'episode' => 11, 'title' => 'Episode 11'],\n ['movie_id' => 9, 'episode' => 12, 'title' => 'Episode 12'],\n ['movie_id' => 9, 'episode' => 13, 'title' => 'Episode 13'],\n\n ['movie_id' => 10, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 10, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 10, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 10, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 10, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 10, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 10, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 10, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 10, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 10, 'episode' => 10, 'title' => 'Episode 10'],\n\n ['movie_id' => 11, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 11, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 11, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 11, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 11, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 11, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 11, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 11, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 11, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 11, 'episode' => 10, 'title' => 'Episode 10'],\n ['movie_id' => 11, 'episode' => 11, 'title' => 'Episode 11'],\n ['movie_id' => 11, 'episode' => 12, 'title' => 'Episode 12'],\n\n ['movie_id' => 12, 'episode' => 1, 'title' => 'Episode 1'],\n ['movie_id' => 12, 'episode' => 2, 'title' => 'Episode 2'],\n ['movie_id' => 12, 'episode' => 3, 'title' => 'Episode 3'],\n ['movie_id' => 12, 'episode' => 4, 'title' => 'Episode 4'],\n ['movie_id' => 12, 'episode' => 5, 'title' => 'Episode 5'],\n ['movie_id' => 12, 'episode' => 6, 'title' => 'Episode 6'],\n ['movie_id' => 12, 'episode' => 7, 'title' => 'Episode 7'],\n ['movie_id' => 12, 'episode' => 8, 'title' => 'Episode 8'],\n ['movie_id' => 12, 'episode' => 9, 'title' => 'Episode 9'],\n ['movie_id' => 12, 'episode' => 10, 'title' => 'Episode 10'],\n ['movie_id' => 12, 'episode' => 11, 'title' => 'Episode 11'],\n ['movie_id' => 12, 'episode' => 12, 'title' => 'Episode 12'],\n ['movie_id' => 12, 'episode' => 13, 'title' => 'Episode 13'],\n ['movie_id' => 12, 'episode' => 14, 'title' => 'Episode 14'],\n ['movie_id' => 12, 'episode' => 15, 'title' => 'Episode 15'],\n ]);\n }", "public function show($movieid)\n {\n \n //$movie = Movie::find(1);\n //$movie->cinema()->attach(3);\n\n\n $movie = Movie::find($movieid);\n\n foreach ($movie->cinema as $cinema) {\n echo $cinema->name;\n \n }\n\n \n }", "public function films()\n {\n return $this->hasMany('App\\Film');\n }", "public function videos()\n {\n \treturn $this->belongsToMany('App\\Video')->withTimeStamps();\n }", "public function run()\n { \n // ================================= Drama ================================= //\n //================================== Episode 1 Movie 1 ================================= //\n // for($i = 1; $i <= 9 ; $i++){\n // for($j = 1; $j <= 4 ; $j++){\n \n // ]);\n // }\n // }\n \n\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 1,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 2,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 3,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 4,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 5,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 6,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 7,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 8,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 9,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 10,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 11,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 12,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 13,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 14,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 15,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 16,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 16,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 16,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 16,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' => 17,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 17,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 17,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 17,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n\n\n DB::table('episodes')->insert([\n 'movie_id' =>18,\n 'episode' => 'Episode 1',\n 'title' => 'New Story 1'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 18,\n 'episode' => 'Episode 2',\n 'title' => 'New Story 2'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 18,\n 'episode' => 'Episode 3',\n 'title' => 'New Story 3'\n ]);\n\n DB::table('episodes')->insert([\n 'movie_id' => 18,\n 'episode' => 'Episode 4',\n 'title' => 'New Story 4'\n ]);\n }", "public function getEpisodeById($id) \n { \n return $this->get('/episodes/'.$id);\n }", "public function run()\n {\n DB::table('episodes')->insert([\n ['movie_id' => 1, 'episode' => 'Episode 1', 'title' => 'The Boy Who Fed on Nightmares'],\n ['movie_id' => 1, 'episode' => 'Episode 2', 'title' => 'The Lady in Red Shoes'],\n ['movie_id' => 1, 'episode' => 'Episode 3', 'title' => 'Sleeping Witch'],\n ['movie_id' => 1, 'episode' => 'Episode 4', 'title' => 'Zombie Kid'],\n ['movie_id' => 1, 'episode' => 'Episode 5', 'title' => 'Rapunzel and the Cursed Castle'],\n ['movie_id' => 1, 'episode' => 'Episode 6', 'title' => 'Bluebeard\\'s Secret'],\n ['movie_id' => 1, 'episode' => 'Episode 7', 'title' => 'The Cheerful Dog'],\n ['movie_id' => 1, 'episode' => 'Episode 8', 'title' => 'Beauty and the Beast'],\n ['movie_id' => 1, 'episode' => 'Episode 9', 'title' => 'King Donkey Ears'],\n ['movie_id' => 1, 'episode' => 'Episode 10', 'title' => 'The Girl Who Cried Wolf'],\n ['movie_id' => 2, 'episode' => 'Episode 1', 'title' => 'Episode 1'],\n ['movie_id' => 2, 'episode' => 'Episode 2', 'title' => 'Episode 2'],\n ['movie_id' => 2, 'episode' => 'Episode 3', 'title' => 'Episode 3'],\n ['movie_id' => 2, 'episode' => 'Episode 4', 'title' => 'Episode 4'],\n ['movie_id' => 2, 'episode' => 'Episode 5', 'title' => 'Episode 5'],\n ['movie_id' => 2, 'episode' => 'Episode 6', 'title' => 'Episode 6'],\n ['movie_id' => 2, 'episode' => 'Episode 7', 'title' => 'Episode 7'],\n ['movie_id' => 2, 'episode' => 'Episode 8', 'title' => 'Episode 8'],\n ['movie_id' => 2, 'episode' => 'Episode 9', 'title' => 'Episode 9'],\n ['movie_id' => 2, 'episode' => 'Episode 10', 'title' => 'Episode 10'],\n ['movie_id' => 3, 'episode' => 'Episode 1', 'title' => 'Episode 1'],\n ['movie_id' => 3, 'episode' => 'Episode 2', 'title' => 'Episode 2'],\n ['movie_id' => 3, 'episode' => 'Episode 3', 'title' => 'Episode 3'],\n ['movie_id' => 3, 'episode' => 'Episode 4', 'title' => 'Episode 4'],\n ['movie_id' => 3, 'episode' => 'Episode 5', 'title' => 'Episode 5'],\n ['movie_id' => 3, 'episode' => 'Episode 6', 'title' => 'Episode 6'],\n ['movie_id' => 3, 'episode' => 'Episode 7', 'title' => 'Episode 7'],\n ['movie_id' => 3, 'episode' => 'Episode 8', 'title' => 'Episode 8'],\n ['movie_id' => 3, 'episode' => 'Episode 9', 'title' => 'Episode 9'],\n ['movie_id' => 3, 'episode' => 'Episode 10', 'title' => 'Episode 10'],\n ['movie_id' => 4, 'episode' => 'Episode 1', 'title' => 'Start-Up'],\n ['movie_id' => 4, 'episode' => 'Episode 2', 'title' => 'Family, Friends, Fools'],\n ['movie_id' => 4, 'episode' => 'Episode 3', 'title' => 'Angel'],\n ['movie_id' => 4, 'episode' => 'Episode 4', 'title' => 'Sandbox'],\n ['movie_id' => 5, 'episode' => 'Episode 1', 'title' => 'Episode 1'],\n ['movie_id' => 5, 'episode' => 'Episode 2', 'title' => 'Episode 2'],\n ['movie_id' => 5, 'episode' => 'Episode 3', 'title' => 'Episode 3'],\n ['movie_id' => 5, 'episode' => 'Episode 4', 'title' => 'Episode 4'],\n ['movie_id' => 5, 'episode' => 'Episode 5', 'title' => 'Episode 5'],\n ['movie_id' => 5, 'episode' => 'Episode 6', 'title' => 'Episode 6'],\n ['movie_id' => 5, 'episode' => 'Episode 7', 'title' => 'Episode 7'],\n ['movie_id' => 5, 'episode' => 'Episode 8', 'title' => 'Episode 8'],\n ['movie_id' => 5, 'episode' => 'Episode 9', 'title' => 'Episode 9'],\n ['movie_id' => 5, 'episode' => 'Episode 10', 'title' => 'Episode 10'],\n ['movie_id' => 6, 'episode' => 'Movie', 'title' => 'The Boss Baby'],\n ['movie_id' => 7, 'episode' => 'Movie', 'title' => 'Frozen'],\n ['movie_id' => 8, 'episode' => 'Movie', 'title' => 'Frozen 2'],\n ['movie_id' => 9, 'episode' => 'Movie', 'title' => 'Despicable Me'],\n ['movie_id' => 10, 'episode' => 'Movie', 'title' => 'Kung Fu Panda 3'],\n ['movie_id' => 11, 'episode' => 'Episode 1', 'title' => 'Nothing Left to Cling to'],\n ['movie_id' => 11, 'episode' => 'Episode 2', 'title' => 'Back in the Sadle'],\n ['movie_id' => 11, 'episode' => 'Episode 3', 'title' => 'Reunited'],\n ['movie_id' => 11, 'episode' => 'Episode 4', 'title' => 'It\\'s Raining Men'],\n ['movie_id' => 11, 'episode' => 'Episode 5', 'title' => 'Breathe Again'],\n ['movie_id' => 11, 'episode' => 'Episode 6', 'title' => 'Whistlin\\' Past the Graveyard'],\n ['movie_id' => 11, 'episode' => 'Episode 7', 'title' => 'Papa Don\\'t Preach'],\n ['movie_id' => 11, 'episode' => 'Episode 8', 'title' => 'My Shot'],\n ['movie_id' => 11, 'episode' => 'Episode 9', 'title' => 'Let\\'s All Go to the Bar'],\n ['movie_id' => 11, 'episode' => 'Episode 10', 'title' => 'Help Me Through the Night'],\n ['movie_id' => 12, 'episode' => 'Episode 1', 'title' => 'The One Where No One Proposes'],\n ['movie_id' => 12, 'episode' => 'Episode 2', 'title' => 'The One Where Emma Cries'],\n ['movie_id' => 12, 'episode' => 'Episode 3', 'title' => 'The One With the Pediatrician'],\n ['movie_id' => 12, 'episode' => 'Episode 4', 'title' => 'The One With the Sharks'],\n ['movie_id' => 12, 'episode' => 'Episode 5', 'title' => 'The One With Phoebe\\'s Birthday'],\n ['movie_id' => 12, 'episode' => 'Episode 6', 'title' => 'The One With the Male Nanny'],\n ['movie_id' => 12, 'episode' => 'Episode 7', 'title' => 'The One With Ross\\'s Inappropriate Song'],\n ['movie_id' => 12, 'episode' => 'Episode 8', 'title' => 'The One With Rachel\\'s Other Sister'],\n ['movie_id' => 12, 'episode' => 'Episode 9', 'title' => 'The One With Rachel\\'s Phone Number'],\n ['movie_id' => 12, 'episode' => 'Episode 10', 'title' => 'The One With Christmas in Tulsa'],\n ['movie_id' => 13, 'episode' => 'Episode 1', 'title' => 'Pilot'],\n ['movie_id' => 13, 'episode' => 'Episode 2', 'title' => 'Magazine Profile'],\n ['movie_id' => 13, 'episode' => 'Episode 3', 'title' => 'Shots and Salsa'],\n ['movie_id' => 13, 'episode' => 'Episode 4', 'title' => 'Mannequin'],\n ['movie_id' => 13, 'episode' => 'Episode 5', 'title' => 'Shoplifter'],\n ['movie_id' => 13, 'episode' => 'Episode 6', 'title' => 'Secret Shopper'],\n ['movie_id' => 13, 'episode' => 'Episode 7', 'title' => 'Color Wars'],\n ['movie_id' => 13, 'episode' => 'Episode 8', 'title' => 'Wedding Day Sale'],\n ['movie_id' => 13, 'episode' => 'Episode 9', 'title' => 'All-Nighter'],\n ['movie_id' => 13, 'episode' => 'Episode 10', 'title' => 'Demotion'],\n ]);\n }", "public function genres()\n {\n return $this->belongsToMany(Genre::class, 'genre__movies', 'movie_id', 'id');\n }", "public function activities(){\n return $this->belongsToMany('App\\Models\\ActivitySpeaker', 'activity_id', 'speaker_id');\n }", "public function evas()\n {\n return $this->hasMany(EVA::class);\n }", "public function exams()\n {\n return $this->hasMany('App\\Exam');\n }", "public static function addEpisodeNavigation($episode, $db)\n {\n\n if($episode['number'] === null)\n $sql = \"SELECT episodes.id, episodes.number\n FROM episodes \n WHERE episodes.id = $episode[id]\n UNION ALL \n (select episodes.id, episodes.number from episodes where anime_id = $episode[anime_id] and episodes.id > $episode[id] order by episodes.id asc limit 1)\n UNION ALL \n (select episodes.id, episodes.number from episodes where anime_id = $episode[anime_id] and episodes.id < $episode[id] order by episodes.id desc limit 1)\";\n else\n $sql = \"SELECT episodes.id, episodes.number\n FROM episodes \n WHERE episodes.id = $episode[id]\n UNION ALL \n (select episodes.id, episodes.number from episodes where anime_id = $episode[anime_id] and episodes.number > $episode[number] order by episodes.number asc limit 1)\n UNION ALL \n (select episodes.id, episodes.number from episodes where anime_id = $episode[anime_id] and episodes.number < $episode[number] order by episodes.number desc limit 1)\";\n\n $n = $db->query($sql);\n $n->setFetchMode(Phalcon\\Db::FETCH_ASSOC);\n $n = $n->fetchAll($n);\n\n if (isset($n[1]) && isset($n[2])) {\n $episode['next'] = $n[1]['id'];\n $episode['previous'] = $n[2]['id'];\n return $episode;\n } elseif (isset($n[1])) {\n if ($n[0]['number'] < $n[1]['number']) {\n $episode['next'] = $n[1]['id'];\n return $episode;\n } else {\n $episode['previous'] = $n[1]['id'];\n return $episode;\n }\n } else {\n return $episode;\n }\n }", "public function setEpisodes($episodes) {\n $this->properties['episodes'] = $episodes;\n\n return $this;\n }", "public function __construct($episode)\n {\n $this->episode = $episode;\n }", "public function games(){\n\t\treturn $this->belongsToMany('App\\Game','favorite_games');\n\t}", "public function invmovdets()\n {\n return $this->hasMany(InvMovDet::class);\n }", "public function playdate() {\n\t\treturn $this->belongsToMany('Playdate');\n\t}", "public function exhibitionFilm()\n {\n return $this->hasOne('Filmoteca\\Models\\Exhibitions\\ExhibitionFilm');\n }", "public function videoList()\n {\n return $this->hasMany(Video::class);\n }", "public function episodes()\n {\n return app(\n Contracts\\Episodes::class\n );\n }", "public function eventos(){\n return $this->hasMany('App\\Evento');\n }", "public function getMeds()\n {\n return $this->hasMany(Med::className(), ['medchart_id' => 'id']);\n }", "public function movieVote(): HasOne\n {\n return $this->hasOne(MovieVote::class);\n }", "public function setEpisode($episode) {\n $this->properties['episode'] = $episode;\n\n return $this;\n }", "public function videos(): MorphToMany\n {\n return $this->morphedByMany(Video::class, 'taggable')->withTimestamps();\n }", "public function playlistVideos() {\n return $this->hasMany(PlaylistVideos::class, 'playlist_id', '_id');\n }", "public function run()\n {\n \n\n \\DB::table('episodes_users')->delete();\n \n \\DB::table('episodes_users')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'user_id' => 1,\n 'episode_id' => 79,\n ),\n 1 => \n array (\n 'id' => 2,\n 'user_id' => 1,\n 'episode_id' => 73,\n ),\n 2 => \n array (\n 'id' => 3,\n 'user_id' => 1,\n 'episode_id' => 74,\n ),\n 3 => \n array (\n 'id' => 4,\n 'user_id' => 1,\n 'episode_id' => 80,\n ),\n 4 => \n array (\n 'id' => 5,\n 'user_id' => 1,\n 'episode_id' => 81,\n ),\n 5 => \n array (\n 'id' => 6,\n 'user_id' => 1,\n 'episode_id' => 75,\n ),\n 6 => \n array (\n 'id' => 7,\n 'user_id' => 1,\n 'episode_id' => 82,\n ),\n 7 => \n array (\n 'id' => 8,\n 'user_id' => 1,\n 'episode_id' => 76,\n ),\n 8 => \n array (\n 'id' => 9,\n 'user_id' => 1,\n 'episode_id' => 77,\n ),\n 9 => \n array (\n 'id' => 10,\n 'user_id' => 1,\n 'episode_id' => 78,\n ),\n 10 => \n array (\n 'id' => 11,\n 'user_id' => 1,\n 'episode_id' => 83,\n ),\n 11 => \n array (\n 'id' => 12,\n 'user_id' => 1,\n 'episode_id' => 89,\n ),\n 12 => \n array (\n 'id' => 13,\n 'user_id' => 1,\n 'episode_id' => 84,\n ),\n 13 => \n array (\n 'id' => 14,\n 'user_id' => 1,\n 'episode_id' => 90,\n ),\n 14 => \n array (\n 'id' => 15,\n 'user_id' => 1,\n 'episode_id' => 91,\n ),\n 15 => \n array (\n 'id' => 16,\n 'user_id' => 1,\n 'episode_id' => 85,\n ),\n 16 => \n array (\n 'id' => 17,\n 'user_id' => 1,\n 'episode_id' => 86,\n ),\n 17 => \n array (\n 'id' => 18,\n 'user_id' => 1,\n 'episode_id' => 92,\n ),\n 18 => \n array (\n 'id' => 19,\n 'user_id' => 1,\n 'episode_id' => 87,\n ),\n 19 => \n array (\n 'id' => 20,\n 'user_id' => 1,\n 'episode_id' => 88,\n ),\n 20 => \n array (\n 'id' => 21,\n 'user_id' => 1,\n 'episode_id' => 93,\n ),\n 21 => \n array (\n 'id' => 22,\n 'user_id' => 1,\n 'episode_id' => 99,\n ),\n 22 => \n array (\n 'id' => 23,\n 'user_id' => 1,\n 'episode_id' => 100,\n ),\n 23 => \n array (\n 'id' => 24,\n 'user_id' => 1,\n 'episode_id' => 94,\n ),\n 24 => \n array (\n 'id' => 25,\n 'user_id' => 1,\n 'episode_id' => 95,\n ),\n 25 => \n array (\n 'id' => 26,\n 'user_id' => 1,\n 'episode_id' => 101,\n ),\n 26 => \n array (\n 'id' => 27,\n 'user_id' => 1,\n 'episode_id' => 102,\n ),\n 27 => \n array (\n 'id' => 28,\n 'user_id' => 1,\n 'episode_id' => 96,\n ),\n 28 => \n array (\n 'id' => 29,\n 'user_id' => 1,\n 'episode_id' => 97,\n ),\n 29 => \n array (\n 'id' => 30,\n 'user_id' => 1,\n 'episode_id' => 98,\n ),\n 30 => \n array (\n 'id' => 31,\n 'user_id' => 1,\n 'episode_id' => 103,\n ),\n 31 => \n array (\n 'id' => 32,\n 'user_id' => 1,\n 'episode_id' => 109,\n ),\n 32 => \n array (\n 'id' => 33,\n 'user_id' => 1,\n 'episode_id' => 110,\n ),\n 33 => \n array (\n 'id' => 34,\n 'user_id' => 1,\n 'episode_id' => 104,\n ),\n 34 => \n array (\n 'id' => 35,\n 'user_id' => 1,\n 'episode_id' => 105,\n ),\n 35 => \n array (\n 'id' => 36,\n 'user_id' => 1,\n 'episode_id' => 106,\n ),\n 36 => \n array (\n 'id' => 37,\n 'user_id' => 1,\n 'episode_id' => 111,\n ),\n 37 => \n array (\n 'id' => 38,\n 'user_id' => 1,\n 'episode_id' => 112,\n ),\n 38 => \n array (\n 'id' => 39,\n 'user_id' => 1,\n 'episode_id' => 107,\n ),\n 39 => \n array (\n 'id' => 40,\n 'user_id' => 1,\n 'episode_id' => 108,\n ),\n 40 => \n array (\n 'id' => 41,\n 'user_id' => 1,\n 'episode_id' => 1,\n ),\n 41 => \n array (\n 'id' => 42,\n 'user_id' => 1,\n 'episode_id' => 2,\n ),\n 42 => \n array (\n 'id' => 43,\n 'user_id' => 1,\n 'episode_id' => 662,\n ),\n 43 => \n array (\n 'id' => 44,\n 'user_id' => 1,\n 'episode_id' => 668,\n ),\n 44 => \n array (\n 'id' => 45,\n 'user_id' => 1,\n 'episode_id' => 674,\n ),\n 45 => \n array (\n 'id' => 46,\n 'user_id' => 1,\n 'episode_id' => 680,\n ),\n 46 => \n array (\n 'id' => 47,\n 'user_id' => 1,\n 'episode_id' => 681,\n ),\n 47 => \n array (\n 'id' => 48,\n 'user_id' => 1,\n 'episode_id' => 675,\n ),\n 48 => \n array (\n 'id' => 49,\n 'user_id' => 1,\n 'episode_id' => 669,\n ),\n 49 => \n array (\n 'id' => 50,\n 'user_id' => 1,\n 'episode_id' => 663,\n ),\n 50 => \n array (\n 'id' => 51,\n 'user_id' => 1,\n 'episode_id' => 664,\n ),\n 51 => \n array (\n 'id' => 53,\n 'user_id' => 1,\n 'episode_id' => 676,\n ),\n 52 => \n array (\n 'id' => 54,\n 'user_id' => 1,\n 'episode_id' => 670,\n ),\n 53 => \n array (\n 'id' => 55,\n 'user_id' => 1,\n 'episode_id' => 682,\n ),\n 54 => \n array (\n 'id' => 56,\n 'user_id' => 1,\n 'episode_id' => 683,\n ),\n 55 => \n array (\n 'id' => 57,\n 'user_id' => 1,\n 'episode_id' => 677,\n ),\n 56 => \n array (\n 'id' => 58,\n 'user_id' => 1,\n 'episode_id' => 665,\n ),\n 57 => \n array (\n 'id' => 59,\n 'user_id' => 1,\n 'episode_id' => 671,\n ),\n 58 => \n array (\n 'id' => 60,\n 'user_id' => 1,\n 'episode_id' => 666,\n ),\n 59 => \n array (\n 'id' => 61,\n 'user_id' => 1,\n 'episode_id' => 672,\n ),\n 60 => \n array (\n 'id' => 62,\n 'user_id' => 1,\n 'episode_id' => 678,\n ),\n 61 => \n array (\n 'id' => 63,\n 'user_id' => 1,\n 'episode_id' => 667,\n ),\n 62 => \n array (\n 'id' => 64,\n 'user_id' => 1,\n 'episode_id' => 673,\n ),\n 63 => \n array (\n 'id' => 65,\n 'user_id' => 1,\n 'episode_id' => 679,\n ),\n 64 => \n array (\n 'id' => 66,\n 'user_id' => 1,\n 'episode_id' => 778,\n ),\n 65 => \n array (\n 'id' => 67,\n 'user_id' => 1,\n 'episode_id' => 784,\n ),\n 66 => \n array (\n 'id' => 68,\n 'user_id' => 1,\n 'episode_id' => 785,\n ),\n 67 => \n array (\n 'id' => 69,\n 'user_id' => 1,\n 'episode_id' => 779,\n ),\n 68 => \n array (\n 'id' => 70,\n 'user_id' => 1,\n 'episode_id' => 780,\n ),\n 69 => \n array (\n 'id' => 71,\n 'user_id' => 1,\n 'episode_id' => 786,\n ),\n 70 => \n array (\n 'id' => 72,\n 'user_id' => 1,\n 'episode_id' => 787,\n ),\n 71 => \n array (\n 'id' => 73,\n 'user_id' => 1,\n 'episode_id' => 781,\n ),\n 72 => \n array (\n 'id' => 74,\n 'user_id' => 1,\n 'episode_id' => 782,\n ),\n 73 => \n array (\n 'id' => 75,\n 'user_id' => 1,\n 'episode_id' => 788,\n ),\n 74 => \n array (\n 'id' => 76,\n 'user_id' => 1,\n 'episode_id' => 783,\n ),\n 75 => \n array (\n 'id' => 77,\n 'user_id' => 1,\n 'episode_id' => 789,\n ),\n 76 => \n array (\n 'id' => 78,\n 'user_id' => 1,\n 'episode_id' => 790,\n ),\n 77 => \n array (\n 'id' => 79,\n 'user_id' => 1,\n 'episode_id' => 796,\n ),\n 78 => \n array (\n 'id' => 80,\n 'user_id' => 1,\n 'episode_id' => 797,\n ),\n 79 => \n array (\n 'id' => 81,\n 'user_id' => 1,\n 'episode_id' => 791,\n ),\n 80 => \n array (\n 'id' => 82,\n 'user_id' => 1,\n 'episode_id' => 792,\n ),\n 81 => \n array (\n 'id' => 83,\n 'user_id' => 1,\n 'episode_id' => 798,\n ),\n 82 => \n array (\n 'id' => 84,\n 'user_id' => 1,\n 'episode_id' => 793,\n ),\n 83 => \n array (\n 'id' => 85,\n 'user_id' => 1,\n 'episode_id' => 799,\n ),\n 84 => \n array (\n 'id' => 86,\n 'user_id' => 1,\n 'episode_id' => 794,\n ),\n 85 => \n array (\n 'id' => 87,\n 'user_id' => 1,\n 'episode_id' => 800,\n ),\n 86 => \n array (\n 'id' => 88,\n 'user_id' => 1,\n 'episode_id' => 795,\n ),\n 87 => \n array (\n 'id' => 89,\n 'user_id' => 1,\n 'episode_id' => 801,\n ),\n 88 => \n array (\n 'id' => 90,\n 'user_id' => 1,\n 'episode_id' => 802,\n ),\n 89 => \n array (\n 'id' => 91,\n 'user_id' => 1,\n 'episode_id' => 808,\n ),\n 90 => \n array (\n 'id' => 92,\n 'user_id' => 1,\n 'episode_id' => 803,\n ),\n 91 => \n array (\n 'id' => 93,\n 'user_id' => 1,\n 'episode_id' => 809,\n ),\n 92 => \n array (\n 'id' => 94,\n 'user_id' => 1,\n 'episode_id' => 810,\n ),\n 93 => \n array (\n 'id' => 95,\n 'user_id' => 1,\n 'episode_id' => 804,\n ),\n 94 => \n array (\n 'id' => 96,\n 'user_id' => 1,\n 'episode_id' => 805,\n ),\n 95 => \n array (\n 'id' => 97,\n 'user_id' => 1,\n 'episode_id' => 811,\n ),\n 96 => \n array (\n 'id' => 98,\n 'user_id' => 1,\n 'episode_id' => 806,\n ),\n 97 => \n array (\n 'id' => 99,\n 'user_id' => 1,\n 'episode_id' => 812,\n ),\n 98 => \n array (\n 'id' => 100,\n 'user_id' => 1,\n 'episode_id' => 807,\n ),\n 99 => \n array (\n 'id' => 101,\n 'user_id' => 1,\n 'episode_id' => 813,\n ),\n 100 => \n array (\n 'id' => 102,\n 'user_id' => 1,\n 'episode_id' => 814,\n ),\n 101 => \n array (\n 'id' => 103,\n 'user_id' => 1,\n 'episode_id' => 820,\n ),\n 102 => \n array (\n 'id' => 104,\n 'user_id' => 1,\n 'episode_id' => 826,\n ),\n 103 => \n array (\n 'id' => 105,\n 'user_id' => 1,\n 'episode_id' => 827,\n ),\n 104 => \n array (\n 'id' => 106,\n 'user_id' => 1,\n 'episode_id' => 821,\n ),\n 105 => \n array (\n 'id' => 107,\n 'user_id' => 1,\n 'episode_id' => 815,\n ),\n 106 => \n array (\n 'id' => 108,\n 'user_id' => 1,\n 'episode_id' => 816,\n ),\n 107 => \n array (\n 'id' => 109,\n 'user_id' => 1,\n 'episode_id' => 822,\n ),\n 108 => \n array (\n 'id' => 110,\n 'user_id' => 1,\n 'episode_id' => 823,\n ),\n 109 => \n array (\n 'id' => 111,\n 'user_id' => 1,\n 'episode_id' => 824,\n ),\n 110 => \n array (\n 'id' => 112,\n 'user_id' => 1,\n 'episode_id' => 818,\n ),\n 111 => \n array (\n 'id' => 113,\n 'user_id' => 1,\n 'episode_id' => 819,\n ),\n 112 => \n array (\n 'id' => 114,\n 'user_id' => 1,\n 'episode_id' => 825,\n ),\n 113 => \n array (\n 'id' => 115,\n 'user_id' => 1,\n 'episode_id' => 817,\n ),\n 114 => \n array (\n 'id' => 116,\n 'user_id' => 1,\n 'episode_id' => 828,\n ),\n 115 => \n array (\n 'id' => 117,\n 'user_id' => 1,\n 'episode_id' => 834,\n ),\n 116 => \n array (\n 'id' => 118,\n 'user_id' => 1,\n 'episode_id' => 840,\n ),\n 117 => \n array (\n 'id' => 119,\n 'user_id' => 1,\n 'episode_id' => 835,\n ),\n 118 => \n array (\n 'id' => 120,\n 'user_id' => 1,\n 'episode_id' => 829,\n ),\n 119 => \n array (\n 'id' => 121,\n 'user_id' => 1,\n 'episode_id' => 830,\n ),\n 120 => \n array (\n 'id' => 122,\n 'user_id' => 1,\n 'episode_id' => 836,\n ),\n 121 => \n array (\n 'id' => 123,\n 'user_id' => 1,\n 'episode_id' => 831,\n ),\n 122 => \n array (\n 'id' => 124,\n 'user_id' => 1,\n 'episode_id' => 837,\n ),\n 123 => \n array (\n 'id' => 125,\n 'user_id' => 1,\n 'episode_id' => 832,\n ),\n 124 => \n array (\n 'id' => 126,\n 'user_id' => 1,\n 'episode_id' => 838,\n ),\n 125 => \n array (\n 'id' => 127,\n 'user_id' => 1,\n 'episode_id' => 833,\n ),\n 126 => \n array (\n 'id' => 128,\n 'user_id' => 1,\n 'episode_id' => 839,\n ),\n 127 => \n array (\n 'id' => 129,\n 'user_id' => 1,\n 'episode_id' => 841,\n ),\n 128 => \n array (\n 'id' => 130,\n 'user_id' => 1,\n 'episode_id' => 847,\n ),\n 129 => \n array (\n 'id' => 131,\n 'user_id' => 1,\n 'episode_id' => 853,\n ),\n 130 => \n array (\n 'id' => 132,\n 'user_id' => 1,\n 'episode_id' => 848,\n ),\n 131 => \n array (\n 'id' => 133,\n 'user_id' => 1,\n 'episode_id' => 842,\n ),\n 132 => \n array (\n 'id' => 134,\n 'user_id' => 1,\n 'episode_id' => 843,\n ),\n 133 => \n array (\n 'id' => 135,\n 'user_id' => 1,\n 'episode_id' => 849,\n ),\n 134 => \n array (\n 'id' => 136,\n 'user_id' => 1,\n 'episode_id' => 844,\n ),\n 135 => \n array (\n 'id' => 137,\n 'user_id' => 1,\n 'episode_id' => 850,\n ),\n 136 => \n array (\n 'id' => 138,\n 'user_id' => 1,\n 'episode_id' => 851,\n ),\n 137 => \n array (\n 'id' => 139,\n 'user_id' => 1,\n 'episode_id' => 845,\n ),\n 138 => \n array (\n 'id' => 140,\n 'user_id' => 1,\n 'episode_id' => 846,\n ),\n 139 => \n array (\n 'id' => 141,\n 'user_id' => 1,\n 'episode_id' => 852,\n ),\n 140 => \n array (\n 'id' => 142,\n 'user_id' => 1,\n 'episode_id' => 854,\n ),\n 141 => \n array (\n 'id' => 143,\n 'user_id' => 1,\n 'episode_id' => 855,\n ),\n 142 => \n array (\n 'id' => 144,\n 'user_id' => 1,\n 'episode_id' => 856,\n ),\n 143 => \n array (\n 'id' => 145,\n 'user_id' => 1,\n 'episode_id' => 857,\n ),\n 144 => \n array (\n 'id' => 146,\n 'user_id' => 1,\n 'episode_id' => 858,\n ),\n 145 => \n array (\n 'id' => 147,\n 'user_id' => 1,\n 'episode_id' => 859,\n ),\n 146 => \n array (\n 'id' => 153,\n 'user_id' => 1,\n 'episode_id' => 860,\n ),\n 147 => \n array (\n 'id' => 155,\n 'user_id' => 1,\n 'episode_id' => 867,\n ),\n 148 => \n array (\n 'id' => 156,\n 'user_id' => 1,\n 'episode_id' => 873,\n ),\n 149 => \n array (\n 'id' => 157,\n 'user_id' => 1,\n 'episode_id' => 874,\n ),\n 150 => \n array (\n 'id' => 158,\n 'user_id' => 1,\n 'episode_id' => 868,\n ),\n 151 => \n array (\n 'id' => 159,\n 'user_id' => 1,\n 'episode_id' => 869,\n ),\n 152 => \n array (\n 'id' => 160,\n 'user_id' => 1,\n 'episode_id' => 870,\n ),\n 153 => \n array (\n 'id' => 161,\n 'user_id' => 1,\n 'episode_id' => 875,\n ),\n 154 => \n array (\n 'id' => 162,\n 'user_id' => 1,\n 'episode_id' => 871,\n ),\n 155 => \n array (\n 'id' => 163,\n 'user_id' => 1,\n 'episode_id' => 872,\n ),\n 156 => \n array (\n 'id' => 164,\n 'user_id' => 1,\n 'episode_id' => 876,\n ),\n 157 => \n array (\n 'id' => 165,\n 'user_id' => 1,\n 'episode_id' => 882,\n ),\n 158 => \n array (\n 'id' => 166,\n 'user_id' => 1,\n 'episode_id' => 883,\n ),\n 159 => \n array (\n 'id' => 167,\n 'user_id' => 1,\n 'episode_id' => 877,\n ),\n 160 => \n array (\n 'id' => 168,\n 'user_id' => 1,\n 'episode_id' => 878,\n ),\n 161 => \n array (\n 'id' => 169,\n 'user_id' => 1,\n 'episode_id' => 884,\n ),\n 162 => \n array (\n 'id' => 170,\n 'user_id' => 1,\n 'episode_id' => 879,\n ),\n 163 => \n array (\n 'id' => 171,\n 'user_id' => 1,\n 'episode_id' => 885,\n ),\n 164 => \n array (\n 'id' => 172,\n 'user_id' => 1,\n 'episode_id' => 880,\n ),\n 165 => \n array (\n 'id' => 173,\n 'user_id' => 1,\n 'episode_id' => 881,\n ),\n 166 => \n array (\n 'id' => 174,\n 'user_id' => 1,\n 'episode_id' => 886,\n ),\n 167 => \n array (\n 'id' => 175,\n 'user_id' => 1,\n 'episode_id' => 892,\n ),\n 168 => \n array (\n 'id' => 176,\n 'user_id' => 1,\n 'episode_id' => 893,\n ),\n 169 => \n array (\n 'id' => 177,\n 'user_id' => 1,\n 'episode_id' => 887,\n ),\n 170 => \n array (\n 'id' => 178,\n 'user_id' => 1,\n 'episode_id' => 888,\n ),\n 171 => \n array (\n 'id' => 179,\n 'user_id' => 1,\n 'episode_id' => 894,\n ),\n 172 => \n array (\n 'id' => 180,\n 'user_id' => 1,\n 'episode_id' => 889,\n ),\n 173 => \n array (\n 'id' => 181,\n 'user_id' => 1,\n 'episode_id' => 895,\n ),\n 174 => \n array (\n 'id' => 182,\n 'user_id' => 1,\n 'episode_id' => 890,\n ),\n 175 => \n array (\n 'id' => 183,\n 'user_id' => 1,\n 'episode_id' => 891,\n ),\n 176 => \n array (\n 'id' => 184,\n 'user_id' => 1,\n 'episode_id' => 896,\n ),\n 177 => \n array (\n 'id' => 186,\n 'user_id' => 1,\n 'episode_id' => 897,\n ),\n 178 => \n array (\n 'id' => 187,\n 'user_id' => 1,\n 'episode_id' => 898,\n ),\n 179 => \n array (\n 'id' => 188,\n 'user_id' => 1,\n 'episode_id' => 899,\n ),\n 180 => \n array (\n 'id' => 189,\n 'user_id' => 1,\n 'episode_id' => 900,\n ),\n 181 => \n array (\n 'id' => 190,\n 'user_id' => 1,\n 'episode_id' => 901,\n ),\n 182 => \n array (\n 'id' => 191,\n 'user_id' => 1,\n 'episode_id' => 902,\n ),\n 183 => \n array (\n 'id' => 192,\n 'user_id' => 1,\n 'episode_id' => 903,\n ),\n 184 => \n array (\n 'id' => 193,\n 'user_id' => 1,\n 'episode_id' => 904,\n ),\n 185 => \n array (\n 'id' => 194,\n 'user_id' => 1,\n 'episode_id' => 905,\n ),\n 186 => \n array (\n 'id' => 195,\n 'user_id' => 1,\n 'episode_id' => 913,\n ),\n 187 => \n array (\n 'id' => 196,\n 'user_id' => 1,\n 'episode_id' => 919,\n ),\n 188 => \n array (\n 'id' => 198,\n 'user_id' => 1,\n 'episode_id' => 925,\n ),\n 189 => \n array (\n 'id' => 199,\n 'user_id' => 1,\n 'episode_id' => 931,\n ),\n 190 => \n array (\n 'id' => 200,\n 'user_id' => 1,\n 'episode_id' => 932,\n ),\n 191 => \n array (\n 'id' => 201,\n 'user_id' => 1,\n 'episode_id' => 926,\n ),\n 192 => \n array (\n 'id' => 202,\n 'user_id' => 1,\n 'episode_id' => 920,\n ),\n 193 => \n array (\n 'id' => 203,\n 'user_id' => 1,\n 'episode_id' => 914,\n ),\n 194 => \n array (\n 'id' => 204,\n 'user_id' => 1,\n 'episode_id' => 915,\n ),\n 195 => \n array (\n 'id' => 205,\n 'user_id' => 1,\n 'episode_id' => 921,\n ),\n 196 => \n array (\n 'id' => 206,\n 'user_id' => 1,\n 'episode_id' => 927,\n ),\n 197 => \n array (\n 'id' => 207,\n 'user_id' => 1,\n 'episode_id' => 933,\n ),\n 198 => \n array (\n 'id' => 208,\n 'user_id' => 1,\n 'episode_id' => 934,\n ),\n 199 => \n array (\n 'id' => 209,\n 'user_id' => 1,\n 'episode_id' => 928,\n ),\n 200 => \n array (\n 'id' => 210,\n 'user_id' => 1,\n 'episode_id' => 916,\n ),\n 201 => \n array (\n 'id' => 211,\n 'user_id' => 1,\n 'episode_id' => 922,\n ),\n 202 => \n array (\n 'id' => 212,\n 'user_id' => 1,\n 'episode_id' => 917,\n ),\n 203 => \n array (\n 'id' => 213,\n 'user_id' => 1,\n 'episode_id' => 923,\n ),\n 204 => \n array (\n 'id' => 214,\n 'user_id' => 1,\n 'episode_id' => 929,\n ),\n 205 => \n array (\n 'id' => 215,\n 'user_id' => 1,\n 'episode_id' => 918,\n ),\n 206 => \n array (\n 'id' => 216,\n 'user_id' => 1,\n 'episode_id' => 924,\n ),\n 207 => \n array (\n 'id' => 217,\n 'user_id' => 1,\n 'episode_id' => 930,\n ),\n 208 => \n array (\n 'id' => 218,\n 'user_id' => 1,\n 'episode_id' => 935,\n ),\n 209 => \n array (\n 'id' => 219,\n 'user_id' => 1,\n 'episode_id' => 941,\n ),\n 210 => \n array (\n 'id' => 220,\n 'user_id' => 1,\n 'episode_id' => 942,\n ),\n 211 => \n array (\n 'id' => 221,\n 'user_id' => 1,\n 'episode_id' => 936,\n ),\n 212 => \n array (\n 'id' => 222,\n 'user_id' => 1,\n 'episode_id' => 937,\n ),\n 213 => \n array (\n 'id' => 223,\n 'user_id' => 1,\n 'episode_id' => 938,\n ),\n 214 => \n array (\n 'id' => 224,\n 'user_id' => 1,\n 'episode_id' => 939,\n ),\n 215 => \n array (\n 'id' => 225,\n 'user_id' => 1,\n 'episode_id' => 940,\n ),\n 216 => \n array (\n 'id' => 226,\n 'user_id' => 1,\n 'episode_id' => 943,\n ),\n 217 => \n array (\n 'id' => 227,\n 'user_id' => 1,\n 'episode_id' => 944,\n ),\n 218 => \n array (\n 'id' => 228,\n 'user_id' => 1,\n 'episode_id' => 945,\n ),\n 219 => \n array (\n 'id' => 229,\n 'user_id' => 1,\n 'episode_id' => 946,\n ),\n 220 => \n array (\n 'id' => 230,\n 'user_id' => 1,\n 'episode_id' => 947,\n ),\n 221 => \n array (\n 'id' => 231,\n 'user_id' => 1,\n 'episode_id' => 948,\n ),\n 222 => \n array (\n 'id' => 232,\n 'user_id' => 1,\n 'episode_id' => 949,\n ),\n 223 => \n array (\n 'id' => 233,\n 'user_id' => 1,\n 'episode_id' => 950,\n ),\n 224 => \n array (\n 'id' => 234,\n 'user_id' => 1,\n 'episode_id' => 951,\n ),\n 225 => \n array (\n 'id' => 235,\n 'user_id' => 1,\n 'episode_id' => 952,\n ),\n 226 => \n array (\n 'id' => 236,\n 'user_id' => 1,\n 'episode_id' => 956,\n ),\n 227 => \n array (\n 'id' => 237,\n 'user_id' => 1,\n 'episode_id' => 955,\n ),\n 228 => \n array (\n 'id' => 238,\n 'user_id' => 1,\n 'episode_id' => 954,\n ),\n 229 => \n array (\n 'id' => 239,\n 'user_id' => 1,\n 'episode_id' => 953,\n ),\n ));\n \n \n }", "public function aviones(){\n\t\t//la relacion es de 1 a muchos: 1 fabricante tiene muchos aviones\n\t\treturn $this->hasMany('App\\Avion');\n\t}", "public function run()\n {\n DB::table('episodes')->insert([\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Episode 9\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Episode 10\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 11\",\n \"title\" => \"Episode 11\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 12\",\n \"title\" => \"Episode 12\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 13\",\n \"title\" => \"Episode 13\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 14\",\n \"title\" => \"Episode 14\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 15\",\n \"title\" => \"Episode 15\"\n ],\n [\n \"movie_id\" => 1,\n \"episode\" => \"Episode 16\",\n \"title\" => \"Episode 16\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Episode 9\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Episode 10\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 11\",\n \"title\" => \"Episode 11\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 12\",\n \"title\" => \"Episode 12\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 13\",\n \"title\" => \"Episode 13\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 14\",\n \"title\" => \"Episode 14\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 15\",\n \"title\" => \"Episode 15\"\n ],\n [\n \"movie_id\" => 2,\n \"episode\" => \"Episode 16\",\n \"title\" => \"Episode 16\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Episode 9\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Episode 10\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 11\",\n \"title\" => \"Episode 11\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 12\",\n \"title\" => \"Episode 12\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 13\",\n \"title\" => \"Episode 13\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 14\",\n \"title\" => \"Episode 14\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 15\",\n \"title\" => \"Episode 15\"\n ],\n [\n \"movie_id\" => 3,\n \"episode\" => \"Episode 16\",\n \"title\" => \"Episode 16\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Episode 9\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Episode 10\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 11\",\n \"title\" => \"Episode 11\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 12\",\n \"title\" => \"Episode 12\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 13\",\n \"title\" => \"Episode 13\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 14\",\n \"title\" => \"Episode 14\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 15\",\n \"title\" => \"Episode 15\"\n ],\n [\n \"movie_id\" => 4,\n \"episode\" => \"Episode 16\",\n \"title\" => \"Episode 16\"\n ],\n [\n \"movie_id\" => 5,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Sponge on the Run\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Scooter Buskie\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Cat's in the Cradle\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Family Fun Night\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Formula for Menace: A Dekker Moonboots Mystery\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Monster Machine\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 6\",\n \"title\" => \"The Constipation Situation\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 7\",\n \"title\" => \"The Boss Babysitter\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Into the Belly of the Den of the House of the Nest of Cats\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Spirit Day\"\n ],\n [\n \"movie_id\" => 6,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Par Avion\"\n ],\n [\n \"movie_id\" => 7,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Despicable Me 3\"\n ],\n [\n \"movie_id\" => 8,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Bee Movie\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Openings\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Exchanges\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Doubled Pawns\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Middle Game\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Fork\"\n ],\n [\n \"movie_id\" => 9,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Adjourment\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 10,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 1\",\n \"title\" => \"First, the Weather Changed\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Prepare to Brace\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Access is Power\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Without Their Maker\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Justice Never Boarded\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Trouble Comes Sideways\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 7\",\n \"title\" => \"The Universe Is Indifferent\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 8\",\n \"title\" => \"These Are His Revolutions\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 9\",\n \"title\" => \"The Train Demanded Blood\"\n ],\n [\n \"movie_id\" => 11,\n \"episode\" => \"Episode 10\",\n \"title\" => \"994 Cars Long\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 1\",\n \"title\" => \"Episode 1\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 2\",\n \"title\" => \"Episode 2\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 3\",\n \"title\" => \"Episode 3\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 4\",\n \"title\" => \"Episode 4\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 5\",\n \"title\" => \"Episode 5\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 6\",\n \"title\" => \"Episode 6\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 7\",\n \"title\" => \"Episode 7\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 8\",\n \"title\" => \"Episode 8\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 9\",\n \"title\" => \"Episode 9\"\n ],\n [\n \"movie_id\" => 12,\n \"episode\" => \"Episode 10\",\n \"title\" => \"Episode 10\"\n ]\n ]);\n }", "public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }", "function get_episode($id = null)\n{\n $post = get_post($id);\n\n if (!$post) {\n return null;\n }\n\n $episode = Model\\Episode::find_one_by_property('post_id', $post->ID);\n\n if (!$episode) {\n return null;\n }\n\n return new Template\\Episode($episode);\n}", "public function videoPosts()\n {\n return $this->hasMany('App\\VideoPost', 'user-id');\n }", "public function leagues() {\n\t\treturn $this->belongsToMany('League', 'league_movies');\n\t}", "public function items()\n {\n return $this->hasMany('App\\PodcastItem');\n }", "public function actasPorSae(){\n return $this->hasMany('Ceidin\\Models\\Acta', 'id_sae');\n }", "public function eventRepetitions()\n {\n return $this->hasMany('DavideCasiraghi\\LaravelEventsCalendar\\Models\\EventRepetition', 'event_id');\n }", "public function videos()\n {\n return $this->morphMany(Video::class, 'videoable');\n }", "public function prodComps()\n {\n return $this->belongsToMany(ProdComp::class, 'prod_comp__movies', 'movie_id', 'id');\n }", "public function videos()\n {\n return $this->belongsToMany(Video::class, 'video_categories');\n }", "public function genres()\n {\n return $this->belongsToMany('App/Genre', 'eventmanager_genre', 'genres_id', 'genres_id');\n }", "public function articles(){ //establece la relacion entre modelos, en este caso 1 a muchos\n return $this -> hasMany('App\\Article');\n }", "public function events(){\n return $this->hasMany('Event');\n }", "public function add(Episode $episode): void\n {\n $this->episodes[] = $episode;\n }", "public function getFilm()\n {\n return $this->hasOne(Film::className(), ['id' => 'film_id']);\n }", "public static function accessorRelatedEpisodes($return, $method_name, $episode, $post, $args = array()) {\n\t\t$episodes = array();\n\n\t\tforeach (EpisodeRelation::get_related_episodes($episode->id) as $related_episode) {\n\t\t\t$episodes[] = new \\Podlove\\Template\\Episode( \\Podlove\\Model\\Episode::find_by_id($related_episode->id));\n\t\t}\n\t\treturn $episodes;\n\t}", "public function moves(){\n return $this->hasMany(\"App\\Models\\Move\");\n }", "public function run()\n {\n $genre_id = $this->insertGenre('Kids');\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Tonari no Totoro',\n 'photo' => '75923.jpg',\n 'description' => 'n 1950s Japan, Tatsuo Kusakabe relocates himself and his two daughters, Satsuki and Mei, to the countryside to be closer to their mother, who is hospitalized due to long-term illness. As the girls grow acquainted with rural life, Mei encounters a small, bunny-like creature in the yard one day. Chasing it into the forest, she finds \"Totoro\"—a giant, mystical forest spirit whom she soon befriends. Before long, Satsuki too meets Totoro, and the two girls suddenly find their lives filled with magical adventures in nature and fantastical creatures of the woods. [Written by MAL Rewrite]',\n 'rating' => 8.34,\n 'genre_id' => $genre_id,\n 'episodes' => 1,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Stand By Me Doraemon',\n 'photo' => '65571.jpg',\n 'description' => 'Nobita Nobi is an elementary student who hates studying, is bad at sports, and does everything half-heartedly. He is a pushover, unlucky, and fearful of many things. His personality makes him a failure in life, even affecting his progeny. This causes his great-great-grandchild, Sewashi, to take control of the situation. Sewashi travels back in time from the 22nd century to the 20th century to meet Nobita, who is shocked to see him appear out of his drawer alongside a blue robotic cat. The robotic cat calls himself Doraemon, who claims to have been pressured by Sewashi to assist Nobita, with their ultimate goal being to provide Nobita happiness. Frustrated after seeing Nobita\\'s hopeless state, Doraemon decides to go back to the future. However, Sewashi activates a program within Doraemon that prevents him from doing so. Forced to stay, Doraemon helps Nobita using futuristic gadgets through his four-dimensional pocket—a bag containing anything inside it. Can Doraemon bring Nobita happiness and return to the future? [Written by MAL Rewrite]',\n 'rating' => 8.05,\n 'genre_id' => $genre_id,\n 'episodes' => 1,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Chocolate Underground',\n 'photo' => '12400.jpg',\n 'description' => 'Chocolate and other sweets have been banned thanks to the political reign of the Good For You Party, and the new laws are enforced strictly, with force if need be. Smudger and Huntley are two teen boys determined to eat chocolate again. They search out rumored chocolate bootleggers, eventually starting their own chocolate underground distribution.',\n 'rating' => 6.16,\n 'genre_id' => $genre_id,\n 'episodes' => 13,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Rilakkuma to Kaoru-san',\n 'photo' => '100702.jpg',\n 'description' => 'Her life might be a little mundane, but Kaoru gets to go home to Rilakkuma, her endearingly lazy roommate who happens to be a fuzzy toy bear.',\n 'rating' => 7.63,\n 'genre_id' => $genre_id,\n 'episodes' => 13,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Ojamajo Doremi Sharp Movie',\n 'photo' => '40405.jpg',\n 'description' => 'One day Pop was out scavenging with Hana, and found a beautiful rose inside the Queen\\'s garden. Curious, she picked the rose and brought it home. Unwittingly, that rose can cause all wishes to become true, whether good or bad. Good wishes will turn the rose white and bloom, while bad wishes will turn the rose black and wither. After a heated argument with her sister Doremi, Pop wishes that Doremi loses all her magic and be turned into a mouse. Hilarity ensues, as Doremi and the others try to put everything back to normal.',\n 'rating' => 7.11,\n 'genre_id' => $genre_id,\n 'episodes' => 1,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Motto! Ojamajo Doremi: Kaeru Ishi no Himitsu',\n 'photo' => '27121.jpg',\n 'description' => 'Mo~tto Ojamajo Doremi movie features the five witches Doremi, Aiko, Hazuki, Onpu, and Momoko as they visit Doremi\\'s grandpa\\'s home. There, they learn of the mystery of the frog stone, a magical place where magic used to mingle in the old countryside. Aiko rediscovers her love for grandpa, and Doremi learns a piece of the magical kingdom\\'s past.',\n 'rating' => 7.14,\n 'genre_id' => $genre_id,\n 'episodes' => 1,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Doraemon Movie 31: Shin Nobita to Tetsujin Heidan - Habatake Tenshi-tachi',\n 'photo' => '72436.jpg',\n 'description' => 'Jealous of Suneo\\'s new robot toy, Nobita asks Doraemon to build him an even better one. Doraemon initially refuses, until Nobita accidentally discovers pieces of a mysterious robot that falls from the sky. After gathering all the robot parts and assembled them together, the giant robot, Zanda Claus, is soon completed. The duo soon learn that the robot is not a mere toy, but a powerful weapon in the fight against the coming Robot Army that is going to attack Earth and enslave the human inhabitants of it. An invasion is near, as a mysterious girl Riruru shows up, looking for the robot. (Source: Wikipedia)',\n 'rating' => 7.87,\n 'genre_id' => $genre_id,\n 'episodes' => 1,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Pokemon Generations',\n 'photo' => '83210.jpg',\n 'description' => 'Pokémon Generations revisits each generation of the Pokémon video game series to shed new light on some timeless moments. From the earliest days in the Kanto region to the splendor of the Kalos region, go behind the scenes and witness Pokémon history with new eyes! (Source: Official site)',\n 'rating' => 7.47,\n 'genre_id' => $genre_id,\n 'episodes' => 18,\n ]);\n\n $this->insertMovieAndEpisodes([\n 'title' => 'Pokemon (2019)',\n 'photo' => '105554.jpg',\n 'description' => 'On a new day in the Kanto region, Satoshi gets invited by Professor Yukinari Ookido over to Professor Sakuragi\\'s lab-opening ceremony in Vermillion City. During the ceremonial speech, Professor Sakuragi receives an alert of a possibly rare Pokémon appearing in Vermillion City\\'s harbor, leading Satoshi and the other trainers to rush to the area in hopes of finding the mysterious Pokémon. At the harbor, they find Lugia—a Legendary Pokémon—engaged in combat with other trainers. Noticing the other trainers\\' tactics, Satoshi has his partner, Pikachu, strike Lugia with a Thunderbolt attack. Unfazed, Lugia flees, but not before Satoshi determinedly leaps onto its back. To Satoshi\\'s surprise, he meets another boy, Gou, who leapt onto Lugia\\'s back as well. The two ride on Lugia\\'s back as it brings them along on a bizarre adventure across the seas. As it lets the two back on the ground, Satoshi and Gou bid their farewells to Lugia and return to Sakuragi Institute. Impressed by Gou\\'s findings and Satoshi\\'s insight taken during their encounter, Sakuragi requests for the duo to be his new research partners. And so the duo\\'s journey begins, traveling across multiple regions to meet many new Pokémon—including ones that have the ability to Gigantamax! [Written by MAL Rewrite]',\n 'rating' => 7.34,\n 'genre_id' => $genre_id,\n 'episodes' => 16,\n ]);\n }", "public function eventos()\n {\n return $this->hasMany('App\\Evento');\n }", "public function video()\n {\n return $this->belongsTo(Video::class);\n }", "public function evento(){\n return $this->hasMany(eventos::class);\n }", "public function evolvesTo() {\n return $this->belongsTo('App\\Pokemon', 'pokemon_id', 'evolves_from_id');\n }", "public function videos()\n {\n return $this->morphedByMany('App\\Video', 'taggable');\n }", "public function music_genre(){\n return $this->belongsTo('App\\MusicGenre');\n }", "public function testSearchForWatchedEpisodes()\n {\n $watchedEpisodes = $this->season->getWatchedEpisodes();\n $this->assertCount(2, $watchedEpisodes);\n\n foreach($watchedEpisodes as $episode) {\n $this->assertTrue($episode->watched);\n }\n }", "public function vacantes()\n {\n return $this->hasMany('App\\BolsaEmpleo\\Vacante', 'puesto_id', 'id');\n }", "public function events()\n {\n return $this->hasMany('App\\Event');\n }", "public function reviews()\n {\n return $this->hasMany('App\\Models\\Review', 'movies_id');\n }", "public function days()\n {\n return $this->hasMany('App\\Day');\n }", "public function artefacts()\n {\n return $this->belongsToMany('App\\Artefact');\n }", "public function getEpisodes()\n {\n $episodes = [];\n if ($this->isReady) {\n if ($seasons = self::getSeasons() > 0) {\n $arrInfo = $this->doCurl($this->_strUrl . 'episodes');\n $seasons = $this->getSeasonNumbers($arrInfo['contents']);\n foreach ($seasons as $season) {\n $seasonInfo = $this->doCurl($this->_strUrl . 'episodes' . \"/_ajax?season=\" . $season);\n $doc = new Document($seasonInfo['contents']);\n foreach ($doc->find(\".list_item\") as $ep) {\n $plot = trim($ep->find(\"[itemprop='description']\")[0]->text());\n $date = trim($ep->find(\".airdate\")[0]->text());\n if (preg_match(\"/\\d+ .+ \\d+/\", $date) === 0) {\n $date = \"\";\n }\n $episodes[] = [\n \"title\" => trim($ep->find(\"[itemprop='name']\")[0]->text()),\n \"plot\" => strpos($plot, \"Know what this is about\") === false ? $plot : '',\n \"season\" => (int)$season,\n \"num\" => (int)$ep->find(\"[itemprop='episodeNumber']\")[0]->attr(\"content\"),\n \"date\" => isset($date) && !empty($date) ? date('Y-m-d', strtotime($date)) : null\n ];\n }\n }\n }\n }\n return $episodes;\n }", "public function evolvesFrom() {\n return $this->hasOne('App\\Pokemon', 'pokemon_id', 'evolves_from_id');\n }", "public function pokemons()\n {\n return $this->hasMany('LaraDex\\Pokemon');\n }", "public function director()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Directors');\n\t}", "public function actors($limit = null)\n {\n return $this->belongsToMany('App\\Models\\Cast', 'cast_of_movies')->where('job_id', 1)->limit($limit);\n }", "public function videoTranslation() {\n return $this->hasMany(VideoTranslation::class, 'video_id');\n }", "public function run()\n {\n $sherlock = array(\n 'A Study in Pink',\n 'The Blind Banker',\n 'The Great Game',\n 'A Scandal in Belgravia',\n 'The Hounds of Baskerville',\n 'The Reichenbach Fall',\n 'The Empty Hearse',\n 'The Sign of Three',\n 'His Last Vow',\n 'The Six Thatchers',\n 'The Lying Detective',\n 'The Final Problem',\n );\n\n for($i=0;$i<count($sherlock);$i++){\n $ep = new Episode();\n $ep->movie_id = 1;\n $ep->episode = $i+1;\n $ep->title = $sherlock[$i];\n $ep->save();\n }\n\n\n $kimetsu = array('Cruelty',\n 'Trainer Sakonji Urokodaki', \n 'Sabito and Makomo', \n 'Final Selection', \n 'My Own Steel', \n 'Swordsman Accompanying a Demon', \n 'Muzan Kibutsuji', \n 'The Smell of Enchanting Blood', \n 'Temari Demon and Arrow Demon', \n 'Together Forever', \n 'Tsuzumi Mansion',\n 'The Boar Bares Its Fangs, Zenitsu Sleeps',\n 'Something More Important Than Life',\n 'The House with the Wisteria Family Crest',\n 'Mount Natagumo',\n 'Letting Someone Else Go First',\n 'You Must Master a Single Thing',\n 'A Forged Bond', \n 'Hinokami',\n 'Pretend Family',\n 'Against Corps Rules',\n 'Master of the Mansion',\n 'Hashira Meeting',\n 'Rehabilitation Training',\n 'Tsuguko, Kanao Tsuyuri',\n 'New Mission');\n \n for($i=0;$i<count($kimetsu);$i++){\n $ep = new Episode();\n $ep->movie_id = 9;\n $ep->episode = $i+1;\n $ep->title = $kimetsu[$i];\n $ep->save();\n }\n }", "public function video()\n {\n return $this->hasOne(Video::class);\n }", "public function getEpisodes() {\n\n //first get the search data \n $seriesEpisodes = \\Q\\Api\\TheTvDb\\Services\\Series\\Request\\Episodes::create()\n ->setHttpServiceHandler($this->oServiceHandler)\n ->setSecurityService($this->oSecurityService)\n ->fetchAndAddSecurityHeaders()\n ->setParams($this->seriesId)//paginateable\n ->callService();\n\n $this->response = $seriesEpisodes->getResponse();\n\n return $this;\n }" ]
[ "0.7796667", "0.77527016", "0.655685", "0.6445905", "0.6379126", "0.6164956", "0.60987264", "0.60660017", "0.60315907", "0.6028489", "0.6016816", "0.59787744", "0.59584117", "0.5938481", "0.5917188", "0.5917188", "0.5913529", "0.5887879", "0.586753", "0.58588046", "0.5823085", "0.5800326", "0.5797101", "0.5742869", "0.57388747", "0.57321006", "0.5723096", "0.5710656", "0.5698036", "0.56920797", "0.5643859", "0.5636107", "0.56218517", "0.5604315", "0.5584856", "0.5580839", "0.5573018", "0.5564465", "0.55623376", "0.5534141", "0.55288815", "0.5488618", "0.54768795", "0.54757035", "0.54739475", "0.5469778", "0.54401094", "0.54287803", "0.5416845", "0.540308", "0.53987956", "0.53856766", "0.53847545", "0.53732866", "0.5369826", "0.5364273", "0.5348352", "0.5337036", "0.53260887", "0.5323938", "0.5314791", "0.53084224", "0.530594", "0.53004575", "0.5297517", "0.52953005", "0.5281991", "0.52696174", "0.52688456", "0.5268127", "0.5266111", "0.526123", "0.52541536", "0.5234985", "0.5208267", "0.52077055", "0.5195529", "0.51863754", "0.51834655", "0.51779705", "0.5170378", "0.5161524", "0.5160127", "0.51587456", "0.51586974", "0.5157725", "0.514072", "0.5136645", "0.5136042", "0.51350534", "0.51322436", "0.5129663", "0.51292914", "0.5125311", "0.512506", "0.5114019", "0.51070344", "0.5106147", "0.51031303", "0.50963223" ]
0.7776266
1
/ VN160204: Breadcrumbs: margin bottom = 20px
protected function getContentPart() { ?> <div class="container-non-responsive" style="margin-top: 15px"> <div class="row chitiet-breadcrumb"> <div class="col-xs-12"> <?= $this->getBreadcrumbsPart() ?> </div> </div> <div class="row"> <div class="col-xs-8 vn-lienhe-left"> <!-- title--> <div class="row"> <div class="col-xs-12"> <h2 class="title" style="text-transform: uppercase"> <small> <?= $this->getContentTitle() ?> </small> </h2> </div> </div> <!-- title--> <div class="row" style="margin-top: 20px;"> <div class="col-xs-12"> <?= $this->getContentMain() ?> </div> </div> <div class="row" style="margin-top: 100px;"> <div class="col-xs-12"> Share + </div> </div> </div> <div class="col-xs-4 vn-lienhe-right"> <div class="row"> <div class="col-xs-12"> <?php //get_sidebar('right-menu-dichvu'); $this->genRightMenu(); ?> </div> <?= $this->getBannerServicePage() ?> </div> </div> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function breadcrumbs() {\n\t\tif(!self::has_breadcrumbs()) return;\n\t\t?>\n\t\t\t<h6 id=\"header-breadcrumbs\">\n\t\t\t\t<?php dimox_breadcrumbs('&middot;') ?>\n\t\t\t</h6>\n\t\t<?php\n\t}", "public function getBreadcrumbs();", "function eo_bbpm_get_breadcrumb() {\n}", "protected function getBreadcrumbsPart()\n {\n ?>\n <?php\n //breadCrums\n $bc = $this->getBreadcrumbs();\n ?>\n\n <ol class=\"breadcrumb\" style=\"\">\n <?php\n\n foreach ($bc as $item):\n ?>\n <li><a href=\"<?= $item['url'] ?>\"><?= $item['name'] ?></a></li>\n <?php\n endforeach;\n ?>\n </ol>\n\n <?php\n }", "function dimox_breadcrumbs() {\n\t\t$text['home'] = 'Home'; // text for the 'Home' link\n\t\t$text['category'] = '%s'; // text for a category page\n\t\t$text['search'] = 'Wyniki wyszukiwania dla \"%s\"'; // text for a search results page\n\t\t$text['404'] = 'Błąd 404'; // text for the 404 page\n\t\t$text['page'] = '%s'; // text 'Page N'\n\t\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\t\t$wrap_before = '<div class=\"breadcrumbs\" itemscope itemtype=\"htt://schema.org/BreadCrumbList\">'; // the opening wrapper tag\n\t\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t\t$sep = '›'; // separator between crumbs\n\t\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t\t$sep_after = '</span>'; // tag after separator\n\t\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t\t$show_on_home = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t\t$after = '</span>'; // tag after the current crumb\n\t\t/* === END OF OPTIONS === */\n\t\tglobal $post;\n\t\t$home_link = home_url('/');\n\t\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t\t$link_after = '</span>';\n\t\t$link_attr = ' itemprop=\"url\"';\n\t\t$link_in_before = '<span itemprop=\"title\">';\n\t\t$link_in_after = '</span>';\n\t\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t\t$frontpage_id = get_option('page_on_front');\n\t\t$parent_id = $post->post_parent;\n\t\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\t\tif (is_home() || is_front_page()) {\n\t\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>' . $wrap_after;\n\t\t} else {\n\t\t\techo $wrap_before;\n\t\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\t\t\tif ( is_category() ) {\n\t\t\t\t$cat = get_category(get_query_var('cat'), false);\n\t\t\t\tif ($cat->parent != 0) {\n\t\t\t\t\t$cats = get_category_parents($cat->parent, TRUE, $sep);\n\t\t\t\t\t$cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $cats;\n\t\t\t\t}\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\t$cat = $cat->cat_ID;\n\t\t\t\t\techo $sep . sprintf($link, get_category_link($cat), get_cat_name($cat)) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . sprintf($text['category'], single_cat_title('', false)) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_search() ) {\n\t\t\t\tif (have_posts()) {\n\t\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\t\tif ($show_current) echo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\t\tprintf($link, $home_link . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t\t} else {\n\t\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\techo $cats;\n\t\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\t\techo $sep . sprintf($link, get_permalink(), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// custom post type\n\t\t\t} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\techo $sep . sprintf($link, get_post_type_archive_link($post_type->name), $post_type->label) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . $post_type->label . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_page() && !$parent_id ) {\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t$breadcrumbs = array();\n\t\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t\t}\n\t\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_404() ) {\n\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\t\t\t} elseif ( has_post_format() && !is_singular() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\techo get_post_format_string( get_post_format() );\n\t\t\t}\n\t\t\techo $wrap_after;\n\t\t}\n\t}", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "function wb_get_breadcrumbs()\n{\n return Westudio_Bootstrap_Breadcrumbs::items();\n}", "function BreadCrumb(){}", "function breadcrumbs(): void\n{\n\tif (function_exists('yoast_breadcrumb')) {\n\t\tyoast_breadcrumb(\n\t\t\t'<nav aria-label=\"You are here:\" role=\"navigation\" xmlns:v=\"http://rdf.data-vocabulary.org/#\">\n\t\t\t\t<ul class=\"breadcrumbs\">',\n\t\t\t'</ul></nav>'\n\t\t);\n\t}\n}", "public function get_navigation_breadcrumbs() {\n if (empty($this->navigation_breadcrumbs)) {\n $nazev_seo = Hana_Application::instance()->get_actual_seo();\n $breadcrumbs_part = array();\n $leaf_module = Hana_Application::instance()->get_main_controller();\n\n if ($leaf_module != \"page\") {\n\n $service = \"Service_\" . ucfirst($leaf_module);\n try {\n $breadcrumbs_part = $service::get_navigation_breadcrumbs($nazev_seo);\n } catch (Exception $exc) {\n throw new Kohana_Exception(\"Chyba v systému navigace - v servise \" . $service . \" chybí metoda \\\"get_navigation_breadcrumbs\\\", nebo je chybná:\" . $exc);\n }\n\n if (!empty($breadcrumbs_part)) {\n\n $temp = $breadcrumbs_part;\n $linked_breadcrumb = array_pop($temp);\n if (isset($linked_breadcrumb[\"parent_nazev_seo\"]))\n $nazev_seo = $linked_breadcrumb[\"parent_nazev_seo\"];\n }\n }\n\n if ($nazev_seo && $nazev_seo != I18n::get(\"index\")) {\n $this->navigation_breadcrumbs = array_merge($breadcrumbs_part, Service_Page::get_navigation_breadcrumbs($nazev_seo));\n } else {\n $this->navigation_breadcrumbs = $breadcrumbs_part;\n }\n }\n //die(print_r($this->navigation_breadcrumbs));\n return $this->navigation_breadcrumbs;\n }", "public function breadCrumbs()\n {\n $menu = Menu::new()\n ->addClass('m-subheader__breadcrumbs m-nav m-nav--inline')\n ->add(\n Link::toRoute('home', '<i class=\"m-nav__link-icon la la-home\"></i>')\n ->addClass('m-nav__link m-nav__link--icon')\n ->addParentClass('m-nav__item m-nav__item--home')\n )\n ;\n\n foreach ($this->crumbs($this->sections()) as $item) {\n $menu\n ->add(\n Html::raw('>')\n ->addParentClass('m-nav__separator')\n )\n ->add(\n Link::to($item['link'], '<span class=\"m-nav__link-text\">'. $item['text'] . '</span>')\n ->addClass('m-nav__link')\n ->addParentClass('m-nav__item')\n )\n ;\n }\n\n return $menu;\n }", "function dimox_breadcrumbs() {\n\n\t/* === OPTIONS === */\n\t$text['home'] = 'Home'; // text for the 'Home' link\n\t$text['category'] = 'Archive by Category \"%s\"'; // text for a category page\n\t$text['search'] = 'Search Results for \"%s\" Query'; // text for a search results page\n\t$text['tag'] = 'Posts Tagged \"%s\"'; // text for a tag page\n\t$text['author'] = 'Articles Posted by %s'; // text for an author page\n\t$text['404'] = 'Error 404'; // text for the 404 page\n\t$text['page'] = 'Page %s'; // text 'Page N'\n\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\n\t$wrap_before = '<div class=\"breadcrumbs\">'; // the opening wrapper tag\n\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t$sep = '>'; // separator between crumbs\n\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t$sep_after = '</span>'; // tag after separator\n\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t$show_on_home = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t$after = '</span>'; // tag after the current crumb\n\t/* === END OF OPTIONS === */\n\n\tglobal $post;\n\tglobal $pre_path;\n\t$home_link = 'https://www.nationalarchives.gov.uk/';\n\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t$link_after = '</span>';\n\t$link_attr = ' itemprop=\"url\"';\n\t$link_in_before = '<span itemprop=\"title\">';\n\t$link_in_after = '</span>';\n\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t$frontpage_id = get_option('page_on_front');\n\t$parent_id = $post->post_parent;\n\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\n\tif (is_home() || is_front_page()) {\n\n\t\t// TNA additional breadcrumbs for front page\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\t$numItems = count($pre_crumbs);\n\t\t\t$i = 0;\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\tif (++$i === $numItems) {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span>'. $crumb_name . '</span> ';\n\t\t\t\t} else {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tglobal $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>';\n\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_after;\n\n\t} else {\n\n\t\t// TNA additional breadcrumbs\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_before;\n\n\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\n\t\tif ( is_page() && !$parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t$breadcrumbs = array();\n\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, str_replace(home_url(), $pre_path, get_permalink($page->ID)), get_the_title($page->ID));\n\t\t\t\t\t}\n\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t}\n\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_404() ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\n\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\tglobal $pre_crumbs_st, $pre_crumbs_post;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_post) echo $pre_crumbs_post;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\tprintf($link, $home_link . '/' . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} else {\n\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t/*echo $cats;*/\n\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\techo $sep . sprintf($link, str_replace(home_url(), $pre_path, get_permalink()), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_after;\n\n\t}\n}", "function YOUR_THEME_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n\n $breadcrumb_items = [];\n $link_options = [\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__link',\n ],\n ],\n 'html' => TRUE\n ];\n $breadcrumb_items = [];\n $menu_breadcrumb = menu_tree_page_data('menu-breadcrumb-menu');\n $i = 0;\n foreach ($menu_breadcrumb as $item) {\n $breadcrumb_item = [\n 'data' => l($item['link']['link_title'], $item['link']['link_path'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n if ($i == 0) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--first';\n }\n $breadcrumb_items[] = $breadcrumb_item;\n $i++;\n }\n\n if ($segments_quantity > 0) {\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $breadcrumb_item = [\n 'data' => l($content, $it['url'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n } else {\n $breadcrumb_item = [\n 'data' => filter_xss($content),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n }\n if ($i == $segments_quantity) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--last';\n }\n\n $breadcrumb_items[] = $breadcrumb_item;\n }\n }\n\n $items = [\n 'items' => $breadcrumb_items,\n 'type' => 'ol',\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__segments-wrapper',\n ],\n ],\n ];\n\n return theme('item_list', $items);\n}", "public function marginBottom() {\n\t}", "function megatron_ubc_clf_breadcrumbs($variables) {\n $title = drupal_set_title();\n $output = '';\n $output .= '<ul class=\"breadcrumb expand\">';\n\n if (theme_get_setting('clf_crumbumbrellaunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbumbrellawebsite') . '\">' . theme_get_setting('clf_crumbumbrellaunit') . '</a><span class=\"divider\">/</span>';\n }\n if (theme_get_setting('clf_crumbunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbwebsite') . '\">' . theme_get_setting('clf_crumbunit') . '</a><span class=\"divider\">/</span>';\n }\n $output .= '<li>' . $title . '</li></ul>';\n return $output;\n}", "function thumbwhere_contentcollectionitem_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollectionItem'), 'admin/content'),\n l(t('ContentCollectionItem'), 'admin/thumbwhere/thumbwhere_contentcollectionitems'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function x_breadcrumbs() {\n\n\tif ( x_get_option( 'x_breadcrumb_display', '1' ) ) {\n\n\t GLOBAL $post;\n\n\t $is_ltr = ! is_rtl();\n\t $stack = x_get_stack();\n\t $delimiter = x_get_breadcrumb_delimiter();\n\t $home_text = x_get_breadcrumb_home_text();\n\t $home_link = home_url();\n\t $current_before = x_get_breadcrumb_current_before();\n\t $current_after = x_get_breadcrumb_current_after();\n\t $page_title = get_the_title();\n\t $blog_title = get_the_title( get_option( 'page_for_posts', true ) );\n\n\t if ( ! is_404() ) {\n\t\t$post_parent = $post->post_parent;\n\t } else {\n\t\t$post_parent = '';\n\t }\n\n\t if ( X_WOOCOMMERCE_IS_ACTIVE ) {\n\t\t//$shop_url = x_get_shop_link();\n\t\t$shop_url = home_url() . 'products';\n\t\t$shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) );\n\t\t$shop_link = '<a href=\"'. $shop_url .'\">' . $shop_title . '</a>';\n\t }\n\n\t echo '<div class=\"x-breadcrumbs\"><a href=\"' . $home_link . '\">' . $home_text . '</a>' . $delimiter;\n\n\t\tif ( is_home() ) {\n\n\t\t echo $current_before . $blog_title . $current_after;\n\n\t\t} elseif ( is_category() ) {\n\n\t\t $the_cat = get_category( get_query_var( 'cat' ), false );\n\t\t if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\n\t\t} elseif ( x_is_product_category() ) {\n\t\t\n\t\t $the_cat = get_queried_object();\n\t\t if ( $the_cat->parent != 0 ) echo x_get_taxonomy_parents( $the_cat->parent, $the_cat->taxonomy, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\t\t\n\t\t /*\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t */\n\t\t\n\t\t} elseif ( x_is_product_tag() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\n\t\t} elseif ( is_search() ) {\n\n\t\t echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;\n\n\t\t} elseif ( is_singular( 'post' ) ) {\n\n\t\t if ( get_option( 'page_for_posts' ) == is_front_page() ) {\n\t\t\techo $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\tif ( $is_ltr ) {\n\t\t\t echo '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t\t} else {\n\t\t\t echo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>';\n\t\t\t}\n\t\t }\n\n\t\t} elseif ( x_is_portfolio() ) {\n\n\t\t echo $current_before . get_the_title() . $current_after;\n\n\t\t} elseif ( x_is_portfolio_item() ) {\n\n\t\t $link = x_get_parent_portfolio_link();\n\t\t $title = x_get_parent_portfolio_title();\n\n\t\t if ( $is_ltr ) {\n\t\t\techo '<a href=\"' . $link . '\">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . $link . '\">' . $title . '</a>';\n\t\t }\n\n\t\t} elseif ( x_is_product() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t \n\t\t} elseif ( x_is_buddypress() ) {\n\n\t\t if ( bp_is_group() ) {\n\t\t\techo '<a href=\"' . bp_get_groups_directory_permalink() . '\">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } elseif ( bp_is_user() ) {\n\t\t\techo '<a href=\"' . bp_get_members_directory_permalink() . '\">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } else {\n\t\t\techo $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t }\n\n\t\t} elseif ( x_is_bbpress() ) {\n\n\t\t remove_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t if ( bbp_is_forum_archive() ) {\n\t\t\techo $current_before . bbp_get_forum_archive_title() . $current_after;\n\t\t } else {\n\t\t\techo bbp_get_breadcrumb();\n\t\t }\n\n\t\t add_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t} elseif ( is_page() && ! $post_parent ) {\n\n\t\t echo $current_before . $page_title . $current_after;\n\n\t\t} elseif ( is_page() && $post_parent ) {\n\n\t\t $parent_id = $post_parent;\n\t\t $breadcrumbs = array();\n\n\t\t if ( is_rtl() ) {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter;\n\t\t }\n\n\t\t while ( $parent_id ) {\n\t\t\t$page = get_page( $parent_id );\n\t\t\t$breadcrumbs[] = '<a href=\"' . get_permalink( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a>';\n\t\t\t$parent_id = $page->post_parent;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\t$breadcrumbs = array_reverse( $breadcrumbs );\n\t\t }\n\n\t\t for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {\n\t\t\techo $breadcrumbs[$i];\n\t\t\tif ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $delimiter . $current_before . $page_title . $current_after;\n\t\t }\n\n\t\t} elseif ( is_tag() ) {\n\n\t\t echo $current_before . single_tag_title( '', false ) . $current_after;\n\n\t\t} elseif ( is_author() ) {\n\n\t\t GLOBAL $author;\n\t\t $userdata = get_userdata( $author );\n\t\t echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';\n\n\t\t} elseif ( is_404() ) {\n\n\t\t echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;\n\n\t\t} elseif ( is_archive() ) {\n\n\t\t if ( x_is_shop() ) {\n\t\t\techo $current_before . $shop_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . __( 'Archives ', '__x__' ) . $current_after;\n\t\t }\n\n\t\t}\n\n\t echo '</div>';\n\n\t}\n}", "function thumbwhere_contentcollection_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollection'), 'admin/content'),\n l(t('ContentCollection'), 'admin/thumbwhere/thumbwhere_contentcollections'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "public function trail() {\n\n\t\t$breadcrumb = '';\n\t\t$item_count = count( $this->items );\n\t\t$item_position = 0;\n\n\t\tif ( 0 < $item_count ) {\n\n\t\t\tif ( true === $this->args['show_browse'] )\n\t\t\t\t$breadcrumb .= sprintf( '<h2 class=\"trail-browse\">%s</h2>', $this->labels['browse'] );\n\n\t\t\t$breadcrumb .= '<ol class=\"breadcrumb '.$this->args['classes'].'\" itemscope itemtype=\"http://schema.org/BreadcrumbList\">';\n\n\t\t\t$breadcrumb .= sprintf( '<meta name=\"numberOfItems\" content=\"%d\" />', absint( $item_count ) );\n\t\t\t$breadcrumb .= '<meta name=\"itemListOrder\" content=\"Ascending\" />';\n\n\t\t\tforeach ( $this->items as $item ) {\n\n\t\t\t\t++$item_position;\n\n\t\t\t\tpreg_match( '/(<a.*?>)(.*?)(<\\/a>)/i', $item, $matches );\n\n\t\t\t\t$item = !empty( $matches ) ? sprintf( '%s<span itemprop=\"name\">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop=\"name\">%s</span>', $item );\n\n\t\t\t\t$item_class = 'breadcrumb-item';\n\n\t\t\t\tif ( $item_count === $item_position )\n\t\t\t\t\t$item_class .= ' active';\n\n\t\t\t\t$attributes = 'itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\" class=\"' . $item_class . '\"';\n\n\t\t\t\t$meta = sprintf( '<meta itemprop=\"position\" content=\"%s\" />', absint( $item_position ) );\n\n\t\t\t\t$breadcrumb .= sprintf( '<li %s>%s%s</li>', $attributes, $item, $meta );\n\t\t\t}\n\n\t\t\t$breadcrumb .= '</ol>';\n\n\t\t\t$breadcrumb = sprintf(\n\t\t\t\t'<%1$s role=\"navigation\" aria-label=\"%2$s\" class=\"breadcrumbs\" itemprop=\"breadcrumb\">%3$s%4$s%5$s</%1$s>',\n\t\t\t\ttag_escape( $this->args['container'] ),\n\t\t\t\tesc_attr( $this->labels['aria_label'] ),\n\t\t\t\t$this->args['before'],\n\t\t\t\t$breadcrumb,\n\t\t\t\t$this->args['after']\n\t\t\t);\n\t\t}\n\n\t\tif ( false === $this->args['echo'] )\n\t\t\treturn $breadcrumb;\n\n\t\techo $breadcrumb;\n\t}", "public static function yoast_breadcrumbs_markup() {\r\n if ( function_exists( 'yoast_breadcrumb' ) ) {\r\n yoast_breadcrumb( '<p class=\"wfc-yoast-breadcrumbs\">','</p>' );\r\n }\r\n }", "function ss_breadcrumbs() {\r\n\tglobal $post;\r\n\r\n\t$blog_page_title = get_the_title( get_queried_object_id() );\r\n\r\n\techo '<ul class=\"theme-breadcrumbs\">';\r\n\r\n\tif ( !is_front_page() ) {\r\n\t\techo '<li><a href=\"';\r\n\t\techo home_url();\r\n\t\techo '\">'.__( 'Home', 'spnoy' );\r\n\t\techo \"</a></li>\";\r\n\t}\r\n\r\n\t$params['link_none'] = '';\r\n\t$separator = '';\r\n\r\n\tif ( is_category() && !is_singular( 'portfolio' ) ) {\r\n\t\t$category = get_the_category();\r\n\t\t$ID = $category[0]->cat_ID;\r\n\t\techo is_wp_error( $cat_parents = get_category_parents( $ID, TRUE, '', FALSE ) ) ? '' : '<li>'.$cat_parents.'</li>';\r\n\t}\r\n\r\n\tif ( is_singular( 'portfolio' ) ) {\r\n\t\techo get_the_term_list( $post->ID, 'portfolio-category', '<li>', '&nbsp;/&nbsp;&nbsp;', '</li>' );\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\r\n\tif ( is_tax( 'portfolio-category' ) ) {\r\n\t\techo '<li>'.get_query_var( 'portfolio-category' ).'</li>';\r\n\t}\r\n\r\n\tif ( is_home() ) { echo '<li>'.$blog_page_title.'</li>'; }\r\n\tif ( is_page() && !is_front_page() ) {\r\n\t\t$parents = array();\r\n\t\t$parent_id = $post->post_parent;\r\n\t\twhile ( $parent_id ) :\r\n\t\t\t$page = get_page( $parent_id );\r\n\t\tif ( $params[\"link_none\"] )\r\n\t\t\t$parents[] = get_the_title( $page->ID );\r\n\t\telse\r\n\t\t\t$parents[] = '<li><a href=\"' . get_permalink( $page->ID ) . '\" title=\"' . get_the_title( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a></li>' . $separator;\r\n\t\t$parent_id = $page->post_parent;\r\n\t\tendwhile;\r\n\t\t$parents = array_reverse( $parents );\r\n\t\techo join( ' ', $parents );\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\tif ( is_single() && !is_singular( 'portfolio' ) ) {\r\n\t\t$categories_1 = get_the_category( $post->ID );\r\n\t\tif ( $categories_1 ):\r\n\t\t\tforeach ( $categories_1 as $cat_1 ):\r\n\t\t\t\t$cat_1_ids[] = $cat_1->term_id;\r\n\t\t\tendforeach;\r\n\t\t$cat_1_line = implode( ',', $cat_1_ids );\r\n\t\tendif;\r\n\t\t$categories = get_categories( array(\r\n\t\t\t\t'include' => $cat_1_line,\r\n\t\t\t\t'orderby' => 'id'\r\n\t\t\t) );\r\n\t\tif ( $categories ) :\r\n\t\t\tforeach ( $categories as $cat ) :\r\n\t\t\t\t$cats[] = '<li><a href=\"' . get_category_link( $cat->term_id ) . '\" title=\"' . $cat->name . '\">' . $cat->name . '</a></li>';\r\n\t\t\tendforeach;\r\n\t\techo join( ' ', $cats );\r\n\t\tendif;\r\n\t\techo '<li>'.get_the_title().'</li>';\r\n\t}\r\n\tif ( is_tag() ) { echo '<li>'.\"Tag: \".single_tag_title( '', FALSE ).'</li>'; }\r\n\tif ( is_404() ) { echo '<li>'.__( \"404 - Page not Found\", 'spnoy' ).'</li>'; }\r\n\tif ( is_search() ) { echo '<li>'.__( \"Search\", 'spnoy' ).'</li>'; }\r\n\tif ( is_year() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\tif ( is_month() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\tif ( is_day() ) { echo '<li>'.get_the_time( get_option( 'date_format' ) ).'</li>'; }\r\n\r\n\techo \"</ul>\";\r\n}", "static public function NavBarBottom() {\n\t\t$show_back = (strlen(self::$prev_page) > 0);\n\t\t$show_next = (strlen(self::$next_page) > 0);\n\n\t\techo '<p class=\"center\">';\n\t\tif ($show_back) {\n\t\t\techo '<a href=\"', self::$prev_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" title=\"', (self::isGerman() ? 'Zurück' : 'Back'), '\" class=\"arrow_left {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_left.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '<a href=\"#top\">';\n\t\techo '<img alt=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" title=\"', (self::isGerman() ? 'nach oben' : 'top'), '\" class=\"arrow_up {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_up.png\" width=\"15\" height=\"22\" />';\n\t\techo '</a>';\n\t\tif ($show_next) {\n\t\t\techo '<a href=\"', self::$next_page, '\">';\n\t\t\techo '<img alt=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" title=\"', (self::isGerman() ? 'Weiter' : 'Next'), '\" class=\"arrow_right {PNGCSS}\" src=\"', self::getImageURL(), '/arrow_right.png\" width=\"30\" height=\"15\" />';\n\t\t\techo '</a>';\n\t\t}else {\n\t\t\techo '<img alt=\"dummy\" title=\"\" src=\"', self::getImageURL(), '/blank.gif\" width=\"30\" height=\"22\" />';\n\t\t}\n\t\techo '</p>';\n\t}", "function _get_breadcrumbs($starting_page, $container = array())\n{\n\n //make sure you're working with an object\n $sp = (!is_object($starting_page)) ? get_post($starting_page) : $starting_page;\n\n //make sure to insert starting page only once\n if (!in_array(get_permalink($sp->ID), $container)) {\n $container[get_permalink($sp->ID)] = get_the_title($sp->ID);\n }\n\n //if parent, recursion!\n if ($sp->post_parent > 0) {\n $container[get_permalink($sp->post_parent)] = get_the_title($sp->post_parent);\n $container = _get_breadcrumbs($sp->post_parent, $container);\n }\n\n return $container;\n}", "function Breadcrumb ($pathinfo) {\n if (strlen($pathinfo)<1) { $pathinfo = $REQUEST_URI; } \n $divider = \">>\";\n print \"<p id=\\\"breadcrumbs\\\" style=\\\"clear: both; margin-left: 8ex; text-indent:-8ex\\\">\\n\";\n $pre_path = \"/docs\";\n $more_path= \"/\";\n $path = split (\"/\", $pathinfo);\n print \"Return to: <a href=\\\"/lib/\\\">Library Homepage</a>\";\n \n $count = count($path);\n $less = $count-1;\n \n if (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n /*\n print \"<!-- COUNT ME: $count -->\";\n print \"<!--\";\n print_r($path);\n print \"-->\";\n */\n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <a href=\\\"$more_path$dir/\\\">$line</a>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "private function _buildBreadcrumbsHtml()\n {\n // Get active elements\n $nodes = $this->_getActiveElements();\n\n // Do we have custom nodes?\n $customNodes = $this->_getParam('customNodes', false);\n if ($customNodes && is_array($customNodes) && count($customNodes)) {\n $nodes = array_merge($nodes, $customNodes);\n }\n\n // Create breadcrumbs\n $length = count($nodes);\n $breadcrumbs = \"\\n\" . sprintf('<%1$s%2$s%3$s xmlns:v=\"http://rdf.data-vocabulary.org/#\">',\n $this->_getParam('wrapper', 'ol'),\n $this->_getParam('id', false) ? ' id=\"' . $this->_getParam('id', '') . '\"' : '',\n $this->_getParam('class', false) ? ' class=\"' . $this->_getParam('class', '') . '\"' : ''\n );\n\n // Before text\n if ($this->_getParam('beforeText', false)) {\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s><span>%2$s</span></li>',\n $this->_getParam('classDefault', false) ? ' class=\"' . $this->_getParam('classDefault', '') . '\"' : '',\n $this->_getParam('beforeText', '')\n );\n }\n\n foreach ($nodes as $index => $node) {\n $nodeTitle = is_array($node) ? (isset($node['title']) ? $node['title'] : Craft::t('Unknown')) : $node->__toString();\n $nodeUrl = is_array($node) ? (isset($node['url']) ? $node['url'] : '') : $node->url;\n\n // Gather node classes\n $childClasses = array();\n if ($this->_getParam('classDefault', false)) {\n $childClasses[] = $this->_getParam('classDefault', '');\n }\n\n // First\n if ($index == 0) {\n $childClasses[] = $this->_getParam('classFirst', 'first');\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\"><a href=\"%2$s\" title=\"%3$s\" rel=\"v:url\" property=\"v:title\">%3$s</a></li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $nodeUrl,\n $this->_getParam('renameHome', $nodeTitle)\n );\n }\n // Last\n elseif ($index == $length - 1)\n {\n $childClasses[] = $this->_getParam('classLast', 'last');\n $breadcrumb = sprintf('<span property=\"v:title\">%1$s</span>',\n $nodeTitle\n );\n if ($this->_getParam('lastIsLink', false)) {\n $breadcrumb = sprintf('<a href=\"%1$s\" title=\"%2$s\" rel=\"v:url\" property=\"v:title\">%2$s</a>',\n $nodeUrl,\n $nodeTitle\n );\n }\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\">%2$s</li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $breadcrumb\n );\n }\n else {\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\"><a href=\"%2$s\" title=\"%3$s\" rel=\"v:url\" property=\"v:title\">%3$s</a></li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $nodeUrl,\n $nodeTitle\n );\n }\n }\n $breadcrumbs .= \"\\n\" . sprintf('</%1$s>',\n $this->_getParam('wrapper', 'ol')\n );\n return TemplateHelper::getRaw($breadcrumbs);\n }", "public function wpo_woocommerce_breadcrumbs() {\n\t\treturn array(\n\t\t\t'delimiter' => ' &#47; ',\n\t\t\t'wrap_before' => '<nav class=\"breadcrumb\" itemprop=\"breadcrumb\">',\n\t\t\t'wrap_after' => '</nav>',\n\t\t\t'before' => '',\n\t\t\t'after' => '',\n\t\t\t'home' => _x( 'Home', 'breadcrumb', 'woocommerce' )\n\t\t\t);\n\t}", "function themeblvd_breadcrumbs(){\n\t\n\tif(function_exists('bcn_display')){\n\t\n\t\techo '<div id=\"breadcrumbs\">';\n \tbcn_display();\n \techo '</div>';\n\t\n\t}\n\t\n##################################################################\n}", "function buildBreadcrumbs( $skin, $template ) {\n \n # Get the list of categories for the current page \n preg_match_all( '`title=\"Category:(.*?)\"`', $skin->getCategories(), $matches, PREG_PATTERN_ORDER );\n $categories = $matches[1];\n \n # Treat the namespace as a category too\n if ( $skin->mTitle->getNsText() )\n $categories[] = $skin->mTitle->getNsText();\n \n # Load and parse the breadcrumb template. If it's a redirected page, extract redirect info\n $crumbs = matchFirstCategory( CRUMBPAGE, $categories );\n $breadcrumb = trim( $crumbs[0] . ' ' . $skin->mTitle->getText() );\n if ( preg_match('/\\(Redirected.*?\\)/', $template->data['subtitle'], $match) )\n $breadcrumb .= ' ' . $match[0];\n # Set the page subtitle to the breadcrumb contents\n $template->set( 'subtitle', $breadcrumb );\n \n # If the current page is a category page, add it to the list\n # We didn't add it before because we don't want Category > Category'\n $pagecat = strstr( $skin->mTitle->getPrefixedText(), 'Category:' );\n if ( $pagecat !== FALSE )\n $categories[] = substr( $pagecat, strlen('Category:') );\n # If it's not a category page, try for an exact match of the title (e.g. 'Main')\n else\n $categories[] = $skin->mTitle->getText();\n \n # Mark the corresponding tab of the sidebar as active\n $crumbs = matchFirstCategory( CRUMBPAGE, $categories );\n if ( !empty($crumbs[1]) ) {\n # See if there's a corresponding link in the sidebar and mark it as active.\n # This is especially useful for skins that display the sidebar as a tab bar. \n if ( method_exists( $template, 'setActiveSidebarLink' ) ) {\n # The DynamicSkin extension can build the tabs (sidebar) dynamically,\n # and not necessarily from $template->data['sidebar'], so DynamicSkin \n # and derived skins have a setActiveSidebarLink() function\n $template->setActiveSidebarLink( $crumbs[1] );\n } else {\n # Normal skins use the global sidebar data\n foreach ($template->data['sidebar'] as $bar => $cont) {\n foreach ($cont as $key => $val) {\n if ( $val['text'] == $crumbs[1] )\n {\n $template->data['sidebar'][$bar][$key]['active'] = true;\n break;\n }\n }\n } \n }\n }\n \n # Finally, see if we should change the site logo\n # Don't go overboard with this... subtle is better.\n if ( ! empty($crumbs[2]))\n {\n global $wgLogo, $wgScriptPath;\n $wgLogo = $wgScriptPath . '/' . $crumbs[2];\n }\n \n return true;\n}", "function breadcrumbs(){\n global $post;\n $seperator = \"/\";\n $home = \"Home\";\n \n echo \"<ul class='breadcrumbs'>\";\n echo \"<li>You are here: </li>\";\n \n if(is_front_page()){\n echo \"<li>\" . $home . \"</li>\";\n }else{\n echo \"<li><a href=\" . get_site_url() . \">\" . $home . \"</a></li>\";\n }\n \n if(is_home() || is_single()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(is_home()){\n echo \"<li>Recipe</li>\";\n }else {\n echo \"<li><a href=\" . get_post_type_archive_link('post') . \">Shop</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n }\n \n if(is_page() && !is_front_page()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(!empty($post->post_parent)){\n echo \"<li>\";\n echo \"<a href=\" . get_permalink($post->post_parent). \">\";\n echo get_the_title($post->post_parent);\n echo \"</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n }\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n \n echo \"</ul>\";\n }", "function thumbwhere_host_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Host'), 'admin/content'),\n l(t('Host'), 'admin/thumbwhere/thumbwhere_hosts'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "public function getBreadcrumbsBlock()\n {\n return $this->getLayout()->getBlock(\"breadcrumbs\");\n }", "public function isBreadcrumbBottom()\r\n\t{\r\n\t\treturn $this->breadcrumbBottom;\r\n\t}", "public function xml_breadcrumbs()\n {\n $post_url = build_url(array('page' => '_SELF', 'type' => '_xml_breadcrumbs'), '_SELF');\n\n return do_template('XML_CONFIG_SCREEN', array(\n '_GUID' => '456f56149832d459bce72ca63a1578b9',\n 'TITLE' => $this->title,\n 'POST_URL' => $post_url,\n 'XML' => file_exists(get_custom_file_base() . '/data_custom/xml_config/breadcrumbs.xml') ? cms_file_get_contents_safe(get_custom_file_base() . '/data_custom/xml_config/breadcrumbs.xml') : cms_file_get_contents_safe(get_file_base() . '/data/xml_config/breadcrumbs.xml'),\n ));\n }", "function create_crumbs() {\n\t\n\t\t$breadcrumb = '';\n\t\t$args = $this->args;\n\n\t\t// Get the items based on page context \n\t\t$trail = $this->get_trail();\n\n\t\t// If items are found, build the trail \n\t\tif ( !empty( $trail ) && is_array( $trail ) ) {\n\n\t\t\t// Wrap the trail and add the 'Before' element\n\t\t\t$breadcrumb = '<'.$args['container']. ' class=\"breadcrumb-trail breadcrumbs\">';\n\t\t\t$breadcrumb .= ( !empty( $args['before'] ) ? '<span class=\"trail-before\">' . $args['before'] . '</span> ' : '' );\n\t\t\t\n\t\t\t// Adds the 'trail-end' class around last item \n\t\t\tarray_push( $trail, '<span class=\"trail-end\">' . array_pop( $trail ) . '</span>' );\n\t\t\t\n\t\t\t// Format the separator \n\t\t\t$separator = ( !empty( $args['separator'] ) ? $args['separator'] : '' );\n\n\t\t\t// Join the individual trail items into a single string \n\t\t\t$breadcrumb .= join( \" {$separator} \", $trail );\n\n\t\t\t// Close the breadcrumb trail containers \n\t\t\t$breadcrumb .= '</' . $args['container'] . '>';\n\t\t}\n\n\t\t// Return the formatted breadcrumbs\n\t\treturn $breadcrumb;\n\t}", "function apoc_breadcrumbs( $args = array() ) {\n\t$crumbs = new Apoc_Breadcrumbs( $args );\n\techo $crumbs->crumbs;\n}", "function the_breadcrumb() {\n\t global $post;\n\t $separator = '<span class=\"breadcrumb-divider\"><svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 8.49993L13.4394 5.93933V7.99599H0V9.00394H13.4394V11.0606L16 8.49993Z\" fill=\"#121212\" /></svg></span>';\n\t echo '<nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\">';\n\t if (!is_home()) {\n\t\t\t echo '<li class=\"breadcrumb-item\"><a href=\"';\n\t\t\t echo get_option('home');\n\t\t\t echo '\">';\n\t\t\t echo __( 'Home', 'thegrapes' );\n\t\t\t echo '</a></li>' . $separator;\n\t\t\t if ( is_category() ) {\n\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">';\n\t\t\t\t\t the_category(' </li>' . $separator . '<li class=\"breadcrumb-item\"> ');\n\t\t\t } elseif ( is_single() ) {\n echo '<li class=\"breadcrumb-item\">';\n echo '<a href=\"' . get_post_type_archive_link( 'post' ) . '\">';\n echo get_the_title( get_option('page_for_posts', true) );\n echo '</a>';\n echo '</li>' . $separator . '<li class=\"breadcrumb-item active\">';\n the_title();\n echo '</li>';\n } elseif ( is_page() ) {\n\t\t\t\t\t if($post->post_parent){\n\t\t\t\t\t\t\t $anc = get_post_ancestors( $post->ID );\n\t\t\t\t\t\t\t $title = get_the_title();\n\t\t\t\t\t\t\t foreach ( $anc as $ancestor ) {\n\t\t\t\t\t\t\t\t\t $output = '<li class=\"breadcrumb-item\"><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>' . $separator;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t echo $output;\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.$title.'</li>';\n\t\t\t\t\t } else {\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.get_the_title().'</li>';\n\t\t\t\t\t }\n\t\t\t }\n\t }\n\t elseif (is_tag()) {single_tag_title();}\n\t elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n\t elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n\t elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n\t elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n\t elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n\t elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n\t echo '</ol></nav>';\n}", "function hbreadcrumbs()\n\t{\n\t\t$uri = luri_get();\n\t\t$html = \"\";\n\n\t\t$cat = lconf_dbget(\"default_uri\");\n\t\t$cat = mcategories_read($cat);\n\t\t$html = $cat[\"name\"];\n\n\t\tif (strlen($uri[0]))\n\t\t{\n\t\t\t$html = '<a href=\"' . hanchor_shref() . '\">' . $html . '</a>';\n\n\t\t\tfor($i = 0; $i < count($uri); $i++)\n\t\t\t{\n\t\t\t\t$cat = mcategories_read($uri[$i]);\n\t\t\t\tif ($i < count($uri) - 1 && $cat) $html .= ' &gt; <a href=\"' . hanchor_href(\"main/index/content\", mcategories_read_path($uri[$i], false)) . '\">' . $cat[\"name\"] . '</a>';\n\t\t\t\telse if ($cat) $html .= ' &gt; <span>' . $cat[\"name\"] . '</span>';\n\t\t\t}\n\t\t}\n\t\telse $html = '<span>' . $html . '</span>';\n\n\t\treturn $html;\n\t}", "function ibio_breadcrumbs(){\n\n genesis_do_breadcrumbs();\n\n /*if ( function_exists('yoast_breadcrumb') ) {\n yoast_breadcrumb('<p id=\"breadcrumbs\">','</p>');\n } else{\n genesis_do_breadcrumbs();\n }*/\n}", "function get_breadcrumbs($breadcrumbs_id_list)\n {\n if(trim($breadcrumbs_id_list)!='')\n {\n $breadcrumb_ids = explode(',',$breadcrumbs_id_list);\n $breadcrumb_ids = array_map('intval', $breadcrumb_ids);\n #if(isset($breadcrumb_ids))\n # {\n $ids = implode(',', $breadcrumb_ids);\n $dbr = Database::$content->query(\"SELECT id, page, title FROM \".Database::$db_settings['pages_table'].\" WHERE id IN(\".$ids.\")\");\n while($data = $dbr->fetch())\n {\n $unordered_breadcrumbs[$data['id']]['page'] = $data['page'];\n $unordered_breadcrumbs[$data['id']]['title'] = $data['title'];\n }\n // order:\n foreach($breadcrumb_ids as $id)\n {\n if(isset($unordered_breadcrumbs[$id])) $breadcrumbs[] = $unordered_breadcrumbs[$id];\n }\n /* // the same with several database requests (1 per breadcrumb):\n $dbr = Database::$content->prepare(\"SELECT page, title FROM \".Database::$db_settings['pages_table'].\" WHERE id=:id\");\n $i=0;\n Database::$content->beginTransaction();\n foreach($breadcrumb_ids as $breadcrumb_id)\n {\n $dbr->bindValue(':id', $breadcrumb_id, PDO::PARAM_INT);\n $dbr->execute();\n $data = $dbr->fetch();\n if(isset($data['page']))\n {\n $breadcrumbs[$i]['page'] = $data['page'];\n $breadcrumbs[$i]['title'] = $data['title'];\n ++$i;\n unset($data);\n }\n }\n Database::$content->commit();\n */\n #}\n if(isset($breadcrumbs))\n {\n return $breadcrumbs;\n }\n }\n return false;\n }", "public function drawBreadcrumb($guid = false){\n\t\t global $db, $siteID, $page;\n\t\t $guid = ($guid) ? $guid : $this->guid;\n\t\t $html = '';\n\t\t $link = array();\n\t\t \n\t\t \t// current page\n\t\t \t$link[] = $this->drawTitleByGUID($guid);\n\t\t \n\t\t \t// add all precedings parents to the array\n\t\t\twhile($parent = $this->getParentByGUID($guid)){\n\t\t\t\t$pagetitle=$this->drawTitleByGUID($parent);\n\t\t\t\t$pagetitle=(strtolower($pagetitle)==\"home\")?$page->drawLabel(\"home\", \"Home\"):$pagetitle;\n\t\t\t\t$link[] = '<a href=\"'. $this->drawLinkByGUID($parent) .'\">'.ucfirst($pagetitle).'</a>';\n\t\t\t\t$guid = $parent;\n\t\t \t}\n\t\t \n\t\t \tif($link){\n\t\t\t\tkrsort($link);\n\t\t \t}\n\t\t \n\t\t \t// Add a home link\n\t\t\t$last = sizeof($link);\n\t\t\t$pagetitle=$this->drawTitleByGUID($siteID);\n\t\t\t$pagetitle=(strtolower($pagetitle)==\"home\")?$page->drawLabel(\"home\", \"Home\"):$pagetitle;\n\t\t \t$link[$last-1] = '<a href=\"'. $this->drawLinkByGUID($siteID) .'\">'.$pagetitle.'</a>';\n\t\t \t// this is a microsite so remove the first (duplicate) link\n\t\t \tif($link[$last-1] == $link[$last-2]){\n\t\t\t\tunset($link[$last-1]);\n\t\t \t}\n\n\t\t \t$html = join(' &gt; ',$link); // add the separator\n\t\t \n\t\t \treturn $html; \n\t\t}", "function bootstrapwp_breadcrumbs()\n{\n $home = 'Home'; // text for the 'Home' link\n $before = '<li class=\"active\">'; // tag before the current crumb\n $sep = '<span class=\"divider\">/</span>';\n $after = '</li>'; // tag after the current crumb\n\n if (!is_home() && !is_front_page() || is_paged()) {\n\n echo '<ul class=\"breadcrumb\">';\n\n global $post;\n $homeLink = home_url();\n echo '<li><a href=\"' . $homeLink . '\">' . $home . '</a> '.$sep. '</li> ';\n if (is_category()) {\n global $wp_query;\n $cat_obj = $wp_query->get_queried_object();\n $thisCat = $cat_obj->term_id;\n $thisCat = get_category($thisCat);\n $parentCat = get_category($thisCat->parent);\n if ($thisCat->parent != 0) {\n echo get_category_parents($parentCat, true, $sep);\n }\n echo $before . 'Archive by category \"' . single_cat_title('', false) . '\"' . $after;\n } elseif (is_day()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo '<li><a href=\"' . get_month_link(get_the_time('Y'), get_the_time('m')) . '\">' . get_the_time(\n 'F'\n ) . '</a></li> ';\n echo $before . get_the_time('d') . $after;\n } elseif (is_month()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo $before . get_the_time('F') . $after;\n } elseif (is_year()) {\n echo $before . get_the_time('Y') . $after;\n } elseif (is_single() && !is_attachment()) {\n if (get_post_type() != 'post') {\n $post_type = get_post_type_object(get_post_type());\n $slug = $post_type->rewrite;\n echo '<li><a href=\"' . $homeLink . '/' . $slug['slug'] . '/\">' . $post_type->labels->singular_name . '</a>'.$sep.'</li> ';\n echo $before . get_the_title() . $after;\n } else {\n $cat = get_the_category();\n $cat = $cat[0];\n echo '<li>'.get_category_parents($cat, true, $sep).'</li>';\n echo $before . get_the_title() . $after;\n }\n } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {\n $post_type = get_post_type_object(get_post_type());\n echo $before . $post_type->labels->singular_name . $after;\n } elseif (is_attachment()) {\n $parent = get_post($post->post_parent);\n $cat = get_the_category($parent->ID);\n $cat = $cat[0];\n echo get_category_parents($cat, true, $sep);\n echo '<li><a href=\"' . get_permalink(\n $parent\n ) . '\">' . $parent->post_title . '</a></li> ';\n echo $before . get_the_title() . $after;\n\n } elseif (is_page() && !$post->post_parent) {\n echo $before . get_the_title() . $after;\n } elseif (is_page() && $post->post_parent) {\n $parent_id = $post->post_parent;\n $breadcrumbs = array();\n while ($parent_id) {\n $page = get_page($parent_id);\n $breadcrumbs[] = '<li><a href=\"' . get_permalink($page->ID) . '\">' . get_the_title(\n $page->ID\n ) . '</a>' . $sep . '</li>';\n $parent_id = $page->post_parent;\n }\n $breadcrumbs = array_reverse($breadcrumbs);\n foreach ($breadcrumbs as $crumb) {\n echo $crumb;\n }\n echo $before . get_the_title() . $after;\n } elseif (is_search()) {\n echo $before . 'Search results for \"' . get_search_query() . '\"' . $after;\n } elseif (is_tag()) {\n echo $before . 'Posts tagged \"' . single_tag_title('', false) . '\"' . $after;\n } elseif (is_author()) {\n global $author;\n $userdata = get_userdata($author);\n echo $before . 'Articles posted by ' . $userdata->display_name . $after;\n } elseif (is_404()) {\n echo $before . 'Error 404' . $after;\n }\n // if (get_query_var('paged')) {\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ' (';\n // }\n // echo __('Page', 'bootstrapwp') . $sep . get_query_var('paged');\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ')';\n // }\n // }\n\n echo '</ul>';\n\n }\n}", "protected function breadcrumbForList()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $breadcrumbTree->addDefaultListEntry();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "function breadcrumbs(BreadcrumbsParams $params) : string\n{\n $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n // This one removes 'oildiscovery' from the path in development environment\n $path = array_diff($path, ['oildiscovery']);\n\n // This is the base URL\n $base = URLROOT;\n \n\n // Initialize a temporary array with our breadcrumbs. (starting with our home page, which will be the base URL)\n $breadcrumbs = array(\"<a class='breadcrumbs__link' href=\\\"$base\\\">$params->home</a>\");\n\n // Find out the index for the last value in our path array\n $pathkeys = array_keys($path);\n $last = end($pathkeys);\n // Build the rest of the breadcrumbs\n foreach ($path as $key => $crumb) {\n // \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n $title = ucwords(str_replace(array('.php', '_'), array('', ' '), $crumb));\n\n // If we are not on the last index, then display an <a> tag\n if ($key != $last) {\n $breadcrumbs[] = \"<a class='breadcrumbs__link' href=\\\"$base\\\\$crumb\\\">$title</a>\";\n }\n // Otherwise, just display the title (minus)\n if ($key === $last) {\n // If the last index is an integer then replace the post id with post title\n if (is_numeric($crumb)) {\n $breadcrumbs[] = $params->post_title;\n } else {\n $breadcrumbs[] = $title;\n }\n }\n\n if (is_numeric($crumb)) {\n }\n }\n\n // Build our temporary array (pieces of bread) into one big string :)\n return implode($params->separator, $breadcrumbs);\n}", "function Breadcrumb2010 () {\n$pathinfo = $_SERVER[REQUEST_URI];\n$divider = \">\";\n$pre_path = \"/docs\";\n$more_path= \"/\";\n$pathinfo = chop ($pathinfo, \"/\");\n$path = split (\"/\", $pathinfo);\n print \"<span class=\\\"crumb\\\"><a href=\\\"/lib/\\\">Library Homepage</a></span>\";\n $count = count($path);\n $less = $count-1;\n\n \nif (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) \n {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <span class=\\\"crumb\\\"><a href=\\\"$more_path$dir/\\\">$line</a></span>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\n // This will build our \"base URL\" ... Also accounts for HTTPS :)\n $base = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\n\n // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n $breadcrumbs = array(\"<a href=\\\"$base\\\">$home</a>\");\n\n // Initialize crumbs to track path for proper link\n $crumbs = '';\n\n // Find out the index for the last value in our path array\n $last = @end(array_keys($path));\n\n // Build the rest of the breadcrumbs\n foreach ($path as $x => $crumb) {\n // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n $title = ucwords(str_replace(array('.php', '_', '%20'), array('', ' ', ' '), $crumb));\n\n // If we are not on the last index, then display an <a> tag\n if ($x != $last) {\n $breadcrumbs[] = \"<a href=\\\"$base$crumbs$crumb\\\">$title</a>\";\n $crumbs .= $crumb . '/';\n }\n // Otherwise, just display the title (minus)\n else {\n $breadcrumbs[] = $title;\n }\n\n }\n\n // Build our temporary array (pieces of bread) into one big string :)\n return implode($separator, $breadcrumbs);\n}", "function breadcrumbs_view($delim = '<b>&raquo;</b>') {\n\tglobal $file_name, $file, $root_filename;\n\t$temp_breadcrumb_path = '';\n\t$temp_breadcrumb_url = '';\n\t$directory_names = explode('/', $file);\n\tunset($directory_names[sizeof($directory_names)-1]);\n\tforeach($directory_names as $directory_name) {\n\t\t$temp_breadcrumb_path .= $directory_name.'/';\n\t\t$temp_breadcrumb_url = substr($temp_breadcrumb_path, 0, -1);\n\t\t$temp_breadcrumb .= $delim.' <a href=\"'.url($temp_breadcrumb_url,'dir').'\">'.$directory_name.'</a> ';\n\t}\n\treturn \"<a href=\\\"\".url('home', 'dir').\"\\\">Home</a> $temp_breadcrumb $delim <b>$file_name</b>\";\n}", "function custom_breadcrumbs() {\n\n // Settings\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'TOP';\n\n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. care_cat)\n $custom_taxonomy = 'knowledge-cat';\n\n // Get the query & post information\n global $post;\n\n // Do not display on the Home\n if ( !is_front_page() ) {\n\n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n\n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\"><i class=\"fa fa-home\" aria-hidden=\"true\"></i>' . $home_title . '</a></li>';\n\n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n // If it is a custom post type display name and link\n \t\t\t\t\t\t if($post_type == 'post') {\n $post_type_object = get_post_type_object($post_type);\n\n\t\t\t\t\t\t\t $post_type_archive_label = \"整骨院・接骨院・整体・鍼灸院\";\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_category_link(get_category_by_slug('clinic')->term_id);\n\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n }\n\n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n\n } else if ( is_single() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n if( $post_type == 'post' ) {\n $clinic_cat = get_the_category(get_the_ID())[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $post_type == 'hikikomori' || $post_type == 'violence' || $post_type == 'voice' || $post_type == 'question' ) {\n $clinic_id = $clinic_page->ID;\n $clinic_cat = get_the_category($clinic_id)[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$post_type_object = get_post_type_object($post_type);\n\t\t\t\t\t\t\t\t$post_type_archive_label = $post_type_object->label;\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_post_type_archive_link( $post_type );\n\t\t\t\t\t\t\t\techo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\n // Get post category info\n $category = get_the_category();\n\n if(!empty($category)) {\n\n // Get last category post is in\n $last_category = end(array_values($category));\n\n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n\n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n // foreach($cat_parents as $parents) {\n \t\t\t\t\t\t\t\t// \t $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // }\n \t\t\t\t\t\t\t\t $cat_display .= '<li class=\"item-cat\">'.$cat_parents[0].'</li>';\n\n }\n\n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n\n }\n\n // Check if the post is in a category\n if(!empty($last_category)) {\n // echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n\n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n } else {\n\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_category() ) {\n\n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n\n } else if ( is_page() ) {\n\n // Standard page\n if( $post->post_parent ){\n\n // If child page, get parents\n $anc = get_post_ancestors( $post->ID );\n\n // Get parents in the right order\n $anc = array_reverse($anc);\n\n // Parent page loop\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n }\n\n // Display parent pages\n echo $parents;\n\n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n\n } else {\n\n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_tag() ) {\n // Tag page\n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n\n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n\n } elseif ( is_day() ) {\n // Day archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n\n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_month() ) {\n\n // Month Archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_year() ) {\n\n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n\n } else if ( is_author() ) {\n\n // Auhor archive\n\n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n\n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n\n } else if ( get_query_var('paged') && !is_search() ) {\n\n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n\n } else if ( is_search() ) {\n\n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"検索結果: ' . get_search_query() . '\">検索結果: ' . get_search_query() . '</strong></li>';\n\n } elseif ( is_404() ) {\n\n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n echo '</ul>';\n }\n }", "function appointment_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Content'), 'admin/content'),\n l(t('Appointment'), 'admin/content/appointment'),\n );\n \n drupal_set_breadcrumb($breadcrumb);\n}", "public function Breadcrumbs($maxDepth = 20, $stopAtPageType = false, $showHidden = false) {\n\t\t$page = $this;\n\t\t$parts = array();\n \n while(\n\t\t\t$page\n \t\t\t&& (!$maxDepth || sizeof($parts) < $maxDepth)\n \t\t\t&& (!$stopAtPageType || $page->ClassName != $stopAtPageType)\n \t\t) {\n\t\t\tif($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {\n\t\t\t\tif($page->URLSegment == 'home') $hasHome = true;\n\n // Use menu title if exists, otherwise page title\n $title = $abbreviatedTitle = ($page->MenuTitle) ? Convert::raw2xml($page->MenuTitle) : Convert::raw2xml($page->Title);\n\n // Truncate breadcrumb title\n if(strlen($abbreviatedTitle) > 26) {\n $abbreviatedTitle = substr($title, 0, 26);\n $abbreviatedTitle = substr($abbreviatedTitle, 0, strrpos($abbreviatedTitle, ' '));\n $abbreviatedTitle .= ' ...';\n }\n \n\t\t\t\tif(($page->ID == $this->ID)) {\n $parts[] = \"<div class='breadcrumbitemlast'>{$abbreviatedTitle}</div>\";\n \n\t\t\t\t} else {\n $parts[] = \"<div class='breadcrumbitem'><a href='{$page->Link()}' title='{$title}'>{$abbreviatedTitle}</a></div>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$page = $page->Parent;\n\t\t}\n\n // Include home page breadcrumb if it isn't already in trail\n if(!$hasHome) {\n if(($page = Page::get_by_link('home'))) {\n $title = ($page->MenuTitle) ? Convert::raw2xml($page->MenuTitle) : Convert::raw2xml($page->Title);\n $parts[] = \"<div class='breadcrumbitem'><a href='{$page->Link()}' title='{$title}'>{$title}</a></div>\";\n }\n }\n\n\t\treturn implode(self::$breadcrumbs_delimiter, array_reverse($parts));\n\t}", "function CreateBreadcrumb($categoryid, $tagtype='<a>') // or '<li>'\n{\n global $DB, $userinfo, $mainsettings, $pages_md_arr, $pages_parents_md_arr;\n\n if(!isset($pages_parents_md_arr)) return;\n $categories = array();\n $cat_id = $categoryid;\n while(!empty($cat_id))\n {\n if(isset($pages_md_arr[$cat_id]))\n {\n $cat = $pages_md_arr[$cat_id];\n array_unshift($categories, $cat);\n $cat_id = $cat['parentid'];\n }\n else\n {\n break;\n }\n }\n\n if(empty($categories))\n {\n return '';\n }\n\n $Breadcrumb = '';\n $count = count($categories);\n $idx = 1;\n // $categories is array with pages for a specific parent page\n foreach($categories as $category_arr)\n {\n // $category_arr contains actual page row (either cached or from DB)\n $category_name = strlen($category_arr['title'])?$category_arr['title']:$category_arr['name'];\n $category_link = strlen($category_arr['link']) ? $category_arr['link'] : RewriteLink('index.php?categoryid=' . $category_arr['categoryid']);\n $category_target = strlen($category_arr['target']) ? ' target=\"' . $category_arr['target'] . '\"' : '';\n switch($idx)\n {\n case 1 : $class ='class=\"first\" '; break;\n case $count: $class ='class=\"last\" '; break;\n default : $class = '';\n }\n //SD370: allow list items output\n //if($tagtype == '<li>') $Breadcrumb .= '<li>';\n if($category_arr['categoryid'] == $categoryid){\n $Breadcrumb .= '<li>'.$category_name.'</li>';\n }\n else{\n $Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n }\n //$Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n //if($tagtype == '<li>') $Breadcrumb .= '</li>';\n $idx++;\n }\n $Breadcrumb .= '<div style=\"clear:both;\"></div>'.\"\\n\";\n\n return $Breadcrumb;\n\n}", "function breadcrumbs()\n{\n $home = __('Home'); // text for the 'Home' link\n $before = '<li class=\"active\">'; // tag before the current crumb\n $sep = '';//'<span class=\"divider\">/</span>';\n $after = '</li>'; // tag after the current crumb\n if (!is_home() && !is_front_page() || is_paged()) {\n echo '<ul class=\"breadcrumb\">';\n global $post;\n $homeLink = home_url();\n echo '<li><a href=\"' . $homeLink . '\">' . $home . '</a> '.$sep. '</li> ';\n if (is_category()) {\n global $wp_query;\n $cat_obj = $wp_query->get_queried_object();\n $thisCat = $cat_obj->term_id;\n $thisCat = get_category($thisCat);\n $parentCat = get_category($thisCat->parent);\n if ($thisCat->parent != 0) {\n echo get_category_parents($parentCat, true, $sep);\n }\n echo $before . __('Archive by category') . ' \"' . single_cat_title('', false) . '\"' . $after;\n } elseif (is_day()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo '<li><a href=\"' . get_month_link(get_the_time('Y'), get_the_time('m')) . '\">' . get_the_time(\n 'F'\n ) . '</a></li> ';\n echo $before . get_the_time('d') . $after;\n } elseif (is_month()) {\n echo '<li><a href=\"' . get_year_link(get_the_time('Y')) . '\">' . get_the_time(\n 'Y'\n ) . '</a></li> ';\n echo $before . get_the_time('F') . $after;\n } elseif (is_year()) {\n echo $before . get_the_time('Y') . $after;\n } elseif (is_single() && !is_attachment()) {\n if (get_post_type() != 'post') {\n $post_type = get_post_type_object(get_post_type());\n $slug = $post_type->rewrite;\n echo '<li><a href=\"' . $homeLink . '/' . $slug['slug'] . '/\">' . $post_type->labels->singular_name . '</a></li> ';\n echo $before . get_the_title() . $after;\n } else {\n $cat = get_the_category();\n $cat = $cat[0];\n echo '<li>'.get_category_parents($cat, true, $sep).'</li>';\n echo $before . get_the_title() . $after;\n }\n } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {\n $post_type = get_post_type_object(get_post_type());\n echo $before . $post_type->labels->singular_name . $after;\n } elseif (is_attachment()) {\n $parent = get_post($post->post_parent);\n $cat = get_the_category($parent->ID);\n $cat = $cat[0];\n echo get_category_parents($cat, true, $sep);\n echo '<li><a href=\"' . get_permalink(\n $parent\n ) . '\">' . $parent->post_title . '</a></li> ';\n echo $before . get_the_title() . $after;\n } elseif (is_page() && !$post->post_parent) {\n echo $before . get_the_title() . $after;\n } elseif (is_page() && $post->post_parent) {\n $parent_id = $post->post_parent;\n $breadcrumbs = array();\n while ($parent_id) {\n $page = get_page($parent_id);\n $breadcrumbs[] = '<li><a href=\"' . get_permalink($page->ID) . '\">' . get_the_title(\n $page->ID\n ) . '</a>' . $sep . '</li>';\n $parent_id = $page->post_parent;\n }\n $breadcrumbs = array_reverse($breadcrumbs);\n foreach ($breadcrumbs as $crumb) {\n echo $crumb;\n }\n echo $before . get_the_title() . $after;\n } elseif (is_search()) {\n echo $before . __('Search results for') . ' \"'. get_search_query() . '\"' . $after;\n } elseif (is_tag()) {\n echo $before . __('Posts tagged') . ' \"' . single_tag_title('', false) . '\"' . $after;\n } elseif (is_author()) {\n global $author;\n $userdata = get_userdata($author);\n echo $before . __('Articles posted by') . ' ' . $userdata->display_name . $after;\n } elseif (is_404()) {\n echo $before . __('Error 404') . $after;\n }\n // if (get_query_var('paged')) {\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ' (';\n // }\n // echo __('Page', 'bootstrapwp') . $sep . get_query_var('paged');\n // if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()\n // ) {\n // echo ')';\n // }\n // }\n echo '</ul>';\n }\n}", "function wiki_breadcrumbs($chain, $current_title = null, $final_link = false, $links = true, $this_link_virtual_root = false)\n{\n $segments = array();\n $token = strtok($chain, '/');\n $rebuild_chain = '';\n while ($token !== false) {\n $next_token = strtok('/');\n\n if ($rebuild_chain != '') {\n $rebuild_chain .= '/';\n }\n $rebuild_chain .= $token;\n\n $link_id = ($this_link_virtual_root && ($next_token === false)) ? $token : $rebuild_chain;\n\n if (is_numeric($token)) {\n $id = intval($token);\n } else {\n $url_moniker_where = array('m_resource_page' => 'wiki', 'm_moniker' => $token);\n $_id = $GLOBALS['SITE_DB']->query_select_value_if_there('url_id_monikers', 'm_resource_id', $url_moniker_where);\n if ($_id === null) {\n return array();\n }\n $id = intval($_id);\n }\n\n $page_link = build_page_link(array('page' => 'wiki', 'type' => 'browse', 'id' => $link_id) + (($this_link_virtual_root && ($next_token === false)) ? array('keep_wiki_root' => $id) : array()), get_module_zone('wiki'));\n\n if ($next_token !== false) { // If not the last token (i.e. not the current page)\n $title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n if (is_null($title)) {\n continue;\n }\n $token_title = get_translated_text($title);\n $segments[] = $links ? array($page_link, $token_title) : array('', $token_title);\n } else {\n if (is_null($current_title)) {\n $_current_title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n $current_title = is_null($_current_title) ? do_lang('MISSING_RESOURCE', 'wiki_page') : get_translated_text($_current_title);\n }\n if ($final_link) {\n $segments[] = array($page_link, $current_title);\n } else {\n $segments[] = array('', $current_title);\n }\n }\n\n $token = $next_token;\n }\n\n return $segments;\n}", "function add_additional_breadcrumbs(BreadcrumbTrail $breadcrumbtrail)\n {\n // Translation :: get('PeerAssessmentToolBrowserComponent')));\n }", "public function getBar()\n\t{\n\t\t$neighbours = 2;\n\n\t\t$page = $this->getPageNo();\n\n\t\t$next = $page + 1;\n\t\t$lastPage = $this->getPagesTotal();\n\t\t$lpm1 = $lastPage - 1;\n\n\t\t$bar = array();\n\t\t$counter = 0;\n\n\t\tif ($lastPage < 2)\n\t\t{\n\t\t\treturn $bar;\n\t\t}\n\n\t\t$bar[] = '<ul class=\"trackerPagination\">';\n\n\t\tif ($lastPage < 7 + ($neighbours * 2))\n\t\t{\n\t\t\tfor ($counter = 1; $counter <= $lastPage; $counter++)\n\t\t\t{\n\t\t\t\tif ($counter == $page)\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif ($lastPage > 5 + ($neighbours * 2))\n\t\t{\n\t\t\tif ($page < 1 + ($neighbours * 2))\n\t\t\t{\n\t\t\t\tfor ($counter = 1; $counter < 4 + ($neighbours * 2); $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\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$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telseif ($lastPage - ($neighbours * 2) > $page && $page > ($neighbours * 2))\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">...</li>';\n\n\t\t\t\tfor ($counter = $page - $neighbours; $counter <= $page + $neighbours; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\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$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lpm1) . '\">' . $lpm1 . '</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . $lastPage . '</a></li>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(1) . '\">1</a></li>';\n\t\t\t\t$bar[] = '<li><a href=\"' . $this->uri(2) . '\">2</a></li>';\n\t\t\t\t$bar[] = '<li class=\"dot\">..</li>';\n\n\t\t\t\tfor ($counter = $lastPage - (2 + ($neighbours * 2)); $counter <= $lastPage; $counter++)\n\t\t\t\t{\n\t\t\t\t\tif ($counter == $page)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bar[] = '<li><a class=\"current\">' . $counter . '</a></li>';\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$bar[] = '<li><a href=\"' . $this->uri($counter) . '\">' . $counter . '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($page < $counter - 1)\n\t\t{\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($next) . '\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a href=\"' . $this->uri($lastPage) . '\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Next') . '</a></li>';\n\t\t\t$bar[] = '<li><a class=\"current\">' . g11n3t('Last') . '</a></li>';\n\t\t}\n\n\t\t$bar[] = '</ul>';\n\n\t\treturn implode(\"\\n\", $bar);\n\t}", "function thim_learnpress_breadcrumb() {\n\t\tif ( is_front_page() || is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the query & post information\n\t\tglobal $post;\n\n\t\t// Build the breadcrums\n\t\techo '<ul itemprop=\"breadcrumb\" itemscope itemtype=\"http://schema.org/BreadcrumbList\" id=\"breadcrumbs\" class=\"breadcrumbs\">';\n\n\t\t// Home page\n\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_html( get_home_url() ) . '\" title=\"' . esc_attr__( 'Home', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'Home', 'eduma' ) . '</span></a></li>';\n\n\t\tif ( is_single() ) {\n\n\t\t\t$categories = get_the_terms( $post, 'course_category' );\n\n\t\t\tif ( get_post_type() == 'lp_course' ) {\n\t\t\t\t// All courses\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\t\t\t} else {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_permalink( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\" title=\"' . esc_attr( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\"><span itemprop=\"name\">' . esc_html( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '</span></a></li>';\n\t\t\t}\n\n\t\t\t// Single post (Only display the first category)\n\t\t\tif ( isset( $categories[0] ) ) {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_term_link( $categories[0] ) ) . '\" title=\"' . esc_attr( $categories[0]->name ) . '\"><span itemprop=\"name\">' . esc_html( $categories[0]->name ) . '</span></a></li>';\n\t\t\t}\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( get_the_title() ) . '\">' . esc_html( get_the_title() ) . '</span></li>';\n\n\t\t} else if ( is_tax( 'course_category' ) || is_tax( 'course_tag' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Category page\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( single_term_title( '', false ) ) . '\">' . esc_html( single_term_title( '', false ) ) . '</span></li>';\n\t\t} else if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['ref'] ) && ( $_REQUEST['ref'] == 'course' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Search result\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'Search results for:', 'eduma' ) . ' ' . esc_attr( get_search_query() ) . '\">' . esc_html__( 'Search results for:', 'eduma' ) . ' ' . esc_html( get_search_query() ) . '</span></li>';\n\t\t} else {\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\">' . esc_html__( 'All courses', 'eduma' ) . '</span></li>';\n\t\t}\n\n\t\techo '</ul>';\n\t}", "function get_uams_breadcrumbs()\n{\n\nglobal $post;\n$ancestors = array_reverse( get_post_ancestors( $post->ID ) );\n$html = '<li><a href=\"http://inside.uams.edu\" title=\"University of Arkansas for Medical Scineces\">Home</a></li>';\nif ( !is_main_site() )\n{\n$html .= '<li' . (is_front_page() ? ' class=\"current\"' : '') . '><a href=\"' . home_url('/') . '\" title=\"' . str_replace(' ', ' ', get_bloginfo('title')) . '\">' . str_replace(' ', ' ', get_bloginfo('title')) . '</a><li>';\n}\n\nif ( is_404() )\n{\n $html .= '<li class=\"current\"><span>Ooops!</span>';\n} else\n\nif ( is_search() )\n{\n $html .= '<li class=\"current\"><span>Search results for ' . get_search_query() . '</span>';\n} else\n\nif ( is_author() )\n{\n $author = get_queried_object();\n $html .= '<li class=\"current\"><span> Author: ' . $author->display_name . '</span>';\n} else\n\nif ( get_queried_object_id() === (Int) get_option('page_for_posts') ) {\n $html .= '<li class=\"current\"><span> '. get_the_title( get_queried_object_id() ) . ' </span>';\n}\n\n// If the current view is a post type other than page or attachment then the breadcrumbs will be taxonomies.\nif( is_category() || is_tax() || is_single() || is_post_type_archive() )\n{\n\n if ( is_post_type_archive() && !is_tax() )\n {\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_post_type_archive_link( $posttype->query_var ) .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n $html .= '<li class=\"current\"><span>'. $posttype->labels->menu_name . '</span>';\n }\n\n if ( is_category() )\n {\n $category = get_category( get_query_var( 'cat' ) );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. get_cat_name($category->term_id ) . '</span>';\n }\n\n if ( is_tax() && !is_post_type_archive() )\n {\n $term = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $tax = get_taxonomy( get_query_var(\"taxonomy\") );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->labels->name .': '. $term->name .'</span>';\n }\n\n if ( is_tax() && is_post_type_archive() )\n {\n $tax = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->name . '</span>';\n }\n\n if ( is_single() )\n {\n if ( has_category() )\n {\n $thecat = get_the_category( $post->ID );\n $category = array_shift( $thecat ) ;\n $html .= '<li><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n }\n if ( uams_is_custom_post_type() )\n {\n $posttype = get_post_type_object( get_post_type() );\n $archive_link = get_post_type_archive_link( $posttype->query_var );\n if (!empty($archive_link)) {\n $html .= '<li><a href=\"' . $archive_link .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n else if (!empty($posttype->rewrite['slug'])){\n $html .= '<li><a href=\"' . site_url('/' . $posttype->rewrite['slug'] . '/') .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n }\n $html .= '<li class=\"current\"><span>'. get_the_title( $post->ID ) . '</span>';\n }\n}\n\n// If the current view is a page then the breadcrumbs will be parent pages.\nelse if ( is_page() )\n{\n\n if ( ! is_home() || ! is_front_page() )\n $ancestors[] = $post->ID;\n\n if ( ! is_front_page() )\n {\n foreach ( array_filter( $ancestors ) as $index=>$ancestor )\n {\n $class = $index+1 == count($ancestors) ? ' class=\"current\" ' : '';\n $page = get_post( $ancestor );\n $url = get_permalink( $page->ID );\n $title_attr = esc_attr( $page->post_title );\n if (!empty($class)){\n $html .= \"<li $class><span>{$page->post_title}</span></li>\";\n }\n else {\n $html .= \"<li><a href=\\\"$url\\\" title=\\\"{$title_attr}\\\">{$page->post_title}</a></li>\";\n }\n }\n }\n\n}\n\nreturn \"<nav class='uams-breadcrumbs' aria-label='breadcrumbs'><ul>$html</ul></nav>\";\n}", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n\t // This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values\n\t $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\t //pre($path);\n\t // This will build our \"base URL\" ... Also accounts for HTTPS :)\n\t $base = base_url();\n\t \n\t // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n\t $breadcrumbs = Array(\"<a href=\\\"$base\\\">$home</a>\");\n\t \n\t // Find out the index for the last value in our path array\n\t $last = end(array_keys($path));\n\t \n\t // Build the rest of the breadcrumbs\n\t foreach ($path AS $x => $crumb) {\n\t // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n\t $title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb));\n\t \n\t // If we are not on the last index, then display an <a> tag\n\t if ($x != $last)\n\t $breadcrumbs[] = \"<a href=\\\"$base$crumb\\\">$title</a>\";\n\t // Otherwise, just display the title (minus)\n\t else\n\t $breadcrumbs[] = $title;\n\t }\n\t \n\t // Build our temporary array (pieces of bread) into one big string :)\n\t return implode($separator, $breadcrumbs);\n\t}", "protected function getIndexBreadcrumbs()\n {\n return [];\n }", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "public function get_links() {\n\t\t$context = $this->context_memoizer->for_current_page();\n\n\t\treturn $context->presentation->breadcrumbs;\n\t}", "public function getBreadcrumb() \r\n {\r\n if(!empty($this->_current_cms_seo)) {\r\n return isset($this->_current_cms_seo['breadcrumb']) ? $this->_current_cms_seo['breadcrumb'] : '';\r\n }\r\n }", "public function getUseBreadcrumbs()\n {\n return Mage::getStoreConfigFlag('komaks_newsedit/author/breadcrumbs');\n }", "function adaline_bottom_bar() {\n\n\techo '<div class=\"bottom-bar\"><div class=\"wrap\">';\n\n\tgenesis_widget_area( 'bottom-bar-left', array(\n\t\t'before' => '<div class=\"bottom-bar-left\">',\n\t\t'after' => '</div>',\n\t) );\n\n\techo '</div></div>';\n \n}", "function getBreadcrumbs($dir)\r\n{\r\n\tglobal $root, $bcI, $m3u, $debug, $playMode;\r\n\t// Find last slash in root dir\r\n\t$lastslash = getLastSlash(getDirectory($root));\r\n\t// Treat that the as the home directory\r\n\t$start = substr($dir,$lastslash);\r\n\t// Get the list of subdirectories in the home directory\r\n\t$directories = explode('/',$start);\r\n\t// Count the list of subdirectories\r\n\t$count = count($directories);\r\n\t$breadcrumbs = '<ol class=\"breadcrumb\">';\r\n\t// Global $bcI is called later in displayDirectories() to determine depth of directories\r\n\t$bcI = 0;\r\n\t$path = '';\r\n\tforeach ( $directories as $directory )\r\n\t{\r\n\t\t// Only count actual directories\r\n\t\tif ( !empty($directory) )\r\n\t\t{\r\n\t\t\t$path = '?dir='.rawurlencode(substr($dir,0,strpos($dir,$directory)+strlen($directory)));\r\n\t\t\tif ( !empty($debug) )\r\n\t\t\t{\r\n\t\t\t\t$path .= '&debug=log';\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Make breadcrumb links for all directories\r\n\t\t$breadcrumbs .= '<li><a href=\"'.$path.'\" title=\"Return to this directory\">'.$directory.'</a>';\r\n\t\t// Add a play all tracks link if this is the current directory\r\n\t\tif ( $bcI == $count-1 && $playMode!='random' )\r\n\t\t{\r\n\t\t\t// Add a play all tracks button if there are playable tracks in this directory\r\n\t\t\t$count = getTracksCount($dir);\r\n\t\t\tif ( $count > 0 )\r\n\t\t\t{\r\n\t\t\t\t$breadcrumbs .= '&nbsp;&nbsp;/&nbsp;&nbsp;<a href=\"?dir='.rawurlencode($dir).'&playmode=folder';\r\n\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$breadcrumbs .= '&debug=log';\r\n\t\t\t\t}\r\n\t\t\t\t$breadcrumbs .= '\" title=\"Play all tracks in this folder\"><span class=\"glyphicon glyphicon-play\"></span></a>';\r\n\t\t\t\t// If m3u streaming is enabled, add a stream all tracks button as well\r\n\t\t\t\tif ( $m3u==true )\r\n\t\t\t\t{\r\n\t\t\t\t\t$breadcrumbs .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"playlist.php?dir='.rawurlencode($dir).'\" title=\"Stream all tracks in this folder (m3u)\" target=\"_blank\"><span class=\"glyphicon glyphicon-list\"></span></a>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$breadcrumbs .= '</li>';\r\n\t\t$bcI++;\r\n\t}\r\n\tif ( $playMode == 'random' )\r\n\t{\r\n\t\t$breadcrumbs .= '<li>Random Playlist</li>';\r\n\t}\r\n\t$breadcrumbs .= '</ol>';\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"getBreadcrumbs(\".$dir.\")\\n----------\\n\";\r\n\t\t$log .= \"breadcrumbs = \".$breadcrumbs.\"\\n\\n\";\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $breadcrumbs;\r\n}", "public function footerMargin() {\n\t}", "function tac_override_yoast_breadcrumb_trail( $links ) {\n global $post;\n\n if ( is_home() || is_singular( 'post' ) || is_archive() ) :\n\n \tif ( 'event' == get_post_type() ) :\n\n\t $breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'event' ) ),\n\t 'text' => 'Our Events',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t elseif ( 'course' == get_post_type() ) :\n\n\t \t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_post_type_archive_link( 'course' ) ),\n\t 'text' => 'Our Learning',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\n\t else :\n\n\t \t\t$breadcrumb[] = array(\n\t 'url' => get_permalink( get_option( 'page_for_posts' ) ),\n\t 'text' => 'Our Series',\n\t );\n\n\t array_splice( $links, 1, -2, $breadcrumb );\n\t endif;\n endif;\n\n return $links;\n}", "public function breadcrumbs($h)\n {\n if ($h->pageName == 'edit_post') {\n $post_link = \"<a href='\" . $h->url(array('page'=>$h->post->id)) . \"'>\";\n $post_link .= $h->post->title . \"</a>\";\n $h->pageTitle = $h->pageTitle . \" / \" . $post_link;\n }\n }", "function mpcth_display_breadcrumb() {\r\n\tglobal $post;\r\n\t$id = $post->ID;\r\n\t$return = '<a href=\"/\">' . __('Home', 'mpcth') . '</a>';\r\n\r\n\tif(is_front_page()) {\r\n\t\t// do nothing\r\n\t} elseif(is_page()) {\r\n\t\t$page = get_post($id);\r\n\r\n\t\t$parent_pages = array();\r\n\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> ' . $page->post_title . \"\\n\";\r\n\r\n\t\twhile ($page->post_parent) {\r\n\t\t\t$page = get_post($page->post_parent);\r\n\t\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_permalink($page->ID) . '\">' . $page->post_title . '</a>';\r\n\t\t}\r\n\r\n\t\t$parent_pages = array_reverse($parent_pages);\r\n\r\n\t\tforeach ($parent_pages as $parent) {\r\n\t\t\t$return .= $parent;\r\n\t\t}\r\n\t} elseif(is_single()) {\r\n\t\tif($post->post_type == 'post') {\r\n\t\t\t$category = get_the_category($id);\r\n\r\n\t\t\tif(!empty($category)){\r\n\t\t\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data, 0, -strlen(' <span class=\"mpcth-header-devider\">/</span> '));\r\n\t\t\t}\r\n\t\t} elseif($post->post_type == 'portfolio') {\r\n\t\t\t$terms = get_the_terms($id, 'mpcth_portfolio_category');\r\n\t\t\t\r\n\t\t\tif(!empty($terms)){\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ';\r\n\r\n\t\t\t\tforeach ($terms as $term) {\r\n\t\t\t\t\t$return .= ' <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($term !== end($terms))\r\n\t\t\t\t\t\t$return .= ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . $post->post_title . \"\\n\";\r\n\t} elseif(is_category()) {\r\n\t\t$category = get_the_category($id);\r\n\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\r\n\t\tif(!empty($category)){\r\n\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data,0,-8);\r\n\t\t}\r\n\t} elseif(is_tax()) {\r\n\t\t$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t}\r\n\r\n\treturn $return;\r\n}", "function phpbits_render_breadcrumbs_block( $attributes ) {\n\t\n\treturn 'This is the content';\n}", "function Forum_getForumBreadcrumbs(&$PAGEDATA, &$id) {\n\t$f=dbRow('select name,parent_id from forums where id='.$id);\n\t$c='&raquo; <a href=\"'.$PAGEDATA->getRelativeUrl().'?forum-f='.$id\n\t\t.'\">'.htmlspecialchars($f['name']).'</a>';\n\tif ($f['parent_id']) {\n\t\t$c=Forum_getForumBreadcrumbs($PAGEDATA, $f['parent_id']).' '.$c;\n\t}\n\treturn $c;\n}", "function faculty_settings_breadcrumb() { \n faculty_setting_line(faculty_add_color_setting('breadcrumb_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('breadcrumb_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('breadcrumb_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n faculty_setting_line(faculty_add_border_setting('breadcrumb_border', __('Bottom Border', FACULTY_DOMAIN)));\n do_action('faculty_settings_breadcrumb');\n}", "function the_breadcrumb() {\n global $post;\n echo '<ol class=\"breadcrumb\">';\n if (!is_home()) {\n echo '<li><a href=\"';\n echo get_option('home');\n echo '\">';\n echo 'Home';\n echo '</a></li>';\n if (is_category() || is_single()) {\n echo '<li>';\n the_category('</li><li> ');\n if (is_single()) {\n echo '</li><li>';\n the_title();\n echo '</li>';\n }\n } elseif (is_page()) {\n if($post->post_parent){\n $anc = get_post_ancestors( $post->ID );\n $title = get_the_title();\n foreach ( $anc as $ancestor ) {\n $output = '<li><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>';\n }\n echo $output;\n echo '<strong title=\"'.$title.'\"> '.$title.'</strong>';\n } else {\n echo '<li><strong>'.get_the_title().'</strong></li>';\n }\n }\n }\n elseif (is_tag()) {single_tag_title();}\n elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n echo '</ol>';\n}", "public function navbar() {\n $items = $this->page->navbar->get_items();\n $breadcrumbs = array();\n foreach ($items as $item) {\n $item->hideicon = true;\n $breadcrumbs[] = $this->render($item);\n }\n $divider = '<span class=\"divider\">/</span>';\n $list_items = '<li>'.join(\" $divider</li><li>\", $breadcrumbs).'</li>';\n $title = '<span class=\"accesshide\">'.get_string('pagepath').'</span>';\n return $title . \"<ul class=\\\"breadcrumb\\\">$list_items</ul>\";\n }", "function apoc_get_buddypress_breadcrumbs( $args = array() ) {\n\t$bp_trail = array();\n\t\n\t// Directories \n\tif ( bp_is_directory() ) :\n\t\tif ( bp_is_activity_component() ) : $bp_trail[] = 'Recent Activity';\n\t\telseif ( bp_is_members_component() ) : $bp_trail[] = 'Members Directory';\n\t\telseif ( bp_is_groups_component() ) : $bp_trail[] = 'Groups and Guilds Directory';\n\t\telse : $bp_trail[] = ucfirst( bp_current_component() );\n\t\tendif;\n\t\n\t// Single Member \n\telseif ( bp_is_user() ) : \n\t\t$bp_trail[] = '<a href=\"'. bp_get_members_directory_permalink() .'\" title=\"Members Directory\">Members</a>';\n\t\t\n\t\t// Get the displayed user \n\t\tif ( bp_is_my_profile() ) : $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"Your Profile\">Your Profile</a>';\n\t\telse : $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"'.bp_get_displayed_user_fullname(). '\">' . bp_get_displayed_user_fullname() . '</a>';\n\t\tendif;\n\n\t\t// Display the current component \n\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\n\t// Single Group \n\telseif ( bp_is_group() ) :\n\t\t\n\t\t// Get the displayed group \n\t\tif ( bp_get_current_group_id() == 1 ) :\n\t\t\t$bp_trail[] = '<a href=\"'. home_url() . '/entropy-rising/\">Entropy Rising</a>';\n\t\telse :\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\">Guilds</a>';\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\tendif;\n\t\t\n\t\t// Display the current group action for everything except forums \n\t\tif ( 'home' == bp_current_action() ) : $bp_trail[] = 'Profile';\n\t\telseif ( bp_current_action() != 'forum' ) : $bp_trail[] = ucfirst( bp_current_action() );\n\t\telseif ( bp_current_action() == 'forum' ) : \n\t\t\t$bp_trail = array_merge( $bp_trail, apoc_get_group_forum_breadcrumbs() );\n\t\tendif;\n\t\n\t// User Registration \n\telseif ( bp_is_register_page() ) :\n\t\t$bp_trail[] = 'New User Registration';\n\t\n\t// User Activation \n\telseif ( bp_is_activation_page() ) :\n\t\t$bp_trail[] = 'User Account Activation';\n\t\n\t// New Group Creation \n\telseif ( bp_is_group_create() ) :\n\t\t$bp_trail[] = 'Create New Group';\n\n \tendif;\n\treturn $bp_trail;\n}", "function simple_pages_display_breadcrumbs($pageId = null, $seperator=' > ', $includePage=true)\n{\n $html = '';\n\n if ($pageId === null) {\n $page = get_current_record('simple_pages_page', false);\n } else {\n $page = get_db()->getTable('SimplePagesPage')->find($pageId);\n }\n\n if ($page) {\n $ancestorPages = get_db()->getTable('SimplePagesPage')->findAncestorPages($page->id);\n $bPages = array_merge(array($page), $ancestorPages);\n\n // make sure all of the ancestors and the current page are published\n foreach($bPages as $bPage) {\n if (!$bPage->is_published) {\n $html = '';\n return $html;\n }\n }\n\n // find the page links\n $pageLinks = array();\n foreach($bPages as $bPage) {\n if ($bPage->id == $page->id) {\n if ($includePage) {\n $pageLinks[] = html_escape($bPage->title);\n }\n } else {\n $pageLinks[] = '<a href=\"' . public_url($bPage->slug) . '\">' . html_escape($bPage->title) . '</a>';\n }\n }\n $pageLinks[] = '<a href=\"'. public_url('') . '\">' . __('Home') . '</a>';\n\n // create the bread crumb\n $html .= implode(html_escape($seperator), array_reverse($pageLinks));\n }\n return $html;\n}", "function print_breadcrumb()\n{\n $breadcrumbs = get_breadcrumb();\n for ($i = 0; $i < sizeof($breadcrumbs); $i++) {\n echo '<li class=\"breadcrumb-path breadcrumb-level-' . $i . '\">';\n echo '<a href=\"' . $breadcrumbs[$i]['url'] . '\">' . $breadcrumbs[$i]['title'] . '</a>';\n echo '</li>';\n }\n}", "public function atBottom() {\n }", "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 Breadcrumbs() {\n\t\t$nonPageParts = array();\n\t\t$parts = array();\n\n\t\t$forumHolder = $this->getForumHolder();\n\t\t$member = $this->Member();\n\n\t\t$parts[] = '<a href=\"' . $forumHolder->Link() . '\">' . $forumHolder->Title . '</a>';\n\t\t$nonPageParts[] = _t('ForumMemberProfile.USERPROFILE', 'User Profile');\n\n\t\treturn implode(\" &raquo; \", array_reverse(array_merge($nonPageParts, $parts)));\n\t}", "public static function breadcrumbs($href) {\n \n $TOPfilter = function ($label) {\n return $label == 'TOP' ? \"\" : $label;\n };\n \n $node = Tree_node::find()->where(['href' => $href])->one();\n \n $breadcrumbs = [ \n ['label' => $TOPfilter($node->name), 'url' => $node->href] \n ];\n \n while($node->parent_id != NULL) {\n $node = Tree_node::find()->where(['id' => $node->parent_id])->one();\n $breadcrumbs[] = ['label' => $TOPfilter($node->name), 'url' => $node->href];\n }\n \n return array_reverse($breadcrumbs);\n }", "public function breadcrumbs()\n {\n $crumbs = Collection::make(explode(\n DIRECTORY_SEPARATOR, $this->getCurrentPath()\n ));\n\n return $crumbs->reject(function ($crumb) {\n return empty($crumb) || is_null($crumb);\n })->map(function ($crumb, $i) use ($crumbs) {\n $parents = array_slice($crumbs->toArray(), 0, $i);\n $url = implode(DIRECTORY_SEPARATOR, $parents).DIRECTORY_SEPARATOR.$crumb;\n $file = $this->file($this->rootPath($url));\n\n return json_decode(json_encode([\n 'text' => $crumb,\n 'url' => $file->fragment(),\n ]));\n });\n }", "function ou_df_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n $separator = $variables['separator'];\n\n $html = '';\n\n if ($segments_quantity > 0) {\n\n $html .= '<dl class=\"breadcrumb\"><dt>You are here:</dt><dd>';\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $html .= l($content, $it['url'], array('attributes' => array('class' => $it['class'])));\n } else {\n $class = implode(' ', $it['class']);\n $html .= '<span class=\"' . $class . '\">'\t. $content . '</span>';\n }\n if ($i < $s) {\n $html .= '<span class=\"easy-breadcrumb_segment-separator\"> ' . $separator . ' </span>';\n }\n }\n\n $html .= '</dd></dl>';\n }\n\n return $html;\n}", "public function breadcrumbs($crumbs) {\n $result = \"\";\n $home = array('controller' => 'pages', 'action' => 'display', 'home');\n $target = \"<i class='icon-home'></i>\";\n\n $result .= \"<nav class='breadcrumbs'>\n <ul>\";\n $result .= \" <li>\" . $this->Html->link($target, $home, array('escape' => false, 'title' => 'Home')) . \"</li>\";\n $size = count($crumbs);\n foreach ($crumbs as $i => $crumb) {\n if ($i == $size - 1) {\n $result .= \" <li class='active'>\";\n } else {\n $result .= \" <li>\";\n }\n if (isset($crumb['link'])) {\n $result .= $this->Html->link($crumb['text'], $crumb['link'], array('escape' => false, 'title' => $crumb['text'])) . \"</li>\";\n } else {\n $result .= $crumb['text'] . \"</li>\";\n }\n }\n\n $result .= \" </ul>\n </nav>\";\n return $result;\n }", "public function getBreadCrumb()\n {\n $aPaths = array();\n $aPath = array();\n $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();\n $sSelfLink = $this->getViewConfig()->getSelfLink();\n\n $aPath['title'] = oxRegistry::getLang()->translateString('MY_ACCOUNT', $iBaseLanguage, false);\n $aPath['link'] = oxRegistry::get(\"oxSeoEncoder\")->getStaticUrl($sSelfLink . 'cl=account');\n $aPaths[] = $aPath;\n\n $aPath['title'] = oxRegistry::getLang()->translateString('ORDER_HISTORY', $iBaseLanguage, false);\n $aPath['link'] = $this->getLink();\n $aPaths[] = $aPath;\n\n return $aPaths;\n }", "public function testCrumbListZurbStyle() {\n\t\t$this->Html->addCrumb('Home', '#');\n\t\t$this->Html->addCrumb('Features', '#');\n\t\t$this->Html->addCrumb('Gene Splicing', '#');\n\t\t$this->Html->addCrumb('Home', '#');\n\t\t$result = $this->Html->getCrumbList(\n\t\t\tarray('class' => 'breadcrumbs', 'firstClass' => false, 'lastClass' => 'current')\n\t\t);\n\t\t$this->assertTags(\n\t\t\t$result,\n\t\t\tarray(\n\t\t\t\tarray('ul' => array('class' => 'breadcrumbs')),\n\t\t\t\t'<li',\n\t\t\t\tarray('a' => array('href' => '#')), 'Home', '/a',\n\t\t\t\t'/li',\n\t\t\t\t'<li',\n\t\t\t\tarray('a' => array('href' => '#')), 'Features', '/a',\n\t\t\t\t'/li',\n\t\t\t\t'<li',\n\t\t\t\tarray('a' => array('href' => '#')), 'Gene Splicing', '/a',\n\t\t\t\t'/li',\n\t\t\t\tarray('li' => array('class' => 'current')),\n\t\t\t\tarray('a' => array('href' => '#')), 'Home', '/a',\n\t\t\t\t'/li',\n\t\t\t\t'/ul'\n\t\t\t), true\n\t\t);\n\t}", "public function testBreadcrumb() {\n\t\t$this->assertNull($this->Html->getCrumbs());\n\n\t\t$this->Html->addCrumb('First', '#first');\n\t\t$this->Html->addCrumb('Second', '#second');\n\t\t$this->Html->addCrumb('Third', '#third');\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs(' &gt; ');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->addCrumb('Fourth', null);\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs('-', 'Start');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '/')),\n\t\t\t'Start',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public static function getCrumbsHtml()\n {\n $html = \"\\n\";\n $glue = ' <span class=\"glyphicon glyphicon-chevron-right\"></span> ';\n $trail = [];\n $menuArray = self::getMenuArray();\n\n // get pagePath (only from site-root), and adjust to the same format as how the $menu_array paths are defined\n $pagePath = self::pagePathFromSiteRoot(''); // '' = no extension as per $menu_array path definitions\n if(substr($pagePath,-5)=='index') $pagePath = substr($pagePath,0,strlen($pagePath)-5); // also remove /path/\"index\" as per $menu_array path definitions\n #dmsg('pagePath',$pagePath,'crumbs');\n\n // prepare home link for beginning of trail\n $homeLink = '<a href=\"' . self::_menuLink2href(self::homePath()) . '\">Home</a>';\n\n // search the menu array for matching path\n if ( self::findPageInMenu( $pagePath, $menuArray, $trail ) ) {\n $trail[] = $homeLink;\n dmsg('trail',$trail,'crumbs');\n $html .= implode( $glue, array_reverse( $trail ) );\n } else {\n // not in menuArray, use this pages dir components to build a virtual trail\n $trail = explode('/', trim(self::$pathComponentDirs,'/')); if(isset($trail[0]) && $trail[0]=='') $trail=[];\n #$trail[] = '<a href=\"' . self::_menuLink2href($pagePath) . '\">'.self::pageFilename('').'</a>';\n $trail[] = self::pageFilename(''); // dont href self\n array_unshift($trail, $homeLink);\n dmsg('trail',$trail,'crumbs');\n $html .= '<span class=\"capitalize\">' . implode( $glue, $trail ) . '</span>';\n }\n return $html;\n }", "function buddypress_crumbs() {\n\t\n\t\t// Setup the trail\n\t\t$bp_trail = array();\n\t\t\t\t\n\t\t// User Profiles\n\t\tif ( bp_is_user() ) : \n\t\t\n\t\t\t// Your own profile\n\t\t\tif ( bp_is_my_profile() ) :\n\t\t\t\t $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"Your Profile\">Your Profile</a>';\n\t\t\t\t \n\t\t\t// Someone else's profile\n\t\t\telse :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_members_directory_permalink() .'\" title=\"Members Directory\">Members</a>';\n\t\t\t\t$bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"'.bp_get_displayed_user_fullname(). '\">' . bp_get_displayed_user_fullname() . '</a>';\n\t\t\tendif;\n\n\t\t\t// Display the current component\n\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\t// Guild Profile\n\t\telseif ( bp_is_group() ) :\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\" title=\"Groups and Guilds Directory\">Groups</a>';\n\t\t\t\n\t\t\t// Group Creation\n\t\t\tif ( bp_is_group_create() ) :\n\t\t\t\t$bp_trail[] = 'Create New Group';\n\t\t\t\t\n\t\t\t// Group Profile Home\n\t\t\telseif ( 'home' == bp_current_action() ) :\n\t\t\t\t$bp_trail[] = bp_get_group_name();\n\t\t\t\t\n\t\t\t// Group Profile Sub-Component\n\t\t\telseif ( bp_current_action() != 'forum' ) : \n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail[] = ucfirst( bp_current_action() );\n\t\t\tendif;\n\t\t\t\t\n\t\t\tif ( bp_current_action() == 'forum' ) :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail = array_merge( $bp_trail, $this->group_forum_crumbs() );\n\t\t\tendif;\n\n\t\t// Directories\n\t\telseif ( bp_is_directory() ) :\t\n\t\t\tif ( bp_is_activity_component() ) \t\t$bp_trail[] = 'Sitewide Activity';\n\t\t\telseif ( bp_is_members_component() )\t$bp_trail[] = 'Members Directory';\n\t\t\telseif ( bp_is_groups_component() )\t\t$bp_trail[] = 'Guilds Directory';\n\t\t\telse \t\t\t\t\t\t\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\telseif ( bp_is_register_page() || bp_is_activation_page() ) :\n\t\t\t$bp_trail[] = 'New User Registration';\n\t\t\t\t\n\t\t// Backup Placeholder\n\t\telse :\n\t\t\t$bp_trail[] = '404 Page Not Found';\n\t\tendif;\n\t\t\t\n\t\t// Return the BuddyPress trail\n\t\treturn $bp_trail;\n\t}", "public static function getBreadcrumbs($sep='&#x279D;')\n\t{\n\t\t$path = parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH);\n\n\t\t$str = '';\n\t\t$linkURL = '';\n\n\t\t$pagesList = explode('/',ltrim($path, \"/\"));\n\n\t\t$c = count($pagesList);\n\t\tfor ($i=0; $i < $c; $i++) {\n\t\t\tunset($linkText);\n\n\t\t\t$page = array_shift($pagesList);\n\t\t\t\n\t\t\t$linkURL .= \"/$page\";\n\t\t\t\n\t\t\t$fullFilePath = BP.\"/app/views$linkURL.phtml\";\n\t\t\t\n\t\t\t# find the break point for the meta data\n\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t$fileParts = explode(\"{endmeta}\", file_get_contents($fullFilePath), 2);\n\t\t\t\t\n\t\t\t\tif (isset($fileParts[0])) # does the template have meta data\n\t\t\t\t\t$metaDataArray = parse_ini_string($fileParts[0]);\n\t\t\t\t\n\t\t\t\tif (isset($metaDataArray['linkText']))\n\t\t\t\t\t$linkText = $metaDataArray['linkText'];\n\t\t\t\telseif (isset($metaDataArray['title']))\n\t\t\t\t\t$linkText = $metaDataArray['title'];\n\t\t\t}\n\n\t\t\tif (!isset($linkText))\n\t\t\t\t$linkText = self::ucwordss(str_replace('-',' ',$page), [\"is\", \"to\", \"the\", \"for\"]);\t\t\t\t\n\n\t\t\tif ($i+1 == $c) # last one\n\t\t\t\t$str .= ' '.$sep.' '.$linkText;\n\t\t\telse\n\t\t\t\t$str .= ' '.$sep.' <a href=\"'.$linkURL.'\">'.$linkText.'</a>';\n\t\t}\n\n\t\t$indexFileParts = explode(\"{endmeta}\", file_get_contents(BP.\"/app/views/index.phtml\"), 2);\n\t\t\t\t\n\t\tif (isset($indexFileParts[0])) # does the template have meta data\n\t\t\t$metaDataArray = parse_ini_string($indexFileParts[0]);\n\t\t\n\t\tif (isset($metaDataArray['linkText']))\n\t\t\t$linkText = $metaDataArray['linkText'];\n\t\telse\n\t\t\t$linkText = 'Home';\n\n\t\treturn '<a href=\"/\">'.$linkText.'</a>'.$str;\n\t}", "function arlo_fn_breadcrumbs() {\n \n // Settings\n $separator = '<span></span>';\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = esc_html__('Home', 'arlo');\n \n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)\n $custom_taxonomy = '';\n \n // Get the query & post information\n global $post,$wp_query;\n \n // Do not display on the homepage\n if ( !is_front_page() ) {\n \t\n\t\techo '<div class=\"arlo_fn_breadcrumbs\">';\n // Build the breadcrums\n echo '<ul id=\"' . esc_attr($breadcrums_id) . '\" class=\"' . esc_attr($breadcrums_class) . '\">';\n \n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . esc_attr($home_title) . '\">' . esc_html($home_title) . '</a></li>';\n echo '<li class=\"separator separator-home\"> ' . wp_kses_post($separator) . ' </li>';\n \n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n \n\t\t\t echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html__('Archive', 'arlo') . '</span></li>';\n\t\t\t\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_attr($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html($custom_tax_name) . '</span></li>';\n \n } else if ( is_single() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_html($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n // Get post category info\n $category = get_the_category();\n \n if(!empty($category)) {\n \n // Get last category post is in\n $last_category = end(array_values($category));\n \n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n \n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n foreach($cat_parents as $parents) {\n $cat_display .= '<li class=\"item-cat\">'.esc_html($parents).'</li>';\n $cat_display .= '<li class=\"separator\"> ' . esc_html($separator) . ' </li>';\n }\n \n }\n \n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n \n }\n \n // Check if the post is in a category\n if(!empty($last_category)) {\n echo wp_kses_post($cat_display);\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n \n echo '<li class=\"item-cat item-cat-' . esc_attr($cat_id) . ' item-cat-' . esc_attr($cat_nicename) . '\"><a class=\"bread-cat bread-cat-' . esc_attr($cat_id) . ' bread-cat-' . esc_attr($cat_nicename) . '\" href=\"' . esc_url($cat_link) . '\" title=\"' . esc_attr($cat_name) . '\">' . esc_html($cat_name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n } else {\n \n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_category() ) {\n \n // Category page\n echo '<li class=\"item-current item-cat\"><span class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</span></li>';\n \n } else if ( is_page() ) {\n \n // Standard page\n if( $post->post_parent ){\n \n // If child page, get parents \n $anc = get_post_ancestors( $post->ID );\n \n // Get parents in the right order\n $anc = array_reverse($anc);\n \n // Parent page loop\n if ( !isset( $parents ) ) $parents = null;\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . esc_attr($ancestor) . '\"><a class=\"bread-parent bread-parent-' . esc_attr($ancestor) . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n $parents .= '<li class=\"separator separator-' . esc_attr($ancestor) . '\"> ' . wp_kses_post($separator) . ' </li>';\n }\n \n // Display parent pages\n echo wp_kses_post($parents);\n \n // Current page\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span title=\"' . get_the_title() . '\"> ' . get_the_title() . '</span></li>';\n \n } else {\n \n // Just display current page if not parents\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\"> ' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_tag() ) {\n \n // Tag page\n \n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n \n // Display the tag name\n echo '<li class=\"item-current item-tag-' . esc_attr($get_term_id) . ' item-tag-' . esc_attr($get_term_slug) . '\"><span class=\"bread-current bread-tag-' . esc_attr($get_term_id) . ' bread-tag-' . esc_attr($get_term_slug) . '\">' . esc_html($get_term_name) . '</span></li>';\n \n } elseif ( is_day() ) {\n \n // Day archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('m') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><span class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_month() ) {\n \n // Month Archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><span class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_year() ) {\n \n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><span class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_author() ) {\n \n // Auhor archive\n \n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n \n // Display author name\n echo '<li class=\"item-current item-current-' . esc_attr($userdata->display_name) . '\"><span class=\"bread-current bread-current-' . esc_attr($userdata->display_name) . '\" title=\"' . esc_attr($userdata->display_name) . '\">' . esc_html__('Author: ', 'arlo') . esc_html($userdata->display_name) . '</span></li>';\n \n } else if ( get_query_var('paged') ) {\n \n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><span class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"'.esc_attr__('Page ', 'arlo') . get_query_var('paged') . '\">'.esc_html__('Page', 'arlo') . ' ' . get_query_var('paged') . '</span></li>';\n \n } else if ( is_search() ) {\n \n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><span class=\"bread-current bread-current-' . get_search_query() . '\" title=\"'.esc_attr__('Search results for: ', 'arlo'). get_search_query() . '\">' .esc_html__('Search results for: ', 'arlo') . get_search_query() . '</span></li>';\n \n } elseif ( is_404() ) {\n \n // 404 page\n echo '<li>' . esc_html__('Error 404', 'arlo') . '</li>';\n }\n \n echo '</ul>';\n\t\techo '</div>';\n \n }\n \n}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "private function buildBreadCrumb() {\n if (is_array($this->breadcrumb)) {\n foreach ($this->breadcrumb as $index => $value) {\n $breadcrumb .= ! is_null($breadcrumb) ? \"<li>&#8250;&nbsp;</li>\" : NULL;\n if (is_string($index))\n $breadcrumb .= sprintf(\"<li><a class='current_page' href='%s' title='%s' alt='%s'>%s</a></li>\", $value, $index, $index, $index);\n else\n $breadcrumb .= sprintf(\"<li>%s</li>\", $value);\n }\n }\n return $breadcrumb;\n }", "private function breadcrumbs($second = null,$third = null)\n {\n $my_breadcrumbs = [ 'Accueil' => $this->session->userdata['user_role'] >= 40 ? 'index.php/member/admin_home':'index.php/ad/display_all' ];\n if($second && !$third)\n {\n $my_breadcrumbs[' / '.$second] = $_SERVER['PHP_SELF'];\n }\n else if($second && $third)\n {\n $my_breadcrumbs[' / '.$second] = $_SERVER['HTTP_REFERER'];\n $my_breadcrumbs[' / '.$third] = $_SERVER['PHP_SELF'];\n }\n\n return $my_breadcrumbs;\n }", "function apoc_get_group_forum_breadcrumbs() {\n\t$bp_trail = array();\n\t\n\t// Group Forum Root \n\tif ( NULL == bp_action_variable() ) :\n\t\t$bp_trail[] = 'Forum';\n\t\n\t// Topic \n\telse :\n\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/\" title=\"Group Forum\">Forum</a>';\n\t\t\n\t\t// Single Topic\n\t\tif ( bp_is_action_variable( 'topic' , 0 ) ) :\n\t\t\t$topic_info = apoc_get_group_topic_info();\n\t\t\t\t\t\n\t\t\t// Edit Topic\n\t\t\tif ( bp_is_action_variable( 'edit' , 2 ) ) :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/topic/' . $topic_info->url . '\" title=\"' . $topic_info->title . '\">' . $topic_info->title . '</a>';\n\t\t\t\t$bp_trail[] = 'Edit Topic';\n\t\t\t\t\n\t\t\telse :\n\t\t\t\t$bp_trail[] = $topic_info->title;\n\t\t\tendif; \n\t\t\t\n\t\t// Edit Reply\n\t\telseif ( bp_is_action_variable( 'reply' , 0 ) ) :\n\t\t\t$topic_info = apoc_get_group_reply_info();\n\t\t\t\n\t\t\tif ( bp_is_action_variable( 'edit' , 2 ) ) :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'forum/topic/' . $topic_info->url . '\" title=\"' . $topic_info->title . '\">' . $topic_info->title . '</a>';\n\t\t\t\t$bp_trail[] = 'Edit Reply';\n\t\t\tendif;\n\t\tendif;\n\t\t\n\tendif;\n\t\n\treturn $bp_trail;\n}", "protected function _initBreadcrumb(){\r\n\n\t\t$layout = $this->bootstrap('layout')->getResource('layout');\r\n\t\t$view = $layout->getView();\r\n\t\t$config = new Zend_Config(require APPLICATION_PATH.'/configs/navigationShop.php');\r\n\t\t$navigation = new Zend_Navigation();\n\t\t$view->navigation($navigation);\r\n\t\t$navigation->addPage($config);\n\t\tZend_Registry::set('navigation',$navigation);\n\t}", "function wordpress_crumbs() {\n\t\t\n\t\t// Setup empty trail\n\t\t$trail \t= array();\n\t\t\n\t\t// Get some info\n\t\t$apoc \t\t= apocrypha();\n\t\t$post\t\t= $apoc->queried_object;\n\t\t$post_id\t= $apoc->queried_id;\n\t\tif ( isset( $post ) ) {\n\t\t\t$post_type \t= isset( $post->post_type ) ? $post->post_type : NULL;\n\t\t\t$parent \t= isset( $post->post_parent ) ? absint( $post->post_parent ) : NULL;\n\t\t}\n\n\t\t// Singular Views\n\t\tif ( is_singular() ) :\n\t\t\tswitch( $post_type ) {\n\t\t\t\n\t\t\t\t// Single Posts \n\t\t\t\tcase 'post' :\n\t\t\t\t\n\t\t\t\t\t// Is the post in a category?\n\t\t\t\t\t$categories = get_the_category( $post_id );\n\t\t\t\t\tif ( $categories ) :\n\t\t\t\t\t\n\t\t\t\t\t\t// Just do the first category\n\t\t\t\t\t\t$term = $categories[0];\n\t\t\t\t\n\t\t\t\t\t\t// If the category has a parent, add it to the trail. \n\t\t\t\t\t\tif ( 0 != $term->parent ) \n\t\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $term->parent, 'category' ) );\n\n\t\t\t\t\t\t// Add the category archive link to the trail. \n\t\t\t\t\t\t$trail[] = '<a href=\"' . get_term_link( $term ) . '\" title=\"' . esc_attr( $term->name ) . '\">' . $term->name . '</a>';\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t// Does the post have an ancestor?\n\t\t\t\t\tif ( 0 != $parent ) \n\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $parent ) );\n\t\t\t\t\t\n\t\t\t\t\t// Editing a comment on this post\n\t\t\t\t\tif ( is_comment_edit() ) :\n\t\t\t\t\t\t$trail[] = '<a href=\"' . get_permalink() . '\" title=\"Return to article\">' . $post->post_title . '</a>';\n\t\t\t\t\t\t$trail[] = 'Edit Comment';\n\t\t\t\t\t\n\t\t\t\t\t// Reading the post\n\t\t\t\t\telse :\n\t\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\t\tendif; \n\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Single Pages \n\t\t\t\tcase 'page' :\n\t\t\t\t\t\n\t\t\t\t\t// If the page has ancestor pages\n\t\t\t\t\tif ( 0 != $parent ) \n\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $parent ) );\n\t\t\t\t\t\n\t\t\t\t\t// Otherwise, viewing the page\n\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Single Calendar Event \n\t\t\t\tcase 'event' :\n\t\t\t\t\t\n\t\t\t\t\t// I need to rewrite this\n\t\t\t\t\tglobal $allowed_calendar;\n\t\t\t\t\tif ( is_group_calendar( $allowed_calendar->term_id ) ) :\n\t\t\t\t\t\t$group_url = ( 'entropy-rising' == $allowed_calendar->slug ) ? SITEURL . '/entropy-rising/' : SITEURL . '/groups/' . trailingslashit( $slug );\n\t\t\t\t\t\t$trail[] = '<a href=\"'. $group_url .'\" title=\"'. $allowed_calendar->name . ' Guild Page\">'. $allowed_calendar->name .'</a>';\n\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$trail[] = '<a href=\"'. SITEURL . '/calendar/' . $allowed_calendar->slug . '/\" title=\"'. $allowed_calendar->name . ' Calendar\">Calendar</a>';\n\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t// Archive Pages\n\t\telseif ( is_archive() ) :\n\t\t\n\t\t\t// Category Archives\n\t\t\tif ( is_category() ) :\n\t\t\t\t$trail[] = 'Categories';\n\n\t\t\t\t// If the category has a parent, add it to the trail. \n\t\t\t\tif ( $post->parent != 0 ) \n\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $post->parent ) );\n\t\t\t\t\n\t\t\t\t// Finish up with the term name\n\t\t\t\t$trail[] = $post->name;\n\t\t\t\n\t\t\t// Author Archive \n\t\t\telseif ( is_author() ) :\n\t\t\t\t$trail[] = 'Authors';\n\t\t\t\t$trail[] = get_the_author_meta( 'display_name', get_query_var( 'author' ) );\n\t\t\t\n\t\t\t\n\t\t\t// Calendar Archive \n\t\t\telseif ( is_calendar() ) :\n\t\t\t\n\t\t\t\t// Is it a group calendar? \n\t\t\t\t$term_id \t= $post->term_id;\n\t\t\t\tif( is_group_calendar( $term_id ) ) :\n\n\t\t\t\t\t// Get the group\n\t\t\t\t\t$slug\t\t= $post->slug;\n\t\t\t\t\t$group_id\t= groups_get_id( $slug );\t\t\n\t\t\t\t\tif ( 'entropy-rising' == $slug ) :\n\t\t\t\t\t\t$trail[] = '<a href=\"'. home_url() . '/entropy-rising/\">Entropy Rising</a>';\n\t\t\t\t\telse :\n\t\t\t\t\t\t$group = groups_get_group( array( 'group_id' => $group_id ) );\n\t\t\t\t\t\t$trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\">Guilds</a>';\n\t\t\t\t\t\t$trail[] = '<a href=\"'. bp_get_groups_directory_permalink() . $slug .'\" title=\"'. $group->name . '\">'. $group->name . '</a>';\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// Otherwise just a standalone calendar\n\t\t\t\t$trail[] = 'Calendar';\n\t\t\tendif;\n\t\t\n\t\t// Search Results\n\t\telseif ( is_search() ) :\n\t\t\t$trail[] = 'Search Results';\n\t\telseif ( is_adv_search() ) :\n\t\t\t$trail[] = 'Advanced Search';\n\t\t\t\n\t\t// Interactive Map\n\t\telseif ( is_interactive_map() ) :\n\t\t\t$trail[] = 'Interactive Map';\n\t\t\t\n\t\t// Page Not Found\n\t\telseif ( is_404() ) : \n\t\t\t$trail[] = '404 Page Not Found';\t\t\n\t\tendif;\n\t\t\t\t\t\n\t\t// Return the trail\n\t\treturn $trail;\t\t\n\t}", "function the_breadcrumb() {\n\tif (!is_home()) {\n\t\techo '<span title=\"';\n\t\techo get_option('home');\n\t echo '\">';\n\t\tbloginfo('name');\n\t\techo \"</span> » \";\n\t\tif (is_page_template()) {\n\t\t\t\techo \" » \";\n echo the_title();\n\n \n \t\n\t\t} elseif (is_single()) {\n\t\t\techo the_title();\n\t\t}\n\t}\n}", "private function weblink_cat_breadcrumbs($weblink_cat_index) {\n\n /* Make an infinity traverse */\n function breadcrumb_arrays($index, $webid) {\n $crumb = [];\n if (isset($index[get_parent($index, $webid)])) {\n $_name = dbarray(dbquery(\"SELECT weblink_cat_id, weblink_cat_name, weblink_cat_parent FROM \".DB_WEBLINK_CATS.\" WHERE weblink_cat_id='\".$webid.\"' AND weblink_cat_status='1' AND \".groupaccess(\"weblink_cat_visibility\").(multilang_table(\"WL\") ? \" AND \".in_group('weblink_cat_language', LANGUAGE) : \"\").\"\"));\n $crumb = [\n \"link\" => INFUSIONS.\"weblinks/weblinks.php?cat_id=\".$_name['weblink_cat_id'],\n \"title\" => $_name['weblink_cat_name']\n ];\n if (isset($index[get_parent($index, $webid)])) {\n if (get_parent($index, $webid) == 0) {\n return $crumb;\n }\n $crumb_1 = breadcrumb_arrays($index, get_parent($index, $webid));\n $crumb = array_merge_recursive($crumb, $crumb_1); // convert so can comply to Fusion Tab API.\n }\n }\n\n return $crumb;\n }\n\n // then we make a infinity recursive function to loop/break it out.\n $crumb = breadcrumb_arrays($weblink_cat_index, $this->cat_id);\n $title_count = !empty($crumb['title']) && is_array($crumb['title']) ? count($crumb['title']) > 1 : 0;\n // then we sort in reverse.\n if ($title_count) {\n krsort($crumb['title']);\n krsort($crumb['link']);\n }\n if ($title_count) {\n foreach ($crumb['title'] as $wbi => $value) {\n BreadCrumbs::getInstance()->addBreadCrumb([\"link\" => $crumb['link'][$wbi], \"title\" => $value]);\n if ($wbi == count($crumb['title']) - 1) {\n add_to_title(self::$locale['global_201'].$value);\n }\n }\n } else if (isset($crumb['title'])) {\n add_to_title(self::$locale['global_201'].$crumb['title']);\n BreadCrumbs::getInstance()->addBreadCrumb([\"link\" => $crumb['link'], \"title\" => $crumb['title']]);\n }\n }", "function print_breadcrumb() {\n\t?>\n\t<div class=\"breadcrumb-wrapper\">\n\t\t<nav aria-label=\"breadcrumb\">\n\t\t\t<ol class=\"breadcrumb\">\n\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( site_url() ); ?>\">Home</a></li>\n\t\t\t\t<?php if ( is_page() ) : ?>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_home() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">Insights</li>\n\t\t\t\t<?php elseif ( is_singular( 'post' ) ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>\">Insights</a></li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_singular( 'service' ) ) : ?>\n\t\t\t\t\t<?php $term = get_the_terms( get_the_ID(), 'service-category' )[0]; ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( $term->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php elseif ( is_singular() ) : ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tglobal $post;\n\t\t\t\t\t$post_type = get_post_type( $post );\n\t\t\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"breadcrumb-item\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $post_type ) ); ?>\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( $post_type_object->label ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_tax() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( get_queried_object()->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php endif; ?>\n\t\t\t</ol>\n\t\t</nav>\n\t</div>\n\t<?php\n}", "function Steps_prepare_parent_breadcrumbs($Step) {\n\tif ($Step && $Step->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($Step->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}" ]
[ "0.7050351", "0.66382456", "0.6413904", "0.63911784", "0.6246362", "0.62159514", "0.61872435", "0.6158721", "0.61342895", "0.61315405", "0.611843", "0.6035857", "0.6028004", "0.6027461", "0.5972861", "0.58917487", "0.5890116", "0.58725697", "0.585618", "0.5850155", "0.58439493", "0.58422154", "0.58374906", "0.5828728", "0.58138835", "0.58120024", "0.5799048", "0.57793087", "0.5766363", "0.5746522", "0.57463604", "0.5739991", "0.5734854", "0.5733325", "0.5732727", "0.5679451", "0.56646925", "0.5663201", "0.56629974", "0.565374", "0.5625303", "0.56215435", "0.56154364", "0.55936456", "0.55841005", "0.55829775", "0.5569845", "0.55694145", "0.55635124", "0.5547932", "0.5542774", "0.55344915", "0.55302364", "0.5528861", "0.5509205", "0.5505435", "0.5502991", "0.5498724", "0.5497091", "0.5494335", "0.5492006", "0.5488062", "0.54754823", "0.5467584", "0.5464139", "0.5464002", "0.5453186", "0.5449041", "0.54452574", "0.5433922", "0.54294574", "0.5425136", "0.54237205", "0.54071164", "0.53972805", "0.53954005", "0.5392044", "0.5391522", "0.53849465", "0.53808", "0.53783345", "0.5375449", "0.5370585", "0.5362427", "0.5356181", "0.5352611", "0.5351235", "0.5350269", "0.5346168", "0.53416944", "0.53395706", "0.53395706", "0.5337312", "0.53360575", "0.53349954", "0.5326143", "0.531533", "0.5314578", "0.53104806", "0.53102463", "0.5303795" ]
0.0
-1
Create a new command instance.
public function __construct(SendAlertMailService $sendAlertMailService) { parent::__construct(); $this->sendMailService = $sendAlertMailService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create() {}", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010808", "0.73334074", "0.7260711", "0.7164211", "0.7160091", "0.7137609", "0.6748687", "0.67234004", "0.6717854", "0.6697033", "0.66780454", "0.6645434", "0.6562241", "0.6543825", "0.648385", "0.64696676", "0.6429314", "0.6382229", "0.63783383", "0.63773185", "0.63159364", "0.6248454", "0.6241942", "0.6194326", "0.60813016", "0.60758287", "0.6069924", "0.60685325", "0.60556376", "0.60278845", "0.601331", "0.60119677", "0.60118407", "0.5969593", "0.5961789", "0.595456", "0.5940454", "0.5938882", "0.59293514", "0.5910567", "0.5906556", "0.589659", "0.589659", "0.589659", "0.5869282", "0.58665484", "0.5866531", "0.58663136", "0.58524704", "0.58524615", "0.58442056", "0.5839224", "0.5815453", "0.5805575", "0.5795847", "0.57802117", "0.5765329", "0.5764038", "0.5758465", "0.5757482", "0.5742644", "0.57393265", "0.5733011", "0.57224995", "0.5701047", "0.5686871", "0.56851953", "0.56819516", "0.5675993", "0.5667153", "0.5660692", "0.565933", "0.56568134", "0.5653405", "0.5634396", "0.56290585", "0.56266344", "0.56255984", "0.56089187", "0.5607999", "0.56063473", "0.56026787", "0.5599554", "0.5599391", "0.556407", "0.556407", "0.5561953", "0.55597264", "0.5555112", "0.5551519", "0.55446017", "0.5539716", "0.552962", "0.55290693", "0.55290693", "0.55290693", "0.55290693", "0.55290693", "0.55290693", "0.55290693", "0.55290693" ]
0.0
-1
Check whether a name is a valid shard type name.
public function isValidShardTypeName($name) { return in_array($name, $this->getShardTypeNames()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }", "public static function isValidName($name) {}", "public static function checkName($name)\n {\n if (strlen($name) >= 2) {\n return true;\n }\n return false;\n }", "public static function checkName($name)\r\n {\r\n if (strlen($name) >= 4) {\r\n return true;\r\n }\r\n return false;\r\n }", "function is_valid_graphql_name(string $type_name)\n {\n }", "protected static function isValidName($name)\n {\n return '' === $name || null === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\\-:]*$/D', $name);\n }", "public static function validateName($name) {\n if (preg_match(\"/^[a-zA-Z]*$/\",$name))\n return true;\n else\n return false;\n }", "public static function isValidName( $name ) {\n return TRUE;\n }", "public static function validateStreamName($name) {\n\t\t\t\treturn (strlen($name) < 32 && strlen($name) > 0) ? true : \"Name must be between 1 to 32 characters\";\n\t\t}", "function is_reserved_name($str) {\n\t\t$reserved = array('name','value','content','parent','rank','password','timestamp');\n\t\tif(empty($str) || in_array($str, $reserved)) return true;\n\t\treturn false;\n\t}", "function validName($name)\n {\n //name should not be empty and should contain only letters\n return !empty($name) && ctype_alpha($name);\n }", "public static function isName($name)\n {\n return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#\"°{}_$%:¤|]*$/u'), stripslashes($name));\n }", "function validName($name)\r\n {\r\n $name = str_replace(' ', '', $name);\r\n return !empty($name) && ctype_alpha($name);\r\n }", "function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "function valid_name($name) {\r\n\tif (empty($name)) \r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n }", "function isValidName ($name)\r\n{\r\n global $cf_reservedpattern;\r\n\r\n $reservedpattern = $cf_reservedpattern ? $cf_reservedpattern : '[_a-z]{0,1}([\\d]+)';\r\n\r\n if (preg_match(\"%^\".$reservedpattern.\"$%i\", $name, $matches))\r\n return FALSE; // reserved - not permitted\r\n\r\n $pattern = '[a-z\\d][_a-z\\d]{2,23}';\r\n if (preg_match('%^'.$pattern.'$%i', $name))\r\n if (!preg_match(\"%^(api|com|biz|def|gov|net|org|wap|web|www|gamma|mobile|mygamma|buzzcity|netbeacon)[\\d]*$%i\", $name))\r\n return TRUE;\r\n\r\n return FALSE; // not permitted\r\n}", "private final static function validClassName($name)\n {\n # a-z, 0-9. Must start with a capitalised letter\n return !preg_match('#[^A-Za-z0-9]|^[^A-Z]#', $name);\n }", "function valid_name($name){\r\n for($i = 0; $i < strlen($name); $i++){\r\n if( is_numeric( $name[$i] ) ){\r\n return False;\r\n }\r\n }\r\n return True;\r\n }", "public function isLegalName($name) {\n\t\t// This variable name is special to bash, so we can't use it\n\t\tif ( $name === '_' ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool) preg_match('/^[_A-Za-z][A-Za-z0-9_]*$/', $name);\n\t}", "function is_validwhitelistname($name) {\n\tif (!is_string($name))\n\t\treturn false;\n\n\tif (!preg_match(\"/[^a-zA-Z0-9\\_\\.\\/]/\", $name))\n\t\treturn true;\n\n\treturn false;\n}", "function validateName($name) {\n\tif (!preg_match('/[^A-Za-z]+/', $name) && strlen($name) >= 2 && strlen($name) <= 20)\n\t\treturn 1;\t//name is valid\n\telse\n\t\treturn 0;\n}", "public static function validateName($name) {\n\t\tif (!empty($name)) {\n\t\t\tif (preg_match('/^[a-z0-9 ]{3,}$/i', $name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function isValidName($name)\n {\n try {\n new static($name);\n } catch (Throwable $th) {\n return false;\n }\n\n return true;\n }", "public function validName(string $ressourceName): bool\n {\n $minLength = 3;\n $maxLength = 255;\n $regex = '/^[a-z](?!oog)([a-z0-9-_.~+%]){'.$minLength.','.$maxLength.'}+$/';\n\n $isValid = (preg_match($regex, $ressourceName)) ? true : false;\n\n return $isValid;\n }", "public static function isGenericName($name)\n {\n return empty($name) || preg_match(Tools::cleanNonUnicodeSupport('/^[^<>={}]*$/u'), $name);\n }", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }", "function _name_check($str){\n }", "public function name(string $name) : bool\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]*$/\",$name)) {\n\t\t\t$this->errors[] = 'Only letters and white space allowed';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasType(string $name): bool;", "function validateUserName($name)\n {\n /**condition for validating the type and size of user input string\n *takes user input name as a parameter for validating with the set conditons\n */\n if (preg_match('/[a-zA-Z]{3}/', $name)) {\n return true;\n }\n }", "function is_validwhitelistname($name) {\n\tif (!is_string($name))\n\treturn false;\n\n\tif (!preg_match(\"/[^a-zA-Z0-9\\.\\/]/\", $name))\n\treturn true;\n\n\treturn false;\n}", "function isValidName($str)\n{\n $parts = explode(' ', $str);\n\n if (count($parts) < 2) {\n return false;\n }\n\n if ($str !== formatName($str))\n return false;\n\n return true;\n}", "function isValidName($name)\n{\n if (! preg_match(\"/^[a-zA-Z ]*$/\", $name)) {\n return false;\n }\n return true;\n}", "private function validName($name): bool {\n\t\t$pattern = '~\n# XML 1.0 Name symbol PHP PCRE regex <http://www.w3.org/TR/REC-xml/#NT-Name>\n(?(DEFINE)\n (?<NameStartChar> [A-Z_a-z\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\x{2FF}\\\\x{370}-\\\\x{37D}\\\\x{37F}-\\\\x{1FFF}\\\\x{200C}-\\\\x{200D}\\\\x{2070}-\\\\x{218F}\\\\x{2C00}-\\\\x{2FEF}\\\\x{3001}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFFD}\\\\x{10000}-\\\\x{EFFFF}])\n (?<NameChar> (?&NameStartChar) | [.\\\\-0-9\\\\xB7\\\\x{0300}-\\\\x{036F}\\\\x{203F}-\\\\x{2040}])\n (?<Name> (?&NameStartChar) (?&NameChar)*)\n)\n^(?&Name)$\n~ux';\n\t\treturn (1 === preg_match($pattern, $name));\n\t}", "function is_validaliasname($name) {\n\tif (!preg_match(\"/(:word:)/\", $name))\n\treturn true;\n\telse\n\treturn false;\n}", "function validate_name($name)\r\n\t{\r\n\t\t$trim = trim($name);\r\n\t\tif(strlen($trim) > 1)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "function ValidateName($name)\n{\n $chars = str_split($name);\n\n // Assess each character\n foreach ($chars as $char) {\n if (!ValidateChar($char)) {\n return false;\n }\n }\n\n // // Check for empty\n // if (empty($name)) {\n // return false;\n // }\n\n return true;\n}", "private function _checkName($name)\n {\n if (!preg_match('/' . $this->_packet->question[0]->qname . '$/', $name)) {\n \n throw new Net_DNS2_Exception(\n 'name provided (' . $name . ') does not match zone name (' .\n $this->_packet->question[0]->qname . ')',\n Net_DNS2_Lookups::E_PACKET_INVALID\n );\n }\n \n return true;\n }", "public function checkItemType(string $name, string $type): bool\n {\n return str_contains(ucfirst($name), $type);\n }", "public function name_valid($name) {\n if (!preg_match(\"/^[a-z0-9]+$/i\", $name)) {\n /* name contains invalid characters */\n return false;\n }\n\n if (strlen($name) >= 100) {\n /* name is too long */\n return false;\n }\n\n /* name already exists? */\n $stmt = get_pdo()->prepare('select * from user where name = :name');\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n return count($stmt->fetchAll()) == 0;\n }", "private final static function validDbName($name)\n {\n return !preg_match('#[^a-z_]|^[^a-z]|[^a-z]|__$#', $name);\n }", "private function isUnderscoreName($string)\n {\n $validName = true;\n // Check that the name only contains legal characters.\n if (preg_match('/[^a-z_0-9]/', $string)) {\n $validName = false;\n }\n return $validName;\n }", "protected function _validVariableName($name)\n {\n // @TODO: Update this list with more\n $named = array('pageName','channel','server','campaign','products','TnT','events','pageType','purchaseID', 'transactionID','state','zip','currencyCode','pageType');\n $count = array('hier', 'eVar', 'prop');\n \n // Check for named\n if(in_array($name, $named))\n return true;\n \n // Check against numbered vars\n foreach($count as $var)\n if(strpos($name, $var) === 0)\n return true;\n \n // No matches :(\n return false;\n }", "public function isNameTake(string $name): bool;", "public static function isValidIdentifierName($name)\n {\n if (\\is_string($name) === \\false || $name === '' || \\strpos($name, ' ') !== \\false) {\n return \\false;\n }\n return \\preg_match(self::PHP_LABEL_REGEX, $name) === 1;\n }", "public static function isValid($name)\n {\n $tot = strlen($name);\n for ($i = 0; $i < $tot; $i += 1) {\n $ord = ord($name[$i]);\n if ($ord < 33 || $ord > 126 || $ord === 58) {\n return false;\n }\n }\n return true;\n }", "static function isName($name)\n {\n return in_array($name, array(\"close_connection\",\n \"savepoint\",\n \"savepoint_rollback\",\n \"savepoint_release\",\n \"commit\",\n \"rollback\",\n \"prepare\",\n \"recover\",\n \"commit_by_xid\",\n \"rollback_by_xid\",\n \"create_cursor_read_view\",\n \"set_cursor_read_view\",\n \"close_cursor_read_view\",\n \"create_handler\",\n \"drop_database\",\n \"panic_call\",\n \"release_temporary_latches\",\n \"update_statistics\",\n \"start_snapshot\",\n \"flush_logs\",\n \"show_status\",\n \"partition_flags\",\n \"alter_table_flags\",\n \"alter_tablespace\",\n \"fill_files_table\",\n \"binlog_func\",\n \"binlog_log_query\"\n ));\n }", "function validateName($name)\n {\n return (mb_strlen($name) <= CUSTOMER_NAME_MAX_LENGTH && mb_strlen($name) !== 0);\n }", "public function name_validation($name){\n\t\tif(!preg_match('/^[a-zA-Z0-9. ]*$/',$name)){ \n\t\t\treturn true;\n \t}\n }", "private function validateName($name)\n {\n if($name != NULL && $name != \"\"){\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public static function event_name_is_valid( $name ) {\n\t\treturn preg_match( self::EVENT_NAME_REGEX, $name );\n\t}", "static function validName($name)\r\n {\r\n if (ctype_alpha($name)) {\r\n return $name;\r\n } else if ($name == \"\") {\r\n return !empty($name);\r\n }\r\n }", "public function hasType($name);", "public static function is_application_name($name)\r\n {\r\n return (preg_match('/^[a-z][a-z_]+$/', $name) > 0);\r\n }", "public static function validate(string $name) : bool\n {\n if (! preg_match(self::$validIdentifierMatcher, $name)) {\n throw new InvalidArgumentException(sprintf(\n 'Provided name \"%s\" is invalid name: must conform \"%s\"',\n $name,\n self::$validIdentifierMatcher\n ));\n }\n\n return true;\n }", "private function ValidateName($name){\n if (empty($name)){ //checks if empty\n $this->valid = False;\n }else if (strlen($name)>= 30){ //checks max length\n $this->valid = False;\n }else if(!preg_match(\"/^[a-zA-Z ]*$/\",$name)){ //checks format\n $this->valid = False;\n }\n }", "public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }", "function verify_name($name) // Colorize: green\n { // Colorize: green\n return isset($name) // Colorize: green\n && // Colorize: green\n is_string($name) // Colorize: green\n && // Colorize: green\n $name != \"\"; // Colorize: green\n }", "public static function prop_name_is_valid( $name ) {\n\t\treturn preg_match( self::PROP_NAME_REGEX, $name );\n\t}", "function isValidShortName($name) {\n return preg_match('#^[a-z0-9]+$#i', $name);\n}", "public static function isValidType(String $type){\n return array_key_exists(strtoupper($type), self::userTypes());\n }", "protected function validateMachineName($value) {\n if (preg_match(\"/^[a-z0-9\\_]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid machine name (only a-z, 0-9, and _)\"));\n return false;\n }", "static function checkNames($input)\r\n {\r\n if (preg_match('/^[\\w\\W][\\w\\W]{1,20}$/', $input)) {\r\n return true; //Illegal Character found!\r\n } else {\r\n echo PageBuilder::printError(\"Please enter alphabets only in name fields.\");\r\n return false;\r\n }\r\n }", "public function isValidNameOrError($name): bool\n {\n if ($name == \"\") {\n throw new Exception('Invalid Product Name');\n }\n return true;\n }", "public static function validate_name( $value ) {\n\t\treturn !DataValidator::cc_number_exists_in_str( $value );\n\t}", "public static function isValidName($name, $strict = false) {\n $constants = self::getConstants();\n\n if ($strict) {\n return array_key_exists($name, $constants);\n }\n\n $keys = array_map(\n 'strtolower', \n array_keys($constants)\n );\n\n return in_array(strtolower($name), $keys);\n }", "function parseTypeName($typeName) {\n\t\t$splitName = $this->splitClassName($typeName);\n\t\tif ($splitName === false) return false;\n\t\tlist($this->_packageName, $this->_className) = $splitName;\n\n\t\t// FIXME: Validate package and class to reduce the risk of\n\t\t// code injection, e.g. check that the package is within given limits/folders,\n\t\t// don't allow empty package parts, etc.\n\n\t\treturn true;\n\t}", "private function _is_valid_column_name($str) {\n\t\tif (preg_match('/[^a-zA-Z0-9\\/\\-\\_]/', $str)) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public static function typeIdentifier($value): bool\n {\n static::regex(\n $value,\n '/^[0-9A-Za-z-_]+$/',\n 'Value \"%s\" does not match type identifier format requirement (must contain only of alphanumeric chars,'\n . ' dash or underscore)'\n );\n static::maxLength($value, self::MAX_TYPE_IDENTIFIER_LENGTH);\n\n return true;\n }", "public static function isCharacterEncodingValid(string $name): bool;", "private final static function validPropertyName($name)\n {\n return !preg_match('#[^a-z0-9_]|^[^a-z]|__#', $name);\n }", "function validName($name) {\r\n //checks to see that a string is all alphabetic\r\n return\r\n (\r\n (!empty($name)) && ctype_alpha($name));\r\n}", "function validate_name($name){\n\n\tif(empty($name)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t else if(count(explode(' ',$name)) <2){\n\t\t\n\t\t\n\t\t\treturn false;\n\t\t\n\t}\n\t\n\telse if(!preg_match(\"/^[a-zA-Z \\.\\-]*$/\",$name)){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse if(!preg_match(\"/^[a-zA-Z]*$/\",$name[0])){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse{\n\t\t\n\t\treturn true;\n\t}\n\t\n\t\n}", "public function validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }", "public static function isNameValid(string $val) : bool {\n $len = strlen($val);\n\n if ($len > 0) {\n for ($x = 0 ; $x < $len ; $x++) {\n $char = $val[$x];\n\n if ($char == '=' || $char == '&' || $char == '#' || $char == '?') {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "function check_name($str, $blank_ok = FALSE)\n\t{\n\t\tif ($str == '')\n\t\t\treturn $blank_ok;\n\t\tif (preg_match(\"#^\\d+[e|E]#\", $str))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "public function isValidContentTypeName($value) {\n return TRUE;\n }", "public static function isValidName($name, $strict = false)\n {\n $constants = self::getConstants();\n\n if ($strict) {\n return array_key_exists($name, $constants);\n }\n\n $keys = array_map('strtolower', array_keys($constants));\n return in_array(strtolower($name), $keys);\n }", "function isSetName($input) {\n return (preg_match(\"~(^[[:alnum:] -]+$)~\", $input));\n }", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "protected function checkName()\n {\n if (preg_match('/^[a-zA-Z_]{1}[a-zA-Z_0-9]*$/', $this->name) == false) {\n throw new ReflectionException('Annotation parameter name may contain letters, underscores and numbers, but contains an invalid character.');\n }\n }", "public function isValid()\n {\n if ($this->type != self::SCALAR_TPYE && $this->type != self::LIST_TYPE && $this->type != self::MAP_TYPE)\n return false;\n if (!Utils::isValidIdentifier($this->name))\n return false;\n return true;\n }", "private function validatePostName($_post_name){\n $this->post_name = htmlspecialchars($_post_name);\n if($this->post_name === '' or strlen($this->post_name) > 100){\n return false; //Was not a string, or an error occured\n }\n return true;\n }", "protected function isSpecialName($name)\n {\n return in_array($name, array('default', 'root', 'parent'));\n }", "public static function isString($var, $name)\n {\n try {\n (string) $var;\n } catch (\\Exception $e) {\n throw new InvalidArgumentTypeException(gettype(''), $name);\n }\n }", "public static function filename_valid($name) {\n return strlen($name) < 100 && preg_match(\"/^[a-z0-9 \\.-]+$/i\", $name) != 0;\n }", "function _valid_trayname($str)\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t\r\n\t\t// used for checking valid tray name while editting \r\n\t\t$tray_id = $this->input->post('tray_id');\r\n\t\tif($tray_id)\r\n\t\t\t$cond = ' and tray_id != '.$tray_id;\r\n\t\telse \r\n\t\t\t$cond = '';\r\n\t\t\r\n\t\t$tray_name =$this->input->post('tray_name');\r\n\t\tif($this->db->query(\"select count(*) as t from m_tray_info where tray_name = ? $cond \",$tray_name)->row()->t)\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('_valid_trayname',$tray_name.' is already available ');\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\treturn true;\r\n\t}", "protected function hasPostType($name)\n {\n return post_type_exists($name);\n }", "public function hasName($name)\n {\n if(strcasecmp($this->data['name'], $name ) == 0)\n return true;\n return false;\n }", "static public function validateName($name)\n {\n return Validate::stringLength($name, self::NAME_LENGTH, 'Category Name');\n }", "public function validateName($name, $definedClass)\n {\n if ($name != camel_case($name)) {\n throw new Exception('Name \"'.$name.'\" (defined in class \"'.$definedClass.'\") is not a camel case name.');\n }\n\n return true;\n }", "static public function checkString($s){\n if (ctype_lower($s) || ctype_upper($s) || ctype_alpha($s)){\n return false;\n }\n return true;\n }", "protected function isValidName(string $key): bool\n {\n return preg_match('/^[\\w\\.]+$/', $key) ? true : false;\n }", "public function _validWikName($str)\n\t{\n\t\tif (preg_match('/[^a-z0-9\\-\\_]/i', $str))\n\t\t{\n\t\t\tee()->form_validation->set_message('_validWikName', lang('invalid_short_name'));\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public static function isValidPhpVariableName($name)\n {\n return (bool) preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $name, $matches);\n }", "public function validate_name($str){\n $allowed = array(\".\", \"-\", \"_\", \" \"); // you can add here more value, you want to allow.\n if(ctype_alnum(str_replace($allowed, '', $str ))) {\n return true;\n }\n else{\n return false;\n }\n }", "public function hasReservedName()\n {\n return count($this->get(self::RESERVED_NAME)) !== 0;\n }", "function isValidName($titreDocument){\n\tif(!(strlen($titreDocument) >= 3 && strlen($titreDocument) <= 100))\n\t\treturn false;\n\tif($titreDocument == '.htaccess' || $titreDocument == '.htpassword' || $titreDocument == 'robots.txt'){\n\t\treturn false;\n\t}\n\n\treturn preg_match('#^([&a-zA-Zéèàç\\(\\)0-9_\\[\\]\\-\\.: \\?\\=])+$#', $titreDocument);\n}", "private static function is_test_name_ok( $test_name ) {\n if (\n\t\t$test_name === self::CPU\n || $test_name === self::DB\n || $test_name === self::DISK\n\t ) {\n\t\treturn true;\n\t } else {\n\t\treturn false;\n\t }\n\t}" ]
[ "0.70160866", "0.6918967", "0.6879366", "0.685767", "0.6736761", "0.66125757", "0.6608893", "0.6587089", "0.65691376", "0.6539598", "0.652879", "0.64908904", "0.64855355", "0.646905", "0.6462404", "0.6461026", "0.645976", "0.64584607", "0.6450859", "0.64370865", "0.6433816", "0.6421523", "0.63810766", "0.6376965", "0.6351239", "0.63505167", "0.6322117", "0.6305537", "0.6302489", "0.62664664", "0.622839", "0.6219635", "0.61973476", "0.61968464", "0.6188072", "0.61817145", "0.61771697", "0.61481965", "0.6139302", "0.6134551", "0.6084731", "0.60557544", "0.6049246", "0.604088", "0.60249025", "0.6020082", "0.60078466", "0.60009485", "0.59718037", "0.5969027", "0.59596884", "0.5957508", "0.595658", "0.59526116", "0.5950135", "0.5932033", "0.5928965", "0.58879375", "0.58863044", "0.58763665", "0.5871945", "0.58665806", "0.5865377", "0.58641386", "0.58639383", "0.58613575", "0.5860478", "0.5860423", "0.5859364", "0.5853576", "0.5832213", "0.5825748", "0.57973725", "0.5783971", "0.5778298", "0.57772017", "0.577704", "0.57562065", "0.5755646", "0.5750942", "0.57489884", "0.5741321", "0.572728", "0.57180136", "0.5683482", "0.5669228", "0.56493586", "0.56397027", "0.563059", "0.56301653", "0.5628597", "0.56169164", "0.5613155", "0.56117", "0.55964166", "0.5588658", "0.5581724", "0.55752003", "0.5574884" ]
0.88166386
1
Check whether nid is valid.
public function isValidNid($value) { return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidNode();", "function checkTxnid($txnid) {\n\tglobal $db;\n\n\t$txnid = $db->real_escape_string($txnid);\n\t$results = $db->query('SELECT * FROM `payments` WHERE txnid = \\'' . $txnid . '\\'');\n\n\treturn ! $results->num_rows;\n}", "function network_domain_check()\n {\n }", "private function checkNetID($netID)\n {\n\n if(empty($netID)){\n\n // Throw exception, banner term code is not valid\n throw new \\Exception('NetID cannot be blank.');\n\n }\n\n // Check if the @ and domain was included, if so strip it out\n $netID = preg_replace(\"/@(.*?)$/\", \"\", $netID);\n\n return $netID;\n\n }", "function check_txnid($tnxid){\n\t\t\t\tglobal $link;\n\t\t\t\t// $dbName= 'EventAdvisors';\n\t\t\t\t// $link = mysqli_connect($host, $user, $pass,$dbName);\n\t\t\t\t// mysql_select_db($db_name);\n\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t\t$valid_txnid = true;\n\t\t\t\t//get result set\n\t\t\t\t$sql = mysqli_query( $con, \"SELECT * FROM payments WHERE txnid = '\".$tnxid.\"' \");\t\t\n\t\t\t\t\n\t\t\t\tif($row = mysqli_fetch_array($sql)) {\n\t\t\t\t\t$valid_txnid = false;\n\t\t\t\t}\n\t\t\t\treturn $valid_txnid;\n\t\t\t}", "public function isValid($rootNodeId): bool;", "public function it_handles_invalid_nodes() {\n\t\t\\WP_Mock::wpPassthruFunction( '__' );\n\n\t\t$node_id = mt_rand( 1, 100 );\n\t\t$settings = array(\n\t\t\t'_type' => 'invalid-node',\n\t\t\t'invalid_node_field' => rand_str(),\n\t\t);\n\n\t\t$subject = new WPML_Cornerstone_Translatable_Nodes();\n\t\t$strings = $subject->get( $node_id, $settings );\n\t\t$this->assertCount( 0, $strings );\n\t}", "public function it_handles_invalid_nodes() {\n\t\t\\WP_Mock::wpPassthruFunction( '__' );\n\n\t\t$node_id = mt_rand( 1, 100 );\n\t\t$settings = array(\n\t\t\t'_type' => 'invalid-node',\n\t\t\t'invalid_node_field' => rand_str(),\n\t\t);\n\n\t\t$subject = new WPML_Cornerstone_Translatable_Nodes();\n\t\t$strings = $subject->get( $node_id, $settings );\n\t\t$this->assertCount( 0, $strings );\n\t}", "public function check(Node $node);", "public function checkNodeExists() {\n try {\n $query = $this->connection->select('node_field_data', 'n');\n $query->fields('n', ['nid'])\n ->condition('n.nid', $this->nodeId, '=')\n ->range(0, 1);\n\n $result = $query->execute()->fetchAll();\n if (empty($result)) {\n return FALSE;\n }\n\n return TRUE;\n }\n catch (\\Exception $e) {\n $logger = $this->getLogger('odp-base');\n $logger->error($e->getMessage());\n }\n }", "public static function validate_nip($nip){\r\n $nip_9 = strlen($nip)==9?TRUE:FALSE;\r\n $nip_18 = strlen($nip)==18?TRUE:FALSE;\r\n \r\n if(Validasi::validate_number($nip)==FALSE) return FALSE;\r\n \r\n if($nip_9 OR $nip_18){\r\n if(strlen($nip)==9){\r\n return preg_match('/^060[0-9]{6}$/',$nip);\r\n }else if(strlen($nip)==18){\r\n $th_lhr = (int) substr($nip, 0,4);\r\n $bl_lhr = (int) substr($nip, 4,2);\r\n $bl_angkat = (int) substr($nip,12,2);\r\n $year = (int) date('Y');\r\n $resign = $year-50;\r\n if($resign<$th_lhr AND $th_lhr<($year-18)){\r\n if(0<$bl_lhr AND $bl_lhr<13 AND 0<$bl_angkat AND $bl_angkat<13){\r\n if(preg_match('/^19([0-9]{12})([1-2]{1})([0]{1})([0-9]{2})$/', $nip)) return TRUE;\r\n return FALSE;\r\n }\r\n }\r\n \r\n }\r\n }else{\r\n return FALSE;\r\n }\r\n }", "function check_fqdn($fqdn)\n{\n\t// domain name length\n\tif(strlen($fqdn) > 256 or strlen($fqdn) < 4)\n\t{\n\t\t// FQDN too long or too short\n\t\treturn false;\n\t}\n\t\n\t// domain name must contain at least two dots\n\tif(substr_count($fqdn, '.') < 2)\n\t{\n\t\t// FQDN too long or too short\n\t\treturn false;\n\t}\n\t\n\t// check to see if this might be an IP address\n\tif(ip2long($fqdn))\n\t{\n\t\t// is IP\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\t// split on each . to get the nodes\n\t\t$nodes = split('\\.', $fqdn);\n\t\t\n\t\t// process each node\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\t// each node is limited to 63 characters\n\t\t\tif(strlen($node) > 63)\n\t\t\t{\n\t\t\t\t//node too long\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// each node is limited to specific characters and structure\n\t\t\tif(!preg_match('/^[a-z\\d]*(?:([a-z\\d-]*[a-z\\d]))$/i', $node))\n\t\t\t{\n\t\t\t\t//node contains invalid characters\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// made it this far, it must be valid\n\t\treturn true;\n\t}\n}", "function isValid() {\n\t\treturn( $this->verifyId( $this->mPostId ) && is_numeric( $this->mPostId ) && $this->mPostId > 0 );\n\t}", "function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }", "private function Nick_Register_Validation($sorce){\r\n\r\n // Create local instance of nick\r\n $nick = $sorce['nick'];\r\n\r\n // Check if nick is null or empty\r\n if(self::check_Null_Or_Empty($nick)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_nick', 'Empty box!');\r\n }\r\n\r\n // Check min chars in nick\r\n else if(self::check_Min($nick)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_nick', 'Your nick is too short, min '.$this->_min.' chars!');\r\n }\r\n\r\n // Check max chars in nick\r\n else if(self::check_Max($nick)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_nick', 'Your nick is too long, max '.$this->_max.' chars!');\r\n }\r\n\r\n // Check if nick contain only alphanumeric chars\r\n else if(!self::check_If_Alphanumeric($nick)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_nick', 'Only alphanumeric letters are allowed!');\r\n }\r\n // Check if nick is currently occupied\r\n else if(Self::check_If_Nick_Exists($nick)){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_nick', 'Nick \"'.$nick.'\" is occupied!');\r\n }\r\n else\r\n Session::put('w_nick', $nick);\r\n }", "public function testCns()\n {\n $this->assertTrue(BrValidation::cns('702 5053 3246 4238'));\n $this->assertTrue(BrValidation::cns('898 0058 0155 2261'));\n $this->assertTrue(BrValidation::cns('706000307269748'));\n $this->assertTrue(BrValidation::cns('706902161943931'));\n\n $this->assertFalse(BrValidation::cns('702 5053 3246 4237'));\n $this->assertFalse(BrValidation::cns('111 1111 1111 1111'));\n $this->assertFalse(BrValidation::cns('9021 6194 0000'));\n $this->assertFalse(BrValidation::cns(['12345678909']));\n }", "public function isValid() {\n\t\treturn !( empty( $this->fk_NMC ) || empty( $this->titre ) || empty( $this->contenu ) );\n\t}", "abstract public function valid();", "protected function validateIPN()\n {\n JLoader::register('PaypalIPN', JPATH_ROOT . '/components/com_osproperty/plugins/paypal/PayPalIPN.php');\n $ipn = new PaypalIPN;\n // Use sandbox URL if test mode is configured\n if (!$this->mode)\n {\n $ipn->useSandbox();\n }\n // Disable use custom certs\n $ipn->usePHPCerts();\n $this->notificationData = $_POST;\n try\n {\n $valid = $ipn->verifyIPN();\n $this->logGatewayData($ipn->getResponse());\n if (!$this->mode || $valid)\n {\n return true;\n }\n return false;\n }\n catch (Exception $e)\n {\n $this->logGatewayData($e->getMessage());\n return false;\n }\n }", "function validate_cidr($cidr) {\n\t\t\tif (preg_match(\"/^(?:12[0-8]|1[0-1]\\d|\\d\\d|\\d)$/\", $cidr))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "public function validate()\n {\n $this->validateNode($this->tree);\n }", "public function testCnh()\n {\n $this->assertTrue(BrValidation::cnh('01827854569'));\n\n $this->assertFalse(BrValidation::cnh('01827854568'));\n $this->assertFalse(BrValidation::cnh('12345678909'));\n $this->assertFalse(BrValidation::cnh('11111111111'));\n $this->assertFalse(BrValidation::cnh('018278545'));\n $this->assertFalse(BrValidation::cnh('abcdefghij'));\n }", "public function is_valid()\n {\n }", "function is_valid_ssn($ssn)\n{\n if(is_null($ssn) || strlen($ssn) != 18)\n {\n return false;\n }\n $pattern = \"/^[1-8][0-7]\\d{4}(19|20)\\d{2}(0[1-9]|1(0|1|2))(0[1-9]|(1|2)\\d|3(0|1))\\d{3}(\\d|x)$/i\";\n return preg_match($pattern, $ssn) == 1;\n}", "public function is_valid()\n {\n }", "public static function validateNationalIdNumber($input)\n {\n $input = trim($input);\n $prepared_input = preg_replace(\"^\\\\s^\", \"\", $input);\n if ((preg_match(\"[^\\\\d{2}-?\\\\d{6,7}-?[A-Za-z]{1}-?\\\\d{2}$]\", $prepared_input) == FALSE) || strlen($prepared_input) < 12 || strlen($prepared_input) > 16) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function isValid() {\n\t\t// check if page type is valid\n\t\ttry {\n\t\t\t$this->getAttribute('uid'); // getAttribute forces the object to be read from database\n\t\t\treturn true;\n\t\t} catch (tx_newspaper_EmptyResultException $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "protected function checkID(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_numeric($this->_ID) && $this->_ID !== 0 ) {\n\t\t\t$inMessage .= \"{$this->_ID} is not a valid value for ID\";\n\t\t\t$isValid = false;\n\t\t}\n\t\treturn $isValid;\n\t}", "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 __validate_acl_network() {\n if (isset($this->initial_data['acl_network'])) {\n # Check if this is an IPv4 or IPv6 address\n if (is_ipaddr($this->initial_data[\"acl_network\"])) {\n $this->ip_version = intval(is_ipaddr($this->initial_data[\"acl_network\"]));\n $this->validated_data[\"acl_network\"] = $this->initial_data['acl_network'];\n } else {\n $this->errors[] = APIResponse\\get(2069);\n }\n } else {\n $this->errors[] = APIResponse\\get(2068);\n }\n }", "public function check()\n\t{\n\t\tif (trim($this->cn) == '')\n\t\t{\n\t\t\t$this->setError(\\Lang::txt('COM_GROUPS_ERROR_EMPTY_TITLE'));\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private function isValid(): bool\n {\n $this->generateChecksum();\n return (($this->luhnValue % $this->base == 0) && ($this->luhnValue != 0));\n }", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "abstract public function isValid();", "abstract public function isValid();", "public function isIdentifierValid()\n {\n return (request('identifier') == $this->identifier) ? true : false;\n }", "function checkTxnid($txnid) {\n //Sample code from the reference\n\n $db = configDB();\n $q = $db->prepare('SELECT * FROM payments WHERE txnid = ?');\n $result = $q->execute(array($txnid));\n return !$q->rowCount();\n}", "public function is_valid_identifier($identifier)\r\n {\r\n if(!$this->is_connected())\r\n {\r\n throw new Exception('Cannot connect to Pubchem server.');\r\n }\r\n\r\n $this->last_identifier = Validator_identifiers::ID_PUBCHEM;\r\n\r\n $format = 'JSON';\r\n\r\n $uri = \"compound/cid/$identifier/property/Title/$format\";\r\n $method = Http_request::METHOD_GET;\r\n\r\n try \r\n {\r\n $response = $this->client->request($uri, $method);\r\n\r\n if($response && $response->PropertyTable && \r\n $response->PropertyTable->Properties && \r\n count($response->PropertyTable->Properties))\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n } \r\n catch (Exception $e) \r\n {\r\n return false;\r\n } \r\n }", "abstract public function nonce_check();", "public static function isValid(string $oid): bool {\n if (self::parse($oid) == null) {\n return false;\n }\n return true;\n }", "public function isValid() {\n return !empty($id);\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 100) {\n return false;\n }\n if ($this->container['nit'] === null) {\n return false;\n }\n if (strlen($this->container['nit']) > 15) {\n return false;\n }\n if ($this->container['inbound_configuration_username'] === null) {\n return false;\n }\n if ($this->container['outbound_configuration_contingency_email'] === null) {\n return false;\n }\n return true;\n }", "function validateNodeParticipant($uid,$nid)\n\t{\n\t\t$response['validate']=new stdclass;\n\n\t\t//use nodes helper\n\t\t$nodesHelper=new nodesHelper();\n\t\t$isNodeParticipant=$nodesHelper->isNodeParticipant($uid,$nid);\n\n\t\tif($isNodeParticipant==1)//active participant\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse if($isNodeParticipant==2)//inactive participant (who left chat)\n\t\t{\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_INACTIVE_MEMBER_MSG');\n\t\t}\n\t\telse if(!$isNodeParticipant)// 0 - not a valid group chat participant\n\t\t{\n\t\t\t$response['validate']->error=1;\n\t\t\t$response['validate']->error_msg=JText::_('COM_JBOLO_NON_MEMBER_MSG');\n\t\t}\n\t\t//echo errors\n\t\tjson_encode($response);\n\t\t//output json response\n\t\theader('Content-type: application/json');\n\t\techo json_encode($response);\n\t\tjexit();\n\t}", "public function testIPIsNotValid()\n {\n $settings = require(__DIR__ . '/../src/settings.php');\n $geo_ip = new GeoIP($settings['settings']);\n\n $this->assertFalse($geo_ip->validateIP('10.0.0'));\n }", "protected function isValidNegotiationNode($node)\n {\n return isset($node['name']) && isset($node['values']);\n }", "function isValid()\r\n\t{\t\t\r\n\t\treturn false;\r\n\t}", "public function testSnils()\n {\n $this->assertTrue(RuValidation::snils('112-233-445 95'));\n $this->assertTrue(RuValidation::snils('032-032-952 00'));\n\n $this->assertFalse(RuValidation::snils('03203295200'));\n\n // invalid checksum\n $this->assertFalse(RuValidation::snils('112-233-445 96'));\n }", "function is_valid_btcaddress($pubkey)\r\n\t{\r\n\r\n\t$forbidden_chars = array(\";\",\"$\",\"*\",\"!\",\"[\",\"]\",\"@\",\"#\",\"%\",\"^\",\"&\");\r\n\t$minimal_lenght = 25;\r\n\t\r\n\t$errors_sum =0;\r\n\t//check pubkey lenght\r\n\tif (strlen($pubkey)<$minimal_lenght)\r\n\t\t$errors_sum=$errors_sum+1;\t\r\n\t// check if address begins from 1\t\t\r\n\tif ($pubkey[0]!='1')\r\n\t\t$errors_sum=$errors_sum+1;\r\n\t//check if forbidden chars occure\r\n\tforeach ($forbidden_chars as &$forbidden_character)\r\n\t\t{\r\n\t\tif (strpos($pubkey, $forbidden_character))\r\n\t\t\t$errors_sum=$errors_sum+1;\t\r\n\t\t}\r\n\t//result of checking\r\n\tif ($errors_sum ==0)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n\r\n\t}", "abstract public function validateNumber(): bool;", "public function isValid() : bool {\n\t\treturn (int) $this->id > 0;\n\t}", "function invalid(){\r\techo \"<node>\";\r\t\techo \"<count>invalid</count>\";\r\techo \"</node>\";\r\tdie(0);\r}", "function isValidSSN($ssn) {\n if (!preg_match(\"/\\b(((20)((0[0-9])|(1[0-8])))|(([1][^0-8])\\d{2}))((0[1-9])|1[0-2])((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[-]?\\d{4}?\\b/\", $ssn)) {\n return false;\n } else {\n $year = substr($ssn, 0, 4);\n $month = substr($ssn, 4, 2);\n $date = substr($ssn, 6, 2);\n\n return checkdate($month, $date, $year);\n }\n}", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "public function isValid();", "function isValid() {\n return( BitBase::verifyId( $this->mContentId ) );\n }", "public function testIsValid()\n {\n $validator = new Idun_Validate_Nand(array(\n new Zend_Validate_StringLength(7, 32),\n new Zend_Validate_EmailAddress\n ));\n file_put_contents('/tmp/debug.log', var_export(get_class_methods($validator), true));\n file_put_contents('/tmp/debug.log', var_export(method_exists($validator, 'isValid'), true), FILE_APPEND);\n $ref = new ReflectionClass($validator);\n file_put_contents('/tmp/debug.log', var_export($ref->getMethods(), true), FILE_APPEND);\n file_put_contents('/tmp/debug.log', var_export($ref->hasMethod('isValid'), true), FILE_APPEND);\n $this->assertTrue($validator->isValid('dummy'));\n }", "public function isValid()\n\t{\n\t\tif ( !parent::isValid())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Return Break error\n\t\t$pattern = \"'<span id=\\\"sitemap404msg\\\">(.*?)<\\/span>'s\";\n\t\tpreg_match_all($pattern, $this->xmlContent, $matches);\n\n\t\tif( !empty($matches[1][0]) )\n\t\t{\n\t\t\t$errormsg = 'COM_COMMUNITY_VIDEOS_FETCHING_VIDEO_ERROR' . strip_tags( $matches[1][0] );\n\t\t\t$this->setError\t( JText::_($errormsg) );\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "protected function verifyNetwork($input): bool\n {\n if ($this->networkRange === null) {\n return true;\n }\n\n if (isset($this->networkRange['mask'])) {\n return $this->belongsToSubnet($input);\n }\n\n $input = sprintf('%u', ip2long($input));\n\n $min = sprintf('%u', ip2long($this->networkRange['min']));\n $max = sprintf('%u', ip2long($this->networkRange['max']));\n\n return ($input >= $min) && ($input <= $max);\n }", "public static function is_valid($identifier)\n\t{\n\t\tif(!$identifier\t|| trim($identifier) == '')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function isValid() ;", "function is_invalid($err)\n{\n // TODO: megírni. Csak akkor printelje ki a hiba-class-t ha tényleg hibás a mező\n if (!$err == null)\n echo $err . ' is-invalid';\n}", "function _checkIP($ip)\n{\n _log(\"checkIP: Starting.\",\"info\");\n global $caasnode;\n _log(\"checkIP: IP address is $ip.\",\"info\");\n $cIP = ip2long($ip);\n $fIP = long2ip($cIP);\n if($fIP=='0.0.0.0')\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): IPaddress is not valid.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: IPaddress is not valid.\");\n\t\t_exit1(\"Exiting at checkIP: Invalid ip address, aborting \\n\\n\\n\");\n\t}\n _log(\"checkIP: $ip is a valid ip address.\",\"info\");\n _log(\"checkIP: Exiting.\",\"info\");\n}", "private function validateCookie($requestor, $nid = NULL) {\n if ($nid && !$this->checkQueryRange($nid, $this->date->get(\"timestamp\"))) {\n // Date range is irrelevant to the node.\n $this->logger->addRow(\"Date is out of display range for node $nid, skipping.\", WATCHDOG_INFO, $nid, \"media_seller\", $requestor->businessEntityId);\n unset($this->nodes[$nid]);\n unset($this->requestors[$nid]);\n return;\n }\n // Get a cookie if already exists.\n $cookie_id = serialize($requestor->getCookieCredentials());\n $cookie = empty($this->cookies[$cookie_id]) ? NULL : $this->cookies[$cookie_id];\n\n // Set the saved cookie to the requestor (or NULL if one doesn't exist).\n $requestor->setCookie($cookie);\n // Login / acquire relevant cookie.\n $this->cookies[$cookie_id] = $requestor->login();\n }", "public function valid(): bool\n {\n return isset($this->nodes[$this->pointer]);\n }", "private function checkQueryRange($nid) {\n $date_start = $this->date->get(\"timestamp\");\n $date_end = $this->date->get(\"last second\");\n return hiro_query_range_is_relevant($nid, $date_start, $date_end);\n }", "function valid_ip($ip)\n\t{\n\t\t$ip_segments = explode('.', $ip);\n\n\t\t// Always 4 segments needed\n\t\tif (count($ip_segments) != 4)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// IP can not start with 0\n\t\tif ($ip_segments[0][0] == '0')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Check each segment\n\t\tforeach ($ip_segments as $segment)\n\t\t{\n\t\t\t// IP segments must be digits and can not be\n\t\t\t// longer than 3 digits or greater then 255\n\t\t\tif ($segment == '' OR preg_match(\"/[^0-9]/\", $segment) OR $segment > 255 OR strlen($segment) > 3)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function valid() {\n return filter_var($this->address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false;\n }", "public function isValid() {}" ]
[ "0.64025486", "0.6340277", "0.5810089", "0.5658293", "0.5650978", "0.5597646", "0.55826086", "0.55826086", "0.55459076", "0.5530434", "0.5477158", "0.54311675", "0.54188114", "0.5411719", "0.53832394", "0.537839", "0.53705055", "0.5364124", "0.5335435", "0.5303845", "0.5292084", "0.529027", "0.52761155", "0.5274856", "0.52747667", "0.52711546", "0.52539366", "0.5249409", "0.5249409", "0.5249409", "0.5249409", "0.5249409", "0.5249409", "0.5249409", "0.5249409", "0.52248096", "0.52248096", "0.52248096", "0.52190876", "0.52108794", "0.51777226", "0.5174921", "0.5169959", "0.5169959", "0.5169959", "0.5169959", "0.5168223", "0.5168223", "0.51675975", "0.5154638", "0.5144895", "0.5135893", "0.51349413", "0.5130772", "0.5128074", "0.51273465", "0.5112984", "0.51118004", "0.51112473", "0.51040024", "0.51028997", "0.5095997", "0.50945836", "0.509234", "0.50886", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.50584275", "0.5049929", "0.50402373", "0.5036006", "0.50329643", "0.50309205", "0.5030272", "0.5029295", "0.5029256", "0.50264025", "0.5025498", "0.5019667", "0.50181615", "0.50039816", "0.50039816", "0.50039816", "0.50039816", "0.50039816", "0.50038815", "0.50037956" ]
0.6356099
1
Check whether view mode name is valid.
public function isValidViewModeName($value) { return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valid() {\n\t\tif( ! defined( 'WPV_VERSION' ) )\n\t\t\treturn false;\n\n\t\t// opposite of parent \"Views exists\"\n\t\treturn ! parent::valid();\n\t}", "public function isMode($mode);", "private function checkForView($name)\n {\n $viewFile = $this->config['views'] . '/' . $name . '.blade.php';\n if (!file_exists($viewFile)) {\n return false;\n }\n\n return true;\n }", "public static function isValid(){\n\n\t\t$valid=false;\n\t\tif(isset($_GET[\"view\"])){\n\t\t\t$url =\"\";\n\t\t\tif(Core::$root==\"\"){\n\n\n\t\t\t\t$url = \"core/app/view/\".$_GET['view'].\"-view.php\";\n\n\t\t\t}\n\n\t\t\tif(file_exists($file = $url)){\n\t\t\t\t$valid = true;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "public function isViewMode($viewMode) {\n return $this->getViewMode() == $viewMode;\n }", "public function isView( $name ) {\n\t\tthrow new MWException( 'DatabaseBase::isView is not implemented in descendant class' );\n\t}", "protected static function isValidName($name)\n {\n return '' === $name || null === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\\-:]*$/D', $name);\n }", "public static function is_application_name($name)\r\n {\r\n return (preg_match('/^[a-z][a-z_]+$/', $name) > 0);\r\n }", "function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "public static function checkName($name)\r\n {\r\n if (strlen($name) >= 4) {\r\n return true;\r\n }\r\n return false;\r\n }", "function valid_name($name) {\r\n\tif (empty($name)) \r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n }", "private function _validMode($creationMode)\r\n {\r\n if (in_array($creationMode, array('private', 'public'))) {\r\n return $creationMode;\r\n }\r\n return 'private';\r\n }", "public static function isValidName($name) {}", "function isValidName($titreDocument){\n\tif(!(strlen($titreDocument) >= 3 && strlen($titreDocument) <= 100))\n\t\treturn false;\n\tif($titreDocument == '.htaccess' || $titreDocument == '.htpassword' || $titreDocument == 'robots.txt'){\n\t\treturn false;\n\t}\n\n\treturn preg_match('#^([&a-zA-Zéèàç\\(\\)0-9_\\[\\]\\-\\.: \\?\\=])+$#', $titreDocument);\n}", "function isValidName ($name)\r\n{\r\n global $cf_reservedpattern;\r\n\r\n $reservedpattern = $cf_reservedpattern ? $cf_reservedpattern : '[_a-z]{0,1}([\\d]+)';\r\n\r\n if (preg_match(\"%^\".$reservedpattern.\"$%i\", $name, $matches))\r\n return FALSE; // reserved - not permitted\r\n\r\n $pattern = '[a-z\\d][_a-z\\d]{2,23}';\r\n if (preg_match('%^'.$pattern.'$%i', $name))\r\n if (!preg_match(\"%^(api|com|biz|def|gov|net|org|wap|web|www|gamma|mobile|mygamma|buzzcity|netbeacon)[\\d]*$%i\", $name))\r\n return TRUE;\r\n\r\n return FALSE; // not permitted\r\n}", "public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }", "public function viewExists($viewName, $schemaName=null){ }", "public function isLegalName($name) {\n\t\t// This variable name is special to bash, so we can't use it\n\t\tif ( $name === '_' ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool) preg_match('/^[_A-Za-z][A-Za-z0-9_]*$/', $name);\n\t}", "private function getMode()\n {\n $mode = $this->mode;\n $conf_view = $this->conf_view;\n\n\n $sumOfModes = count( $conf_view );\n\n // RETURN false : there isn't any single view\n if ( $sumOfModes < 1 )\n {\n // RETURN : no DRS prompt needed\n if ( !$this->pObj->b_drs_error )\n {\n return false;\n }\n\n // RETURN : DRS prompt\n $this->getModeDRSnoView();\n return false;\n }\n\n // mode isn't proper. Move it to 1.\n if ( $mode > $sumOfModes )\n {\n $mode = 1;\n }\n\n return $mode;\n }", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }", "public function validName(string $ressourceName): bool\n {\n $minLength = 3;\n $maxLength = 255;\n $regex = '/^[a-z](?!oog)([a-z0-9-_.~+%]){'.$minLength.','.$maxLength.'}+$/';\n\n $isValid = (preg_match($regex, $ressourceName)) ? true : false;\n\n return $isValid;\n }", "function is_reserved_name($str) {\n\t\t$reserved = array('name','value','content','parent','rank','password','timestamp');\n\t\tif(empty($str) || in_array($str, $reserved)) return true;\n\t\treturn false;\n\t}", "public function validateControlName($name);", "public function checkViewExists($view);", "private function _view_file_exists()\n {\n $route = Rails::application()->dispatcher()->router()->route();\n # Build a simple path for the view file, as there's no support for\n # stuff like modules.\n # Note that the extension is PHP, there's no support for different\n # request formats.\n $base_path = Rails::config('views_path');\n $view_path = $base_path . '/' . $route->path() . '.php';\n return is_file($view_path);\n }", "public static function isValidName( $name ) {\n return TRUE;\n }", "public static function checkName($name)\n {\n if (strlen($name) >= 2) {\n return true;\n }\n return false;\n }", "public function isMode($mode)\n {\n return $this->mode == $mode;\n }", "private function ValidateName($name){\n if (empty($name)){ //checks if empty\n $this->valid = False;\n }else if (strlen($name)>= 30){ //checks max length\n $this->valid = False;\n }else if(!preg_match(\"/^[a-zA-Z ]*$/\",$name)){ //checks format\n $this->valid = False;\n }\n }", "private final static function validDbName($name)\n {\n return !preg_match('#[^a-z_]|^[^a-z]|[^a-z]|__$#', $name);\n }", "public static function isNameValid(string $val) : bool {\n $len = strlen($val);\n\n if ($len > 0) {\n for ($x = 0 ; $x < $len ; $x++) {\n $char = $val[$x];\n\n if ($char == '=' || $char == '&' || $char == '#' || $char == '?') {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "public static function validateName($name) {\n if (preg_match(\"/^[a-zA-Z]*$/\",$name))\n return true;\n else\n return false;\n }", "public function isIdentifierValid()\n {\n return (request('identifier') == $this->identifier) ? true : false;\n }", "private function validName($name): bool {\n\t\t$pattern = '~\n# XML 1.0 Name symbol PHP PCRE regex <http://www.w3.org/TR/REC-xml/#NT-Name>\n(?(DEFINE)\n (?<NameStartChar> [A-Z_a-z\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\x{2FF}\\\\x{370}-\\\\x{37D}\\\\x{37F}-\\\\x{1FFF}\\\\x{200C}-\\\\x{200D}\\\\x{2070}-\\\\x{218F}\\\\x{2C00}-\\\\x{2FEF}\\\\x{3001}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFFD}\\\\x{10000}-\\\\x{EFFFF}])\n (?<NameChar> (?&NameStartChar) | [.\\\\-0-9\\\\xB7\\\\x{0300}-\\\\x{036F}\\\\x{203F}-\\\\x{2040}])\n (?<Name> (?&NameStartChar) (?&NameChar)*)\n)\n^(?&Name)$\n~ux';\n\t\treturn (1 === preg_match($pattern, $name));\n\t}", "public static function event_name_is_valid( $name ) {\n\t\treturn preg_match( self::EVENT_NAME_REGEX, $name );\n\t}", "function isMsgViewMode() {\n\n\tif (isset($_GET['msg_id'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "public function valid()\n {\n return !empty($this->name);\n }", "private function validateName($name)\n {\n if($name != NULL && $name != \"\"){\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function verifyTemplate($view_name)\n {\n if (!file_exists('view/' . $view_name . '.tpl.php')) {\n echo \"No such controller\";\n exit;\n }\n }", "public function getViewMode();", "function checkData() {\n\t //check template name\n\t if (!ereg('^[0-9a-zA-Z_\\-]+$',$this->newIdt)) {\n\t\t $this->error = MF_WRONG_SHORT_NAME;\n\t\t return false;\n\t } else \n\t \t return $this->isNameFree();\n }", "public function name_exists($name, $viewid) {\n return $this->df->name_exists('views', $name, $viewid);\n }", "public function isModeActive($key)\n {\n $params = request()->input();\n\n if (isset($params['mode']) && $key == $params['mode'])\n return true;\n\n return false;\n }", "function nameFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_NAME_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "function view_exists($view, $viewtype = 'default') {\n global $CONFIG;\n\n if (isset($CONFIG->views->locations[$viewtype][$view]))\n return true;\n\n $result = view($view, $viewtype);\n if ($result)\n return true;\n\n return false;\n}", "public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }", "private static function checkFormatModeValidity($mode) {\n $validMode = array(\n self::FORMAT_MODE_WITH_PLUS_AND_DOT_SEPARATOR,\n self::FORMAT_MODE_WITHOUT_PLUS,\n self::FORMAT_MODE_WITHOUT_DOT_SEPARATOR,\n );\n \n if (in_array($mode, $validMode) === false) {\n throw new \\Exception('The format mode asked is not valid !');\n }\n \n }", "public static function validateName($name) {\n\t\tif (!empty($name)) {\n\t\t\tif (preg_match('/^[a-z0-9 ]{3,}$/i', $name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function field_view($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $fieldRight = right::get_field($name);\r\n $view = $fieldRight[view];\r\n\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($view != 0) return($userRight & $view);\r\n else return(false); // default no display\r\n }", "public function isTestMode()\n {\n if (strpos($this->adyenMode, Environment::TEST) !== false) {\n return true;\n } else {\n return false;\n }\n }", "public function name_validation($name){\n\t\tif(!preg_match('/^[a-zA-Z0-9. ]*$/',$name)){ \n\t\t\treturn true;\n \t}\n }", "public function hasReservedName()\n {\n return count($this->get(self::RESERVED_NAME)) !== 0;\n }", "protected function _validVariableName($name)\n {\n // @TODO: Update this list with more\n $named = array('pageName','channel','server','campaign','products','TnT','events','pageType','purchaseID', 'transactionID','state','zip','currencyCode','pageType');\n $count = array('hier', 'eVar', 'prop');\n \n // Check for named\n if(in_array($name, $named))\n return true;\n \n // Check against numbered vars\n foreach($count as $var)\n if(strpos($name, $var) === 0)\n return true;\n \n // No matches :(\n return false;\n }", "public static function prop_name_is_valid( $name ) {\n\t\treturn preg_match( self::PROP_NAME_REGEX, $name );\n\t}", "private final static function validPropertyName($name)\n {\n return !preg_match('#[^a-z0-9_]|^[^a-z]|__#', $name);\n }", "public function assertViewIs($name)\n {\n $this->assertEquals($name, $this->response->original->getName());\n }", "function check_name($str, $blank_ok = FALSE)\n\t{\n\t\tif ($str == '')\n\t\t\treturn $blank_ok;\n\t\tif (preg_match(\"#^\\d+[e|E]#\", $str))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "function is_validaliasname($name) {\n\tif (!preg_match(\"/(:word:)/\", $name))\n\treturn true;\n\telse\n\treturn false;\n}", "function isvalid($value) {\n global $debugging;\n switch (true) {\n case (! parent::isvalid($value)):\n $this->error = \"File name must be short and simple\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $value . \"]\";\n }\n return false;\n case (! $this->contentAccessValid()):\n $this->error = \"Content inaccessible\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $this->filepath($value) . \"]\";\n }\n return false;\n default:\n return true;\n }\n }", "public function name(string $name) : bool\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]*$/\",$name)) {\n\t\t\t$this->errors[] = 'Only letters and white space allowed';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validateName($name) {\n\tif (!preg_match('/[^A-Za-z]+/', $name) && strlen($name) >= 2 && strlen($name) <= 20)\n\t\treturn 1;\t//name is valid\n\telse\n\t\treturn 0;\n}", "public static function isName($name)\n {\n return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#\"°{}_$%:¤|]*$/u'), stripslashes($name));\n }", "public function isFullView(): bool\n {\n return self::VIEW_FULL === $this->viewType;\n }", "public function validateName() {\n if (!$this->hasErrors()) {\n $authManager = Yii::$app->authManager;\n if ($authManager->getRole($this->name)) {\n $this->addError('name', 'Ya existe un rol con ese nombre');\n return false;\n }\n return true;\n }\n return false;\n }", "function isSetName($input) {\n return (preg_match(\"~(^[[:alnum:] -]+$)~\", $input));\n }", "private function _is_valid_column_name($str) {\n\t\tif (preg_match('/[^a-zA-Z0-9\\/\\-\\_]/', $str)) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "function _name_check($str){\n }", "function validName($name)\n {\n //name should not be empty and should contain only letters\n return !empty($name) && ctype_alpha($name);\n }", "public function checkViewFile(FileData $fileData)\n\t{\n\t\treturn true;\n\t}", "function vdb_name ($db) \r\n\t\t{\r\n\t\t\treturn !preg_match('/[^a-z_\\-0-9]/i', $db);\r\n\t\t\t\r\n\t\t}", "public static function validateMode(string $mode): void\n {\n $invalid = $mode != self::MIGRATION_MODE_UNSPECIFIED\n && $mode != self::NEW_SURFACE_ONLY\n && $mode != self::PRE_MIGRATION_SURFACE_ONLY\n && $mode != self::MIGRATING;\n if ($invalid) {\n throw new \\Exception(\"Invalid migration mode '{$mode}', allowed values are: 'MIGRATION_MODE_UNSPECIFIED', 'PRE_MIGRATION_SURFACE_ONLY', 'NEW_SURFACE_ONLY', 'MIGRATING'\");\n }\n }", "protected function isValidName(string $key): bool\n {\n return preg_match('/^[\\w\\.]+$/', $key) ? true : false;\n }", "function viewExists ($view_name) {\n\t\treturn isset ($this->_views[$view_name]);\n\t}", "function validate_name($name)\r\n\t{\r\n\t\t$trim = trim($name);\r\n\t\tif(strlen($trim) > 1)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "function checkDisplayMode($a_title = \"\")\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientview.html\", \"setup\");\n\t\t\t\t// display tabs\n\t\t\t\tinclude \"./setup/include/inc.client_tabs.php\";\n\t\t\t\t$client_name = ($this->setup->getClient()->getName()) ? $this->setup->getClient()->getName() : $this->lng->txt(\"no_client_name\");\n\t\t\t\t$this->tpl->setVariable(\"TXT_HEADER\",$client_name.\" (\".$this->lng->txt(\"client_id\").\": \".$this->setup->getClient()->getId().\")\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientsetup.html\", \"setup\");\n\t\t\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt($a_title));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->displayError($this->lng->txt(\"unknown_display_mode\"));\n\t\t\t\texit();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function validName($name)\r\n {\r\n $name = str_replace(' ', '', $name);\r\n return !empty($name) && ctype_alpha($name);\r\n }", "public function testInvalidView() {\n $renderer = $this->container->get('renderer');\n $render_element = [\n '#type' => 'view',\n '#name' => 'invalid_view_name',\n '#embed' => FALSE,\n ];\n $this->expectException(ViewRenderElementException::class);\n $this->expectExceptionMessage(\"Invalid View name ({$render_element['#name']}) given.\");\n $renderer->renderRoot($render_element);\n }", "private function isViewValid($viewFile) {\n\t\ttry {\n\t\t\t// check if file path exists\n\t\t\tif (!file_exists($viewFile)) {\n\t\t\t\tthrow new Fari_Exception('View not located in: ' . $viewFile);\n\t\t\t}\n\t\t} catch (Fari_Exception $exception) { $exception->fire(); }\n\t}", "private static function isView($controller, $view) {\n\t\tif (file_exists(APP_DIR.'/Mvc/View/'.$controller.'/'.$view.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isTV(){\n\t\tif ($this->view == \"tv\"){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isValidFilename()\n {\n $fileName = $this->fileName;\n if(substr($fileName, 0,1) == '-') {\n return false;\n }\n return true;\n }", "function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function isCorrectFilename ($name) {\r\n if (!empty($name)) {\r\n if (preg_match('/[a-zA-Z0-9_]/', $name)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "public function modeName()\n\t{\n\t\treturn $this->mode->name();\n\t}", "function vName( $name ) \r\n\t\t{\t \r\n\t\t\t\t\r\n\t\t\t\treturn preg_match (\"/^[a-zA-ZàáâäãåąćęèéêëìíîïłńòóôöõøùúûüÿýżźñçčšžÀÁÂÄÃÅĄĆĘÈÉÊËÌÍÎÏŁŃÒÓÔÖÕØÙÚÛÜŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+$/u\", $name);\r\n\t\t\t\t\t\t \r\n\t\t}", "public function isViewable() {\n\t\tif ($this->isVariable()) {\n\t\t\t$editables = $this->parent->editables();\n\t\t\tif (!empty($editables)) {\n\t\t\t\treturn in_array($this->parsedVarName, $this->parent->viewables());\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function check_environment_correct()\n {\n $environment_array = explode('|', strtolower($this->EE->TMPL->fetch_param('environment')));\n\n return ( ! empty($environment_array))\n ? (in_array(strtolower($_SERVER['SERVER_NAME']), $environment_array))\n : TRUE;\n }", "public function setViewMode($input);", "public function canShowTab()\n {\n return $this->_getCurrentTheme()->isVirtual() && $this->_getCurrentTheme()->getId();\n }", "public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}", "public static function filename_valid($name) {\n return strlen($name) < 100 && preg_match(\"/^[a-z0-9 \\.-]+$/i\", $name) != 0;\n }", "function validateUserName($name)\n {\n /**condition for validating the type and size of user input string\n *takes user input name as a parameter for validating with the set conditons\n */\n if (preg_match('/[a-zA-Z]{3}/', $name)) {\n return true;\n }\n }", "private static function isValidTagName($tag)\n {\n $pattern = '/^[a-z_]+[a-z0-9\\:\\-\\.\\_]*[^:]*$/i';\n return preg_match($pattern, $tag, $matches) && $matches[0] == $tag;\n }", "public function hasView()\n {\n return false;\n }", "private static function is_test_name_ok( $test_name ) {\n if (\n\t\t$test_name === self::CPU\n || $test_name === self::DB\n || $test_name === self::DISK\n\t ) {\n\t\treturn true;\n\t } else {\n\t\treturn false;\n\t }\n\t}", "public static function isValidBootstrapMode($test_mode) {\n $valid_modes = ['auto', 'manual'];\n return in_array($test_mode, $valid_modes);\n }", "final public static function isDefinedName($name)\n {\n self::initOptions();\n\n return isset(self::$options[$name]);\n }", "public function valid_input_role() {\n $role = $this->ci->input->post(\"role\");\n\n if ($role == USER_CATI || $role == USER_CID || $role == USER_FINANCE ||\n $role == USER_MP || $role == USER_DIV_MARKETEERS || $role == USER_DIV_CONSULTING ||\n $role == USER_DIV_INSTITUTE || $role == USER_DIV_INSIGHT\n ) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "static function isName($name)\n {\n return in_array($name, array(\"close_connection\",\n \"savepoint\",\n \"savepoint_rollback\",\n \"savepoint_release\",\n \"commit\",\n \"rollback\",\n \"prepare\",\n \"recover\",\n \"commit_by_xid\",\n \"rollback_by_xid\",\n \"create_cursor_read_view\",\n \"set_cursor_read_view\",\n \"close_cursor_read_view\",\n \"create_handler\",\n \"drop_database\",\n \"panic_call\",\n \"release_temporary_latches\",\n \"update_statistics\",\n \"start_snapshot\",\n \"flush_logs\",\n \"show_status\",\n \"partition_flags\",\n \"alter_table_flags\",\n \"alter_tablespace\",\n \"fill_files_table\",\n \"binlog_func\",\n \"binlog_log_query\"\n ));\n }" ]
[ "0.61483645", "0.6118603", "0.59659773", "0.5828386", "0.57788956", "0.5691769", "0.5683853", "0.5647113", "0.56275946", "0.5613283", "0.55903804", "0.5563434", "0.55476195", "0.5537629", "0.55198556", "0.5516457", "0.55151033", "0.5510152", "0.5497375", "0.5495907", "0.5479214", "0.54739153", "0.5454045", "0.54526985", "0.54355454", "0.5421203", "0.542003", "0.5389728", "0.5354826", "0.53508425", "0.53489566", "0.53460115", "0.5344857", "0.5343223", "0.5342278", "0.5306187", "0.53045166", "0.52978003", "0.52829653", "0.5272004", "0.52676255", "0.5257643", "0.52574396", "0.5249424", "0.524774", "0.5247638", "0.52447903", "0.52364033", "0.52202606", "0.52119714", "0.52011395", "0.51920676", "0.5191203", "0.5184437", "0.5183055", "0.5181392", "0.5180069", "0.51784474", "0.5173323", "0.5172426", "0.5168506", "0.5167674", "0.516282", "0.51582515", "0.51544", "0.51418823", "0.5141863", "0.5135114", "0.51099765", "0.51012486", "0.50942814", "0.5091362", "0.5088722", "0.5088354", "0.5085773", "0.50700086", "0.5061907", "0.5060958", "0.5057477", "0.5056878", "0.5050584", "0.50489706", "0.5044734", "0.504176", "0.50362164", "0.5027341", "0.5025937", "0.5024236", "0.502271", "0.50218916", "0.50164425", "0.50143546", "0.50107807", "0.50067514", "0.50005037", "0.49947572", "0.49876595", "0.4982738", "0.4977289", "0.4976831" ]
0.83675677
0
Check whether content type name is valid.
public function isValidContentTypeName($value) { return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function accepts_content_type($name)\n {\n return true;\n }", "static function isValidContentType($ct) {\n $valids = self::getValidContentTypes();\n\n foreach ($valids as $vct) {\n if (strpos($ct, $vct) !== FALSE) {\n return TRUE;\n }\n }\n\n return FALSE;\n }", "function isValidName($titreDocument){\n\tif(!(strlen($titreDocument) >= 3 && strlen($titreDocument) <= 100))\n\t\treturn false;\n\tif($titreDocument == '.htaccess' || $titreDocument == '.htpassword' || $titreDocument == 'robots.txt'){\n\t\treturn false;\n\t}\n\n\treturn preg_match('#^([&a-zA-Zéèàç\\(\\)0-9_\\[\\]\\-\\.: \\?\\=])+$#', $titreDocument);\n}", "public function accepts_content_type($name = '') {\n\t\treturn ($name == 'channel' || $name == 'grid');\n\t}", "function is_valid_graphql_name(string $type_name)\n {\n }", "public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }", "public function isValidShardTypeName($name) {\n return in_array($name, $this->getShardTypeNames());\n }", "public function isValidShardTypeName($name) {\n return in_array($name, $this->getShardTypeNames());\n }", "private function validName($name): bool {\n\t\t$pattern = '~\n# XML 1.0 Name symbol PHP PCRE regex <http://www.w3.org/TR/REC-xml/#NT-Name>\n(?(DEFINE)\n (?<NameStartChar> [A-Z_a-z\\\\xC0-\\\\xD6\\\\xD8-\\\\xF6\\\\xF8-\\\\x{2FF}\\\\x{370}-\\\\x{37D}\\\\x{37F}-\\\\x{1FFF}\\\\x{200C}-\\\\x{200D}\\\\x{2070}-\\\\x{218F}\\\\x{2C00}-\\\\x{2FEF}\\\\x{3001}-\\\\x{D7FF}\\\\x{F900}-\\\\x{FDCF}\\\\x{FDF0}-\\\\x{FFFD}\\\\x{10000}-\\\\x{EFFFF}])\n (?<NameChar> (?&NameStartChar) | [.\\\\-0-9\\\\xB7\\\\x{0300}-\\\\x{036F}\\\\x{203F}-\\\\x{2040}])\n (?<Name> (?&NameStartChar) (?&NameChar)*)\n)\n^(?&Name)$\n~ux';\n\t\treturn (1 === preg_match($pattern, $name));\n\t}", "public static function isValidName($name) {}", "function check_exists()\n\t{\n\t\t$name = url_title($this->input->post('name'));\n\n\t\t$exists = $this->content_type_model->check_exists(\n\t\t\t'name',\n\t\t\t$name,\n\t\t\t$this->input->post('id_content_type')\n\t\t);\n\n\t\t$this->xhr_output($exists);\n\t}", "function isValidName ($name)\r\n{\r\n global $cf_reservedpattern;\r\n\r\n $reservedpattern = $cf_reservedpattern ? $cf_reservedpattern : '[_a-z]{0,1}([\\d]+)';\r\n\r\n if (preg_match(\"%^\".$reservedpattern.\"$%i\", $name, $matches))\r\n return FALSE; // reserved - not permitted\r\n\r\n $pattern = '[a-z\\d][_a-z\\d]{2,23}';\r\n if (preg_match('%^'.$pattern.'$%i', $name))\r\n if (!preg_match(\"%^(api|com|biz|def|gov|net|org|wap|web|www|gamma|mobile|mygamma|buzzcity|netbeacon)[\\d]*$%i\", $name))\r\n return TRUE;\r\n\r\n return FALSE; // not permitted\r\n}", "protected static function isValidName($name)\n {\n return '' === $name || null === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\\-:]*$/D', $name);\n }", "public static function isGenericName($name)\n {\n return empty($name) || preg_match(Tools::cleanNonUnicodeSupport('/^[^<>={}]*$/u'), $name);\n }", "function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "public static function checkName($name)\r\n {\r\n if (strlen($name) >= 4) {\r\n return true;\r\n }\r\n return false;\r\n }", "public static function validateName($name) {\n if (preg_match(\"/^[a-zA-Z]*$/\",$name))\n return true;\n else\n return false;\n }", "public static function filename_valid($name) {\n return strlen($name) < 100 && preg_match(\"/^[a-z0-9 \\.-]+$/i\", $name) != 0;\n }", "function valid_name($name) {\r\n\tif (empty($name)) \r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n }", "function validName($name)\n {\n //name should not be empty and should contain only letters\n return !empty($name) && ctype_alpha($name);\n }", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }", "function _name_check($str){\n }", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "public function validName(string $ressourceName): bool\n {\n $minLength = 3;\n $maxLength = 255;\n $regex = '/^[a-z](?!oog)([a-z0-9-_.~+%]){'.$minLength.','.$maxLength.'}+$/';\n\n $isValid = (preg_match($regex, $ressourceName)) ? true : false;\n\n return $isValid;\n }", "public static function isValidName( $name ) {\n return TRUE;\n }", "function testFileName(): void\n {\n $this->assertTrue(FileValidator::isName(\"docu.doc\"));\n $this->assertTrue(FileValidator::isName(\"docu\"));\n $this->assertFalse(FileValidator::isName(\"doc?u\"));\n }", "public function name_validation($name){\n\t\tif(!preg_match('/^[a-zA-Z0-9. ]*$/',$name)){ \n\t\t\treturn true;\n \t}\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "public static function checkName($name)\n {\n if (strlen($name) >= 2) {\n return true;\n }\n return false;\n }", "private function ValidateName($name){\n if (empty($name)){ //checks if empty\n $this->valid = False;\n }else if (strlen($name)>= 30){ //checks max length\n $this->valid = False;\n }else if(!preg_match(\"/^[a-zA-Z ]*$/\",$name)){ //checks format\n $this->valid = False;\n }\n }", "function is_validwhitelistname($name) {\n\tif (!is_string($name))\n\t\treturn false;\n\n\tif (!preg_match(\"/[^a-zA-Z0-9\\_\\.\\/]/\", $name))\n\t\treturn true;\n\n\treturn false;\n}", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validName($name)\r\n {\r\n $name = str_replace(' ', '', $name);\r\n return !empty($name) && ctype_alpha($name);\r\n }", "public static function validateStreamName($name) {\n\t\t\t\treturn (strlen($name) < 32 && strlen($name) > 0) ? true : \"Name must be between 1 to 32 characters\";\n\t\t}", "public static function isName($name)\n {\n return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#\"°{}_$%:¤|]*$/u'), stripslashes($name));\n }", "private function validatePostName($_post_name){\n $this->post_name = htmlspecialchars($_post_name);\n if($this->post_name === '' or strlen($this->post_name) > 100){\n return false; //Was not a string, or an error occured\n }\n return true;\n }", "function isValidName($name)\n{\n if (! preg_match(\"/^[a-zA-Z ]*$/\", $name)) {\n return false;\n }\n return true;\n}", "function is_reserved_name($str) {\n\t\t$reserved = array('name','value','content','parent','rank','password','timestamp');\n\t\tif(empty($str) || in_array($str, $reserved)) return true;\n\t\treturn false;\n\t}", "function validateName($name) {\n\tif (!preg_match('/[^A-Za-z]+/', $name) && strlen($name) >= 2 && strlen($name) <= 20)\n\t\treturn 1;\t//name is valid\n\telse\n\t\treturn 0;\n}", "protected function checkName()\n {\n if (preg_match('/^[a-zA-Z_]{1}[a-zA-Z_0-9]*$/', $this->name) == false) {\n throw new ReflectionException('Annotation parameter name may contain letters, underscores and numbers, but contains an invalid character.');\n }\n }", "public static function isCharacterEncodingValid(string $name): bool;", "private final static function validClassName($name)\n {\n # a-z, 0-9. Must start with a capitalised letter\n return !preg_match('#[^A-Za-z0-9]|^[^A-Z]#', $name);\n }", "function is_validwhitelistname($name) {\n\tif (!is_string($name))\n\treturn false;\n\n\tif (!preg_match(\"/[^a-zA-Z0-9\\.\\/]/\", $name))\n\treturn true;\n\n\treturn false;\n}", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "private function validateName($name)\n {\n if($name != NULL && $name != \"\"){\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function parseTypeName($typeName) {\n\t\t$splitName = $this->splitClassName($typeName);\n\t\tif ($splitName === false) return false;\n\t\tlist($this->_packageName, $this->_className) = $splitName;\n\n\t\t// FIXME: Validate package and class to reduce the risk of\n\t\t// code injection, e.g. check that the package is within given limits/folders,\n\t\t// don't allow empty package parts, etc.\n\n\t\treturn true;\n\t}", "function validateUserName($name)\n {\n /**condition for validating the type and size of user input string\n *takes user input name as a parameter for validating with the set conditons\n */\n if (preg_match('/[a-zA-Z]{3}/', $name)) {\n return true;\n }\n }", "public function checkItemType(string $name, string $type): bool\n {\n return str_contains(ucfirst($name), $type);\n }", "public function hasType(string $name): bool;", "public static function typeIdentifier($value): bool\n {\n static::regex(\n $value,\n '/^[0-9A-Za-z-_]+$/',\n 'Value \"%s\" does not match type identifier format requirement (must contain only of alphanumeric chars,'\n . ' dash or underscore)'\n );\n static::maxLength($value, self::MAX_TYPE_IDENTIFIER_LENGTH);\n\n return true;\n }", "function nameFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_NAME_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "protected function isValidName(string $key): bool\n {\n return preg_match('/^[\\w\\.]+$/', $key) ? true : false;\n }", "public function validateRealname() {\r\n $leng = mb_strlen($this->data[$this->name]['RealName']);\r\n if ($leng > 128) {\r\n return FALSE;\r\n } else if ($leng > 64) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['RealName']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "function isvalid($value) {\n global $debugging;\n switch (true) {\n case (! parent::isvalid($value)):\n $this->error = \"File name must be short and simple\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $value . \"]\";\n }\n return false;\n case (! $this->contentAccessValid()):\n $this->error = \"Content inaccessible\";\n if ($debugging > 1) {\n $this->error .= \" [\" . $this->filepath($value) . \"]\";\n }\n return false;\n default:\n return true;\n }\n }", "public static function validateName($name) {\n\t\tif (!empty($name)) {\n\t\t\tif (preg_match('/^[a-z0-9 ]{3,}$/i', $name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function isCorrectFilename ($name) {\r\n if (!empty($name)) {\r\n if (preg_match('/[a-zA-Z0-9_]/', $name)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "public function hasType($name);", "function valid_name($name){\r\n for($i = 0; $i < strlen($name); $i++){\r\n if( is_numeric( $name[$i] ) ){\r\n return False;\r\n }\r\n }\r\n return True;\r\n }", "public function isLegalName($name) {\n\t\t// This variable name is special to bash, so we can't use it\n\t\tif ( $name === '_' ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool) preg_match('/^[_A-Za-z][A-Za-z0-9_]*$/', $name);\n\t}", "public function isValidFilename()\n {\n $fileName = $this->fileName;\n if(substr($fileName, 0,1) == '-') {\n return false;\n }\n return true;\n }", "function checkData() {\n\t //check template name\n\t if (!ereg('^[0-9a-zA-Z_\\-]+$',$this->newIdt)) {\n\t\t $this->error = MF_WRONG_SHORT_NAME;\n\t\t return false;\n\t } else \n\t \t return $this->isNameFree();\n }", "static function validName($name)\r\n {\r\n if (ctype_alpha($name)) {\r\n return $name;\r\n } else if ($name == \"\") {\r\n return !empty($name);\r\n }\r\n }", "public function isValid()\n {\n if ($this->type != self::SCALAR_TPYE && $this->type != self::LIST_TYPE && $this->type != self::MAP_TYPE)\n return false;\n if (!Utils::isValidIdentifier($this->name))\n return false;\n return true;\n }", "public function validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }", "public function name(string $name) : bool\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]*$/\",$name)) {\n\t\t\t$this->errors[] = 'Only letters and white space allowed';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private final static function validPropertyName($name)\n {\n return !preg_match('#[^a-z0-9_]|^[^a-z]|__#', $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_name($name)\r\n\t{\r\n\t\t$trim = trim($name);\r\n\t\tif(strlen($trim) > 1)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "protected function validateMimetype($mime) {\n if (preg_match('#^[-\\w]+/[-\\w\\.+]+$#', $mime)) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "private function assertTheNameOnlyContainsAllowedCharacters()\n {\n if (1 !== preg_match(self::NAME_REGEX, $this->getName())) {\n throw new Exception('The result of the getName method can only contain letters, numbers, underscore and dashes.');\n }\n }", "function ValidateName($name)\n{\n $chars = str_split($name);\n\n // Assess each character\n foreach ($chars as $char) {\n if (!ValidateChar($char)) {\n return false;\n }\n }\n\n // // Check for empty\n // if (empty($name)) {\n // return false;\n // }\n\n return true;\n}", "protected function _validVariableName($name)\n {\n // @TODO: Update this list with more\n $named = array('pageName','channel','server','campaign','products','TnT','events','pageType','purchaseID', 'transactionID','state','zip','currencyCode','pageType');\n $count = array('hier', 'eVar', 'prop');\n \n // Check for named\n if(in_array($name, $named))\n return true;\n \n // Check against numbered vars\n foreach($count as $var)\n if(strpos($name, $var) === 0)\n return true;\n \n // No matches :(\n return false;\n }", "function is_validaliasname($name) {\n\tif (!preg_match(\"/(:word:)/\", $name))\n\treturn true;\n\telse\n\treturn false;\n}", "public function setContentTypeName($content_type_name);", "function validateName($name)\n {\n return (mb_strlen($name) <= CUSTOMER_NAME_MAX_LENGTH && mb_strlen($name) !== 0);\n }", "function validate_name($name){\n\n\tif(empty($name)){\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t else if(count(explode(' ',$name)) <2){\n\t\t\n\t\t\n\t\t\treturn false;\n\t\t\n\t}\n\t\n\telse if(!preg_match(\"/^[a-zA-Z \\.\\-]*$/\",$name)){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse if(!preg_match(\"/^[a-zA-Z]*$/\",$name[0])){\n\t\t\n\t\t\n\t\treturn false;\n\t}\n\telse{\n\t\t\n\t\treturn true;\n\t}\n\t\n\t\n}", "public function isAllowedType()\n {\n $extension = $this->getFile()->guessExtension();\n if (in_array($extension, $this->allowedTypes)) {\n return true;\n } else {\n return false;\n }\n }", "public function getContentTypeName();", "public function getContentTypeName();", "public function getContentTypeName();", "private function isValid(){\n\n\t\tif (!$this->inputValidation->validateRequiredFields('Du måste i fylla både namn och kommentar.')){ return false; }\t\n\t\tif (!$this->inputValidation->regexValidation('/^[A-Za-zåäöÅÄÖ\\s]{2,64}$/', 'author', 'Namnet innehåller otillåtna tecken. (A-Ö, a-ö, 2-64 tecken)')){ return false; }\n\n\t\treturn true;\t\t\n\t}", "protected function validateType($type) {\n switch (strtolower($type)) {\n case 'string':\n return 'string';\n break;\n\n case 'url':\n return 'url';\n break;\n\n case 'file':\n return 'file';\n break;\n\n default:\n return FALSE;\n break;\n }\n }", "static function checkNames($input)\r\n {\r\n if (preg_match('/^[\\w\\W][\\w\\W]{1,20}$/', $input)) {\r\n return true; //Illegal Character found!\r\n } else {\r\n echo PageBuilder::printError(\"Please enter alphabets only in name fields.\");\r\n return false;\r\n }\r\n }", "public static function isNameValid(string $val) : bool {\n $len = strlen($val);\n\n if ($len > 0) {\n for ($x = 0 ; $x < $len ; $x++) {\n $char = $val[$x];\n\n if ($char == '=' || $char == '&' || $char == '#' || $char == '?') {\n return false;\n }\n }\n\n return true;\n }\n\n return false;\n }", "protected function validateMachineName($value) {\n if (preg_match(\"/^[a-z0-9\\_]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid machine name (only a-z, 0-9, and _)\"));\n return false;\n }", "public function validateControlName($name);", "function validFname($fname)\r\n {\r\n return !empty($fname) && ctype_alpha($fname);\r\n }", "public static function prop_name_is_valid( $name ) {\n\t\treturn preg_match( self::PROP_NAME_REGEX, $name );\n\t}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasProperArgumentName(): void\n {\n $filter = new RestrictByTypeFilter(RestrictByTypeFilter::MUNICIPALITY_NAME);\n\n $this->assertEquals('type', $filter->name());\n }", "function validName($name) {\r\n //checks to see that a string is all alphabetic\r\n return\r\n (\r\n (!empty($name)) && ctype_alpha($name));\r\n}", "public function isValidNameOrError($name): bool\n {\n if ($name == \"\") {\n throw new Exception('Invalid Product Name');\n }\n return true;\n }", "function isValidShortName($name) {\n return preg_match('#^[a-z0-9]+$#i', $name);\n}", "private function assertValidName() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->name,\n '#[Route.name] must contain a non-empty string.'\n );\n }", "public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }", "protected function isBaseNameValid($baseName)\n {\n $blnStatus = false;\n if ($baseName != \".\" && $baseName != \"..\") {\n $blnStatus = true;\n }\n\n return $blnStatus;\n }", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "function isSetName($input) {\n return (preg_match(\"~(^[[:alnum:] -]+$)~\", $input));\n }", "private function isValidStaticTypeFile(): bool\n {\n return $this->oHttpRequest->getExists('t') &&\n in_array($this->oHttpRequest->get('t'), self::ASSET_FILES_ACCEPTED, true);\n }", "public function isValid($value)\n {\n if (!\\is_string($value)) {\n return false;\n }\n\n // no leading special characters\n $leading = \\mb_substr($value, 0, 1);\n if($leading === '_' || $leading === '.' || $leading === '-') {\n return false;\n }\n\n // Valid chars: A-Z, a-z, 0-9, underscore, period, hyphen, space\n if (\\preg_match('/[^A-Za-z0-9\\_\\.\\-]/', $value)) {\n return false;\n }\n\n if (\\mb_strlen($value) > 36) {\n return false;\n }\n\n return true;\n }" ]
[ "0.7056041", "0.691529", "0.6873244", "0.6823518", "0.6692001", "0.65823215", "0.65537065", "0.65537065", "0.6515422", "0.6507167", "0.6489778", "0.6457966", "0.64251924", "0.64228266", "0.6341118", "0.6332946", "0.63063747", "0.629769", "0.62954515", "0.6279857", "0.62788546", "0.62762725", "0.62760943", "0.6260614", "0.62346655", "0.6193822", "0.618597", "0.61816597", "0.61412406", "0.61111146", "0.610792", "0.6100043", "0.6090167", "0.6087794", "0.6085627", "0.60750014", "0.60695076", "0.6058094", "0.6048237", "0.6035377", "0.6032929", "0.6025362", "0.602325", "0.6019122", "0.60138196", "0.60066116", "0.5996964", "0.5983781", "0.59817034", "0.5979677", "0.5961416", "0.59528184", "0.5950965", "0.5950273", "0.5946787", "0.59285957", "0.5923113", "0.5910113", "0.59084743", "0.5905926", "0.5905871", "0.5885212", "0.5885137", "0.58798563", "0.58797264", "0.5872712", "0.5862206", "0.5830726", "0.5828851", "0.5816941", "0.5813753", "0.58016074", "0.579053", "0.577503", "0.57748485", "0.57626534", "0.5740399", "0.5735255", "0.5735255", "0.5735255", "0.57351774", "0.57310575", "0.5726528", "0.5723116", "0.57201445", "0.5695963", "0.569461", "0.5688869", "0.56825036", "0.5681373", "0.56795365", "0.56708515", "0.56677896", "0.5665741", "0.56580156", "0.5652575", "0.56524825", "0.5652368", "0.5646784", "0.5627925" ]
0.77957493
0
Return a list of the names of fields that are allowed to have shards in them.
public function listEligibleFieldsForNode(NodeInterface $node) { return ['body']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function field_names()\n\t{\n\t\t// All the fields that are being validated\n\t\t$fields = array_keys(array_merge\n\t\t(\n\t\t\t$this->pre_filters,\n\t\t\t$this->rules,\n\t\t\t$this->callbacks,\n\t\t\t$this->post_filters\n\t\t));\n\n\t\t// Remove wildcard fields\n\t\t$fields = array_diff($fields, array('*'));\n\n\t\treturn $fields;\n\t}", "private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }", "public static function fields()\n {\n return array_keys(Scholarship::validations());\n }", "public function getSearchFields()\n\t{\n\t\treturn $this->possible_fields;\n\t}", "public function getFieldsNames(): array\n {\n return array_keys($this->fields);\n }", "public function getFieldNames() {\n return array_keys($this->_fields);\n }", "public function listFields()\n {\n return array_keys($this->fields);\n }", "function _get_field_names()\n {\n return array();\n }", "public function getFieldNames()\n {\n return array_keys($this->fieldMappings);\n }", "public function getFields() {\n return array_keys($this->_fields);\n }", "public function fields()\r\n {\r\n return array_keys($this->getKey('schema', true));\r\n }", "public function getIndexableFields() {\r\n\t\treturn $this->_indexableFields;\r\n\t}", "public function getFields()\r\n {\r\n return array_keys($this->fields);\r\n }", "public function getFieldNames() {}", "public function getFields()\n {\n return array_keys($this->fields);\n }", "public function getFields() {\n return array_keys($this->fields);\n }", "public function get_field_names(): array {\n\t\treturn array_keys( $this->data );\n\t}", "public function getRequiredFields() {\n return $this->source->getRequiredFields($this->filter);\n }", "public function getFieldNames(): array\n {\n return array_keys($this->fieldDefinitions);\n }", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "final public function getFields(): array\n {\n return array_keys($this->fields);\n }", "protected function getValidSearchFields()\n {\n if (empty($this->validSearchFields)) {\n $this->validSearchFields = $this->getEntityPropertyNames();\n }\n\n return $this->validSearchFields;\n }", "static public function fieldsGet()\n {\n return array_keys(static::$conditions);\n }", "function GetFieldsList()\n\t{\n\t\tglobal $dal_info;\n\t\treturn array_keys( $dal_info[ $this->infoKey ] );\n\t}", "public function getSearchFields(): array {\n # TODO move this to database\n $ignoreValues = ['SortNum' => '', 'Accession Numerical' => '', 'Imaged' => '', 'IIFRNo' => '',\n 'Photographs::photoFileName' => '', 'Event::eventDate' => '', 'card01' => '', 'Has Image' => '', 'imaged' => ''];\n return array_diff_key($this->search_layout->getFields(), $ignoreValues);\n }", "public static function getFilterableFields(): array\n {\n return ['name', 'accessCode'];\n }", "public function getSearchFields()\n {\n //return $this->searchFields;\n return ['_all'];\n }", "public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }", "public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }", "public static function available_fields()\n {\n return self::$available_fields;\n }", "public function getFields()\n\t{\n\t\treturn [];\n\t}", "protected function getAvailableFields() \n {\n return array_merge(\n Fields::$spot,\n Fields::$mass,\n Fields::$location\n );\n }", "public function getFrontEndRequiredFields();", "public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'content' => 'string',\n\t\t\t'console_names' => 'string',\n\t\t\t'game_idGame' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public function getSearchFields();", "public function fieldNames()\n {\n $query = $this->_manager->createQuery('SELECT e FROM ' . $this->_entityName . ' e');\n //It will probably also fail with an empty table\n $query->setMaxResults(1);\n $results = $query->getArrayResult();\n $row = reset($results);\n return array_keys($row);\n }", "static public function fieldTypeNames()\n {\n /* Fetch the field type information from the Horde_Form classes. */\n $fields = self::fieldTypes();\n\n /* Strip out the name element from the array. */\n $available_fields = array();\n foreach ($fields as $field_type => $info) {\n $available_fields[$field_type] = $info['name'];\n }\n\n /* Sort for display purposes. */\n asort($available_fields);\n\n return $available_fields;\n }", "public function getFieldNames() {\n $fields = array();\n foreach ($this->getFields() as $field) {\n $fields[] = $this->getFieldName($field);\n }\n return $fields;\n }", "protected function listRequiredSchemaKeys()\n {\n return ['name'];\n }", "final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }", "public function getRequiredCsvFields()\n {\n // indexes are specified for clarity, they are used during import\n return [\n 0 => __('created_at'),\n 1 => __('product_id'),\n 2 => __('status_id'),\n 3 => __('Title'),\n 4 => __('Detail'),\n 5 => __('nickname'),\n 6 => __('customer_id'),\n 7 => __('option_id'),\n 8 =>__('stores')\n ];\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getAllFields();", "public function getIncludeShardKeyBounds()\n {\n return $this->include_shard_key_bounds;\n }", "public function getListFields();", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'url' => 'string',\n\t\t\t'name' => 'string',\n\t\t\t'price' => 'float',\n\t\t\t'devise' => 'string',\n\t\t\t'edition_idEdition' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "function getFieldNames();", "public function getFieldsList()\n {\n return $this->table_fields_names;\n }", "public function action_allowed_fields() {\n return array();\n }", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'report' => 'string',\n\t\t\t'date' => 'date',\n\t\t\t'user_name' => 'string',\n\t\t\t'note' => 'int',\n\t\t\t'console_idConsole' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "private function getRequiredFields()\n\t{\n\t\treturn $this->endpointRequiredFields;\n\t}", "public function getFields() {\n $modifiable_fields = [];\n $type = $this->getType();\n $bundle = $this->getBundle();\n // Get _all_ defined fields. This should return an associative array.\n $fields = Framework::instance()->fieldInfoFields();\n foreach ($fields as $field => $info) {\n if (isset($info['bundles'][$type]) && is_array($info['bundles'][$type]) && in_array($bundle, $info['bundles'][$type]) && $this->filter($field)) {\n $this->addModifier($modifiable_fields, 'field', $field);\n }\n }\n return $modifiable_fields;\n }", "public function getFields() {\n\t\treturn true;\n\t\t// not yet used\n\t\t// if activated\n\t\t// return false;\n\t}", "abstract public function getAllFieldsRealNames(): array;", "public function indexFields()\r\n {\r\n $fields = [];\r\n foreach ($this->indexes as $index) {\r\n $fields = array_merge($fields, $index->fields());\r\n }\r\n\r\n $result = [];\r\n foreach (array_unique($fields) as $field) {\r\n $result[] = $this->field($field);\r\n }\r\n\r\n return $result;\r\n }", "abstract public function supported_fields();", "protected function getBareRequiredFieldList()\n {\n $requiredFields = array_keys(singleton('NewsletterSubscription')->stat('db'));\n\n $this->extend('updateBareRequiredFieldList', $requiredFields);\n\n return $requiredFields;\n }", "public static function getAllFieldNames()\n {\n return [\n self::ACTIVE,\n self::DISPLAY_NAME,\n self::EMAIL,\n self::EMPLOYEE_ID,\n self::FIRST_NAME,\n self::GROUPS,\n self::HR_CONTACT_NAME,\n self::HR_CONTACT_EMAIL,\n self::LAST_NAME,\n self::LOCKED,\n self::MANAGER_EMAIL,\n self::PERSONAL_EMAIL,\n self::REQUIRE_MFA,\n self::USERNAME,\n ];\n }", "public function getFields()\n {\n return $this->arr_defined_fields;\n }", "function _get_avail_fields() {\n\t\t$avail_fields = array();\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$avail_fields = $this->_get_fields_map_simple();\n\t\t} else {\n\t\t\t$avail_fields = $this->_get_fields_map_dynamic(true);\n\t\t}\n\t\treturn $avail_fields;\n\t}", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "public function getAllowedFields() {\n\t\treturn array('date', 'amount');\n\t}", "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 getRequiredFields(){\n if(empty($this->tableFields)){\n $this->getTableInfo();\n }\n return $this->requiredFields;\n }", "function FieldNameList ( ) { return $this->_FieldNameList; }", "public function getRequiredFields()\n {\n return $this->requiredFields;\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "public function genericSearchFields()\n {\n return ['url', 'content', 'title', 'arguments_json', 'language_info'];\n }", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "abstract public function getFieldsSearchable();", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function getFieldNames(){\n $names=[];\n if (!empty($this->dbFields)){\n foreach($this->dbFields as $dbField){\n $names[$dbField->id]=$dbField->name;\n }\n }\n return $names;\n }", "public function requiredFields(): array\n {\n return ['store'];\n }", "protected function getFilterableFields() {\n $fields = $this->config->getFilterableFields();\n\n if(count($fields) == 0) {\n return false;\n }\n\n return $fields;\n }", "public function getKeyFields()\n {\n return $this->_aKeyFieldList;\n }", "public function getRequiredFields()\n {\n return $this->_aRequiredFields;\n }", "protected function __fields() {\n $Fields = array_keys(get_object_vars($this));\n if (!empty ($this->__onlyFields)) {\n $Fields = $this->__onlyFields;\n }\n $NewFields = array();\n foreach ($Fields as $field) {\n if (in_array ($field, array ('__bound', '__Data', 'cleaned_data', 'label_suffix', 'required_suffix', 'is_editable', 'suppress_errors'))) continue;\n if (!is_object($this->$field)) continue;\n if (!empty ($this->disabled[$field])) continue;\n if (in_array ($field, $this->__Exclude)) continue;\n $NewFields[] = $field;\n }\n return $NewFields;\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 getRequiredVisitFields()\n {\n return array();\n }", "public function getReadOnlyFields();", "function list_fields()\n\t{\n\t\t$field_names = array();\n\t\tforeach(sqlsrv_field_metadata($this->result_id) as $offset => $field)\n\t\t{\n\t\t\t$field_names[] = $field['Name'];\n\t\t}\n\t\t\n\t\treturn $field_names;\n\t}" ]
[ "0.653828", "0.64942497", "0.6349691", "0.63047236", "0.6234627", "0.6206531", "0.61971205", "0.6176767", "0.6128791", "0.6110102", "0.6101969", "0.60926473", "0.60679543", "0.6039215", "0.6025417", "0.6018671", "0.60177517", "0.6006257", "0.5988434", "0.5945133", "0.5945133", "0.5945133", "0.59177274", "0.59024763", "0.5891713", "0.58795065", "0.5856756", "0.58506835", "0.5849818", "0.5829057", "0.5829057", "0.58079994", "0.58012253", "0.5799489", "0.5784665", "0.5772289", "0.5767425", "0.57658696", "0.57615405", "0.5730926", "0.57278687", "0.57270473", "0.57069874", "0.56884855", "0.5674059", "0.5674059", "0.5674059", "0.5674059", "0.5674059", "0.5674059", "0.5655944", "0.5639473", "0.5634949", "0.56341505", "0.56318676", "0.5624739", "0.5595181", "0.55940425", "0.5592554", "0.55824596", "0.55783623", "0.5569402", "0.5567849", "0.5560621", "0.5550789", "0.5548718", "0.55432045", "0.5541783", "0.55397797", "0.55397797", "0.5534332", "0.5532718", "0.5532718", "0.5532718", "0.5532718", "0.5532718", "0.55316895", "0.5524212", "0.55222297", "0.551899", "0.55175245", "0.5517311", "0.5517311", "0.5517311", "0.55154854", "0.551306", "0.55114627", "0.55114627", "0.55114627", "0.55114627", "0.55114627", "0.5495586", "0.5495244", "0.5487578", "0.54708314", "0.5461444", "0.5457974", "0.54303324", "0.5416785", "0.54129916", "0.5410139" ]
0.0
-1
Return a list of the names of fields that are allowed to have shards in them.
public function listEligibleFieldsForBundle($bundleName) { return ['body']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function field_names()\n\t{\n\t\t// All the fields that are being validated\n\t\t$fields = array_keys(array_merge\n\t\t(\n\t\t\t$this->pre_filters,\n\t\t\t$this->rules,\n\t\t\t$this->callbacks,\n\t\t\t$this->post_filters\n\t\t));\n\n\t\t// Remove wildcard fields\n\t\t$fields = array_diff($fields, array('*'));\n\n\t\treturn $fields;\n\t}", "private function getCheckableFields()\n {\n return ['index', 'city', 'countryIso', 'text', 'region'];\n }", "public static function fields()\n {\n return array_keys(Scholarship::validations());\n }", "public function getSearchFields()\n\t{\n\t\treturn $this->possible_fields;\n\t}", "public function getFieldsNames(): array\n {\n return array_keys($this->fields);\n }", "public function getFieldNames() {\n return array_keys($this->_fields);\n }", "public function listFields()\n {\n return array_keys($this->fields);\n }", "function _get_field_names()\n {\n return array();\n }", "public function getFieldNames()\n {\n return array_keys($this->fieldMappings);\n }", "public function getFields() {\n return array_keys($this->_fields);\n }", "public function fields()\r\n {\r\n return array_keys($this->getKey('schema', true));\r\n }", "public function getIndexableFields() {\r\n\t\treturn $this->_indexableFields;\r\n\t}", "public function getFields()\r\n {\r\n return array_keys($this->fields);\r\n }", "public function getFieldNames() {}", "public function getFields()\n {\n return array_keys($this->fields);\n }", "public function getFields() {\n return array_keys($this->fields);\n }", "public function get_field_names(): array {\n\t\treturn array_keys( $this->data );\n\t}", "public function getRequiredFields() {\n return $this->source->getRequiredFields($this->filter);\n }", "public function getFieldNames(): array\n {\n return array_keys($this->fieldDefinitions);\n }", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "public static function getFieldNames() {\n\t\treturn self::$FIELD_NAMES;\n\t}", "final public function getFields(): array\n {\n return array_keys($this->fields);\n }", "protected function getValidSearchFields()\n {\n if (empty($this->validSearchFields)) {\n $this->validSearchFields = $this->getEntityPropertyNames();\n }\n\n return $this->validSearchFields;\n }", "static public function fieldsGet()\n {\n return array_keys(static::$conditions);\n }", "function GetFieldsList()\n\t{\n\t\tglobal $dal_info;\n\t\treturn array_keys( $dal_info[ $this->infoKey ] );\n\t}", "public function getSearchFields(): array {\n # TODO move this to database\n $ignoreValues = ['SortNum' => '', 'Accession Numerical' => '', 'Imaged' => '', 'IIFRNo' => '',\n 'Photographs::photoFileName' => '', 'Event::eventDate' => '', 'card01' => '', 'Has Image' => '', 'imaged' => ''];\n return array_diff_key($this->search_layout->getFields(), $ignoreValues);\n }", "public static function getFilterableFields(): array\n {\n return ['name', 'accessCode'];\n }", "public function getSearchFields()\n {\n //return $this->searchFields;\n return ['_all'];\n }", "public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }", "public function getAllowedFields(): array\n {\n\n return $this->allowedFields;\n }", "public static function available_fields()\n {\n return self::$available_fields;\n }", "public function getFields()\n\t{\n\t\treturn [];\n\t}", "protected function getAvailableFields() \n {\n return array_merge(\n Fields::$spot,\n Fields::$mass,\n Fields::$location\n );\n }", "public function getFrontEndRequiredFields();", "public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'content' => 'string',\n\t\t\t'console_names' => 'string',\n\t\t\t'game_idGame' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public function getSearchFields();", "public function fieldNames()\n {\n $query = $this->_manager->createQuery('SELECT e FROM ' . $this->_entityName . ' e');\n //It will probably also fail with an empty table\n $query->setMaxResults(1);\n $results = $query->getArrayResult();\n $row = reset($results);\n return array_keys($row);\n }", "protected function listRequiredSchemaKeys()\n {\n return ['name'];\n }", "static public function fieldTypeNames()\n {\n /* Fetch the field type information from the Horde_Form classes. */\n $fields = self::fieldTypes();\n\n /* Strip out the name element from the array. */\n $available_fields = array();\n foreach ($fields as $field_type => $info) {\n $available_fields[$field_type] = $info['name'];\n }\n\n /* Sort for display purposes. */\n asort($available_fields);\n\n return $available_fields;\n }", "public function getFieldNames() {\n $fields = array();\n foreach ($this->getFields() as $field) {\n $fields[] = $this->getFieldName($field);\n }\n return $fields;\n }", "final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }", "public function getRequiredCsvFields()\n {\n // indexes are specified for clarity, they are used during import\n return [\n 0 => __('created_at'),\n 1 => __('product_id'),\n 2 => __('status_id'),\n 3 => __('Title'),\n 4 => __('Detail'),\n 5 => __('nickname'),\n 6 => __('customer_id'),\n 7 => __('option_id'),\n 8 =>__('stores')\n ];\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getAllFields();", "public function getIncludeShardKeyBounds()\n {\n return $this->include_shard_key_bounds;\n }", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'url' => 'string',\n\t\t\t'name' => 'string',\n\t\t\t'price' => 'float',\n\t\t\t'devise' => 'string',\n\t\t\t'edition_idEdition' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "public function getListFields();", "function getFieldNames();", "public function getFieldsList()\n {\n return $this->table_fields_names;\n }", "public function action_allowed_fields() {\n return array();\n }", "public static function getRequiredFields()\n\t{\n\t\t$requiredFields = [\n\t\t\t'report' => 'string',\n\t\t\t'date' => 'date',\n\t\t\t'user_name' => 'string',\n\t\t\t'note' => 'int',\n\t\t\t'console_idConsole' => 'int',\n\t\t];\n\n\t\treturn $requiredFields;\n\t}", "private function getRequiredFields()\n\t{\n\t\treturn $this->endpointRequiredFields;\n\t}", "public function getFields() {\n $modifiable_fields = [];\n $type = $this->getType();\n $bundle = $this->getBundle();\n // Get _all_ defined fields. This should return an associative array.\n $fields = Framework::instance()->fieldInfoFields();\n foreach ($fields as $field => $info) {\n if (isset($info['bundles'][$type]) && is_array($info['bundles'][$type]) && in_array($bundle, $info['bundles'][$type]) && $this->filter($field)) {\n $this->addModifier($modifiable_fields, 'field', $field);\n }\n }\n return $modifiable_fields;\n }", "public function getFields() {\n\t\treturn true;\n\t\t// not yet used\n\t\t// if activated\n\t\t// return false;\n\t}", "abstract public function getAllFieldsRealNames(): array;", "public function indexFields()\r\n {\r\n $fields = [];\r\n foreach ($this->indexes as $index) {\r\n $fields = array_merge($fields, $index->fields());\r\n }\r\n\r\n $result = [];\r\n foreach (array_unique($fields) as $field) {\r\n $result[] = $this->field($field);\r\n }\r\n\r\n return $result;\r\n }", "abstract public function supported_fields();", "protected function getBareRequiredFieldList()\n {\n $requiredFields = array_keys(singleton('NewsletterSubscription')->stat('db'));\n\n $this->extend('updateBareRequiredFieldList', $requiredFields);\n\n return $requiredFields;\n }", "public static function getAllFieldNames()\n {\n return [\n self::ACTIVE,\n self::DISPLAY_NAME,\n self::EMAIL,\n self::EMPLOYEE_ID,\n self::FIRST_NAME,\n self::GROUPS,\n self::HR_CONTACT_NAME,\n self::HR_CONTACT_EMAIL,\n self::LAST_NAME,\n self::LOCKED,\n self::MANAGER_EMAIL,\n self::PERSONAL_EMAIL,\n self::REQUIRE_MFA,\n self::USERNAME,\n ];\n }", "public function getFields()\n {\n return $this->arr_defined_fields;\n }", "function _get_avail_fields() {\n\t\t$avail_fields = array();\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$avail_fields = $this->_get_fields_map_simple();\n\t\t} else {\n\t\t\t$avail_fields = $this->_get_fields_map_dynamic(true);\n\t\t}\n\t\treturn $avail_fields;\n\t}", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "public function schemaFields() { \n return $this->allFieldsArray;\n }", "public function getAllowedFields() {\n\t\treturn array('date', 'amount');\n\t}", "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 getRequiredFields(){\n if(empty($this->tableFields)){\n $this->getTableInfo();\n }\n return $this->requiredFields;\n }", "function FieldNameList ( ) { return $this->_FieldNameList; }", "public function getRequiredFields()\n {\n return $this->requiredFields;\n }", "public function genericSearchFields()\n {\n return ['url', 'content', 'title', 'arguments_json', 'language_info'];\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "abstract public function getFieldsSearchable();", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function requiredFields(): array\n {\n return ['store'];\n }", "public function getFieldNames(){\n $names=[];\n if (!empty($this->dbFields)){\n foreach($this->dbFields as $dbField){\n $names[$dbField->id]=$dbField->name;\n }\n }\n return $names;\n }", "protected function getFilterableFields() {\n $fields = $this->config->getFilterableFields();\n\n if(count($fields) == 0) {\n return false;\n }\n\n return $fields;\n }", "public function getKeyFields()\n {\n return $this->_aKeyFieldList;\n }", "public function getRequiredFields()\n {\n return $this->_aRequiredFields;\n }", "protected function __fields() {\n $Fields = array_keys(get_object_vars($this));\n if (!empty ($this->__onlyFields)) {\n $Fields = $this->__onlyFields;\n }\n $NewFields = array();\n foreach ($Fields as $field) {\n if (in_array ($field, array ('__bound', '__Data', 'cleaned_data', 'label_suffix', 'required_suffix', 'is_editable', 'suppress_errors'))) continue;\n if (!is_object($this->$field)) continue;\n if (!empty ($this->disabled[$field])) continue;\n if (in_array ($field, $this->__Exclude)) continue;\n $NewFields[] = $field;\n }\n return $NewFields;\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 getRequiredVisitFields()\n {\n return array();\n }", "public function getReadOnlyFields();", "public function fields()\n {\n return [ \n ];\n }" ]
[ "0.6535505", "0.6494089", "0.634792", "0.63040346", "0.62314546", "0.62033397", "0.6194545", "0.61741996", "0.61254984", "0.61077297", "0.6100468", "0.6092241", "0.6065433", "0.60371125", "0.60228294", "0.6016168", "0.6014547", "0.60056525", "0.59856665", "0.59424555", "0.59424555", "0.59424555", "0.59157974", "0.5902521", "0.5890091", "0.58772814", "0.5855778", "0.58498436", "0.5849271", "0.5828457", "0.5828457", "0.5807431", "0.5799299", "0.57991815", "0.5785404", "0.57689947", "0.57670677", "0.5765966", "0.5758291", "0.57281387", "0.5727996", "0.5723874", "0.5705071", "0.568838", "0.56728065", "0.56728065", "0.56728065", "0.56728065", "0.56728065", "0.56728065", "0.5654847", "0.5642954", "0.56340283", "0.56334054", "0.56295425", "0.56220156", "0.55957097", "0.559323", "0.55929494", "0.55807716", "0.5577514", "0.5566833", "0.556651", "0.5561438", "0.5549962", "0.55465376", "0.5541315", "0.55412364", "0.5538795", "0.5538795", "0.5533686", "0.5531619", "0.5531619", "0.5531619", "0.5531619", "0.5531619", "0.5531061", "0.55218685", "0.5521526", "0.5517778", "0.5516647", "0.5516414", "0.5516414", "0.5516414", "0.55163276", "0.55116653", "0.5511299", "0.5511299", "0.5511299", "0.5511299", "0.5511299", "0.5496721", "0.5491544", "0.5486577", "0.54693294", "0.5460636", "0.5456129", "0.5427061", "0.5417653", "0.5412883", "0.5408565" ]
0.0
-1
tiene la funcion listado de empresas final
function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa, $r= getResponse(); setLocaleMode(); if (!xvalidaAcceso($r,PAGE_PRIV)){ $r->assign($capa,inner,'Acceso denegado'); return $r; } //$r->alert($args); $c = new connection(); $c->open(); $sa_paquetes = $c->sa_v_paquetes; $query = new query($c); $query->add($sa_paquetes); $paginador = new fastpaginator('xajax_load_page',$args,$query); $arrayFiltros=array( 'Empresa'=>array( 'change'=>'h_empresa', 'addevent'=>"obj('empresa').value='';" ), 'busca'=>array( 'title'=>'B&uacute;squeda', 'event'=>'restablecer();' ), 'fecha'=>array( 'title'=>'Fecha' ) ); $argumentos = $paginador->getArrayArgs(); $aplica_iva=($argumentos['iva']==1); $id_empresa=$argumentos['h_empresa']; $query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa)); if($id_empresa==null){ $r->assign($paginador->layer,inner,'Seleccione una Empresa'); return $r; } $rec=$paginador->run(); if($rec){ foreach($rec as $v){ //buscando las unidades basicas del paquete $unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica'); $lista_unidades=implode(',',$unidades); $html.='<table class="order_table"><col width="20%" /><col width="40%" /><col width="40%" /><thead>'; $html.='<tr><td>PAQUETE</td><td>Descripci&oacute;n</td><td>Unidades</td></tr></thead><tbody>'; $html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>'; $html.='<table class="order_table"><col width="20%" /><col width="40%" /><col width="20%" /><thead><tr><td>Codigo</td><td>Descripci&oacute;n</td><td>Unidad</td><td>Cantidad</td><td style="display:none;">Precio</td><td style="display:none;">Importe</td></tr></thead><tbody>'; //cargando los detalles de tempario $sa_v_paq_tempario=$c->sa_paq_tempario; $sa_tempario= new table('sa_v_tempario','',$c); $join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario); $qdet=new query($c); $qdet->add($join); $qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete)); //$r->alert($qdet->getSelect()); $recdet=$qdet->doSelect(); if($recdet){ foreach($recdet as $temp){ $html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style="display:none;">'.$temp->precio.'</td><td style="display:none;">'.$temp->precio.'</td></tr>'; } } $sa_v_paq_repuestos=$c->sa_paquete_repuestos; $iv_articulos= new table('iv_articulos','',$c); $join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo); $qdet=new query($c); $qdet->add($join); $qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete)); //$r->alert($qdet->getSelect()); $recdet=$qdet->doSelect(); $recdet=$qdet->doSelect(); if($recdet){ foreach($recdet as $rep){ $html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style="display:none;">'.$rep->precio.'</td><td style="display:none;">'.$rep->precio.'</td></tr>'; } } $html.='</tbody></table><br />'; } } $html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>'; $r->assign('paginador',inner,'<hr><div class="ifilter">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>'); /*if($argumentos['busca']!=''){ $query->where( new criteria(sqlOR, array( new criteria(' like ',$sa_paquetes->descripcion_paquete,"'%".$argumentos['busca']."%'")//, //new criteria(' like ',$sa_paquetes->chasis,"'%".$argumentos['busca']."%'"), //new criteria(' like ',$sa_paquetes->color,"'%".$argumentos['busca']."%'"), //new criteria(' like ',$c->pg_empresa->nombre_empresa,"'%".$argumentos['busca']."%'") ) ) ); } if($argumentos['fecha']!=''){ $query->where(new criteria(' = ',"DATE_FORMAT(".$sa_paquetes->fecha_rev.",'%d-%m-%Y')","'".$argumentos['fecha']."'")); } if($argumentos['h_empresa']!=''){ $query->where(new criteria(sqlEQUAL,"id_empresa","'".$argumentos['h_empresa']."'")); }else{ $arrayFiltros['Empresa']['hidden']=1; }*/ //$r->alert($argumentos['h_empresa']); //$rec=$paginador->run(); /*if($rec){ if($rec->getNumRows()==0){ $html.='<div class="order_empty">No se han encontrado registros</div>'; }else{ $html.='<table class="order_table"><thead><tr class="xajax_order_title"> <td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td> <td>'.$paginador->get($sa_paquetes->codigo_paquete,'C&oacute;digo').'</td> <td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripci&oacute;n').'</td> <td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td> <td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td> </tr></thead><tbody>'; $class=''; foreach($rec as $v){ if ($rec->parcial == '1') $parcial = 'Si'; else $parcial = 'No'; $html.='<tr class="'.$class.'"> <td align="center">'.$rec->id_paquete.'</td> <td align="center">'.$rec->codigo_paquete.'</td> <td align="center">'.$rec->descripcion_paquete.'</td> <td align="center">'.$rec->nombre_empresa_sucursal.'</td> <td align="center">'.$rec->fecha_rev.'</td> </tr>'; if($class==''){ $class='impar'; }else{ $class=''; } } $html.='</tbody></table>'; } }*/ $r->assign($paginador->layer,inner,$html); //$r->assign('paginador',inner,'<hr><div class="ifilter">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class="ifilter">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>'); $r->assign('campoFecha','value',$fec); $r->script($paginador->fillJS('datos')); $c->close(); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getListaFuncionarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function functions() {\n \n }", "public function Empleado()\n {\n //Obtengo un array con los parámetros enviados a la funcion.\n $params = func_get_args();\n \n\t\t//Saco el numero de parametros que estoy recibiendo.\n $num_params = func_num_args();\n \n\t\t//Cada constructor de un número dado de parámtros tendrá un nombre de función\n\t\t//Atendiendo al siguiente modelo Empleado0() Empleado3()\n\t\t$funcion_constructor ='Empleado'.$num_params;\n if (method_exists($this,$funcion_constructor))\n {\n\t\t\tcall_user_func_array(array($this,$funcion_constructor),$params);\n\t\t}\n }", "function rec_empresa_list(){\n\t\t}", "function listado();", "public function funcs()\n { \n //start a new array, which which will store the function descriptions\n $output = array();\n\n //add each function to the array\n foreach ($this->user_functions as $fnn=>$dat)\n $output[] = $fnn . '(' . implode(',', $dat[MATHSCRIPT_ARGUMENTS]) . ')';\n\n //and return the completed array of functions\n return $output;\n }", "function recuperarFinalistas(){\n\t\t$votopro = new VotaProfesional();\n\t\t$res = $votopro->recuperarFinalistas();\n\t\treturn $res;\n\t}", "function isExecuted() ;", "protected function getAddAfterFunction()\n {\n \n }", "public function getAllFinished(): array;", "function listarUoFuncionario(){\r\n\t\t$this->objParam->defecto('ordenacion','FUNCIO.desc_funcionario1');\r\n\t\t$this->objParam->defecto('dir_ordenacion','asc');\r\n\t\t\r\n\t\t//crea el objetoFunSeguridad que contiene todos los metodos del sistema de seguridad\r\n\t\tif ($this->objParam->getParametro('tipoReporte')=='excel_grid' || $this->objParam->getParametro('tipoReporte')=='pdf_grid'){\r\n\t\t\t$this->objReporte=new Reporte($this->objParam, $this);\r\n\t\t\t$this->res=$this->objReporte->generarReporteListado('MODUoFuncionario','listarUoFuncionario');\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//obtiene el parametro nodo enviado por la vista\r\n\t\t\t$id_uo=$this->objParam->getParametro('id_uo');\r\n\t\t\t$this->objParam->addParametro('id_uo',$id_uo);\r\n\t\t\t//$this->objParam->addParametro('id_subsistema',$id_subsistema);\r\n\t\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\r\n\t\t\t//ejecuta el metodo de lista funcionarios a travez de la intefaz objetoFunSeguridad\r\n\t\t\t$this->res=$this->objFunSeguridad->listarUoFuncionario($this->objParam);\r\n\t\t\t\r\n\t\t}\r\n\t\t//imprime respuesta en formato JSON para enviar lo a la interface (vista)\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t}", "function post_eventos()\n\t{\n\t\tif ($this->disparar_importacion_efs ) {\n\t\t\tif (isset($this->s__importacion_efs['datos_tabla'])) {\n\t\t\t\t$clave = array('proyecto' => toba_editor::get_proyecto_cargado(),\n\t\t\t\t\t\t\t\t\t\t\t'componente' => $this->s__importacion_efs['datos_tabla']);\n\t\t\t\t$dt = toba_constructor::get_info($clave, 'toba_datos_tabla');\n\t\t\t\t$this->s__importacion_efs = $dt->exportar_datos_efs($this->s__importacion_efs['pk']);\n\t\t\t\tforeach ($this->s__importacion_efs as $ef) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (! $this->get_tabla()->existe_fila_condicion(array($this->campo_clave => $ef[$this->campo_clave]))) {\n\t\t\t\t\t\t\t$this->get_tabla()->nueva_fila($ef);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(toba_error $e) {\n\t\t\t\t\t\ttoba::notificacion()->agregar(\"Error agregando el EF '{$ef[$this->campo_clave]}'. \" . $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->disparar_importacion_efs = false;\n\t\t}\n\t}", "public function allAction() {}", "public function listagemAction()\n\t{\n\t\n\t}", "public function getFunctions();", "function metodo() {\n // Funcion normal\n }", "public function getOperationMade() {}", "public static function getFunctionList()\n {\n return ['onePageFunction'];\n }", "function complete();", "function expositor_list(){\n return expositor_novo();\n}", "public function listar(){\r\n }", "function guardarUoFuncionario(){\r\n\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\r\n\t\t\r\n\t\t//preguntamos si se debe insertar o modificar \r\n\t\tif($this->objParam->insertar('id_uo_funcionario')){\r\n\r\n\t\t\t//ejecuta el metodo de insertar de la clase MODFuncionario a travez \r\n\t\t\t//de la intefaz objetoFunSeguridad \r\n\t\t\t$this->res=$this->objFunSeguridad->insertarUoFuncionario($this->objParam);\t\t\t\r\n\t\t}\r\n\t\telse{\t\r\n\t\t\t//ejecuta el metodo de modificar funcionario de la clase MODFuncionario a travez \r\n\t\t\t//de la intefaz objetoFunSeguridad \r\n\t\t\t$this->res=$this->objFunSeguridad->modificarUoFuncionario($this->objParam);\r\n\t\t}\r\n\t\t\r\n\t\t//imprime respuesta en formato JSON\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\r\n\t}", "function needsExecution() ;", "public function getFuncao()\n\t{\n\t\treturn $this->funcao;\n\t}", "public function reescalarActi(){\n }", "public function doneAction()\n {\n return array();\n }", "function getLista(){\n\n }", "public function getServiceCallableName()\n {\n return [];\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "abstract public function getFunctions();", "public function finishedAction()\n {\n }", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function ComandoConsultarPreguntasFrecuentes()\n\t{\n\t\t$lineaComando = $this->ConstruirComando(SP_PreguntasFrecuentes);\n\t\t$lineaComando = $lineaComando . $this->_cierre;\n\t\t//echo \"Comando: \".$lineaComando;\n\t\treturn $lineaComando;\n\t}", "public function hookEofe() {\n\n\t\tif (TYPO3_DLOG) t3lib_div::devLog('Processing tslib_fe hook \"hook_eofe\" in '.__METHOD__, 'pt_list', 1);\n\t\ttx_ptlist_genericDataAccessor::storeAllCachesToSession();\n\n\t}", "public function concatenarFunciones()\n {\n $i=0;\n $salida = \"\";\n foreach ($this->funciones as $funcion) {\n $salida .= \"-----------------------------------------------\\n\";\n $salida .= \"Funcion $i:\";\n $salida .= $funcion->__toString();\n $salida .= \"-----------------------------------------------\\n\";\n $i++;\n }\n return $salida;\n }", "public function doneAction()\n\t{\n\t\n\t}", "function cl_empreendimento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empreendimento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function doneAction()\n {\n \n }", "function listarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_sel';\n\t\t$this->transaccion='DIR_EMP_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_empresa','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('tipo_sociedad','varchar');\n\t\t$this->captura('actividad','text');\n\t\t$this->captura('actividad_esp','varchar');\n\t\t$this->captura('nit','varchar');\n\t\t$this->captura('actividad_gral','varchar');\n\t\t$this->captura('domicilio','text');\n\t\t$this->captura('matricula','int8');\n\t\t$this->captura('renovado','int4');\n\t\t$this->captura('actividad_prim','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('departamento','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('municipio','varchar');\n\t\t$this->captura('estado_matricula','varchar');\n\t\t$this->captura('mail','varchar');\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\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function getFunctions() {\n return mysql_query(sprintf('SELECT definer, name, param_list, returns, body FROM mysql.proc WHERE db = \\'%s\\' AND type = \\'FUNCTION\\'', $this->config[\"database\"]));\n }", "function cl_empage() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empage\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function pesquisarAction() {\r\n \r\n }", "function event_proveerCampos($sNombreReporte, $tuplaSQL)\n {\n global $config;\n $oACL=getACL();\n $input=$apellido=$nombre=$email=\"\";\n\n //echo \"<pre>\";print_r($tuplaSQL);echo \"</pre>\";\n\n switch ($sNombreReporte) {\n case \"CALIFICAR_CALIFICABLES\":\n $apellido=$tuplaSQL['APELLIDO'];\n $nombre=$tuplaSQL['NOMBRE'];\n $fecha_realizacion=$tuplaSQL['FECHA_REALIZACION'];\n $email=$tuplaSQL['EMAIL'];\n $estatus=$tuplaSQL['ESTATUS'];\n\n if($estatus=='T' || $estatus=='V')\n $alumno= \"<a href='\".$this->sBaseURL.\n \"&calificar_calificable=Calificar&id_calificable=\".$tuplaSQL['ID_CALIFICABLE'].\n \"&id_alumno_calificable=\".$tuplaSQL['ID_ALUMNO_CALIFICABLE'].\"'>\".$tuplaSQL['ALUMNO'].\"</a>\";\n else\n $alumno=$tuplaSQL['ALUMNO'];\n\n $puntuacion=$tuplaSQL['PUNTUACION'];\n $sQuery = \" SELECT SUM(puntuacion) \".\n \" FROM ul_alumno_pregunta \".\n \" WHERE id_alumno_calificable='\".$tuplaSQL['ID_ALUMNO_CALIFICABLE'].\"' \".\n \" AND puntuacion IS NOT NULL\";\n $result = $this->oDB->getFirstRowQuery($sQuery);\n if(is_array($result)){\n if(count($result)>0)\n $puntuacion=$result[0];\n }else{\n }\n\n switch($estatus){\n case 'N':\n $estatus='No Realizado';\n break;\n case 'V':\n $estatus=\"<div style='color:#aa5500'>Visto</div>\";\n break;\n case 'T':\n $estatus=\"<div style='color:green;'>Terminado\";\n break;\n case 'A':\n $estatus='Anulado';\n break;\n default:\n $estatus=\"<div style='color:red;'>No Asignado</div>\";\n }\n\n return array(//\"INPUT\" => $input,\n \"ALUMNO\" => $alumno,\n \"APELLIDO\" => $apellido,\n \"NOMBRE\" => $nombre,\n \"EMAIL\" => $email,\n \"FECHA_REALIZACION\" => $fecha_realizacion,\n \"ESTATUS\" => $estatus,\n \"PUNTUACION\" => sprintf(\"%.2f\",$puntuacion),\n \"TOTAL\" => sprintf(\"%.2f\",$puntuacion*$tuplaSQL['PONDERACION']),\n\n );\n default:\n }\n\n return array(//\"INPUT\" => $input,\n \"APELLIDO\" => $apellido,\n \"NOMBRE\" => $nombre,\n \"EMAIL\" => $email,\n );\n }", "public function complete();", "public function complete();", "function finalizarSolicitudServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->transaccion='tgv_FINSOLSER_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function completeAction() {\n\n }", "function cl_far_listacontroladomed() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"far_listacontroladomed\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function existeLetra(/*>>> Completar parámetros <<<*/ ){\n \n /*>>> Completar cuerpo de la función <<<*/\n\n}", "function action(){\n\t\t//Campos que se quieren excluir de la limpieza de código. Formato: nombreCampo1|nombreCampo2|nombreCampo3\n\t\t$excluir=\"\";\n\t\t$_REQUEST=$this->inspector->cleanPHPHTML($_REQUEST);\n\n\t\t$option=isset($_REQUEST['option'])?$_REQUEST['option']:\"list\";\n\n\n\t\tswitch($option){\n\t\t\tcase \"processList\":\n\t\t\t\t$variable[\"option\"]=\"list\";\n\t\t\t\t$variable[\"grado\"]=$_REQUEST['grado'];\n\t\t\t\t$variable[\"sede\"]=$_REQUEST['sede'];\n $variable[\"periodo\"]=$_REQUEST['periodo'];\n\t\t\t\t$this->getComportamiento($variable);\n\t\t\tbreak;\n\n case \"actualizarNota\":\n $result = $this->procesarNota($_REQUEST);\n echo \"Registro actualizado\";\n /*if(!$result->status){\n echo json_encode($result);\n return false;\n }\n echo json_encode($result);*/\n\n break;\n\t\t}\n\t}", "public function CBfunctions() {}", "function listarExec() \n\t{\n\t\t$this->db->select('*');\n\t\t\n\t\t$this->db->from('AuditoriaExec');\n\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query->result();\n\t}", "function listaFuncionalidades(){\n\t$lista = null;//array para almacenar las funcionalidades\n\t$num=0; //variable para indexar el array lista\n\t$USU_GRUPO = new USU_GRUPO_Model($_SESSION[\"login\"], '');\n\t$listaGrupos = $USU_GRUPO->listagrupoUsuario();\n\tif($listaGrupos == null){\n\t\treturn false;\n\t}\n\tforeach ($listaGrupos as $key => $IdGrupo) {\n\n\t\t$PERMISO = new PERMISO_Model($IdGrupo, '', '', '', '', '', '','');\n\t\t$resultado = $PERMISO->funcionalidadesGrupo();\n\t\t$num_rows = mysqli_num_rows($resultado);\n\t\tif($num_rows > 0){\n\t\t\twhile($row = mysqli_fetch_array($resultado)){\n\t\t\t\t$lista[$num] =$row[\"IdFuncionalidad\"];\n\t\t\t\t$num++;\n\t\t\t}\n\t\treturn $lista;\n\t\t}\n\t}\n\treturn null;\n\n}", "public function listforms()\n {\n\t\t\n }", "function evt__efs_lista__modificacion($registros)\n\t{\n\t\t/*\n\t\t\tComo en el mismo request es posible dar una efs de alta y seleccionarla,\n\t\t\ttengo que guardar el ID intermedio que el ML asigna en las efss NUEVAS,\n\t\t\tporque ese es el que se pasa como parametro en la seleccion\n\t\t\t*/\n\t\t$orden = 1;\n\t\tforeach(array_keys($registros) as $id)\n\t\t{\n\t\t\t//Creo el campo orden basado en el orden real de las filas\n\t\t\t$registros[$id]['orden'] = $orden;\n\t\t\t$orden++;\n\t\t\t$accion = $registros[$id][apex_ei_analisis_fila];\n\t\t\tunset($registros[$id][apex_ei_analisis_fila]);\n\t\t\tswitch($accion){\n\t\t\t\tcase 'A':\n\t\t\t\t\t//Por defecto el campo 'columnas' es igual a $this->campo_clave\n\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t$this->id_intermedio_efs[$id] = $this->get_tabla()->nueva_fila($registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'B':\n\t\t\t\t\t$this->get_tabla()->eliminar_fila($id);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'M':\n\t\t\t\t\t//---Si se cambia un identificador que estaba ligado con us columna se cambia tambien el valor de la columna\n\t\t\t\t\t$anterior_id = $this->get_tabla()->get_fila_columna($id, $this->campo_clave);\n\t\t\t\t\t$anterior_col = $this->get_tabla()->get_fila_columna($id, 'columnas');\n\t\t\t\t\tif ($anterior_id != $registros[$id][$this->campo_clave]) {\n\t\t\t\t\t\tif ($anterior_id == $anterior_col) {\n\t\t\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->get_tabla()->modificar_fila($id, $registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}", "public function pasaje_abonado();", "function listarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_PAREJE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tipo_cc','id_tipo_cc','int4');\n\t\t\n\t\t$this->capturaCount('total_egreso_mb','numeric');\n\t\t$this->capturaCount('total_ingreso_mb','numeric');\n\t\t$this->capturaCount('total_monto_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_desc_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_iva_revertido_mb','numeric');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_partida_ejecucion','int4');\n\t\t$this->captura('id_int_comprobante','int4');\n\t\t$this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n\t\t$this->captura('id_presupuesto','int4');\n $this->captura('desc_pres','varchar');\n $this->captura('codigo_categoria','varchar');\n\t\t$this->captura('id_partida','int4');\n $this->captura('codigo','varchar');\n $this->captura('nombre_partida','varchar');\n\t\t$this->captura('nro_tramite','varchar');\n\t\t$this->captura('tipo_cambio','numeric');\n\t\t$this->captura('columna_origen','varchar');\n\t\t$this->captura('tipo_movimiento','varchar');\n\t\t$this->captura('id_partida_ejecucion_fk','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha','date');\n\t\t$this->captura('egreso_mb','numeric');\n\t\t$this->captura('ingreso_mb','numeric');\n\t\t$this->captura('monto_mb','numeric');\n\t\t$this->captura('monto','numeric');\n\t\t$this->captura('valor_id_origen','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_ai','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');\t\t\n\t\t$this->captura('id_tipo_cc','int4');\n\t\t$this->captura('desc_tipo_cc','varchar');\n\t\t\n\t\t$this->captura('nro_cbte','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t\n\t\t$this->captura('monto_anticipo_mb','numeric');\n\t\t$this->captura('monto_desc_anticipo_mb','numeric');\n\t\t$this->captura('monto_iva_revertido_mb','numeric');\n\t\t\n\t\t$this->captura('glosa1','varchar');\t\t\n\t\t$this->captura('glosa','varchar');\n\t\t\n\t\t$this->captura('cantidad_descripcion','numeric');\n\n $this->captura('total_pago','numeric');\n $this->captura('desc_contrato','varchar');\n $this->captura('obs','varchar');\n $this->captura('tipo_ajuste_formulacion','varchar'); //#41\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}", "private function f_ListarValidado(){\n $lobj_AccesoZona = new cls_AccesoZona;\n //creo la peticion\n $pet = array(\n 'operacion' => 'buscarZonas',\n 'codigo_usuario' => $_SESSION['Con']['Nombre']\n );\n //guardo los datos en el objeto y gestiono para obtener una respuesta\n $lobj_AccesoZona->setPeticion($pet);\n $zona = $lobj_AccesoZona->gestionar();\n $cadenaBusqueda = ' where codigo_zona in(';\n if($zona['success'] == 1){\n for($x = 0;$x < count($zona['registros']) - 1; $x++){\n $cadenaBusqueda .= $zona['registros'][$x].',';\n }\n $cadenaBusqueda .= $zona['registros'][count($zona['registros']) - 1].' ';\n }\n $cadenaBusqueda .= \") \";\n $cadenaBusqueda .= ($this->aa_Atributos['valor']=='')?'':\"and nombre_finca like '%\".$this->aa_Atributos['valor'].\"%'\";\n $ls_SqlBase=\"SELECT * FROM agronomia.vfinca $cadenaBusqueda\";\n $orden = ' order by codigo_productor,letra';\n $ls_Sql = $this->f_ArmarPaginacion($ls_SqlBase,$orden);\n $x=0;\n $la_respuesta=array();\n $this->f_Con();\n $lr_tabla=$this->f_Filtro($ls_Sql);\n while($la_registros=$this->f_Arreglo($lr_tabla)){\n $la_respuesta[$x]['codigo']=$la_registros['codigo_productor'];\n $la_respuesta[$x]['nombre']=$la_registros['codigo_productor'].'-'.$la_registros['letra'];\n $la_respuesta[$x]['id_finca']=$la_registros['id_finca'];\n $x++;\n }\n $this->f_Cierra($lr_tabla);\n $this->f_Des();\n $this->aa_Atributos['registros'] = $la_respuesta;\n $lb_Enc=($x == 0)?false:true;\n return $lb_Enc;\n }", "function action()\n\t{\n\t\t//Campos que se quieren excluir de la limpieza de código. Formato: nombreCampo1|nombreCampo2|nombreCampo3\n\t\t$excluir=\"\";\n\t\t$_REQUEST=$this->miInspectorHTML->limpiarPHPHTML($_REQUEST);\n\n\t\t$option=isset($_REQUEST['option'])?$_REQUEST['option']:\"list\";\n\n\t\t\n\t\tswitch($option){\n\t\t\tcase \"processNew\":\n\n\t\t\t\t$this->processNew();\n\t\n\t\t\t\tif(!$this->status){\n\t\t\t\t\t$mensaje=implode(\"<br/>\",$this->mensaje['error']);\t\n\t\t\t\t\t$this->redireccionar(\"falloRegistro\",array($mensaje,$this->data));\n\t\t\t\t}else{\n\t\t\t\t\t$mensaje=implode(\"<br/>\",$this->mensaje['exito']);\n\t\t\t\t\t$this->redireccionar(\"exitoRegistro\",array($mensaje));\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"processEdit\":\n\t\t\t\t$this->processEdit($_REQUEST['optionValue']);\n\t\t\t\t$this->redireccionar(\"exitoRegistro\",array($mensaje));\n\t\t\tbreak;\n\t\t\tcase \"processDelete\":\n\t\t\t\t$this->processDelete($_REQUEST['optionValue']);\n\t\t\tbreak;\n\t\t}\n\n\n\n\n\t}", "public function operations();", "function modulos($acceso){\n\t$acceso->objeto->ejecutarSql(sql(\"perfil ORDER BY nombreperfil\"));\t\t\n\treturn seguridadPerfil($acceso);\n}", "function PCO_AgregarFuncionesEdicionTarea($RegistroTareas,$ColumnasDisponibles,$ID_TableroKanban,$ResultadoColumnas)\n\t\t{\n\t\t global $PCOSESS_LoginUsuario,$MULTILANG_ArchivarTareaAdv,$MULTILANG_ArchivarTarea,$MULTILANG_DelKanban,$MULTILANG_Evento,$TablasCore,$MULTILANG_Cerrar,$ArchivoCORE,$MULTILANG_Editar,$MULTILANG_FrmAdvDelCampo,$MULTILANG_Eliminar,$MULTILANG_FrmAumentaPeso,$MULTILANG_FrmDisminuyePeso,$MULTILANG_Anterior,$MULTILANG_Columna,$MULTILANG_Siguiente;\n\t\t\t$salida='';\n //Determina estados de activacion o no para controles segun valores actuales del registro\n $EstadoDeshabilitadoMoverIzquierda=\"\";\n $EstadoDeshabilitadoMoverDerecha=\"\";\n $EstadoDeshabilitadoMoverArriba=\"\";\n if($RegistroTareas[\"columna\"]-1<=0) $EstadoDeshabilitadoMoverIzquierda=\"disabled\";\n if($RegistroTareas[\"columna\"]+1>$ColumnasDisponibles) $EstadoDeshabilitadoMoverDerecha=\"disabled\";\n if($RegistroTareas[\"peso\"]-1<=0) $EstadoDeshabilitadoMoverArriba=\"disabled\";\n\n //Determina si la tarea esta en la ultima columna (candidata a ser archivada)\n $ComplementoArchivar=\"\";\n if ($RegistroTareas[\"columna\"]==$ColumnasDisponibles && $PCOSESS_LoginUsuario==$ResultadoColumnas[\"login_admintablero\"])\n $ComplementoArchivar='&nbsp;&nbsp;<a onclick=\\'return confirm(\"'.$MULTILANG_ArchivarTareaAdv.'\");\\' href=\\''.$ArchivoCORE.'?PCO_Accion=ArchivarTareaKanban&ID_TableroKanban='.$ID_TableroKanban.'&IdTareaKanban='.$RegistroTareas[\"id\"].'\\' class=\"btn btn-warning btn-xs\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_ArchivarTarea.'\"><i class=\"fa fa-archive\"></i></a>';\n\n //Determina si la tarea se puede o no eliminar\n $ComplementoEliminar=\"\";\n if ($PCOSESS_LoginUsuario==$ResultadoColumnas[\"login_admintablero\"])\n $ComplementoEliminar='<a onclick=\\'return confirm(\"'.$MULTILANG_DelKanban.'\");\\' href=\\''.$ArchivoCORE.'?PCO_Accion=EliminarTareaKanban&ID_TableroKanban='.$ID_TableroKanban.'&ID_TableroKanban='.$ID_TableroKanban.'&IdTareaKanban='.$RegistroTareas[\"id\"].'\\' class=\"btn btn-danger btn-xs\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_Eliminar.'\"><i class=\"fa fa-trash\"></i></a>';\n\n //Determina si la tarea se puede o no editar\n $ComplementoEditar=\"\";\n if ($PCOSESS_LoginUsuario==$ResultadoColumnas[\"login_admintablero\"])\n $ComplementoEditar='<a onclick=\\'PCO_CargarPopUP(0,0,'.$RegistroTareas[\"id\"].');\\' class=\"btn btn-default btn-xs\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_Editar.'\"><i class=\"fa fa-pencil\"></i></a>';\n\n //Pone controles\n $salida='<div id=\"PCOEditorContenedor_Col'.$RegistroTareas[\"columna\"].'_'.$RegistroTareas[\"id\"].'\" style=\"margin:2px; display:none; visibility:hidden; position: absolute; z-index:1000;\">\n <div align=\"center\" style=\"display: inline-block\">\n <!--<a class=\"btn btn-xs btn-warning\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_Editar.'\" href=\\''.$ArchivoCORE.'?PCO_Accion=PCO_EditarFormulario&campo='.$RegistroTareas[\"id\"].'&formulario='.$RegistroTareas[\"formulario\"].'&popup_activo=FormularioCampos&nombre_tabla='.$registro_formulario[\"tabla_datos\"].'\\'><i class=\"fa fa-fw fa-pencil\"></i></a>-->\n <a class=\"btn btn-xs btn-info '.$EstadoDeshabilitadoMoverIzquierda.'\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_Anterior.' '.$MULTILANG_Columna.'\" href=\\''.$ArchivoCORE.'?PCO_Accion=cambiar_estado_campo&id='.$RegistroTareas[\"id\"].'&tabla=kanban&campo=columna&accion_retorno=PCO_ExplorarTablerosKanban&ID_TableroKanban='.$ID_TableroKanban.'&valor='.($RegistroTareas[\"columna\"]-1).'\\'><i class=\"fa fa-arrow-left\"></i></a>\n <a class=\"btn btn-xs btn-info\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_FrmAumentaPeso.' a '.($RegistroTareas[\"peso\"]+1).'\" href=\\''.$ArchivoCORE.'?PCO_Accion=cambiar_estado_campo&id='.$RegistroTareas[\"id\"].'&tabla=kanban&campo=peso&accion_retorno=PCO_ExplorarTablerosKanban&ID_TableroKanban='.$ID_TableroKanban.'&valor='.($RegistroTareas[\"peso\"]+1).'\\'><i class=\"fa fa-arrow-down\"></i></a>\n <a class=\"btn btn-xs btn-info '.$EstadoDeshabilitadoMoverArriba.'\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_FrmDisminuyePeso.' a '.($RegistroTareas[\"peso\"]-1).'\" href=\\''.$ArchivoCORE.'?PCO_Accion=cambiar_estado_campo&id='.$RegistroTareas[\"id\"].'&tabla=kanban&campo=peso&accion_retorno=PCO_ExplorarTablerosKanban&ID_TableroKanban='.$ID_TableroKanban.'&valor='.($RegistroTareas[\"peso\"]-1).'\\'><i class=\"fa fa-arrow-up\"></i></a>\n <a class=\"btn btn-xs btn-info '.$EstadoDeshabilitadoMoverDerecha.'\" data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"top\" title=\"'.$MULTILANG_Siguiente.' '.$MULTILANG_Columna.'\" href=\\''.$ArchivoCORE.'?PCO_Accion=cambiar_estado_campo&id='.$RegistroTareas[\"id\"].'&tabla=kanban&campo=columna&accion_retorno=PCO_ExplorarTablerosKanban&ID_TableroKanban='.$ID_TableroKanban.'&valor='.($RegistroTareas[\"columna\"]+1).'\\'><i class=\"fa fa-arrow-right\"></i></a>\n '.$ComplementoEditar.'\n '.$ComplementoEliminar.'\n '.$ComplementoArchivar.'\n </div>\n </div>';\n\n\t\t\treturn $salida;\n\t\t}", "protected function getUpdateAfterFunction()\n {\n \n }", "function eventclass_Delected_Jobs()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public static function returnActions() {\n }", "function actions()\n {\n return[];\n }", "function ejecutarScriptTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_EJSCTABLA_PRO';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function eliminarUoFuncionario(){\r\n\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\t\r\n\t\t$this->res=$this->objFunSeguridad->eliminarUoFuncionario($this->objParam);\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\r\n\t}", "public function getFuncionario()\n {\n return $this->funcionario;\n }", "public function elso()\n {\n }", "public function afficherAll()\n {\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\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 factures_autoriser(){}", "function carga_accion(){\r\n\t\tif (isset($_GET['action'])\r\n\t\t\t&& $_GET['action']!=NULL\r\n\t\t\t&& $_GET['action']!=\"\"\r\n\t\t) {\r\n\t\t\t$this->action=$_GET['action'];\r\n\t\t}else{\r\n\t\t\t$this->action=\"index\";\r\n\t\t}\r\n\t\t$this->pasa_vista(\"action\", $this->action);\r\n\t\t//$_SESSION['pasos'][]=$this->module.$this->action;\r\n\t\t//print_r($_SESSION['pasos']);\r\n\t\t//ejecucion de la accion\r\n\t\t$nombrefunc=\"action_\".$this->action;\r\n\t\t$this->$nombrefunc();\r\n\t}", "public function agregarFunciones($index, $unaFuncion)\n {\n $exito = false;\n $horaFuncion = $unaFuncion->getHoraInicio();\n $duracionFuncion = $unaFuncion->getDuracion();\n //Se comprueba que no se solapen los horarios con otra funcion\n if ($this->comprobarHorario($index,$horaFuncion, $duracionFuncion)) {\n $tempFunciones = $this->getFunciones();\n $tempFunciones[] = $unaFuncion;\n $this->setFunciones($tempFunciones);\n $exito = true;\n }\n return $exito;\n }", "public function getCallbacks(): array;", "function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}", "public function getFunctions()\n {\n return array();\n }", "public function findToBeExecuted();", "function guardarReclamo()\n\t\t{\n\t\t}", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\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}", "private function ExecEventActions(){\n\t\t$this->m_eventActionsArr = $this->m_taskModel->GetEventActions($this->m_eventId, $this->m_eventDataArr['journal_id']);\n\t\t$lResult = array(\n\t\t\t'err_cnt' => 0,\n\t\t\t'err_msgs' => array()\n\t\t);\n\t\t\n\t\tforeach ($this->m_eventActionsArr as $key => $value) {\n\t\t\t//trigger_error('!!!!!!!!!!!!!!invitation_id!!!!!!!!!!: ' . (int)$this->m_AdditionalParams['invitation_id'], E_USER_NOTICE);\n\t\t\tif($value['eval_code']) {\n\t\t\t\t//trigger_error('CODE: ' . $value['eval_code'], E_USER_NOTICE);\n\t\t\t\ttry{\n\t\t\t\t\teval($value['eval_code']);\n\t\t\t\t}catch(Exception $pException){\n\t\t\t\t\t$lResult['err_cnt'] ++;\n\t\t\t\t\t$lResult['err_msgs'][] = array(\n\t\t\t\t\t\t'err_msg' => $pException->getMessage()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//trigger_error('ERRORS: ' . var_export($lResult, 1), E_USER_NOTICE);\n\t\t\n\t\treturn $lResult;\n\t}", "public function pesquisarParteInteressadaAction()\n {\n }", "public function extProc_finish() {}", "function listarSolicitudModalidades()\r\n {\r\n $this->procedimiento = 'adq.f_solicitud_modalidades_sel';\r\n $this->transaccion = 'ADQ_SOLMODAL_SEL';\r\n $this->tipo_procedimiento = 'SEL';//tipo de transaccion\r\n\r\n\r\n $this->setParametro('id_funcionario_usu', 'id_funcionario_usu', 'int4');\r\n $this->setParametro('tipo_interfaz', 'tipo_interfaz', 'varchar');\r\n $this->setParametro('historico', 'historico', 'varchar');\r\n\r\n\r\n //Definicion de la lista del resultado del query\r\n $this->captura('id_solicitud', 'int4');\r\n $this->captura('estado_reg', 'varchar');\r\n $this->captura('id_solicitud_ext', 'int4');\r\n $this->captura('presu_revertido', 'varchar');\r\n $this->captura('fecha_apro', 'date');\r\n $this->captura('estado', 'varchar');\r\n $this->captura('id_funcionario_aprobador', 'int4');\r\n $this->captura('id_moneda', 'int4');\r\n $this->captura('id_gestion', 'int4');\r\n $this->captura('tipo', 'varchar');\r\n $this->captura('num_tramite', 'varchar');\r\n $this->captura('justificacion', 'text');\r\n $this->captura('id_depto', 'int4');\r\n $this->captura('lugar_entrega', 'varchar');\r\n $this->captura('extendida', 'varchar');\r\n\r\n $this->captura('posibles_proveedores', 'text');\r\n $this->captura('id_proceso_wf', 'int4');\r\n $this->captura('comite_calificacion', 'text');\r\n $this->captura('id_categoria_compra', 'int4');\r\n $this->captura('id_funcionario', 'int4');\r\n $this->captura('id_estado_wf', 'int4');\r\n $this->captura('fecha_soli', 'date');\r\n $this->captura('fecha_reg', 'timestamp');\r\n $this->captura('id_usuario_reg', 'int4');\r\n $this->captura('fecha_mod', 'timestamp');\r\n $this->captura('id_usuario_mod', 'int4');\r\n $this->captura('usr_reg', 'varchar');\r\n $this->captura('usr_mod', 'varchar');\r\n\r\n $this->captura('id_uo', 'integer');\r\n\r\n $this->captura('desc_funcionario', 'text');\r\n $this->captura('desc_funcionario_apro', 'text');\r\n $this->captura('desc_uo', 'text');\r\n $this->captura('desc_gestion', 'integer');\r\n $this->captura('desc_moneda', 'varchar');\r\n $this->captura('desc_depto', 'varchar');\r\n $this->captura('desc_proceso_macro', 'varchar');\r\n $this->captura('desc_categoria_compra', 'varchar');\r\n $this->captura('id_proceso_macro', 'integer');\r\n $this->captura('numero', 'varchar');\r\n $this->captura('desc_funcionario_rpc', 'text');\r\n $this->captura('obs', 'text');\r\n $this->captura('instruc_rpc', 'varchar');\r\n $this->captura('desc_proveedor', 'varchar');\r\n $this->captura('id_proveedor', 'integer');\r\n $this->captura('id_funcionario_supervisor', 'integer');\r\n $this->captura('desc_funcionario_supervisor', 'text');\r\n $this->captura('ai_habilitado', 'varchar');\r\n $this->captura('id_cargo_rpc', 'integer');\r\n $this->captura('id_cargo_rpc_ai', 'integer');\r\n $this->captura('tipo_concepto', 'varchar');\r\n $this->captura('revisado_asistente', 'varchar');\r\n $this->captura('fecha_inicio', 'date');\r\n $this->captura('dias_plazo_entrega', 'integer');\r\n $this->captura('obs_presupuestos', 'varchar');\r\n $this->captura('precontrato', 'varchar');\r\n $this->captura('update_enable', 'varchar');\r\n $this->captura('codigo_poa', 'varchar');\r\n $this->captura('obs_poa', 'varchar');\r\n $this->captura('contador_estados', 'bigint');\r\n\r\n $this->captura('nro_po', 'varchar');\r\n $this->captura('fecha_po', 'date');\r\n\r\n $this->captura('importe_total', 'numeric');\r\n $this->captura('prioridad', 'varchar');\r\n $this->captura('id_prioridad', 'integer');\r\n $this->captura('list_proceso', 'integer[]');\r\n\r\n $this->captura('cuce', 'varchar');\r\n $this->captura('fecha_conclusion', 'date');\r\n $this->captura('presupuesto_aprobado', 'varchar');\r\n\r\n $this->captura('tipo_modalidad', 'varchar');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n //echo($this->consulta);exit;\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "public function extProc_finish() {}", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "public function listAllActions() {\n\t\t$controleurs = [];\n\t\t// on liste les controleurs disponibles\n\t\t$path = './Controleur';\n\t\t$files = scandir($path);\n\t\t$files = array_diff(scandir($path), array('.', '..'));\n\t\tforeach ($files as $file){\n\t\t\tif(is_file('./Controleur/'.$file)){\n\t\t\t\tinclude_once './Controleur/'.$file;\n\t\t\t\t$class_name=str_replace(\".php\",\"\",$file);\n\t\t\t\t$array_tmp = array_diff(get_class_methods($class_name),array('__construct','clean','setRequete','executerAction' ));\n\t\t\t\t$array_tmp = array_combine($array_tmp, $array_tmp);\n\t\t\t\tforeach ($array_tmp as $value =>$key):\n\t\t\t\t\t$array_tmp[$value] = [];\n\t\t\t\t\t$array_tmp[$value]['name'] = $key;\n\t\t\t\t\t$array_tmp[$value]['isActive'] = 0;\n\t\t\t\t\t$array_tmp[$value]['id'] = 0;\n\t\t\t\tendforeach;\n\t\t\t\t$controleurs[$class_name]=$array_tmp;\t\t\t\n\t\t\t}\n\t\t}\n\t\t$allControleurs = $this->checkActionInDb($controleurs);\n\t\treturn $allControleurs;\n }", "public function contarInventario(){\n\t}", "public function CambiaEstatus()\n {\n \t$consulta = $this->Modelo_direccion->getAllEntradas($this->session->userdata('id_direccion'));\n \t\n \tforeach ($consulta as $key) {\n \t\t$idoficio = $key->id_recepcion;\n\n \t\tif($this->db->query(\"CALL comparar_fechas('\".$idoficio.\"')\"))\n \t\t{\n \t\t\techo 'Ejecutando Cambios';\n \t\t}else{\n \t\t\tshow_error('Error! al ejecutar');\n \t\t}\n \t}\n\n redirect(base_url() . 'Direcciones/Externos/RecepcionDir/');\n }", "protected function getDeleteAfterFunction()\n {\n \n }", "function index() {\n global $autorias;\n global $autores;\n global $livros;\n $autorias = buscarRegistros('tab_autorias');\n $autores = buscarRegistros('tab_autor');\n $livros = buscarRegistros('tab_livro');\n }", "public function accionesParticulares($str_accion, $objDatos) {\n \n\t\t//throw new Exception('Se ha intentado ejecutar la acción '.$str_accion.' y no está programada.'); \n\n\t\t//IgepDebug::setDebug(DEBUG_USER,\"El valor es: <pre>\".$str_accion.\"</pre>\");\n //$num=IgepSession::dameCampoTuplaSeleccionada('TcomintComunicaciones','edi_numorden');\n //$anyo=IgepSession::dameCampoTuplaSeleccionada('TcomintComunicaciones','edi_anyo');\n $id_animal=$objDatos->getValue('id_animal');\n $fecha=$objDatos->getValue('edi_fecha');\n switch ($str_accion) {\n case 'verInformeAnalisis':\n //Bucle para crear un listado para cada peticion seleccionada:\n // $objDatos->setOperation(\"seleccionar\");\n //$m_datosSeleccionados = $objDatos->currentTupla();\n $res = $this->consultar(\"SELECT nombre_fichero,informe from tasoka_historial_analitica\n WHERE id_animal ='\".$id_animal.\"' and fecha='\".$this->getConnection()->prepararFecha( $fecha).\"'\");\n if(is_array($res)&&$res[0]['informe']!=''){ \n $trozos = explode(\".\", $res[0]['nombre_fichero']); \n $extension =strtolower(end($trozos));\n if($extension===\"pdf\") \n header('Content-Type: application/pdf');\n elseif($extension===\"doc\" || $extension===\"docx\")\n header(\"Content-type: application/msword\");\n elseif($extension===\"odt\") \n header(\"Content-type: application/vnd.oasis.opendocument.text\");\n else {\n $this->showMessage('APL-11');\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n break;\n }\n \n \n header('Content-Disposition: attachment; filename=\"'.$res[0]['nombre_fichero'].'\"');\n \n /*\n * header(\"Content-type: application/msword\");\nheader(\"Content-Disposition: inline; filename=word.doc\");\n\n */\n //print(pg_unescape_bytea($res[0]['doc_entrada']));\n\t\t\t\t\tprint($res[0]['informe']);\n ob_end_flush ();\n //Para que no continue la ejecuci\\F3n de la p\\E1gina\n die; \n } \n else {\n $this->showMessage('APL-44');\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n \n } \n \n break;\n \n case 'borrarInformeAnalisis': \n // $objDatos->setOperation(\"actualizar\");\n if($objDatos->getValue('edi_nombre_fichero','actualizar')!='') {\n \n if(!empty($id_animal) && !empty($fecha)) {\n \n $sql=\"update tasoka_historial_analitica set informe=null , nombre_fichero=null where id_animal=$id_animal and fecha='\".$this->getConnection()->prepararFecha($fecha).\"' \";\n $error=$this->operar($sql);\n if($error==0) {\n $this->showMessage('APL-49',array('ENTRADA'));\n $actionForward = $objDatos->getForward('gvHidraSuccess');\n $this->refreshSearch(false);\n }\n else {\n $this->showMessage('APL-48',array('ENTRADA'));\n $actionForward = $objDatos->getForward('gvHidraError');\n }\n }\n //IgepDebug::setDebug(DEBUG_USER,\"El codigo es: <pre>\".print_r($objDatos->getValue('edi_doc_entrada_nombre'),true).\"</pre>\");\n //$objDatos->setValue('edi_asunto','');\n //die;\n } \n else {\n $this->showMessage('APL-52',array('ENTRADA'));\n $actionForward = new ActionForward('gvHidraValidationError');\n $actionForward->put('IGEPclaseManejadora','Tasoka_salud_analitica2D');\n }\n break;\n }\n \t\n }", "function finish(){\r\n\t}", "function saludo(){\n echo \"hola<br>\";// tarea a ejecutar solo es la declaracion\n}", "function calcular_espacios_disponibles ($aula, $espacios){\n \n \n //creo un arreglo con todos los horarios de cursado por dia\n $horarios=$this->crear_horarios();\n $longitud=count($horarios);\n foreach ($espacios as $clave=>$espacio){\n $indice=0; //debe ir ahi porque el arreglo no esta ordenado\n $fin=FALSE;\n while(($indice < $longitud) && !$fin){\n \n if(strcmp(($horarios[$indice][0]), ($espacio['hora_inicio'])) == 0){\n// print_r(strcmp(($horarios[$indice][0]), ($espacio['hora_inicio'])));\n\n \n //para que el arreglo horarios pueda ser modificado en la rutina eliminar_horarios\n //hay que realizar un pasaje de parametros por referencia (&horarios)\n $this->eliminar_horario(&$horarios, $indice, $longitud, $espacio['hora_fin']);\n \n $fin=TRUE;\n \n //para volver a recorrer todo el arreglo de nuevo en la proxima iteracion.\n //Evita conflictos si el arreglo no esta ordenado.\n $indice=0;\n }\n else{\n $indice += 1;\n }\n }\n }\n return $horarios;\n }", "function printFunction($functions){\n\n // Total number of functions\n $funcLength = count($functions);\n \n if($funcLength == 0){\n echo \"]\\n\";\n }\n else{\n echo \"|\";\n \n // Loop through length - 1\n for($x = 0; $x < $funcLength - 1; $x++){\n\n $function = $functions[$x];\n\n // Print the modifer of the function (+,-,#)\n printModifier($function->__get(\"modifier\")); // for printing the modfiers\n\n // Print the function name with all the parmbers\n echo $function->__get(\"name\") . \"(\";\n \n if(count($function->__get(\"params\")) === 0){\n echo \");\";\n }\n else{\n // Total number of parambers\n printParambers($function->__get(\"params\"));\n echo \";\";\n }\n }\n\n // The remaining last function to be closed \n $function = $functions[$funcLength - 1];\n\n // Print the modifer of the function\n printModifier($function->__get(\"modifier\")); // for printing the modfiers\n echo $function->__get(\"name\") . \"(\";\n if(count($function->__get(\"params\")) === 0){\n echo \")\";\n }\n else{\n // Total number of parambers\n printParambers($function->__get(\"params\"));\n \n }\n \n \n echo \"]\\n\";\n }\n \n }", "function listarCotizacionRPC(){\n $this->procedimiento='adq.f_cotizacion_sel';\n $this->transaccion='ADQ_COTRPC_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n \n \n $this->setParametro('id_funcionario_usu','id_funcionario_usu','int4');\n $this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\n $this->setParametro('id_funcionario_rpc','id_funcionario_rpc','int4');\n $this->setParametro('historico','historico','varchar');\n \n //Definicion de la lista del resultado del query\n $this->captura('id_cotizacion','int4');\n $this->captura('estado_reg','varchar');\n $this->captura('estado','varchar');\n $this->captura('lugar_entrega','varchar');\n $this->captura('tipo_entrega','varchar');\n $this->captura('fecha_coti','date');\n $this->captura('numero_oc','varchar');\n $this->captura('id_proveedor','int4');\n $this->captura('desc_proveedor','varchar');\n $this->captura('fecha_entrega','date');\n $this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n $this->captura('id_proceso_compra','int4');\n $this->captura('fecha_venc','date');\n $this->captura('obs','text');\n $this->captura('fecha_adju','date');\n $this->captura('nro_contrato','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('id_usuario_reg','int4');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('id_estado_wf','integer');\n $this->captura('id_proceso_wf','integer');\n $this->captura('desc_moneda','varchar');\n $this->captura('tipo_cambio_conv','numeric');\n $this->captura('id_solicitud','integer');\n\t\t$this->captura('id_categoria_compra','integer');\n\t\t$this->captura('numero','varchar');\n $this->captura('num_tramite','varchar');\n $this->captura('tiempo_entrega','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\n\t\t$this->captura('id_gestion','int4');\n\n \n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n \n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function completed() {\n\t}", "public function haz_eff_hea(){\n $this->search_list();\n\t}" ]
[ "0.60756433", "0.59669894", "0.593945", "0.58580554", "0.5816253", "0.5690485", "0.56757206", "0.5603504", "0.5524062", "0.5520745", "0.55040824", "0.5502581", "0.5496754", "0.54567486", "0.54400474", "0.5430406", "0.540173", "0.53956264", "0.5393811", "0.5374096", "0.536563", "0.5364606", "0.53630704", "0.53551614", "0.53451216", "0.53378004", "0.5321769", "0.5319062", "0.53002924", "0.52996993", "0.5295692", "0.5271562", "0.525197", "0.52437246", "0.524072", "0.5239739", "0.52329797", "0.52281463", "0.52211475", "0.5211671", "0.5210937", "0.52072275", "0.52017766", "0.5198938", "0.51981044", "0.51981044", "0.51968557", "0.51948035", "0.51787513", "0.5174171", "0.5170676", "0.516606", "0.5161917", "0.5159293", "0.51494926", "0.51483333", "0.51474553", "0.5139118", "0.5130881", "0.5125595", "0.5123721", "0.5122209", "0.51154685", "0.50943494", "0.5093302", "0.5091226", "0.5090747", "0.5090516", "0.5085561", "0.50841075", "0.50780517", "0.5076248", "0.5074238", "0.50694555", "0.50646234", "0.5062817", "0.50627005", "0.5061506", "0.50610685", "0.5060037", "0.5058585", "0.50574565", "0.50553614", "0.5053477", "0.5052822", "0.50527287", "0.50522625", "0.5052212", "0.50511175", "0.50435644", "0.50435096", "0.5038188", "0.50309837", "0.5029709", "0.5026219", "0.5022137", "0.50186986", "0.5016227", "0.5010146", "0.5009168", "0.50088954" ]
0.0
-1
This function extends the navigation with the report items
function report_retrievecourse_extend_navigation_course($navigation, $course, $context) { global $CFG, $PAGE, $USER; $tempCourse = substr ( $PAGE->course->shortname, - ($CFG->tempYearOne + $CFG->tempYearTwo) ); if (($CFG->visibilite_plugin && $tempCourse == $CFG->temp) || array_key_exists ( $USER->id, get_admins () )) { if (has_capability ( 'report/retrievecourse:view', $context )) { $url = new moodle_url ( '/report/retrievecourse/index.php', array ( 'id' => $course->id ) ); $namePlugin = 'Copie ' . (substr ( $CFG->temp, 0, $CFG->tempYearOne ) + 1) . '-' . (substr ( $CFG->temp, - $CFG->tempYearTwo ) + 1) . ' du cours'; $navigation->add ( $namePlugin, $url, navigation_node::TYPE_SETTING, null, null, new pix_icon ( 'i/report', '' ) ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerNavigation() {\n\t\t//$this->addNavigationSubGroup('Subgroup Name', 'moduleName.ReportName', 'Anchor Text', order (int, optional),'privlege (optional)', 'Group Name (optional)');\n\t\t// Note that moduleName.reportName should match the report you want the subgroup to link to\n\t\t// E.g.: example.reportDashboard links to the report controlled by reportDashboard.php\n\t\t$this->addNavigationSubGroup('Example', 'example.reportDashboard', 'Example');\n\t\t\n\t\t// (same args as addNavigationSubgroup)\n\t\t$this->addNavigationLinkInSubGroup('Example','example.subReport','Example Subreport',1);\n\t\t$this->addNavigationLinkInSubGroup('Example','example.reportCharts','Assorted Charts',2);\n\t\t\n\t}", "function getNavigation()\n\t{\n\n\n\t\treturn;\n\n\t\tglobal $gMysql;\n\t\tglobal $member_id;\n\t\t# grab these items\n\t\t$num_views\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_views where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_winks\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_winks where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_favs\t\t\t=\t$gMysql->queryItem(\"select count(*) from sm_fav where member_id='$member_id'\",__FILE__,__LINE__);\n\t\t$num_messages\t\t=\t$gMysql->queryItem(\"select count(*) from sm_messages where member_id='$member_id'\",__FILE__,__LINE__);\n\n\n\n\t\t$menuArray\t=\tarray(\n\t\tarray(\n\t\t\"title\"\t\t\t=>\t\"Profile\",\n\t\t\"bShowNumber\"\t=>\tfalse,\n\t\t\"number\"\t\t=>\t0,\n\t\t\"bHeader\"\t\t=>\ttrue,\n\t\t\"className\"\t\t=>\t\"icon-user\",\n\t\t\"link\" \t\t\t=>\t\"http://bbc.co.uk\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Search\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-search\",\n\t\t\"link\" \t\t\t =>\t\"search\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Messages\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_messages,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-mail\",\n\t\t\"link\" \t\t\t =>\t\"inbox\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Views\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_views,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-binoculars\",\n\t\t\"link\" \t\t\t =>\t\"views\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Winks\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_winks,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-eye\",\n\t\t\"link\" \t\t\t =>\t\"winks\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Favourites\",\n\t\t\"bShowNumber\"\t =>\ttrue,\n\t\t\"number\"\t\t =>\t$num_favs,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-bookmarks\",\n\t\t\"link\" \t\t\t =>\t\"favourites\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Matches\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-heart\",\n\t\t\"link\" \t\t\t =>\t\"matches\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Membership\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-unlocked\",\n\t\t\"link\" \t\t\t =>\t\"membership\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t =>\t\"Profile\",\n\t\t\"bShowNumber\"\t =>\tfalse,\n\t\t\"number\"\t\t =>\t0,\n\t\t\"bHeader\"\t\t =>\ttrue,\n\t\t\"className\"\t\t =>\t\"icon-user\",\n\t\t\"link\" \t\t\t =>\t\"profile\",\n\t\t),\n\t\tarray(\n\t\t\"title\"\t\t\t\t=>\t\"Logout\",\n\t\t\"bShowNumber\"\t\t=>\tfalse,\n\t\t\"number\"\t\t\t=>\t0,\n\t\t\"bHeader\"\t\t\t=>\ttrue,\n\t\t\"className\"\t\t\t=>\t\"icon-switch\",\n\t\t\"link\"\t\t\t\t=>\t\"javacript:confirm('app/m/login/logout');\",\n\t\t),\n\t\t);\n\n\t\t$selectedItem\t=\t3;\n\t\t$index\t\t\t=\t0;\n\n\n\t\t$menuString\t=\t' <ul> ';\n\n\n\t\tforeach ($menuArray as $menuItem)\n\t\t{\n\t\t\t# build html of menu\n\t\t\tif\t($selectedItem == $index)\n\t\t\t{\n\t\t\t\t$menu_line\t=\t'<li class=\"selected\">';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$menu_line\t=\t'<li>';\n\t\t\t}\n\n\n\t\t\t$menu_line\t.=\t'<a href=\"' . $menuItem['link'] . '\" class=\"' . $menuItem['className'] . '\" >' . $menuItem['title'];\n\t\t\t# numerics?\n\t\t\tif\t($menuItem['bShowNumber'] == true)\n\t\t\t{\n\t\t\t\t$menu_line\t.=\t\t' <span class=\"pip\">' . $menuItem['number'] . '</span>';\n\t\t\t}\n\t\t\t$menu_line .= \"</a></li>\\r\\n\";\n\n\t\t\t$menuString\t.=\t$menu_line;\n\n\t\t\t$index++;\n\t\t}\n\t\t$menuString\t.=\t\"</ul>\";\n\n\t\treturn\t$menuString;\n\t}", "function _navSetup()\n\t{\n\t\t// get the path to the current page\n\t\t$this->path = $this->getPath($this->area, $this->page);\n\t\t\n\t\t// reset the navigational elements\n\t\t$this->nav = array();\n\t\t\n\t\t// we use the view URL a lot\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'wikilink', 'view_url');\n\t\t\n\t\t// is there a path? (if not, the page is not on the map)\n\t\tif (count($this->path) > 0) {\n\t\t\t\n\t\t\t// get nav elements leading to this page...\n\t\t\tforeach ($this->path as $key => $val) {\n\t\t\t\t\t\n\t\t\t\tif ($key == 0) {\n\t\t\t\t\n\t\t\t\t\t// get the map tops\n\t\t\t\t\t$this->nav[$key] = $this->_tops($val, $view_url);\n\t\t\t\t\t\n\t\t\t\t} elseif (isset($this->path[$key-1])) {\n\t\t\t\t\n\t\t\t\t\t// get children\n\t\t\t\t\t$prev_page = $this->path[$key-1];\n\t\t\t\t\t$this->nav[$key] = $this->_kids($prev_page, $val, $view_url);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// and get the first nav element below this page.\n\t\t\t$prev_page = $val;\n\t\t\t$this->nav[$key+1] = $this->_kids($prev_page, $this->page,\n\t\t\t\t$view_url, true);\n\t\t\t\n\t\t} else {\n\n\t\t\t// Set the nav element to the top level page list for the area, so\n\t\t\t// that the list of top level pages is shown even if we move outside\n\t\t\t// the area map.\n\t\t\t$this->nav[0] = $this->_tops(\"\", $view_url);\n\t\t}\n\t\t\t\n\t\t\n\t\t// nav to AreaMap, edit, history, and links\n\t\t$this->nav['map'] =\tsprintf($view_url, 'AreaMap');\n\t\t$this->nav['history'] = sprintf($view_url, $this->page) . '&view=history';\n\t\t$this->nav['links'] = sprintf($view_url, $this->page) . '&view=links';\n\t\t$this->nav['source'] = sprintf($view_url, $this->page) . '&view=source';\n\t\t$this->nav['rss'] = sprintf($this->conf['absolute_url'].\"rss.php?area=%s&page=%s\", $this->area, $this->page);\n\t\t$this->nav['edit'] = sprintf($this->conf['absolute_url'].\"edit.php?area=%s&page=%s\", $this->area, $this->page);\n\t}", "public function appendNavigation(){\n\t\t\t$nav = $this->getNavigationArray();\n\n\t\t\t/**\n\t\t\t * Immediately before displaying the admin navigation. Provided with the\n\t\t\t * navigation array. Manipulating it will alter the navigation for all pages.\n\t\t\t *\n\t\t\t * @delegate NavigationPreRender\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $nav\n\t\t\t * An associative array of the current navigation, passed by reference\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers('NavigationPreRender', '/backend/', array('navigation' => &$nav));\n\n\t\t\t$xNav = new XMLElement('ul');\n\t\t\t$xNav->setAttribute('id', 'nav');\n\n\t\t\tforeach($nav as $n){\n\t\t\t\tif($n['visible'] == 'no') continue;\n\n\t\t\t\t$can_access = false;\n\n\t\t\t\tif(!isset($n['limit']) || $n['limit'] == 'author')\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\telseif($n['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t$can_access = true;\n\n\t\t\t\tif($can_access) {\n\t\t\t\t\t$xGroup = new XMLElement('li', $n['name']);\n\t\t\t\t\tif(isset($n['class']) && trim($n['name']) != '') $xGroup->setAttribute('class', $n['class']);\n\n\t\t\t\t\t$hasChildren = false;\n\t\t\t\t\t$xChildren = new XMLElement('ul');\n\n\t\t\t\t\tif(is_array($n['children']) && !empty($n['children'])){\n\t\t\t\t\t\tforeach($n['children'] as $c){\n\t\t\t\t\t\t\tif($c['visible'] == 'no') continue;\n\n\t\t\t\t\t\t\t$can_access_child = false;\n\n\t\t\t\t\t\t\tif(!isset($c['limit']) || $c['limit'] == 'author')\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\telseif($c['limit'] == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\t\t\t\t\t$can_access_child = true;\n\n\t\t\t\t\t\t\tif($can_access_child) {\n\t\t\t\t\t\t\t\t$xChild = new XMLElement('li');\n\t\t\t\t\t\t\t\t$xChild->appendChild(\n\t\t\t\t\t\t\t\t\tWidget::Anchor($c['name'], SYMPHONY_URL . $c['link'])\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$xChildren->appendChild($xChild);\n\t\t\t\t\t\t\t\t$hasChildren = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($hasChildren){\n\t\t\t\t\t\t\t$xGroup->appendChild($xChildren);\n\t\t\t\t\t\t\t$xNav->appendChild($xGroup);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->Header->appendChild($xNav);\n\t\t\tAdministration::instance()->Profiler->sample('Navigation Built', PROFILE_LAP);\n\t\t}", "protected function GetCustomNavigationItems()\n {\n return array();\n }", "function listNavigationItems()\n{\n include('models/navigation.php');\n $items = getAllNavigationItems();\n return [\n 'page' => 'admin/lists/navigation.php',\n 'items' => $items,\n 'edit_link' => 'index.php?p=admin&module=navigation&action=edit&id=',\n 'delete_link' => 'index.php?p=admin&module=navigation&action=delete&id=',\n ];\n}", "public function createNavigation() {\n\t \n\t // 1. Gruppen auslesen\n\t\t$groups = array();\n\t\t$items = array();\n\t\n\t $items = $this->applicationHandler->getApplications(array(\n\t \t'groups' => true,\n\t \t'isVisible' => 1\n\t ));\n\n\t // 2. Elemente auslesen und parsen\n\t foreach ($items as $g) {\n\t \t\n\t \t$groupIsEmpty = true;\n\t \t$groupSelected = false;\n\n\t \tforeach ($g['cmtApplications'] as $r) {\n\t\n\t \t\t// Zugriffsrechte prüfen\n\t\t \tif (!$this->user->checkUserAccessRight($r['id'])) {\n\t\t \t\tcontinue;\t\n\t\t \t}\n\t\t \t\n\t\t\t\t// Da ist was drin in der Gruppe!\n\t\t\t\t$groupIsEmpty = false;\n\t\t\t\t$itemSelected = false;\n\t\t\t\t\t\t\n\t\t\t\t// Default-Einstellungen holen, sofern es welche gibt.\n\t\t\t\tif ($r['cmt_type'] == 'table') {\n\t\t\t\t\t$settingsPath = 'app_showtable/';\n\t\t\t\t} else {\n\t\t\t\t\t$a = explode('.', $r['cmt_include']);\n\t\t\t\t\t$settingsPath = $a[0].'/';\n\t\t\t\t\tunset ($a);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$itemSettings = $r['cmt_tablesettings'];\n\t\t\t\t\n\t\t\t\tif (!isset($itemSettings['icon'])) {\n\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch ($itemSettings['icon']) {\n\t\t\t\t\tcase 'otherIcon':\n\t\t\t\t \t$itemIcon = CMT_TEMPLATE.$itemSettings['iconPath'];\n\t\t\t\t \tbreak;\n\t\t\t\t\n\t\t\t\t\tcase 'none':\n\t\t\t\t\t\t$itemIcon = '';\n\t\t\t\t\t\tunset ($itemSettings['iconPath']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (isset($itemSettings['iconPath']) && is_file(CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'])) {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.$settingsPath.$itemSettings['iconPath'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$itemSettings['icon'] = 'default';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Das 16px große Icon anzeigen\n\t\t\t\tif (!strstr($itemIcon, 'cmt_default')) {\n\t\t\t\t\t$iconParts = explode('.', (basename($itemIcon)));\n\t\t\t\t\t$itemIcon = dirname($itemIcon).'/'.array_shift($iconParts).'_16px.'.implode('.', $iconParts);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_file($itemIcon)) {\n\t\t\t\t\t$itemIcon = CMT_TEMPLATE.'general/img/'.str_replace('table', $r['cmt_type'], 'cmt_defaulttableicon_16px.png');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($r['id'] == $this->selectedApplicationID) {\n\t\t\t\t\t$itemSelected = true;\n\t\t\t\t\t$groupSelected = true;\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$itemSelected = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// generate query variables\n\t\t\t\t$queryVars = '';\n\t\t\t\tif ($r['cmt_queryvars']) {\n\t\t\t\t\t$queryVars = str_replace(array(\"\\n\", \"\\r\"), array('&amp;', ''), $r['cmt_queryvars']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$parserVars = array(\n\t\t\t\t\t'itemIcon' => $itemIcon,\n\t\t\t\t\t'itemName' => $r['cmt_showname'],\n\t\t\t\t\t'itemId' => $r['id'],\n\t\t\t\t\t'itemSelected' => $itemSelected,\n\t\t\t\t\t'groupSelected' => $groupSelected,\n\t\t\t\t\t'queryVars' => $queryVars\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->parser->setMultipleParserVars($parserVars);\n\t\t\t\t$groupHtml .= $this->parser->parse($this->itemTemplate);\n\t \t}\n\t \t\n\t \t// Falls was in der Gruppe drin ist, dann anzeigen\n\t \tif (!$groupIsEmpty) {\n\t \t\t\n\t \t\t$groupSettings = $g['cmt_groupsettings'];\n\t \t\t\n\t \t\tif (!is_array($groupSettings)) {\n\t \t\t\t$groupSettings = array();\n\t \t\t}\n\t \t\t\n\t\t\t\t// Icon suchen\n\t\t\t switch ($groupSettings['icon']) {\n\t\t\t \tcase 'otherIcon':\n\t\t\t \t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tcase 'none':\n\t\t\t \t\t$groupIcon = '';\n\t\t\t \t\tbreak;\n\t\t\t \t\t\n\t\t\t \tdefault:\n\t\t\t \t\tif ($groupSettings['iconPath']) {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.$groupSettings['iconPath'];\n\t\t\t \t\t} else {\n\t\t\t \t\t\t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t \t\t}\n\t\t\t \t\t$groupSettings['icon'] = 'default';\n\t\t\t \t\tbreak;\n\t\t\t }\n\t\t\t \n\t\t\t // Das 32px große Icon auswählen\n\t\t\t if (!strstr($groupIcon, 'cmt_defaultgroupicon_32px.png') && $groupIcon != '') {\n\t\t\t \t$iconParts = explode('.', (basename($groupIcon)));\n\t\t\t \t$groupIcon = dirname($groupIcon).'/'.array_shift($iconParts).'_32px.'.implode('.', $iconParts);\n\t\t\t }\n\t\t\t \n\t\t\t if ($groupIcon != '' && !is_file($groupIcon)) {\n\t\t\t \t$groupIcon = CMT_TEMPLATE.'general/img/cmt_defaultgroupicon_32px.png';\n\t\t\t }\n\t\t\t \n\t\t\t // Gruppentemplate parsen\n\t\t\t $this->parserVars = array(\n\t\t \t\t'groupIcon' => $groupIcon,\n\t\t\t\t\t'groupName' => $g['cmt_groupname'],\n\t\t\t\t\t'groupId' => $g['id'],\n\t\t\t\t\t'groupHtml' => $groupHtml,\n\t\t \t\t'groupSelected' => $groupSelected\n\t\t\t \t);\n\t\t\t\t\t\t\n\t\t\t $this->parser->SetMultipleParserVars($this->parserVars);\n\t\t\t $navigation .= $this->parser->parse($this->groupTemplate);\n\t\t\t \n\t\t\t unset($groupHtml);\n\t \t}\n\t }\n\t $this->parser->setParserVar('cmtNavigationGroups', $navigation);\t \n\t return $this->parser->parseTemplate('administration/cmt_navigation.tpl');\n\t}", "public static function getNavigator($currentPage) {\n\t\tif (strcmp ( $currentPage, \"/\" ) == 0) {\n\t\t\theader ( \"Location: \".ConfigUtil::getSiteName());\n\t\t\tdie ();\n\t\t}\n\t\t\n\t\t// if (! UserLoginUtils::isLogin ()) {\n\t\t// $this->redirect ( Yii::app ()->createUrl ( 'Site/login' ) );\n\t\t// }\n\t\t\n\t\t$currentPage = str_replace ( ConfigUtil::getAppName (), \"\", $currentPage );\n\t\t\n\t\t$link = explode ( \"/\", $currentPage );\n\t\t\n\t\t$_tmpPage = \"\";\n\t\tswitch (count ( $link )) {\n\t\t\tcase 3 :\n\t\t\t\tbreak;\n\t\t\tcase 4 :\n\t\t\t\t$_tmpPage = \"/\" . $link [3];\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$nav = \"\";\n\t\t\n\t\t$nav = $nav . \"<li>\";\n\t\t$nav = $nav . \"<i class=\\\"fa fa-home\\\"></i>\";\n\t\t$nav = $nav . \"<a href=\\\"\" . \"#\" . \"\\\">Home</a>\";\n\t\t$nav = $nav . \"</li>\";\n\t\t\n\t\t$criMenu = new CDbCriteria ();\n\t\t$criMenu->condition = \"URL_NAVIGATE = '/\" . $link [1] . \"/\" . $link [2] . ($link [2] == \"Report\" ? \"/\" . $link [3] : \"\") . \"'\";\n\t\t\n\t\t// echo \"<font color='red'>/\" . $link [1] . \"/\" . $link [2] . $_tmpPage .' ('.count($link).\")\". \"</font>\";\n\t\t\n\t\t$childs = Menu::model ()->findAll ( $criMenu );\n\t\tif (isset ( $childs )) {\n\t\t\t\n\t\t\tforeach ( $childs as $child ) {\n\t\t\t\t\n\t\t\t\tif (0 === strpos ( $currentPage, $child->URL_NAVIGATE )) {\n\t\t\t\t\t\n\t\t\t\t\t$criMenuParent = new CDbCriteria ();\n\t\t\t\t\t$criMenuParent->condition = \"MENU_ID = \" . $child->PREVIOUS_MENU_ID;\n\t\t\t\t\t\n\t\t\t\t\t$parent = Menu::model ()->findAll ( $criMenuParent );\n\t\t\t\t\tif (isset ( $parent [0] )) {\n\t\t\t\t\t\t$nav = $nav . \"<li>\";\n\t\t\t\t\t\t$nav = $nav . \"<i class=\\\"fa fa-angle-right\\\"></i>\";\n\t\t\t\t\t\t$nav = $nav . \"<a href=\\\"\" . (ConfigUtil::getAppName () . $child->URL_NAVIGATE) . \"\\\">\" . $parent [0]->MENU_NAME . \"</a>\";\n\t\t\t\t\t\t$nav = $nav . \"</li>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$nav = $nav . \"<li>\";\n\t\t\t\t\t$nav = $nav . \"<i class=\\\"fa fa-angle-right\\\"></i>\";\n\t\t\t\t\t$nav = $nav . \"<a href=\\\"#\\\">\" . $child->MENU_NAME . \"</a>\";\n\t\t\t\t\t$nav = $nav . \"</li>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $nav;\n\t}", "function _getNav()\n {\n }", "function vitero_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n\n}", "function report_myfeedback_extend_navigation(global_navigation $navigation) {\n $url = new moodle_url('/report/myfeedback/index.php', array('course' => $course->id));\n $navigation->add(get_string('pluginname', 'report_myfeedback'), $url, null, null, new pix_icon('i/report', ''));\n}", "function content_nav() {\n\t\t$current_individual_nav_items = 0;\n\t\t$max_individual_nav_items = 4;\n\t\t\n\t\tforeach($this->data['content_actions'] as $key => $item) :\n\t\t\tif ( $current_individual_nav_items == $max_individual_nav_items ) { ?>\n\t\t\t\t<?\n\t\t\t}\n\t\t\t\n\t\t\techo $this->makeListItem( $key, $item );\n\t\t\t$current_individual_nav_items++;\n\t\tendforeach;\n\t\t\n\t\t?></ul></li><?\n\t}", "public function navigationiniAction()\n {\n }", "function page_nav() {\n global $user;\n global $xtpl;\n \n $xtpl->assign('nav_base', trim(simpleid_url(' ', '', true)));\n \n if ($user != NULL) {\n if (isset($user['administrator']) && ($user['administrator'] == 1)) $xtpl->parse('main.nav.nav_admin');\n \n }\n $xtpl->parse('main.nav');\n}", "function get_navigation_default() {\n return array(array('name' => get_string('listinstancejobs_pagetitle',\n 'block_php_report'),\n 'link' => null, 'type' => 'misc')\n );\n }", "private function stepNav() {\n $course = $this->step->course;\n\t\t$root = $course->root;\n\t\t$stepUrl = $this->step->url;\n\n\t\t$prev = $this->stepSection->prev;\n\t\t$prevUrl = $prev !== null ? $prev->url : $stepUrl;\n\n\t\t$next = $this->stepSection->next;\n\t\t$nextUrl = $next !== null ? $next->url : $stepUrl;\n\t\t\n\t\t$html = <<<END1\n<div class=\"cl-stepnav-div\"><nav class=\"cl-stepnav cl-nav\"><div><ul>\n<li><a href=\"$stepUrl\"><span>Return to Step Page</span>\n<img alt=\"Return to Step\" width=\"28\" height=\"25\" src=\"$root/vendor/cl/step/img/returnstep.png\" /></a></li>\nEND1;\n\n\t\t// Extra menu items here\n\t\tforeach($this->step->menuExtra as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\n\t\t$html .= <<<HTML\n<li><a href=\"$prevUrl\"><span>Previous Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/previcon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\"><span>Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/nexticon.png\" width=\"40\" /></a></li>\n<li><a href=\"$nextUrl\" class=\"cl-step-completed-next\"><span>Mark Completed and Next Section</span>\n<img alt=\"Mark Complete\" height=\"25\" src=\"$root/vendor/cl/site/img/checknext.png\" width=\"40\" /></a></li>\n<li class=\"cl-step-progress\"></li>\nHTML;\n\n\t\t// Appended menu items here\n\t\tforeach($this->step->menuAppend as $extra) {\n\t\t\t$html .= $extra->html($this->stepSection, $this->user);\n\t\t}\n\t\t\n\t\t/*\n\t\t * End of menu bar \n\t\t */\n\t\t$html .= <<<HTML\n</ul></div>\n</nav></div>\nHTML;\n\t\n\t\treturn $html;\n\t}", "public function main_navigation(){\r\n\r\n echo \"<ul>\";\r\n\r\n if(isset($this->navigationSettings)){\r\n\r\n foreach((array) $this->navigationSettings as $key => $value){\r\n echo \"<li>\";\r\n echo \"<a href='$value'>$key</a>\";\r\n echo \"</li>\";\r\n }\r\n\r\n }\r\n\r\n echo \"</ul>\";\r\n\r\n }", "function pgsf_get_byu_navigation() { \n\n\n\n\t\tif ( get_field( 'display_header_sub-navigation', 'parent_options' ) ) { ?>\n\t\t\t<byu-menu slot=\"nav\"> \n\n\t\t\t\t<?php // loop through the rows of data\n\t\t\t \twhile ( have_rows( 'sub-navigation', 'parent_options' ) ) { the_row();\n\n\t\t\t\t\t// check current row layout\n\t\t\t\t\tif ( 'link_information' === get_row_layout() ) {\n\n\t\t\t\t\t\t$link_title = get_sub_field( 'title' );\n\t\t\t\t\t\t$link_url = get_sub_field( 'url' ); ?>\n\n\t\t\t\t\t\t<li><a href=\" <?php echo esc_url( $link_url ); ?>\"><?php echo esc_html( $link_title ); ?></a></li>\n\t\t\t\t\t\n\t\t\t\t\t<?php }\n\t\t\t\t} ?>\n\t\t\t</byu-menu>\n\t\t<?php }\n}", "function public_nav_items(array $navArray = null, $maxDepth = 0)\n{\n if (!$navArray) {\n $navArray = array(\n array(\n 'label' => __('Browse All'),\n 'uri' => url('items/browse'),\n ));\n if (total_records('Tag')) {\n $navArray[] = array(\n 'label' => __('Browse by Tag'),\n 'uri' => url('items/tags')\n );\n }\n $navArray[] = array(\n 'label' => __('Search Items'),\n 'uri' => url('items/search')\n );\n }\n return nav($navArray, 'public_navigation_items');\n}", "function roshine_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n}", "public function getNav() \n {\n //@return : $stri_html : affichage du html de la navigation\n \n\t\t$stri_html =\"\";\n \n //**** START - navigation previous\n //si la page précédente > 1 alors affichage du lien sinon affichage du label (if previous page > 1 then put link else label)\n\t\t$stri_html .= ($this->int_page_prev > 0) ? $this->obj_a_prev->htmlValue() : $this->obj_lb_prev->htmlValue(); \n\t\t$stri_html .= \" | \";\n\t\t//**** END - navigation previous\n\t\t\n\t\t\n //**** DEBUT corps navigator\n\n // calcule le milieu pour les liens de page dans le but d'avoir la page courante au centre de la navigation (determine the middle of link to post courant page in middle)\n\t\t$int_middle = floor($this->int_limit_page / 2);\n\n\t\t// calcule la page minimum à afficher dans les liens (determine the min page)\n $minpage = (($this->int_page - $int_middle)<1) ? 1 : $this->int_page - $int_middle;\t\t\n\n // calcule la page maximum à afficher dans les liens (determine the max page)\n\t\t$maxpage = (($this->int_page + $int_middle)> $this->int_pages)? $this->int_pages : ($this->int_page + $int_middle);\n\n // pour chaque lien de navigation (post each page)\n\t\tforeach (range($minpage, $maxpage) as $i) \n {\n\t\t\tif ($i == $this->int_page) \n { \n // selected page\n $this->obj_lb_courant_page->setValue($i);\n\t\t\t\t$stri_html .= $this->obj_lb_courant_page->htmlValue(); \n\t\t\t} \n else \n {\n // other page\n $this->obj_a_page->setValue($i);\n $this->obj_a_page->setOnClick(\"document.form_page.start.value=\".$i.\";document.form_page.submit();\");\n \n\t\t\t\t$stri_html.=\" \".$this->obj_a_page->htmlValue().\" \";\n\t\t\t}\n\t\t}\n\n //**** END corps navigation\n \n \n //**** START - navigation next\n //si la page suivante <= nb de pages alors affichage du lien sinon affichage du label (if next page <= number of page then put link else label)\n\t\t$stri_html .= \" | \";\n\t\t$stri_html .= ($this->int_page_next <= $this->int_pages) ? $this->obj_a_next->htmlValue() : $this->obj_lb_next->htmlValue(); \n //**** END - navigation next\n\n\t\treturn $stri_html;\n\t}", "public function registerNavigation() {\n return [\n 'sampling' => [\n 'label' => 'Sampling',\n 'url' => Backend::url('mtech/sampling/project'),\n 'icon' => 'icon-globe',\n 'permissions' => ['mtech.sampling.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'province' => [\n 'label' => 'Provinces',\n 'icon' => 'icon-sitemap',\n 'url' => Backend::url('mtech/sampling/province'),\n 'permissions' => ['mtech.sampling.province'],\n 'counterLabel' => 'General',\n ],\n 'district' => [\n 'label' => 'Districts',\n 'icon' => 'icon-map-marker',\n 'url' => Backend::url('mtech/sampling/district'),\n 'permissions' => ['mtech.sampling.district'],\n 'counterLabel' => 'General',\n ],\n 'productbrand' => [\n 'label' => 'Product brands',\n 'icon' => 'icon-address-card-o',\n 'url' => Backend::url('mtech/sampling/productbrand'),\n 'permissions' => ['mtech.sampling.productbrand'],\n 'counterLabel' => 'General',\n ],\n 'categorygift' => [\n 'label' => 'Category Gifts',\n 'icon' => 'icon-gift',\n 'url' => Backend::url('mtech/sampling/categorygift'),\n 'permissions' => ['mtech.sampling.categorygift'],\n 'counterLabel' => 'General',\n ],\n 'productsampling' => [\n 'label' => 'Product Sampling',\n 'icon' => 'icon-newspaper-o',\n 'url' => Backend::url('mtech/sampling/productsampling'),\n 'permissions' => ['mtech.sampling.productsampling'],\n 'counterLabel' => 'General',\n ],\n 'project' => [\n 'label' => 'Projects',\n 'icon' => 'icon-list',\n 'url' => Backend::url('mtech/sampling/project'),\n 'permissions' => ['mtech.sampling.project'],\n 'counterLabel' => 'Sampling',\n ],\n 'location' => [\n 'label' => 'Locations',\n 'icon' => 'icon-map-marker',\n 'url' => Backend::url('mtech/sampling/location'),\n 'permissions' => ['mtech.sampling.location'],\n 'counterLabel' => 'Sampling',\n ],\n 'gift' => [\n 'label' => 'Gifts',\n 'icon' => 'icon-gift',\n 'url' => Backend::url('mtech/sampling/gift'),\n 'permissions' => ['mtech.sampling.gift'],\n 'counterLabel' => 'Sampling',\n ],\n 'customergift' => [\n 'label' => 'Customer Info',\n 'icon' => 'icon-address-card-o',\n 'url' => Backend::url('mtech/sampling/customergift'),\n 'permissions' => ['mtech.sampling.customergift'],\n 'counterLabel' => 'Report Detail',\n ],\n 'historypg' => [\n 'label' => 'PG Info',\n 'icon' => 'icon-address-card-o',\n 'url' => Backend::url('mtech/sampling/historypg'),\n 'permissions' => ['mtech.sampling.historypg'],\n 'counterLabel' => 'Report Detail',\n ],\n 'configapp' => [\n 'label' => 'Config App',\n 'icon' => 'icon-cog',\n 'url' => Backend::url('mtech/sampling/configapp'),\n 'permissions' => ['mtech.sampling.configapp'],\n 'counterLabel' => 'Setting',\n ],\n 'settingotp' => [\n 'label' => 'Config OTP',\n 'icon' => 'icon-cog',\n 'url' => Backend::url('mtech/sampling/settingotp'),\n 'permissions' => ['mtech.sampling.settingotp'],\n 'counterLabel' => 'Setting',\n ],\n // 'customergift' => [\n // 'label' => 'Customer Gifts',\n // 'icon' => 'icon-history',\n // 'url' => Backend::url('mtech/sampling/customergift'),\n // 'permissions' => ['mtech.sampling.*'],\n // 'counterLabel' => 'History',\n // ]\n ]\n ],\n ];\n }", "function getNavMenu() {\r\r\n\t$PView = new PView;\r\r\n\t$Appl = $PView -> getAppl();\r\r\n\t$page = 1;\r\r\n\r\r\n\tglobal $applImages;\r\r\n\t$imagesData = $PView->sortApplImages($applImages);\r\r\n\t\r\r\n\tforeach($imagesData as $key => $dataset){\r\r\n\t\tif ($dataset['imageId'] == $Appl[1]){\r\r\n\t\t\t$currImage = $key;\r\r\n\t\t}\r\r\n\t}\r\r\n\t//back to list\r\r\n\t$currImageData = $PView->getImageData($Appl[1]);\r\r\n\twhile ($PView->getPView_config(\"pics_per_page\")*$page < $currImage + 1){\r\r\n\t\t$page++;\r\r\n\t}\r\r\n\tif (isset($_GET['view'])) {\r\r\n\t\t$view = $_GET['view'];\r\r\n\t}else{\r\r\n\t\t$view = \"\";\r\r\n\t}\r\r\n\tswitch ($view) {\r\r\n\t\tcase \"cat\":\r\r\n\t\t\t$backTo = \"cat=\".$currImageData['cat'].\"&amp;page=\".$page;\r\r\n\t\t\t$linkText = LAN_IMAGE_51;\r\r\n\t\tbreak;\r\r\n\t\tcase \"user\":\r\r\n\t\t\t$backTo = \"user=\".$currImageData['uploaderUserId'].\"&amp;page=\".$page;\r\r\n\t\t\t$linkText = LAN_IMAGE_52;\r\r\n\t\tbreak;\t\t\r\r\n\t\tcase \"album\":\r\r\n\t\t\t$backTo = \"album=\".$currImageData['albumId'].\"&amp;page=\".$page;\r\r\n\t\t\t$linkText = LAN_IMAGE_8;\r\r\n\t\tbreak;\r\r\n\t\tcase \"\":\r\r\n\t\t\t// default for call from menu or a direct link\r\r\n\t\t\t$backTo = \"album=\".$currImageData['albumId'].\"&amp;page=\".$page;\r\r\n\t\t\t$linkText = LAN_IMAGE_8;\r\r\n\t\tbreak;\t\t\r\r\n\t}\r\r\n\t\r\r\n\r\r\n\t//first image\r\r\n\t$imageFirst = $imagesData[0]['imageId'];\r\r\n\r\r\n\t//last image\r\r\n\t$imageLast = $imagesData[count($imagesData) - 1]['imageId'];\r\r\n\t//previous image\r\r\n\t$imagePrev = $imagesData[$currImage - 1]['imageId'];\r\r\n\t//next image\r\r\n\t$imageNext = $imagesData[$currImage + 1]['imageId'];\r\r\n\r\r\n\t$NavMenu = \"<table width='95%'><tr>\";\r\r\n\t$NavMenu.= \"<td width='18%' style='text-align:center;'><a href='pviewgallery.php?image=\".$imageFirst.\"&amp;view=\".$view.\"'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/back.png' border='0px'></a></td>\";\r\r\n\t$NavMenu.= \"<td width='18%' style='text-align:center;'>\";\r\r\n\tif ($imagePrev) {\r\r\n\t\t$NavMenu.= \"<a href='pviewgallery.php?image=\".$imagePrev.\"&amp;view=\".$view.\"'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/image_prev.png' border='0px'></a>\";\r\r\n\t}\r\r\n\t$NavMenu.= \"&nbsp;</td>\";\r\r\n\t$NavMenu.= \"<td width='28%' style='text-align:center;'><a href='pviewgallery.php?\".$backTo.\"'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/up.png' border='0px'></a></td>\";\r\r\n\t$NavMenu.= \"<td width='18%' style='text-align:center;'>\";\r\r\n\tif ($imageNext) {\r\r\n\t\t$NavMenu.= \"<a href='pviewgallery.php?image=\".$imageNext.\"&amp;view=\".$view.\"'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/image_next.png' border='0px'></a>\";\r\r\n\t}\r\r\n\t$NavMenu.= \"&nbsp;</td>\";\r\r\n\t$NavMenu.= \"<td width='18%' style='text-align:center;'><a href='pviewgallery.php?image=\".$imageLast.\"&amp;view=\".$view.\"'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/next.png' border='0px'></a></td>\";\r\r\n\t$NavMenu.= \"</tr></table>\";\r\r\n\treturn $NavMenu;\r\r\n}", "function _setNavigation()\r\n {\r\n global $_ARRAYLANG;\r\n\r\n $ckEditorFuncNum = isset($_GET['CKEditorFuncNum']) ? '&amp;CKEditorFuncNum='.contrexx_raw2xhtml($_GET['CKEditorFuncNum']) : '';\r\n $ckEditor = isset($_GET['CKEditor']) ? '&amp;CKEditor='.contrexx_raw2xhtml($_GET['CKEditor']) : '';\r\n\r\n $this->_objTpl->addBlockfile('FILEBROWSER_NAVIGATION', 'fileBrowser_navigation', 'module_fileBrowser_navigation.html');\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_MEDIA_TYPE_MENU' => $this->_getMediaTypeMenu('fileBrowserType', $this->_mediaType, 'onchange=\"window.location.replace(\\''. \\Cx\\Core\\Csrf\\Controller\\Csrf::enhanceURI('index.php?cmd=FileBrowser').'&amp;standalone=true&amp;langId='.$this->_frontendLanguageId.'&amp;type=\\'+this.value+\\''.$ckEditorFuncNum.'\\')\"'),\r\n 'TXT_FILEBROWSER_PREVIEW' => $_ARRAYLANG['TXT_FILEBROWSER_PREVIEW']\r\n ));\r\n\r\n if ($this->_mediaType != 'webpages') {\r\n // only show directories if the files should be displayed\r\n if (count($this->_arrDirectories) > 0) {\r\n foreach ($this->_arrDirectories as $arrDirectory) {\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_FILE_PATH' => \"index.php?cmd=FileBrowser&amp;standalone=true&amp;langId={$this->_frontendLanguageId}&amp;type={$this->_mediaType}&amp;path={$arrDirectory['path']}\" . $ckEditor . $ckEditorFuncNum,\r\n 'FILEBROWSER_FILE_NAME' => $arrDirectory['name'],\r\n 'FILEBROWSER_FILE_ICON' => $arrDirectory['icon']\r\n ));\r\n $this->_objTpl->parse('navigation_directories');\r\n }\r\n }\r\n }\r\n $this->_objTpl->parse('fileBrowser_navigation');\r\n }", "public function actionbar_navigation() {\n $currentpage = format_flexpage_cache()->get_current_page();\n $options = array();\n foreach (format_flexpage_cache()->get_pages() as $page) {\n $options[$page->get_id()] = $this->pad_page_name($page, true);\n }\n\n if ($prevpage = format_flexpage_cache()->get_previous_page($currentpage)) {\n $previcon = new pix_icon('t/moveleft', get_string('gotoa', 'format_flexpage', format_string($prevpage->get_name())));\n $prevpage = $this->output->action_icon($prevpage->get_url(), $previcon);\n $prevpage = html_writer::tag('span', $prevpage, array('id' => 'format_flexpage_prevpage'));\n } else {\n $prevpage = '';\n }\n if ($nextpage = format_flexpage_cache()->get_next_page($currentpage)) {\n $nexticon = new pix_icon('t/removeright', get_string('gotoa', 'format_flexpage', format_string($nextpage->get_name())));\n $nextpage = $this->output->action_icon($nextpage->get_url(), $nexticon);\n $nextpage = html_writer::tag('span', $nextpage, array('id' => 'format_flexpage_nextpage'));\n } else {\n $nextpage = '';\n }\n $jumpselect = new single_select($this->page->url, 'pageid', $options, $currentpage->get_id(), array(), 'jumptopageid');\n $jumpselect->set_label(get_string('jumptoflexpage', 'format_flexpage'), array('class' => 'accesshide'));\n\n $jumptopage = html_writer::tag('span', $this->output->render($jumpselect), array('id' => 'format_flexpage_jumptopage'));\n $helpicon = $this->pix_icon('help', get_string('help'), 'moodle', array('id' => 'format_flexpage_actionbar_help'));\n $helpicon = html_writer::tag('span', $helpicon);\n\n return html_writer::tag('div', $prevpage.$jumptopage.$nextpage.$helpicon, array('id' => 'format_flexpage_actionbar_nav'));\n }", "function tv_add_menu_items(){\n $reports_page = \"contact_reports.php\";\n // add_menu_page('Reports', 'Reports', 'manage_options', 'contact_reports.php', 'tv_render_list_page', 'dashicons-clipboard', 6);\n add_menu_page('Reports', 'Reports', 'manage_options', $reports_page, 'tv_render_list_page', 'dashicons-clipboard', 6);\n}", "function show_navigation()\n {\n }", "public function getPageItems()\n {\n }", "function contactmod_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n}", "function navigation() {\t\treturn array( 'wpgmp_manage_extentions' => esc_html__( 'Extentions', 'wpgmp-google-map' ));\n\t\t\t}", "public function woocommerce_account_navigation() {\n\t\t\tastra_addon_get_template( 'woocommerce/templates/navigation.php' );\n\t\t}", "function public_nav_main()\n{\n $view = get_view();\n $nav = new Omeka_Navigation;\n $nav->loadAsOption(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME);\n $nav->addPagesFromFilter(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);\n return $view->navigation()->menu($nav);\n}", "public function navigation() {\n\n\t\t\treturn array(\n\t\t\t'wpgmp_form_location' => __( 'Add Location', WPGMP_TEXT_DOMAIN ),\n\t\t\t'wpgmp_manage_location' => __( 'Manage Locations', WPGMP_TEXT_DOMAIN ),\n\t\t\t);\n\t\t}", "private function _showPublic(){\n $omenu = D('Menu');\n $amodules = $omenu->getModules();\n $this->assign('modules',$amodules);\n $amenu = $omenu->getMenuByModelName(MODULE_NAME);\n $asubNav = array();\n $amenus = array();\n $asubmenus = array();\n $temp = array();\n foreach($amenu as $v){\n if(!$this->_auth($v['name'])) continue;\n switch(count(explode(',',$v['level']))){\n case 2:\n $amenus[$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'icon' => $v['icon']\n );\n if(MODULE_NAME == $v['name']){\n $anav[] = array(\n 'title' => $amodules[$v['pId']]['title'],\n 'URL' => $amodules[$v['pId']]['URL'],\n 'icon' => $amodules[$v['pId']]['icon']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $amenus[$v['id']]['active'] = true;\n $icon = $v['icon'];\n }else{\n $amenus[$v['id']]['active'] = false;\n }\n break;\n case 3:\n $amenus[$v['pId']]['submenu'][$v['id']] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n if($foundSubNav){\n $stop = true;\n break;\n }else{\n $asubNav = array();\n }\n\n if($v['name'] == MODULE_NAME.'_'.ACTION_NAME){\n $bnatchNav || $bmatchNav = true;\n $foundSubNav = true;\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $tcontentTitle = $v['title'];\n }else{\n $temp = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n );\n $bmatchNav && $bmatchNav = false;\n }\n break;\n case 4:\n if($foundSubNav && $stop) break;\n if($bmatchNav){\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n $tsubContentTitle = $tcontentTitle;\n }else{\n $asubNav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL']\n );\n //$tsubContentTitle = $temp['name'];\n if(MODULE_NAME.'_'.ACTION_NAME == $v['name']){\n $foundSubNav = true;\n $tsubContentTitle = $v['title'];\n $tcontentTitle = $temp['title'];\n $anav[] = array(\n 'title' => $temp['title'],\n 'URL' => $temp['URL']\n );\n $anav[] = array(\n 'title' => $v['title'],\n 'URL' => $v['URL'],\n 'class' => 'current'\n );\n $asubNav[count($asubNav)-1]['active'] = true;\n }\n }\n break;\n }\n }\n $this->assign('menu',$amenus);\n $this->assign('nav',$anav);\n $this->assign('contentTitle',$tcontentTitle);\n $this->assign('subnav',$asubNav);\n $this->assign('subContentTitle',$tsubContentTitle);\n $this->assign('icon',$icon);\n }", "function getMenuItems()\n {\n $this->menuitem(\"xp\", \"\", \"main\", array(\"xp.story\", \"admin\"));\n $this->menuitem(\"stories\", dispatch_url(\"xp.story\", \"admin\"), \"xp\", array(\"xp.story\", \"admin\"));\n }", "function addLocatorItems()\n\t{\n\t\tglobal $ilLocator;\n\t\t\n\t\tif (is_object($this->object))\n\t\t{\n\t\t\t$ilLocator->addItem($this->object->getTitle(),\n\t\t\t\t$this->getGotoLink($this->object->getRefId()), \"\", $_GET[\"ref_id\"]);\n\t\t}\n\t}", "function tquiz_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "function pagination( $which ) {\r\n\t\t$save_uri = $_SERVER['REQUEST_URI'];\r\n\t\t$_SERVER['REQUEST_URI'] = add_query_arg( self::mla_submenu_arguments(), $save_uri );\r\n\t\tparent::pagination( $which );\r\n\t\t$_SERVER['REQUEST_URI'] = $save_uri;\r\n\t}", "function getNavigationItems($relation) {\n\t\tglobal $page;\n\t\t$actual_content = false;\n\n\t\t$query = new Query();\n\t\t$query->sql(\"SELECT * FROM \".UT_MEN.\" WHERE relation = $relation ORDER BY sequence ASC\");\n\n\t\t$items = array();\n\t\tfor($i = 0; $i < $query->getQueryCount(); $i++) {\n\t\t\t$id = $query->getQueryResult($i,\"id\");\n\t\t\t$url = $query->getQueryResult($i,\"url\");\n\t\t\t$name = $this->translate($query->getQueryResult($i, \"name\"));\n\n\t\t\t$children = $this->getNavigationItems($id);\n\t\t\t// see if url contains page_status action\n\t\t\t$url_parts = (strpos($url, \"?page_status=\") ? explode('?page_status=', $url) : array($url, false));\n\n\t\t\tif((!$url && $children) || Session::getLogin()->validateNavigation($url_parts[0], $url_parts[1]) || $name == \"----\") {\n\t\t\t\t$item = null;\n\t\t\t\t$item->url = false;\n\t\t\t\tif($name != \"----\"){\n\t\t\t\t\t$actual_content = true;\n\t\t\t\t\t$item->url = preg_replace(\"/\\A\\/admin/\", \"\", removeKnownPaths($url, true));\n\t\t\t\t}\n\t\t\t\t$item->name = $name;\n\n\t\t\t\t// comwell fuck! Windows\n//\t\t\t\tif(substr(FRAMEWORK_PATH, 0, 2) == \"D:\") {\n//\t\t\t\t\t$item->url = str_replace(str_replace(\"D:\", \"\", FRAMEWORK_PATH.\"/admin\"), \"\", $url);\n//\t\t\t\t\t$item->url = str_replace(str_replace(\"D:\", \"\", GLOBAL_PATH.\"/admin\"), \"\", $item->url);\n//\t\t\t\t}\n//\t\t\t\telse {\n/*\n\t\t\t\t\t$item->url = str_replace(FRAMEWORK_PATH.'/admin', \"\", $url);\n\t\t\t\t\t$item->url = str_replace(GLOBAL_PATH.'/admin', \"\", $item->url);\n\t\t\t\t\t$item->url = str_replace(REGIONAL_PATH.'/admin', \"\", $item->url);\n*/\n//\t\t\t\t}\n\n\t\t\t\t$item->id = $id;\n\t\t\t\t$item->children = $children;\n\t\t\t\t$items[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $actual_content ? $items : false;\n\t}", "public function getNavigation() {\n \n $search = $this->search();\n $menuObjects = $search->getRecords();\n $result = array();\n $fields = $this->definition->fields();\n $menuItemField = FieldService::instance()->getFieldByName($fields, \"menuItems\");\n \n //$search->getRelationsForObjects(\"menuItems\", $menuObjects);\n \n foreach($menuObjects as $menuObject) {\n $result[$menuObject->name] = $search->getRelations($menuItemField, $menuObject->id);\n }\n \n return $result;\n }", "public function renderNav() {\n if($this->renderNav['onoff']) {\n \n if(isset($this->renderNav['html']) && $this->renderNav['html']) {\n $content = $this->renderNav['html'];\n unset($this->renderNav['html']);\n } else {\n $ct['btnAddNav'] = $this->btnAddNav;\n $ct['btnAddMultiNav'] = $this->btnAddMultiNav;\n $ct['btnDeleteNav'] = $this->btnDeleteNav;\n $ct['btnCopyNav'] = $this->btnCopyNav;\n $result = '';\n $get = r()->get();\n foreach($ct as $key => $item) {\n if($item && isset($item['onoff']) && $item['onoff']) {\n unset($item['onoff']);\n if(isset($item['href'])) {\n $href = $item['href'];\n unset($item['href']);\n } else {\n $params = isset($get['SettingsGridSearch']['table_id']) ? $get : [];\n $params['menu_admin_id'] = $this->menu_admin_id;\n $href = UtilityUrl::createUrl($item['link_children'],$params);\n }\n $html = $item['icon'].$item['html'];unset($item['html']);unset($item['icon']);unset($item['link_children']);\n $result .= Html::a($html, $href, $item).' ';\n }\n }\n $content = '<div class=\"fr\">'.$result.'</div>';\n }\n unset($this->renderNav['onoff']);\n $html = Html::tag('div',$content.$this->renderNavLeft, $this->renderNav);\n return $html;\n } else {\n return '';\n }\n }", "private function _getNavigation()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVar( 'task' );\r\n\t\t$uri->delVar( 'submit' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action ) {\r\n\t\t\t\tif ( array_key_exists( 'task', $whmcs->input ) ) {\r\n\t\t\t\t\tif ( $whmcs->input['task'] != 'edittheme' ) {\r\n\t\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\t\tcontinue;\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\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "public function execute() {\n\t\tglobal $Logoshow;\n\t\tglobal $SearchBar;\n\n\t\t// Build additional attributes for navigation urls\n\t\t$nav = $this->data['content_navigation'];\n\n\t\tif ( $this->config->get( 'VectorUseIconWatch' ) ) {\n\t\t\t$mode = $this->getSkin()->getUser()->isWatched( $this->getSkin()->getRelevantTitle() )\n\t\t\t\t? 'unwatch'\n\t\t\t\t: 'watch';\n\n\t\t\tif ( isset( $nav['actions'][$mode] ) ) {\n\t\t\t\t$nav['views'][$mode] = $nav['actions'][$mode];\n\t\t\t\t$nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' );\n\t\t\t\t$nav['views'][$mode]['primary'] = true;\n\t\t\t\tunset( $nav['actions'][$mode] );\n\t\t\t}\n\t\t}\n\n\t\t$xmlID = '';\n\t\tforeach ( $nav as $section => $links ) {\n\t\t\tforeach ( $links as $key => $link ) {\n\t\t\t\tif ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) {\n\t\t\t\t\t$link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' );\n\t\t\t\t}\n\n\t\t\t\t$xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID;\n\t\t\t\t$nav[$section][$key]['attributes'] =\n\t\t\t\t\t' id=\"' . Sanitizer::escapeId( $xmlID ) . '\"';\n\t\t\t\tif ( $link['class'] ) {\n\t\t\t\t\t$nav[$section][$key]['attributes'] .=\n\t\t\t\t\t\t' class=\"' . htmlspecialchars( $link['class'] ) . '\"';\n\t\t\t\t\tunset( $nav[$section][$key]['class'] );\n\t\t\t\t}\n\t\t\t\tif ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tLinker::tooltip( $xmlID );\n\t\t\t\t} else {\n\t\t\t\t\t$nav[$section][$key]['key'] =\n\t\t\t\t\t\tXml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->data['namespace_urls'] = $nav['namespaces'];\n\t\t$this->data['view_urls'] = $nav['views'];\n\t\t$this->data['action_urls'] = $nav['actions'];\n\t\t$this->data['variant_urls'] = $nav['variants'];\n\n\t\t// Reverse horizontally rendered navigation elements\n\t\tif ( $this->data['rtl'] ) { \n\t\t\t$this->data['view_urls'] =\n\t\t\t\tarray_reverse( $this->data['view_urls'] );\n\t\t\t$this->data['namespace_urls'] =\n\t\t\t\tarray_reverse( $this->data['namespace_urls'] );\n\t\t\t$this->data['personal_urls'] =\n\t\t\t\tarray_reverse( $this->data['personal_urls'] );\n\t\t}\n\t\t$personalTools = $this->getPersonalTools();\n\t\tforeach ( $personalTools as $key => $item ) {\n\t\t\tif ( $key !== 'notifications' ) {\n\t\t\t\t$this->mPersonalTools .= $this->makeListItem( $key, $item );\n\t\t\t} else {\n\t\t\t\t$this->mPersonalToolsEcho .= $this->makeListItem( $key, $item );\n\t\t\t}\n\t\t}\n\t\t// Output HTML Page\n\t\t$this->html( 'headelement' );\n?>\n <style>\n body {\nheight:100%;\n }\n html {\nheight:100%;\n }\n\t\thtml,\n\t\tbody {\n\t\t\tmargin: 0px 0px 0px 0px ;\n\t\t\tpadding: 0px 0px 0px 0px ;\nheight:100%;\n\t\t\t}\n\t\t#top-tile-bar {\n\t\t\tbackground:transparent ;\n\t\t\tleft: 0px ;\n\t\t\theight: 200px;\n\t\t\tposition: fixed ;\n\t\t\tz-index:100 ;\n\t\t\t}\n.tilebar {\nposition: fixed;\nleft: 0px;\ntop: 0px;\nright: 0px;\nbottom: 0px;\nalign:right;\ncolor:#fff;background:#1D1D1D;width:100%;height:400px;\ndisplay:block;\nz-index:102;\n}\n.tile:hover {\n outline: 3px #4A4A4A solid;\n}\n.onhoverbg:hover {\n background: #9F6F40;\n}\n.topleft {\n display: inline;\n position: relative;\n }\n .topright .hover {\n display: none;\n position: absolute;\n left:0;\n z-index: 2000;\n\theight:200px;\n }\n </style>\n\n <script>\nvar openDiv;\nfunction toggleDiv(divID) {\n $(\"#\" + divID).fadeToggle(150, function() {\n openDiv = $(this).is(':visible') ? divID : null;\n });\n}\n$(document).click(function(e) {\n if (!$(e.target).closest('#'+openDiv).length) {\n toggleDiv(openDiv);\n }\n});\n$(function () {\n $('.usermenu > div').toggleClass('no-js js');\n $('.usermenu .js div').hide();\n $('.usermenu .js').click(function(e) {\n $('.usermenu .js div').fadeToggle(150);\n $('.usermenu').toggleClass('active');\n e.stopPropagation();\n });\n $(document).click(function() {\n if ($('.usermenu .js div').is(':visible')) {\n $('.usermenu .js div', this).fadeOut(150);\n $('.usermenu').removeClass('active');\n }\n });\n});\n\n$(function () {\n $('.actionmenu > div').toggleClass('no-js js');\n $('.actionmenu .js div').hide();\n $('.actionmenu .js').click(function(e) {\n $('.actionmenu .js div').fadeToggle(150);\n $('.clicker').toggleClass('active');\n e.stopPropagation();\n });\n $(document).click(function() {\n if ($('.actionmenu .js div').is(':visible')) {\n $('.actionmenu .js div', this).fadeOut(150);\n $('.clicker').removeClass('active');\n }\n });\n});\n </script>\n<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:700' defer=\"defer\" rel='stylesheet' type='text/css'>\n<meta name=\"msapplication-TileImage\" content=\"http://www.pidgi.net/new/public/images/pidgiwiki.png\"/>\n<meta name=\"msapplication-TileColor\" content=\"#BE0027\"/>\n<script src=\"http://files.pidgi.net/overthrow.js\"></script>\n\t\t<div id=\"mw-page-base\" class=\"noprint\"></div>\n\t\t<div id=\"mw-head-base\" class=\"noprint\"></div>\n\t\t<div id=\"content\" class=\"mw-body\" class=\"overthrow\" role=\"main\">\n\t\t\t<a id=\"top\"></a>\n\n\t\t\t<?php\n\t\t\tif ( $this->data['sitenotice'] ) {\n\t\t\t\t?>\n\t\t\t\t<div id=\"siteNotice\"><?php $this->html( 'sitenotice' ) ?></div>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<h1 id=\"firstHeading\" class=\"firstHeading\" lang=\"<?php\n\t\t\t$this->data['pageLanguage'] =\n\t\t\t\t$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();\n\t\t\t$this->text( 'pageLanguage' );\n\t\t\t?>\"><span dir=\"auto\"><?php $this->html( 'title' ) ?></span></h1>\n\t\t\t<?php $this->html( 'prebodyhtml' ) ?>\n\t\t\t<div id=\"bodyContent\" class=\"mw-body-content\">\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['isarticle'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"siteSub\"><?php $this->msg( 'tagline' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div id=\"contentSub\"<?php\n\t\t\t\t$this->html( 'userlangattributes' )\n\t\t\t\t?>><?php $this->html( 'subtitle' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['undelete'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"contentSub2\"><?php $this->html( 'undelete' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['newtalk'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"usermessage\"><?php $this->html( 'newtalk' ) ?></div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div id=\"jump-to-nav\" class=\"mw-jump\">\n\t\t\t\t\t<?php $this->msg( 'jumpto' ) ?>\n\t\t\t\t\t<a href=\"#mw-navigation\"><?php\n\t\t\t\t\t\t$this->msg( 'jumptonavigation' )\n\t\t\t\t\t\t?></a><?php\n\t\t\t\t\t$this->msg( 'comma-separator' )\n\t\t\t\t\t?>\n\t\t\t\t\t<a href=\"#p-search\"><?php $this->msg( 'jumptosearch' ) ?></a>\n\t\t\t\t</div>\n\t\t\t\t<?php $this->html( 'bodycontent' ) ?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['printfooter'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"printfooter\">\n\t\t\t\t\t\t<?php $this->html( 'printfooter' ); ?>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['catlinks'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->html( 'catlinks' );\n\t\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n<br clear=\"all\" />\n\t\t<div id=\"footer\" role=\"contentinfo\"<?php $this->html( 'userlangattributes' ) ?>>\n<hr />\n\t\t\t<?php\n\t\t\tforeach ( $this->getFooterLinks() as $category => $links ) {\n\t\t\t\t?>\n\t\t\t\t<ul id=\"footer-<?php\n\t\t\t\techo $category\n\t\t\t\t?>\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $links as $link ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li id=\"footer-<?php\n\t\t\t\t\t\techo $category\n\t\t\t\t\t\t?>-<?php\n\t\t\t\t\t\techo $link\n\t\t\t\t\t\t?>\"><?php\n\t\t\t\t\t\t\t$this->html( $link )\n\t\t\t\t\t\t\t?></li>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<?php $footericons = $this->getFooterIcons( \"icononly\" );\n\t\t\tif ( count( $footericons ) > 0 ) {\n\t\t\t\t?>\n\t\t\t\t<ul id=\"footer-icons\" class=\"noprint\">\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $footericons as $blockName => $footerIcons ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li id=\"footer-<?php\n\t\t\t\t\t\techo htmlspecialchars( $blockName ); ?>ico\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tforeach ( $footerIcons as $icon ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo $this->getSkin()->makeFooterIcon( $icon );\n\t\t\t\t\t\t\t\t?>\n\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t\t<div style=\"clear:both\"></div>\n\t\t</div>\n\t\t\t\t<?php\n\t\t\t\tif ( $this->data['dataAfterContent'] ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->html( 'dataAfterContent' );\n\t\t\t\t\t?>\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div class=\"visualClear\"></div>\n\t\t\t\t<?php $this->html( 'debughtml' ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<div id=\"mw-navigation\">\n\t\t\t<h2><?php $this->msg( 'navigation-heading' ) ?></h2>\n\n\t\t<div id=\"mw-head\">\n\t\t\t<div class=\"vectorMenu\" style=\"float:right;background-image:none;vertical-align:middle;height:40px;padding-left:10px;padding-right:10px;position:relative;top:0px;right:10px;width:auto;text-align:right;\">\n<a href=\"#\" style=\"text-decoration:none;\"><span id=\"username-top\"><?php\nif ($_SERVER[\"REMOTE_ADDR\"] == htmlspecialchars($this->getSkin()->getUser()->getName())) {\necho \"Guest\";\n}\nelse {\necho htmlspecialchars( $this->getSkin()->getUser()->getName() );\n}\n ?><span style=\"word-spacing:4px;\"> </span><img style=\"position:relative;top:-1px;\" src=\"<?php\n$default = 'http://www.pidgi.net/wiki/skins/metrolook/images/user-icon.png';\n$grav_url = 'http://www.gravatar.com/avatar/' . md5( strtolower( trim( $this->getSkin()->getUser()->getEmail() ) ) ) . '?d=' . urlencode ( $default ) . '&s=' . 20;\necho $grav_url;\n?>\" /></span></a>\n<div class=\"menu\" style=\"position:absolute;top:40px;right:0px;margin:0;width:200px;\">\n<?php $this->renderNavigation( 'PERSONAL' ); ?>\n</div>\n</div>\n<div id=\"echoNotifications\">\n\t<ul>\n\t<?php\n\t\techo $this->mPersonalToolsEcho;\n\t?>\n\t</ul>\n</div>\n<div style=\"padding-left:10px;\"><div class=\"lighthover\" style=\"height:40px;float:left;\"><div class=\"onhoverbg\" style=\"height:40px;float:left;\"><h4 class=\"title-name\"><a href=\"<?php echo $this->data['nav_urls']['mainpage']['href']; ?>\"><div class=\"title-name\" style=\"font-size: 0.9em; padding-left:0.4em;padding-right:0.4em;color:white;max-width: auto;height:auto; max-height:700px; display: inline-block; vertical-align:middle;\"><?php echo $GLOBALS['wgSitename'] ?></div></a></h4></div><img src=\"http://images.pidgi.net/line.png\" style=\"float:left;\" /><div class=\"onhoverbg\" style=\"height:40px;float:left;\"><img src=\"http://images.pidgi.net/downarrow.png\" style=\"cursor:pointer;\" onclick=\"toggleDiv('bartile');\"></div></div></div>\n\t<div id=\"top-tile-bar\" class=\"fixed-position\">\n\n<div style=\"vertical-align:top;align:left;\">\n<div class=\"topleft\">\n<div style=\"align:left;margin-left:auto;margin-right:auto;display:none;height:200px;\" class=\"tilebar\" id=\"bartile\"><div style=\"height:200px;display:table;\"><div style=\"vertical-align:middle;display:table-cell;padding-left:36px;\">\n<div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/wiki/\"><img src=\"http://images.pidgi.net/pidgiwikitiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/press/\"><img src=\"http://images.pidgi.net/pidgipresstiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.pidgi.net/jcc/\"><img src=\"http://images.pidgi.net/jcctiletop.png\" /></a></span></div><div style=\"float:left;padding:5px;\"><span class=\"tile\"><a href=\"http://www.petalburgwoods.com/\"><img src=\"http://images.pidgi.net/pwntiletop.png\" /></a></span></div>\n\n</div></div></div>\n</div>\n\n</div></div>\n\t\t\t<div id=\"left-navigation\">\n\t\t\t\t<a href=\"<?php echo $this->data['nav_urls']['upload']['href']; ?>\"><div class=\"onhoverbg\" style=\"padding-left:0.8em;padding-right:0.8em;float:left;height:40px;font-size:10pt;\"><img src=\"http://images.pidgi.net/uploadlogo.png\" /> <span style=\"color:#fff;position:relative;top:1px;\"><?php $this->msg('uploadbtn') ?></span></div></a><?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS', 'VIEWS', 'ACTIONS' ) ); ?>\n\t\t\t</div>\n\t\t\t<div id=\"right-navigation\">\n\t\t\t\t<?php if ( $SearchBar ): ?>\n\t\t\t\t<?php $this->renderNavigation( array( 'SEARCH' ) ); ?>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php endif; ?>\t\n\t\t\t</div>\n\t\t</div>\n\t\t <?php if ( $SearchBar ): ?>\n\t\t\t<div id=\"mw-panel\">\n\t\t\t<?php else: ?>\n\t\t\t<div id=\"mw-panel-custom\">\n\t\t\t<?php endif; ?>\t\n\t\t\t\t<?php if ( $Logoshow ): ?>\n\t\t\t\t<div id=\"p-logo\" role=\"banner\"><a style=\"background-image: url(<?php\n\t\t\t\t\t$this->text( 'logopath' )\n\t\t\t\t\t?>);\" href=\"<?php\n\t\t\t\t\techo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] )\n\t\t\t\t\t?>\" <?php\n\t\t\t\t\techo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) )\n\t\t\t\t\t?>></a></div>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php if ( $SearchBar ): ?>\n\t\t\t\t<?php $this->renderPortals( $this->data['sidebar'] ); ?>\n\t\t\t\t<?php else: ?>\n\t\t\t\t<?php $this->renderNavigation( array( 'SEARCH' ) ); ?>\n\t\t\t\t<?php $this->renderPortals( $this->data['sidebar'] ); ?>\n\t\t\t\t<?php endif; ?>\t\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php $this->printTrail(); ?>\n\n\t</body>\n</html>\n\n <?php\n }", "private function PH_PageMenu(){\n $site_menu = self::$xvi_api->GetSiteMenu();\n $page_menu = self::$xvi_api->GetPageMenu();\n \n $menu =\"\";\n foreach($site_menu as $menu_item=>$menu_path) {\n if (strcmp($menu_item,$page_menu[\"item\"])) { /*not selected menu item*/\n $menu .= \"<li><a href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n } else { /* it is selected menu*/\n $menu .= \"<li><a class=\\\"sel\\\" href=\\\"\".$menu_path.\"\\\"<span></span>\".$menu_item.\"</a></li>\";\n }\n }\n return $menu;\n }", "public function moduleNavigation() {\n\t\t$out = '';\n\t\tif($modules = DataObject::get('WorkflowCategory', '', 'priority ASC')) {\n\t\t\tforeach ($modules as $module) {\n\t\t\t\tif (Permission::check(strtoupper(str_replace(\" \", \"_\", $module->name)))) {\n\t\t\t\t\t$icon = '';\n\t\t\t\t\tif($image = DataObject::get_by_id('Image', $module->imageID)) {\n\t\t\t\t\t\tif($smImage = $image->setSize(16,16)) {\n\t\t\t\t\t\t\t$icon = $smImage->URL;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($module->module == null) {\n\t\t\t\t\t\t$out .= \"\n\t\t\t\t\t\t, new Ext.Button({\n\t\t\t\t\t\t\tcls: 'x-toolbar',\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\ttext: '{$module->name}', \n\t\t\t\t\t\t\ticon: '{$icon}',\n\t\t\t\t\t\t\thandler: function(){\n\t\t\t\t\t\t\t\tfor (var i=0; i<subNavigationHolder.items.items.length; i++) {\n\t\t\t\t\t\t\t\t\tsubNavigationHolder.items.items[i].hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\".str_replace(\" \", \"_\",$module->name.\"Panel\").\".show();\n\t\t\t\t\t\t\t\tfor (var i=0; i<Ext.getCmp('centerWorkflowHolder').items.items.length; i++) {\n\t\t\t\t\t\t\t\t\tExt.getCmp('centerWorkflowHolder').items.items[i].hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t{$module->action}\n\t\t\t\t\t\t\t\tExt.getCmp('main').doLayout();\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\t$out .= \"\n\t\t\t\t\t\t, new Ext.Button({\n\t\t\t\t\t\t\tcls: 'x-toolbar',\n\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\ttext: '{$module->name}', \n\t\t\t\t\t\t\ticon: '{$icon}',\n\t\t\t\t\t\t\thandler: function(){\n\t\t\t\t\t\t\t\tfor (var i=0; i<subNavigationHolder.items.items.length; i++) {\n\t\t\t\t\t\t\t\t\tsubNavigationHolder.items.items[i].hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\".str_replace(\" \", \"_\",$module->name.\"Panel\").\".show();\n\t\t\t\t\t\t\t\tfor (var i=0; i<Ext.getCmp('centerWorkflowHolder').items.items.length; i++) {\n\t\t\t\t\t\t\t\t\tExt.getCmp('centerWorkflowHolder').items.items[i].hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t{$module->getNavigation()}\n\t\t\t\t\t\t\t\tExt.getCmp('main').doLayout();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public function registerNavigation()\n {\n $nexus = NexusSettings::instance();\n $iconSvg = '';\n\n if ($nexus->menu_icon_uploaded) {\n $iconSvg = $nexus->menu_icon_uploaded->getPath();\n } elseif (NexusSettings::get('menu_icon_text', '') == '') {\n $iconSvg = 'plugins/xitara/nexus/assets/images/icon-nexus.svg';\n }\n\n if (($label = NexusSettings::get('menu_text')) == '') {\n $label = 'xitara.nexus::lang.submenu.label';\n }\n\n return [\n 'nexus' => [\n 'label' => $label,\n 'url' => Backend::url('xitara/nexus/dashboard'),\n 'icon' => NexusSettings::get('menu_icon_text', 'icon-leaf'),\n 'iconSvg' => $iconSvg,\n 'permissions' => ['xitara.nexus.*'],\n 'order' => 50,\n ],\n ];\n }", "private function gen_nav_links()\n\t{\n\t\t$this->template->assign_block_vars('navlinks', array(\n\t\t\t'S_IS_CAT'\t\t=> true,\n\t\t\t'S_IS_LINK'\t\t=> false,\n\t\t\t'S_IS_POST'\t\t=> false,\n\t\t\t'FORUM_NAME'\t=> $this->user->lang('BLOG_MAIN'),\n\t\t\t'FORUM_ID'\t\t=> -1,\n\t\t\t'U_VIEW_FORUM'\t=> append_sid('blog'),\n\t\t));\n\t}", "public function getMenuItems() {\n\n $url = $this->urlHelper;\n $items = [];\n\n //Links Visible always to everyone logged in or not.\n //default Home page - no login required. \n\n /* $items[] = [\n 'id' => 'home',\n 'label' => 'Home',\n 'link' => $url('home')\n ]; */\n\n //add links here for pages that will be visible for all users logged-in or not.\n //you must adjust User\\Module.php (~line 85) onDispatch method to ignore calls for \n //the associated Controller and action or you will end up with an infinite loop.\n /*\n $items[] = [\n 'id' => 'about',\n 'label' => 'About',\n 'link' => $url('about')\n ];\n */\n\n $user = $this->authManager->getLoggedInUser();\n\n //BEGIN Authentication/Rendering Logic\n // Display \"Login\" menu item for not authorized user only. On the other hand,\n // display \"Admin\" and \"Logout\" menu items only for authorized users and any other links \n // that should be visible by logged-in users.\n if (!$user) {\n\n $items[] = [\n 'id' => 'login',\n 'label' => 'Sign in',\n 'link' => $url('login'),\n 'float' => 'right'\n ];\n } else {\n\n //render Customers link for all users with sales_attr_id value in users table\n if (!empty($user->getSales_attr_id())) {\n $items[] = [\n 'id' => 'customers',\n 'label' => 'Customers',\n 'data-ffm-salesperson' => $user->getFullName(),\n 'float' => 'static',\n 'link' => $url('customer', ['action' => 'view', 'id' => $user->getSales_attr_id()])\n ];\n }\n //only display admin drop down for admin users.\n $isAdmin = $this->authManager->isAdmin();\n if ($isAdmin) {\n $items[] = [\n 'id' => 'admin',\n 'label' => '<i class=\"ion-gear-a\"></i>',\n 'float' => 'right',\n 'dropdown' => [\n [\n 'id' => 'users',\n 'label' => 'Manage Users',\n 'link' => $url('users')\n ]\n ]\n ];\n }\n\n $settingsDropDownManageAccount = [\n 'id' => 'manage_account',\n 'label' => 'Manage Account',\n 'link' => $url('users', ['action' => 'edit', 'id' => $user->getId()])\n ];\n\n $settingsDropDownViewAccount = [\n 'id' => 'view_account',\n 'label' => 'View Account',\n 'link' => $url('application', ['action' => 'settings'])\n ];\n\n $settingsDropDownLogout = [\n 'id' => 'logout',\n 'label' => 'Logout',\n 'link' => $url('logout')\n ];\n\n $settingsDropDown = [];\n\n //only add the Manage Account link for Admins.\n if ($isAdmin) {\n $settingsDropDown[] = $settingsDropDownManageAccount;\n }\n\n $settingsDropDown[] = $settingsDropDownViewAccount;\n\n $settingsDropDown[] = $settingsDropDownLogout;\n\n $items[] = [\n 'id' => 'settings',\n 'label' => '<i class=\"ion-person\"></i>' . $user->getUsername(),\n 'float' => 'right',\n 'dropdown' => $settingsDropDown\n ];\n\n $loggedInItems = $this->getLoggedInItems();\n\n if ($loggedInItems)\n array_merge($items, $loggedInItems);\n\n // add items to right of settings in top right corner only for logged-in users here\n //Show Salespeople link only to Admin users\n if ($isAdmin) {\n\n $items[] = [\n 'id' => 'salespeople',\n 'label' => 'Salespeople',\n 'float' => 'static',\n 'link' => $url('salespeople', ['action' => 'index']),\n ];\n }\n }\n\n return $items;\n }", "protected function __construct(){\n $this->_navigation = $this->_markActive($this->_filter($this->_getPages()));\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function nav()\n {\n $PagesAdmin=new LaraPagesController;\n $PagesAdmin->modelId='media';\n return $PagesAdmin->nav();\n }", "function getReportsMenu(){\r\n $level=2;\r\n $hr=new HabilitationReport();\r\n $user=getSessionUser();\r\n //$allowedReport=array();\r\n $allowedCategory=array();\r\n $lst=$hr->getSqlElementsFromCriteria(array('idProfile'=>$user->idProfile, 'allowAccess'=>'1'), false);\r\n $res=array();\r\n $listCateg=SqlList::getList('ReportCategory');\r\n $idMenuReport=SqlElement::getSingleSqlElementFromCriteria('Navigation', array('name'=>'navReports'));\r\n $menuReport=SqlElement::getSingleSqlElementFromCriteria('Menu', array('name'=>'menuReports'));\r\n foreach ($lst as $h) {\r\n $report=$h->idReport;\r\n $nameReport=SqlList::getNameFromId('Report', $report, false);\r\n if (! Module::isReportActive($nameReport)) continue;\r\n //$allowedReport[$report]=$report;\r\n $category=SqlList::getFieldFromId('Report', $report, 'idReportCategory',false);\r\n $allowedCategory[$category]=$category;\r\n }\r\n $c=1;\r\n $lstIdCate=array();\r\n $idReportMenu=$idMenuReport->id.$level.$menuReport->id;\r\n $menuReportKey=$level.'-'.numericFixLengthFormatter($idMenuReport->id,5).'-'.numericFixLengthFormatter($c,5);\r\n $object= array('id'=>$idReportMenu,'name'=>$menuReport->name,'idParent'=>$idMenuReport->id,'idMenu'=>$menuReport->id);\r\n $res[$menuReportKey]=array('level'=>$level,'objectType'=>'reportDirect','object'=>$object);\r\n foreach ($listCateg as $id=>$name) {\r\n if (isset($allowedCategory[$id])) {\r\n $c++;\r\n $cat=new ReportCategory($id);\r\n $lstIdCate[]=$id;\r\n $idReport=$idMenuReport->id.$level.$id;\r\n $key=$level.'-'.numericFixLengthFormatter($idMenuReport->id,5).'-'.numericFixLengthFormatter($c,5);\r\n $obj= array('id'=>$idReport,'name'=>$cat->name,'idParent'=>$idMenuReport->id);\r\n $res[$key]=array('level'=>$level,'objectType'=>'report','object'=>$obj);\r\n }\r\n }\r\n //===================\r\n //=================== lis of all report dependant of this categoryies\r\n\r\n $level++;\r\n $reportDirect= new Report();\r\n $lstCatId=(empty($lstIdCate))?\"0\":\"0\".implode(\",\", $lstIdCate);\r\n $where=\" idReportCategory in (\".$lstCatId.\")\";\r\n $reportList= $reportDirect->getSqlElementsFromCriteria(null,false,$where,\"file\");\r\n $nameFile=SqlList::getList('Report','file');\r\n $lstReportName=array();\r\n $lstNewNavMenu=array();\r\n foreach ($nameFile as $idN=>$nameFile){\r\n $lstReportName[]=substr($nameFile, 0,strpos($nameFile, '.php'));\r\n }\r\n $countNameFil=array_count_values($lstReportName);\r\n foreach ($countNameFil as $name=>$val){\r\n if($val==1)unset($countNameFil[$name]);\r\n else $lstNewNavMenu[]=$name;\r\n }\r\n storReports($reportList,$res, $lstNewNavMenu,$idMenuReport, $level);\r\n return $res;\r\n \r\n}", "public function registerNavigation()\n {\n return [\n 'portfolio' => [\n 'label' => 'depcore.portfolio::lang.plugin.name',\n 'url' => Backend::url('depcore/portfolio/portfolioitems'),\n 'icon' => 'icon-briefcase',\n 'permissions' => ['depcore.portfolio.manage_portfolios'],\n 'order' => 500,\n 'sideMenu' => [\n 'items' => [\n 'label' => 'depcore.portfolio::lang.portfolioitem.label',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('depcore/portfolio/portfolioitems'),\n 'permissions' => ['depcore.portfolio.manage_portfolios'],\n ],\n 'create_portfolio' => [\n 'label' => 'depcore.portfolio::lang.portfolioitem.new',\n 'icon' => 'icon-plus',\n 'url' => Backend::url('depcore/portfolio/portfolioitems/create'),\n 'permissions' => ['depcore.portfolio.manage_portfolios'],\n ],\n 'categories' => [\n 'label' => 'depcore.portfolio::lang.category.label',\n 'icon' => 'icon-inbox',\n 'url' => Backend::url('depcore/portfolio/categories'),\n 'permissions' => ['depcore.portfolio.access_categories'],\n ],\n 'clients' => [\n 'label' => 'depcore.portfolio::lang.client.label',\n 'icon' => 'icon-user',\n 'url' => Backend::url('depcore/portfolio/clients'),\n 'permissions' => ['depcore.portfolio.access_clients']\n ],\n 'industries' => [\n 'label' => 'depcore.portfolio::lang.industry.label',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('depcore/portfolio/industries'),\n 'permissions' => ['depcore.portfolio.access_industries']\n ],\n 'settings' => [\n 'label' => 'depcore.portfolio::lang.menu.secondary.settings',\n 'icon' => 'icon-cog',\n 'url' => Backend::url('system/settings/update/depcore/portfolio/form'),\n 'permissions' => ['depcore.portfolio.access_settings']\n ],\n ], // side menu ends\n ],\n ];\n }", "function cicleinscription_extend_navigation(navigation_node $navref, stdclass $course, stdclass $module, cm_info $cm) {\n\treturn false;\n}", "public function index() {\n //$this->data['page'] = $this->page_m->get_by_original(array('slug' => (string) $this->uri->segment(1)), TRUE);\n //count($this->data['page']) || show_404(current_url());\n\n $this->data['error_messages'] = '';\n $this->data['succes_messages'] = '';\n\n if($this->uri->segment(1) == '')\n {\n $this->data['page'] = $this->page_m->get(1);\n }\n else\n {\n $this->data['page'] = $this->page_m->get_by_original(array('slug' => (string) $this->uri->segment(1)), TRUE);\n }\n count($this->data['page']) || show_404(current_url());\n\n\n // Fetch the page data\n $method = '_' . $this->data['page']->template;\n $this->$method($this->data['page']->id);\n\n $this->data['menu_items'] = $this->page_m->get_nested(1);\n\n $this->load->model('interview_m');\n $interviews = $this->interview_m->get_interviews();\n\n $this->load->model('reportage_m');\n $reportages = $this->reportage_m->get_reportages();\n\n if($reportages[0]['datum'] > $interviews[0]['datum'])\n {\n $this->data['element'] = $reportages[0];\n $this->data['element']['id'] = $this->data['element']['reportage_id'];\n\n if($reportages[0]['type'] == '1')\n {\n $pagina = $this->page_m->get('32');\n $this->data['element']['detail_pagina'] = $pagina->slug;\n }\n if($reportages[0]['type'] == '2')\n {\n $pagina = $this->page_m->get('35');\n $this->data['element']['detail_pagina'] = $pagina->slug;\n }\n }\n else\n {\n $this->data['element'] = $interviews[0];\n $this->data['element']['id'] = $this->data['element']['interview_id'];\n\n if($interviews[0]['type'] == '1')\n {\n $pagina = $this->page_m->get('31');\n $this->data['element']['detail_pagina'] = $pagina->slug;\n }\n if($interviews[0]['type'] == '2')\n {\n $pagina = $this->page_m->get('34');\n $this->data['element']['detail_pagina'] = $pagina->slug;\n }\n }\n\n $this->data['plugins'] = $this->getPlugins();\n\n $this->data[\"extra_js\"] .= '\n <script>\n\t\t$(document).ready(function() {\n\n\t\t\t$(\"#main-slider\").owlCarousel({\n\n\t\t\t\tautoPlay: 2000, //Set AutoPlay to 3 seconds\n\t\t\t\tnavigation : true,\n\t\t\t\tnavigationText: [\"<i class=\\'fa fa-arrow-left left\\' aria-hidden=\\'true\\'></i>\",\"<i class=\\'fa fa-arrow-right right\\' aria-hidden=\\'true\\'></i>\"],\n\t\t\t\titems : 1,\n\t\t\t\titemsDesktop : [1199,1],\n\t\t\t\titemsDesktopSmall : [979,1]\n\n\t\t\t});\n\n\t\t});\n\t</script>\n ';\n\n // Load the view\n $this->data['subview'] = $this->data['page']->template;\n $this->load->view('_main_layout', $this->data);\n }", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "function print_navigation($site, $title){\n $i = 0;\n $fout = '<div class=\"profile_menu\">\n <div class=\"container\">\n <span vr-control id=\"span-show-nav\" class=\"profile_menu_item show_all selected\" ><a>'.$title.'</a>\n <div class=\"fr nav_button\" alt=\"'.lang(\"Show navigation\").'\">&nbsp;</div> \n </span>';\n $fout .= '\n <span vr-control id=\"profile_menu_span_'.$i.'\" class=\"profile_menu_item '.($title == lang(\"Products\")?'selected':'').'\" onClick=\\'document.getElementById(\"profile_menu_link_'.$i.'\").click();\\'>'\n . '<a vr-control id=\"profile_menu_link_'.$i++.'\" href=\"'.$_SERVER[\"DIR\"].'/product\">'. lang(\"Products\").'</a></span>';\n $query = 'SELECT * FROM `nodes_product_data` WHERE `cat_id` = \"1\" AND `url` <> \"\" ORDER BY `order` DESC';\n $res = engine::mysql($query);\n while($data = mysqli_fetch_array($res)){\n $fout .= '\n <span vr-control id=\"profile_menu_span_'.$i.'\" class=\"profile_menu_item '.($title == $data[\"value\"]?'selected':'').'\" onClick=\\'document.getElementById(\"profile_menu_link_'.$i.'\").click();\\'>'\n . '<a vr-control id=\"profile_menu_link_'.$i++.'\" href=\"'.$_SERVER[\"DIR\"].'/product/'.$data[\"url\"].'\">'.$data[\"value\"].'</a></span>';\n }\n $fout .= '</div>'\n . '</div>';\n if($i) return $fout;\n}", "function scheduledreporting_component_addmenu()\n{\n $desturl = get_component_url_base(\"scheduledreporting\");\n\n $mi = find_menu_item(MENU_REPORTS, \"menu-reports-sectionend-myreports\", \"id\");\n if ($mi == null)\n return;\n\n $order = grab_array_var($mi, \"order\", \"\");\n if ($order == \"\")\n return;\n\n $reports = get_user_meta('0', 'scheduled_reports');\n ($reports) ? $reports = mb_unserialize($reports) : $reports = array();\n\n $num = count($reports);\n\n $neworder = $order + .01;\n\n // Add scheduled reports\n add_menu_item(MENU_REPORTS, array(\n \"type\" => \"menusection\",\n \"title\" => _(\"My Scheduled Reports\"),\n \"id\" => \"menu-reports-scheduledreportings\",\n \"order\" => $neworder,\n \"opts\" => array(\n \"id\" => \"scheduledreportings\",\n \"expanded\" => true,\n \"num\" => $num,\n \"url\" => $desturl . '/schedulereport.php',\n )\n ));\n\n $neworder += 0.01;\n\n foreach ($reports as $key => $r) {\n if (empty($r['dontdisplay'])) {\n add_menu_item(MENU_REPORTS, array(\n \"type\" => MENULINK,\n \"title\" => encode_form_val($r['name']),\n \"id\" => \"menu-reports-scheduledreporting-\".uniqid(),\n \"order\" => $neworder,\n \"opts\" => array(\n \"href\" => $desturl . \"/schedulereport.php?visit=1&id=\" . urlencode($key) . \"&nsp=\" . get_nagios_session_protector_id(),\n )));\n $neworder += .01;\n }\n }\n\n add_menu_item(MENU_REPORTS, array(\n \"type\" => \"menusectionend\",\n \"id\" => \"menu-reports-sectionend-scheduledreportings\",\n \"order\" => $neworder,\n \"title\" => \"\",\n \"opts\" => \"\"\n ));\n\n // Add management section if admin\n\n if (is_admin()) {\n add_menu_item(MENU_REPORTS, array(\n \"type\" => \"link\",\n \"title\" => _(\"Scheduled Reports\"),\n \"id\" => \"menu-reports-user-scheduled\",\n \"order\" => 501,\n \"opts\" => array(\n \"href\" => $desturl . \"/manage.php\"\n )\n ));\n add_menu_item(MENU_REPORTS, array(\n \"type\" => \"link\",\n \"title\" => _(\"Scheduled Reports History\"),\n \"id\" => \"menu-reports-user-scheduled-history\",\n \"order\" => 501.5,\n \"opts\" => array(\n \"href\" => $desturl . \"/history.php\"\n )\n ));\n }\n}", "function wp_get_associated_nav_menu_items($object_id = 0, $object_type = 'post_type', $taxonomy = '')\n {\n }", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function viewNav() {\n\t$view = new viewModel();\n\t$view->showNav();\t\n}", "private function _getNavigation()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'themer' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action && $task != 'edittheme' ) {\r\n\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "public function getAdminNavigation ()\n\t{\n\t\t// Navigation Menu Array\n\t\t$navigation = array(\n\t\t\t//1 => array('icon' => 'cus-house', 'text' => __('Dashboard', true), 'path' => '/admin/admin_top/'),\t\n\t\t\t2 => array('icon' => 'cus-cart', 'text' => __('Orders', true), 'path' => '/admin/admin_top/2', \n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-cart-go', 'text' => __('All Orders', true), 'path' => '/orders/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-user', 'text' => __('Customers', true), 'path' => '/customers/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-group', 'text' => __('Customers Groups', true), 'path' => '/groups_customers/admin/')\n\t\t\t\t)\t\t\t\n\t\t\t),\t\t\t\t\n\t\t\t3 => array('icon' => 'cus-table', 'text' => __('Contents', true), 'path' => '/admin/admin_top/3',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-book-add', 'text' => __('Categories/Products', true), 'path' => '/contents/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-database-refresh', 'text' => __('Import/Export', true), 'path' => '/import_export/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-page', 'text' => __('Pages', true), 'path' => '/contents/admin_core_pages/'),\n\t\t\t\t\t4 => array('icon' => 'cus-application-cascade', 'text' => __('Content Blocks', true), 'path' => '/global_content_blocks/admin/')\n\t\t\t\t)\n\t\t\t),\n\t\t\t4 => array('icon' => 'cus-paintbrush', 'text' => __('Layout', true), 'path' => '/admin/admin_top/4',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-layout', 'text' => __('Templates', true), 'path' => '/templates/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-palette', 'text' => __('Stylesheets', true), 'path' => '/stylesheets/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-layout-content', 'text' => __('Micro Templates', true), 'path' => '/micro_templates/admin/')\t\t\t\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t),\n\t\t\t5 => array('icon' => 'cus-cog', 'text' => __('Configurations', true), 'path' => '/admin/admin_top/5',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-cog-edit', 'text' => __('Store Settings', true), 'path' => '/configuration/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-lock', 'text' => __('License', true), 'path' => '/license/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-arrow-refresh', 'text' => __('Update', true), 'path' => '/update/admin/'),\n\t\t\t\t\t4 => array('icon' => 'cus-cart-edit', 'text' => __('Order status', true), 'path' => '/order_status/admin/'),\n\t\t\t\t\t5 => array('icon' => 'cus-report', 'text' => __('Payment Methods', true), 'path' => '/payment_methods/admin/'),\n\t\t\t\t\t6 => array('icon' => 'cus-box', 'text' => __('Shipping Methods', true), 'path' => '/shipping_methods/admin/'),\n\t\t\t\t\t7 => array('icon' => 'cus-calculator-add', 'text' => __('Tax Classes', true), 'path' => '/taxes/admin/'),\n\t\t\t\t\t8 => array('icon' => 'cus-calculator-edit', 'text' => __('Tax Rates', true), 'path' => '/tax_country_zone_rates/admin/0'),\n\t\t\t\t\t9 => array('icon' => 'cus-email-open', 'text' => __('Email Templates', true), 'path' => '/email_template/admin/'),\n\t\t\t\t\t10 => array('icon' => 'cus-comment-edit', 'text' => __('Answer Templates', true), 'path' => '/answer_template/admin/'),\n\t\t\t\t\t11 => array('icon' => 'cus-tag-blue-edit', 'text' => __('Attribute Templates', true), 'path' => '/attribute_templates/admin/'),\n\t\t\t\t\t12 => array('icon' => 'cus-tag-blue', 'text' => __('Product Labels', true), 'path' => '/labels/admin/')\n\t\t\t\t)\n\t\t\t),\t\n\t\t\t6 => array('icon' => 'cus-world', 'text' => __('Locale', true), 'path' => '/admin/admin_top/6',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-table-edit', 'text' => __('Currencies', true), 'path' => '/currencies/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-flag-green', 'text' => __('Languages', true), 'path' => '/languages/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-world-add', 'text' => __('Countries', true), 'path' => '/countries/admin/'),\n\t\t\t\t\t4 => array('icon' => 'cus-page-white-world', 'text' => __('Geo Zones', true), 'path' => '/geo_zones/admin/')\n\t\t\t\t)\n\t\t\t),\t\t\t\t\t\n\t\t\t7 => array('icon' => 'cus-plugin', 'text' => __('Extensions', true), 'path' => '/admin/admin_top/7',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-plugin-add', 'text' => __('Modules', true), 'path' => '/modules/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-tag-blue', 'text' => __('Tags', true), 'path' => '/tags/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-tag-blue-add', 'text' => __('User Tags', true), 'path' => '/user_tags/admin/'),\n\t\t\t\t\t4 => array('icon' => 'cus-page-gear', 'text' => __('Events', true), 'path' => '/events/admin/'),\n\t\t\t\t)\n\t\t\t),\t\t\t\t\t\t\t\t\t\n\t\t\t8 => array('icon' => 'cus-group', 'text' => __('Account', true), 'path' => '/admin/admin_top/8',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-group-add', 'text' => __('Manage Accounts', true), 'path' => '/users/admin/'),\n\t\t\t\t\t2 => array('icon' => 'cus-group-edit', 'text' => __('My Account', true), 'path' => '/users/admin_user_account/'),\n\t\t\t\t\t3 => array('icon' => 'cus-group-key', 'text' => __('Prefences', true), 'path' => '/users/admin_user_preferences/'),\t\t\t\t\t\n\t\t\t\t\t4 => array('icon' => 'cus-group-go', 'text' => __('Logout', true), 'path' => '/users/admin_logout/')\t\t\t\t\t\n\t\t\t\t)\n\t\t\t),\t\t\t\t\t\t\n\t\t\t9 => array('icon' => 'cus-wrench', 'text' => __('Tools', true), 'path' => '/admin/admin_top/9',\n\t\t\t\t'children' => array(\n\t\t\t\t\t1 => array('icon' => 'cus-database-save', 'text' => __('Database Backup', true), 'path' => '/tools/admin_backup/'),\n\t\t\t\t\t2 => array('icon' => 'cus-chart-curve', 'text' => __('Sales Report', true), 'path' => '/reports/admin/'),\n\t\t\t\t\t3 => array('icon' => 'cus-comments', 'text' => __('Contact Us Messages', true), 'path' => '/contact_us/admin/'),\n\t\t\t\t\t4 => array('icon' => 'cus-zoom', 'text' => __('Search Log', true), 'path' => '/search_log/admin/')\n\t\t\t\t)\n\t\t\t),\n\t\t\t//10 => array('icon' => 'cus-application-go', 'text' => __('Launch Site', true), 'path' => '/', 'attributes' => array('target' => 'blank'))\n\t\t);\n\t\t\n\t\t// Add module navigation elements\n\t\tApp::import('Model', 'Module');\n\t\t$Module = new Module();\n\t\t\n\t\t$modules = $Module->find('all');\n\t\t\n\t\tforeach($modules AS $module)\n\t\t{\n\t\t\t$nav_level = $module['Module']['nav_level'];\n\t\t\tif ($nav_level > 0) {\n\t\t\t$navigation[$nav_level]['children'][] = array('icon' => $module['Module']['icon'], 'text' => ucfirst($module['Module']['name']), 'path' => '/module_' . $module['Module']['alias'] . '/admin/admin_index/', 'attributes' => array('class' => 'module'));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn($navigation);\n\t}", "function showNavigation() {\n $action = $this->action;\n $start = $this->start;\n $amount = $this->amount;\n $minamount = $this->minamount;\n $maxamount = $this->maxamount;\n $blogid = $this->blogid;\n $search = hsc($this->search);\n $itemid = $this->itemid;\n\n $prev = $start - $amount;\n if ($prev < $minamount) $prev=$minamount;\n\n $enable_cat_select = in_array($action , array('itemlist' , 'browseownitems'));\n if ($enable_cat_select)\n $catid = isset($_POST['catid']) ? max(0,intval($_POST['catid'])) : 0;\n\n // maxamount not used yet\n // if ($start + $amount <= $maxamount)\n $next = $start + $amount;\n // else\n // $next = $start;\n\n ?>\n <table class=\"navigation\">\n <tr><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"submit\" value=\"&lt;&lt; <?php echo _LISTS_PREV?>\" />\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $prev; ?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input name=\"amount\" size=\"3\" value=\"<?php echo $amount; ?>\" /> <?php echo _LISTS_PERPAGE?>\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $start; ?>\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"submit\" value=\"&gt; <?php echo _LISTS_CHANGE?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <?php if ($enable_cat_select) echo $this->getFormSelectCategoryBlog($action, $blogid , $catid); ?>\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"0\" />\n <input type=\"text\" name=\"search\" value=\"<?php echo $search; ?>\" size=\"16\" />\n <input type=\"submit\" value=\"&gt; <?php echo _LISTS_SEARCH?>\" />\n </div></form>\n </td><td>\n <form method=\"post\" action=\"index.php\"><div>\n <input type=\"submit\" value=\"<?php echo _LISTS_NEXT?> &gt; &gt;\" />\n <input type=\"hidden\" name=\"search\" value=\"<?php echo $search; ?>\" />\n <input type=\"hidden\" name=\"blogid\" value=\"<?php echo $blogid; ?>\" />\n <input type=\"hidden\" name=\"itemid\" value=\"<?php echo $itemid; ?>\" />\n <?php if ($enable_cat_select) echo '<input type=\"hidden\" name=\"catid\" value=\"' . $catid . '\" />'; ?>\n <input type=\"hidden\" name=\"action\" value=\"<?php echo $action; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $amount; ?>\" />\n <input type=\"hidden\" name=\"start\" value=\"<?php echo $next; ?>\" />\n </div></form>\n </td></tr>\n </table>\n <?php }", "public function nav()\n\t{\n\t\t$nav['dashboard'] = array('name' => Blocks::t('Dashboard'));\n\t\t$nav['content'] = array('name' => Blocks::t('Content'));\n\t\t$nav['assets'] = array('name' => Blocks::t('Assets'));\n\n\t\tif (Blocks::hasPackage(BlocksPackage::Users) && blx()->userSession->checkPermission('editUsers'))\n\t\t{\n\t\t\t$nav['users'] = array('name' => Blocks::t('Users'));\n\t\t}\n\n\t\t// Add any Plugin nav items\n\t\t$plugins = blx()->plugins->getPlugins();\n\n\t\tforeach ($plugins as $plugin)\n\t\t{\n\t\t\tif ($plugin->hasCpSection())\n\t\t\t{\n\t\t\t\t$lcHandle = strtolower($plugin->getClassHandle());\n\t\t\t\t$nav[$lcHandle] = array('name' => $plugin->getName());\n\n\t\t\t\t// Does the plugin have an icon?\n\t\t\t\t$resourcesPath = blx()->path->getPluginsPath().$lcHandle.'/resources/';\n\n\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-16x16.png'))\n\t\t\t\t{\n\t\t\t\t\t$nav[$lcHandle]['hasIcon'] = true;\n\n\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-16x16.png');\n\t\t\t\t\tblx()->templates->includeCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\n\t\t\t\t\t// Does it even have a hi-res version?\n\t\t\t\t\tif (IOHelper::fileExists($resourcesPath.'icon-32x32.png'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = UrlHelper::getResourceUrl($lcHandle.'/icon-32x32.png');\n\t\t\t\t\t\tblx()->templates->includeHiResCss(\"#sidebar #nav-{$lcHandle} { background-image: url('{$url}'); }\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->checkPermission('autoUpdateBlocks'))\n\t\t{\n\t\t\t$numberOfUpdates = blx()->updates->getTotalNumberOfAvailableUpdates();\n\n\t\t\tif ($numberOfUpdates > 0)\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'), 'badge' => $numberOfUpdates);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nav['updates'] = array('name' => Blocks::t('Updates'));\n\t\t\t}\n\t\t}\n\n\t\tif (blx()->userSession->isAdmin())\n\t\t{\n\t\t\t$nav['settings'] = array('name' => Blocks::t('Settings'));\n\t\t}\n\n\t\treturn $nav;\n\t}", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "function printItemNavbar( $text, $link, $actual, $index ) {\n\n // seta a classe\n $cl = $index == $actual ? 'active' : '';\n\n // imprime o item\n echo \"<a href='\".site_url( $link ).\"' class='nav-link $cl'>$text</a>\"; \n}", "public function addToMenu()\n\t{\n\t\t$content = sprintf(\n\t\t\t\"$%s = (\\$user->hasPermission(%d)) ? new Link(route('report.%s'), _('%s %s %s')) : new Node();\",\n\t\t\tcamel_case(str_replace('.', '_', $this->class)),\n\t\t\t$this->permission,\n\t\t\t$this->route,\n\t\t\t$this->class,\n\t\t\t$this->sufix,\n\t\t\t'TODO'\n\t\t);\n\n\t\treturn parent::addToMenu($content);\n\t}", "public function navigation() {\n if(!isset($this->navigationZamowienia)) {\n $RepoZamowienia = $this->doctrine->getRepository('MarcinAdminBundle:Zamowienia');\n $this->navigationZamowienia = $RepoZamowienia->getStatistics();\n }\n if(!isset($this->navigationUser)) {\n $RepoUser = $this->doctrine->getRepository('MarcinAdminBundle:Username');\n $this->navigationUser = $RepoUser->getUsernamecount();\n }\n// if(!isset($this->navigationPage)) {\n// $RepoPage = $this->doctrine->getRepository('TomSiteBundle:Page');\n// $this->navigationPage = $RepoPage->getStatistics();\n// }\n// if(!isset($this->navigationSlider)) {\n// $RepoSlider = $this->doctrine->getRepository('TomSiteBundle:Slider');\n// $this->navigationSlider = $RepoSlider->getStatistics();\n// }\n// if(!isset($this->navigationSugestion)) {\n// $RepoSugestion = $this->doctrine->getRepository('TomSiteBundle:Sugestion');\n// $this->navigationSugestion = $RepoSugestion->getStatistics();\n// }\n \n return $this->environment->render('MarcinAdminBundle:Template:navigation.html.twig', array(\n 'navigation' => array(\n 'zamowienia' => array(\n 'count' => $this->navigationZamowienia\n ),\n 'username' => array(\n 'count' => $this->navigationUser\n )\n// ,\n// 'page' => array(\n// 'count' => $this->navigationPage\n// ),\n// 'slider' => array(\n// 'count' => $this->navigationSlider\n// ),\n// 'sugestion' => array(\n// 'count' => $this->navigationSugestion\n// )\n )\n ));\n }", "public function registerNavigation() {\n\n return [\n 'elearning' => [\n 'label' => 'Goodworks Online Academy',\n 'url' => Backend::url('elearning/system/courses'),\n 'icon' => 'icon-university',\n 'permissions' => ['elearning.system.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'courses' => [\n 'label' => 'Courses',\n 'icon' => 'icon-cubes',\n 'url' => Backend::url('elearning/system/courses'),\n 'permissions' => ['elearning.system.*']\n ],\n 'levels' => [\n 'label' => 'Levels',\n 'icon' => 'icon-database',\n 'url' => Backend::url('elearning/system/levels'),\n 'permissions' => ['elearning.system.*']\n ],\n 'subjects' => [\n 'label' => 'Subjects',\n 'icon' => 'icon-sitemap',\n 'url' => Backend::url('elearning/system/subjects'),\n 'permissions' => ['elearning.system.*']\n ],\n 'lessons' => [\n 'label' => 'Lessons',\n 'icon' => 'icon-copy',\n 'url' => Backend::url('elearning/system/lessons'),\n 'permissions' => ['elearning.system.*']\n ],\n ]\n ],\n ];\n }", "function simple_history_print_nav() {\n\n\tglobal $wpdb;\n\t$tableprefix = $wpdb->prefix;\n\t\n\t// fetch all types that are in the log\n\tif (isset($_GET[\"simple_history_type_to_show\"])) {\n\t\t$simple_history_type_to_show = $_GET[\"simple_history_type_to_show\"];\n\t} else {\n\t\t$simple_history_type_to_show = \"\";\n\t}\n\n\t// Get all object types and object subtypes\n\t// order by the number of times they occur\n\t$sql = \"SELECT \n\t\t\t\tcount(object_type) AS object_type_count,\n\t\t\t\tobject_type, object_subtype \n\t\t\tFROM {$tableprefix}simple_history \n\t\t\tGROUP BY object_type, object_subtype\n\t\t\tORDER BY object_type_count DESC, object_type, object_subtype\n\t\t\";\n\t$arr_types = $wpdb->get_results($sql);\n\n\t$css = \"\";\n\tif (empty($simple_history_type_to_show)) {\n\t\t$css = \"class='selected'\";\n\t}\n\n\t// Reload-button\n\t$str_reload_button = sprintf('<a class=\"simple-fields-reload\" title=\"%1$s\" href=\"#\"><span>Reload</span></a>', esc_attr__(\"Reload history\", \"simple-history\"));\n\techo $str_reload_button;\n\n\t// Begin select\n\t$str_types_select = \"\";\n\t$str_types_select .= \"<select name='' class='simple-history-filter simple-history-filter-type'>\";\n\n\t$total_object_num_count = 0;\n\tforeach ( $arr_types as $one_type ) {\n\t\t$total_object_num_count += $one_type->object_type_count;\n\t}\n\n\t// First filter is \"all types\"\n\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", \"\"));\n\t$str_types_desc = __(\"All types\", 'simple-history');\n\n\t$str_types_select .= sprintf('<option data-simple-history-filter-type=\"\" data-simple-history-filter-subtype=\"\" value=\"%1$s\">%2$s (%3$d)</option>', $link, esc_html($str_types_desc), $total_object_num_count );\n\n\t// Loop through all types\n\t// $one_type->object_type = user | post | attachment | comment | plugin | attachment | post | Reply | Topic | Widget | Wordpress_core\n\t// $one_type->object_subtype = page | nav_menu_item | ...\n\t#sf_d($arr_types);\n\tforeach ($arr_types as $one_type) {\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif ($one_type->object_subtype && $simple_history_type_to_show == ($one_type->object_type.\"/\".$one_type->object_subtype)) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t} elseif (!$one_type->object_subtype && $simple_history_type_to_show == $one_type->object_type) {\n\t\t\t$css = \"class='selected'\";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// Create link to filter this type + subtype\n\t\t$arg = \"\";\n\t\tif ($one_type->object_subtype) {\n\t\t\t$arg = $one_type->object_type.\"/\".$one_type->object_subtype;\n\t\t} else {\n\t\t\t$arg = $one_type->object_type;\n\t\t}\n\t\t$link = esc_html(add_query_arg(\"simple_history_type_to_show\", $arg));\n\n\t\t// Begin option\n\t\t$str_types_select .= sprintf(\n\t\t\t'<option %1$s data-simple-history-filter-type=\"%2$s\" data-simple-history-filter-subtype=\"%3$s\" value=\"%4$s\">',\n\t\t\t$option_selected, // 1\n\t\t\t$one_type->object_type, // 2\n\t\t\t$one_type->object_subtype, // 3\n\t\t\t$link // 4\n\t\t);\n\t\t\n\t\t// Some built in types we translate with built in translation, the others we use simple history for\n\t\t// TODO: use WP-function to get all built in types?\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// Get built in post types\n\t\t$arr_built_in_post_types = get_post_types( array(\"_builtin\" => true) );\n\n\t\t$object_type_translated = \"\";\n\t\t$object_subtype_translated = \"\";\n\n\t\t// For built in types\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) ) {\n\t\t\t\n\t\t\t// Get name of main type\n\t\t\t$object_post_type_object = get_post_type_object( $one_type->object_type );\n\t\t\t$object_type_translated = $object_post_type_object->labels->name;\n\t\t\t\n\t\t\t// Get name of subtype\n\t\t\t$object_subtype_post_type_object = get_post_type_object( $one_type->object_subtype );\n\t\t\tif ( ! is_null( $object_subtype_post_type_object ) ) {\n\t\t\t\t$object_subtype_translated = $object_subtype_post_type_object->labels->name;;\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif ( empty( $object_type_translated ) ) {\n\t\t\t$object_type_translated = ucfirst( esc_html__( $one_type->object_type, \"simple-history\") );\n\t\t}\n\n\t\tif ( empty( $object_subtype_translated ) ) {\n\t\t\t$object_subtype_translated = ucfirst( esc_html__( $one_type->object_subtype, \"simple-history\") );\n\t\t}\n\t\t\n\t\t// Add name of type (post / attachment / user / etc.)\n\t\t\n\t\t// built in types use only subtype\n\t\tif ( in_array( $one_type->object_type, $arr_built_in_post_types ) && ! empty($object_subtype_translated) ) {\n\n\t\t\t$str_types_select .= $object_subtype_translated;\n\n\t\t} else {\n\t\t\t\n\t\t\t$str_types_select .= $object_type_translated;\n\n\t\t\t// And subtype, if different from main type\n\t\t\tif ($object_subtype_translated && $object_subtype_translated != $object_type_translated) {\n\t\t\t\t$str_types_select .= \"/\" . $object_subtype_translated;\n\t\t\t}\n\n\t\t}\n\t\t// Add object count\n\t\t$str_types_select .= sprintf(' (%d)', $one_type->object_type_count);\n\t\t\n\t\t// Close option\n\t\t$str_types_select .= \"\\n</option>\";\n\t\t\n\t\t// debug\n\t\t#$str_types .= \" type: \" . $one_type->object_type;\n\t\t#$str_types .= \" type: \" . ucfirst($one_type->object_type);\n\t\t#$str_types .= \" subtype: \" . $one_type->object_subtype. \" \";\n\t\t\n\t} // foreach arr types\n\n\t$str_types_select .= \"\\n</select>\";\n\n\t// Output filters\n\tif ( ! empty( $arr_types ) ) {\n\t\t// echo $str_types;\n\t\techo $str_types_select;\n\t}\n\n\t// fetch all users that are in the log\n\t$sql = \"SELECT DISTINCT user_id FROM {$tableprefix}simple_history WHERE user_id <> 0\";\n\t$arr_users_regular = $wpdb->get_results($sql);\n\tforeach ($arr_users_regular as $one_user) {\n\t\t$arr_users[$one_user->user_id] = array(\"user_id\" => $one_user->user_id);\n\t}\n\t\n\tif ( ! empty( $arr_users ) ) {\n\t\n\t\tforeach ($arr_users as $user_id => $one_user) {\n\t\t\t$user = get_user_by(\"id\", $user_id);\n\t\t\tif ($user) {\n\t\t\t\t$arr_users[$user_id][\"user_login\"] = $user->user_login;\n\t\t\t\t$arr_users[$user_id][\"user_nicename\"] = $user->user_nicename;\n\t\t\t\tif (isset($user->first_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"first_name\"] = $user->first_name;\n\t\t\t\t}\n\t\t\t\tif (isset($user->last_name)) {\n\t\t\t\t\t$arr_users[$user_id][\"last_name\"] = $user->last_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif (isset($arr_users) && $arr_users) {\n\n\t\tif (isset($_GET[\"simple_history_user_to_show\"])) {\n\t\t\t$simple_history_user_to_show = $_GET[\"simple_history_user_to_show\"];\n\t\t} else {\n\t\t\t$simple_history_user_to_show = \"\";\n\t\t}\n\n\t\t$str_users_select = \"\";\n\t\t$str_users_select .= \"<select name='' class='simple-history-filter simple-history-filter-user'>\";\n\n\t\t$css = \"\";\n\t\t$option_selected = \"\";\n\t\tif (empty($simple_history_user_to_show)) {\n\t\t\t$css = \" class='selected' \";\n\t\t\t$option_selected = \" selected \";\n\t\t}\n\n\t\t// All users\n\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", \"\"));\n\n\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" value=\"%3$s\" %2$s>%1s</option>', \n\t\t\t\t__(\"By all users\", 'simple-history'), // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t\"\" // 4\n\t\t\t);\n\n\t\tforeach ($arr_users as $user_id => $user_info) {\n\n\t\t\t$user = new WP_User($user_id);\n\t\t\tif ( ! $user->exists() ) continue;\n\n\t\t\t$link = esc_html(add_query_arg(\"simple_history_user_to_show\", $user_id));\n\t\t\t\n\t\t\t$css = \"\";\n\t\t\t$option_selected = \"\";\n\n\t\t\tif ($user_id == $simple_history_user_to_show) {\n\t\t\t\t$css = \" class='selected' \";\n\t\t\t\t$option_selected = \" selected \";\n\t\t\t}\n\n\t\t\t// all users must have username and email\n\t\t\t$str_user_name = sprintf('%1$s (%2$s)', esc_attr($user->user_login), esc_attr($user->user_email));\n\t\t\t// if ( ! empty( $user_info[\"first_name\"] ) $user_info[\"last_name\"] );\n\t\t\t\n\t\t\t$str_users_select .= sprintf(\n\t\t\t\t'<option data-simple-history-filter-user-id=\"%4$s\" %2$s value=\"%1$s\">%1$s</option>',\n\t\t\t\t$str_user_name, // 1\n\t\t\t\t$option_selected, // 2\n\t\t\t\t$link, // 3\n\t\t\t\t$user_id\n\t\t\t);\n\n\t\t}\n\n\t\t$str_users_select .= \"</select>\";\n\n\t\tif ( ! empty($str_users_select) ) {\n\t\t\techo $str_users_select;\n\t\t}\n\n\t}\n\t\n\t// search\n\t$str_search = __(\"Search\", 'simple-history');\n\t$search = \"<p class='simple-history-filter simple-history-filter-search'>\n\t\t<input type='text' />\n\t\t<input type='button' value='$str_search' class='button' />\n\t</p>\";\n\techo $search;\n\t\n}", "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}", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "function compileMenu() {\n\t\tglobal $page;\n\t\tSession::setMenu($page->getNavigationItems(0));\n\t}", "public function registerNavigation()\n {\n return [\n 'iklan' => [\n 'label' => 'Iklan',\n 'url' => Backend::url('panatausolusindo/iklan/iklan'),\n 'icon' => 'icon-diamond',\n 'permissions' => ['panatausolusindo.iklan.kelola_iklan'],\n 'order' => 500,\n 'sideMenu' => [\n 'iklan' => [\n 'label' => 'Daftar Iklan',\n 'icon' => 'icon-list',\n 'url' => Backend::url('panatausolusindo/iklan/iklan'),\n 'permissions' => ['panatausolusindo.iklan.kelola_iklan']\n ],\n 'client' => [\n 'label' => 'Client',\n 'icon' => 'icon-user',\n 'url' => Backend::url('panatausolusindo/iklan/clientiklan'),\n 'permissions' => ['panatausolusindo.iklan.kelola_iklan']\n ],\n 'tempat' => [\n 'label' => 'Tempat',\n 'icon' => 'icon-anchor',\n 'url' => Backend::url('panatausolusindo/iklan/tempatiklan'),\n 'permissions' => ['panatausolusindo.iklan.kelola_iklan']\n ]\n ]\n ],\n ];\n }", "function navigation (){\n}", "protected function menus()\n {\n\n }", "protected function getArrOutputNaviEntries() {\r\n\r\n $strOldAction = $this->getAction();\r\n $this->setAction($this->strOriginalAction);\r\n $arrPathLinks = parent::getArrOutputNaviEntries();\r\n $this->setAction($strOldAction);\r\n\r\n $arrPath = $this->getPathArray($this->getSystemid());\r\n \r\n // Render additional navigation path entries for child objects.\r\n foreach($arrPath as $strOneSystemid) {\r\n\r\n if(!validateSystemid($strOneSystemid))\r\n continue;\r\n\r\n $objInstance = class_objectfactory::getInstance()->getObject($strOneSystemid);\r\n if($objInstance != null) {\r\n $objEntry = $this->getOutputNaviEntry($objInstance);\r\n if($objEntry != null)\r\n $arrPathLinks[] = $objEntry;\r\n }\r\n \r\n }\r\n\r\n return $arrPathLinks;\r\n }", "public function exampleNavigation()\n {\n /*\n $config = array(\n array(\n 'label' => 'Home',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'index',\n ),\n\n array(\n 'label' => 'Coding Guidelines',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'guideslines',\n ),\n\n array(\n 'label' => 'Libraries',\n 'module' => 'example',\n 'controller' => 'index',\n 'action' => 'index',\n 'pages' => array(\n array(\n 'label' => 'Blueprint',\n 'module' => 'example',\n 'controller' => 'library',\n 'action' => 'blueprint',\n ),\n ),\n ),\n );\n\n $container = new Zend_Navigation($config);\n\t\t$this->setContainer($container);\n\n return $this;\n\n */\n $menus = array(\n\n '' => array(\n '/example' => 'Home',\n '/example/index/guideslines' => 'Coding Guidelines',\n ),\n\n 'Libraries' => array(\n //'/example/library/zend' => 'Zend Framework',\n '/example/library/blueprint' => 'Blueprint',\n '/example/library/mootools' => 'Mootools',\n ),\n\n 'Tools' => array(\n '/example/tools/debug' => 'Debug',\n '/example/tools/makefile' => 'MakeFile',\n ),\n\n 'CSS Elements' => array(\n '/example/css/menus' => 'Menus',\n '/example/css/buttons' => 'Fancy Buttons',\n '/example/css/box' => 'Round Box',\n ),\n\n 'JS Elements' => array(\n '/example/javascript/ajaxlink' => 'Ajax Link',\n '/example/javascript/ajaxform' => 'Ajax Form',\n '/example/javascript/lightbox' => 'LightBox',\n '/example/javascript/uwa' => 'UWA Widget',\n ),\n\n 'Form Elements' => array(\n '/example/form/index' => 'Showcases',\n '/example/form/fancyselect' => 'Fancy Select',\n '/example/form/dateselect' => 'Date Select',\n '/example/form/autocompleter' => 'Auto Completer',\n //'/example/form/rangeselect' => 'Range Select Element',\n //'/example/form/contactselect' => 'Contact List Element',\n ),\n\n 'View Helpers' => array(\n '/example/helper/geshi' => 'GeShi',\n '/example/helper/googleanalytics' => 'Google Analytics',\n ),\n\n 'Services' => array(\n '/example/service/xmlrpc' => 'Simple XMLRPC',\n ),\n\n 'Core Classes' => array(\n '/example/core/error' => 'Error Handler',\n '/example/core/controller' => 'Controller Abstract',\n '/example/core/archive' => 'Archive',\n '/example/core/template' => 'Template',\n '/example/core/notify' => 'Notify',\n '/example/core/stitem' => 'StItem/StCollection',\n '/example/core/dbitem' => 'DbItem/DbCollection',\n '/example/core/dbsearch' => 'DbSearch',\n ),\n );\n\n $xhtml = array();\n foreach ($menus as $menu => $links) {\n\n if (strlen($menu) > 0) {\n $xhtml[] = '<h4>' . $this->view->escape($menu) . '</h4>';\n }\n\n $xhtml[] = '<ul>';\n foreach ($links as $link => $label) {\n $xhtml[] = '<li><a href=\"' . $link . '\">' . $this->view->escape($label) . '</a></li>';\n }\n $xhtml[] = '</ul>';\n }\n\n return implode(\"\\n\", $xhtml);\n }", "function randomstrayquotes_extend_navigation(navigation_node $navref, stdClass $course, stdClass $module, cm_info $cm) {\n // TODO Delete this function and its docblock, or implement it.\n}", "public function filterAdminNavigationMain($nav)\n { \n $annotationCount = get_db()->getTable('AnnotationAnnotatedItems')->count();\n if($annotationCount > 0) {\n $uri = url('annotation/items');\n $label = __('Assisted Annotation');\n } else {\n $uri = url('annotation/index');\n $label = __('Assisted Annotation');\n } \n \n $nav[] = array(\n 'label' => $label,\n 'uri' => $uri,\n 'resource' => 'Annotation_Annotation',\n 'privilege' => 'browse'\n );\n return $nav;\n }", "function dllc_extend_navigation(navigation_node $navref, stdClass $course, stdClass $module, cm_info $cm) {\n // TODO Delete this function and its docblock, or implement it.\n}", "function get_nav_menu_locations()\n {\n }", "public function leftNavigation()\n\t{\n\t\t// Build hierarchies\n\t\t$hierarchies = $this->_toHierarchies(Admin_Auth::getInstance()->getNavigation()->toArray());\n\t\t$navigation = new Zend_Navigation($hierarchies);\n\t\t$this->_menu = $this->view->navigation($navigation)->menu();\n\t\t$this->_menu->setUlClass('nav');\n\t\t\n\t\t// Get current url\n\t\t$currentUrl = rtrim(Zend_Controller_Front::getInstance ()->getRequest ()->getRequestUri (), '/');\n\t\t\n\t\t// If current url not match with list urls\n\t\tif (!($currentPage = $navigation->findOneByUri ( $currentUrl ))) \n\t\t{\n\t\t\t// Put each element into an array.\n\t\t\t$segments = explode('/', $currentUrl);\n\t\t\t$count = count($segments);\n\t\t\tif ($count === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Separate url to sub-url\n\t\t\tfor ($i = 1; $i < $count; $i++)\n\t\t\t{\n\t\t\t\t$segments[$i] = ($segments[$i - 1] . '/' . $segments[$i]);\n\t\t\t}\n\t\t\t\n\t\t\t// Reverse order\n\t\t\t$segments = array_reverse($segments);\n\t\t\t\n\t\t\t// Check for an exact match\n\t\t\tforeach ($segments as $segment)\n\t\t\t{\n\t\t\t\t// Break out of the loop, we've found an exact match;\n\t\t\t\tif ($currentPage = $navigation->findOneByUri ( $segment ))\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($currentPage instanceof Zend_Navigation_Page_Uri)\n\t\t{\n\t\t // Set active\n\t\t $currentPage->setActive ( true );\n\t\t \t\n\t\t // Set active flag for own parent\n\t\t $currentPage = $currentPage->getParent ();\n\t\t while ( $currentPage instanceof Zend_Navigation_Page_Uri )\n\t\t {\n\t\t $currentPage->setActive ( true );\n\t\t $currentPage = $currentPage->getParent ();\n\t\t }\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function __buildNavigation(){\n\t\t\t$nav = array();\n\t\t\t$xml = simplexml_load_file(ASSETS . '/navigation.xml');\n\n\t\t\t// Loop over the default Symphony navigation file, converting\n\t\t\t// it into an associative array representation\n\t\t\tforeach($xml->xpath('/navigation/group') as $n){\n\n\t\t\t\t$index = (string)$n->attributes()->index;\n\t\t\t\t$children = $n->xpath('children/item');\n\t\t\t\t$content = $n->attributes();\n\n\t\t\t\t// If the index is already set, increment the index and check again.\n\t\t\t\t// Rinse and repeat until the index is not set.\n\t\t\t\tif(isset($nav[$index])){\n\t\t\t\t\tdo{\n\t\t\t\t\t\t$index++;\n\t\t\t\t\t}while(isset($nav[$index]));\n\t\t\t\t}\n\n\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t'name' => __(strval($content->name)),\n\t\t\t\t\t'index' => $index,\n\t\t\t\t\t'children' => array()\n\t\t\t\t);\n\n\t\t\t\tif(strlen(trim((string)$content->limit)) > 0){\n\t\t\t\t\t$nav[$index]['limit'] = (string)$content->limit;\n\t\t\t\t}\n\n\t\t\t\tif(count($children) > 0){\n\t\t\t\t\tforeach($children as $child){\n\t\t\t\t\t\t$item = array(\n\t\t\t\t\t\t\t'link' => (string)$child->attributes()->link,\n\t\t\t\t\t\t\t'name' => __(strval($child->attributes()->name)),\n\t\t\t\t\t\t\t'visible' => ((string)$child->attributes()->visible == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$limit = (string)$child->attributes()->limit;\n\t\t\t\t\t\tif(strlen(trim($limit)) > 0) $item['limit'] = $limit;\n\n\t\t\t\t\t\t$nav[$index]['children'][] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Build the section navigation, grouped by their navigation groups\n\t\t\t$sections = Symphony::Database()->fetch(\"SELECT * FROM `tbl_sections` ORDER BY `sortorder` ASC\");\n\t\t\tif(is_array($sections) && !empty($sections)){\n\t\t\t\tforeach($sections as $s){\n\n\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $s['navigation_group']);\n\n\t\t\t\t\tif($group_index === false){\n\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\n\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t'name' => $s['navigation_group'],\n\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t'children' => array()\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t$nav[$group_index]['children'][] = array(\n\t\t\t\t\t\t'link' => '/publish/' . $s['handle'] . '/',\n\t\t\t\t\t\t'name' => $s['name'],\n\t\t\t\t\t\t'type' => 'section',\n\t\t\t\t\t\t'section' => array('id' => $s['id'], 'handle' => $s['handle']),\n\t\t\t\t\t\t'visible' => ($s['hidden'] == 'no' ? 'yes' : 'no')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Loop over all the installed extensions to add in other navigation items\n\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\t\t\tforeach($extensions as $e){\n\t\t\t\t$info = Symphony::ExtensionManager()->about($e);\n\n\t\t\t\tif(isset($info['navigation']) && is_array($info['navigation']) && !empty($info['navigation'])){\n\t\t\t\t\tforeach($info['navigation'] as $item){\n\n\t\t\t\t\t\t$type = (isset($item['children']) ? Extension::NAV_GROUP : Extension::NAV_CHILD);\n\n\t\t\t\t\t\tswitch($type){\n\t\t\t\t\t\t\tcase Extension::NAV_GROUP:\n\n\t\t\t\t\t\t\t\t$index = General::array_find_available_index($nav, $item['location']);\n\n\t\t\t\t\t\t\t\t$nav[$index] = array(\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'index' => $index,\n\t\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tforeach($item['children'] as $child){\n\t\t\t\t\t\t\t\t\tif(!isset($child['relative']) || $child['relative'] == true){\n\t\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$link = '/' . ltrim($child['link'], '/');\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$nav[$index]['children'][] = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t\t'name' => $child['name'],\n\t\t\t\t\t\t\t\t\t\t'visible' => ($child['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($child['limit']) ? $child['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase Extension::NAV_CHILD:\n\n\t\t\t\t\t\t\t\tif(!isset($item['relative']) || $item['relative'] == true){\n\t\t\t\t\t\t\t\t\t$link = '/extension/' . $e . '/' . ltrim($item['link'], '/');\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\t$link = '/' . ltrim($item['link'], '/');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif(!is_numeric($item['location'])){\n\t\t\t\t\t\t\t\t\t// is a navigation group\n\t\t\t\t\t\t\t\t\t$group_name = $item['location'];\n\t\t\t\t\t\t\t\t\t$group_index = self::__navigationFindGroupIndex($nav, $item['location']);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// is a legacy numeric index\n\t\t\t\t\t\t\t\t\t$group_index = $item['location'];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$child = array(\n\t\t\t\t\t\t\t\t\t'link' => $link,\n\t\t\t\t\t\t\t\t\t'name' => $item['name'],\n\t\t\t\t\t\t\t\t\t'visible' => ($item['visible'] == 'no' ? 'no' : 'yes'),\n\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif ($group_index === false) {\n\t\t\t\t\t\t\t\t\t$group_index = General::array_find_available_index($nav, 0);\n\t\t\t\t\t\t\t\t\t// add new navigation group\n\t\t\t\t\t\t\t\t\t$nav[$group_index] = array(\n\t\t\t\t\t\t\t\t\t\t'name' => $group_name,\n\t\t\t\t\t\t\t\t\t\t'index' => $group_index,\n\t\t\t\t\t\t\t\t\t\t'children' => array($child),\n\t\t\t\t\t\t\t\t\t\t'limit' => (!is_null($item['limit']) ? $item['limit'] : null)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// add new location by index\n\t\t\t\t\t\t\t\t\t$nav[$group_index]['children'][] = $child;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * After building the Navigation properties array. This is specifically\n\t\t\t * for extensions to add their groups to the navigation or items to groups,\n\t\t\t * already in the navigation. Note: THIS IS FOR ADDING ONLY! If you need\n\t\t\t * to edit existing navigation elements, use the `NavigationPreRender` delegate.\n\t\t\t *\n\t\t\t * @deprecated This delegate is deprecated and will be removed in the next\n\t\t\t * major release of Symphony. Extensions are encouraged to use provide the\n\t\t\t * `fetchNavigation` method instead.\n\t\t\t * @delegate ExtensionsAddToNavigation\n\t\t\t * @param string $context\n\t\t\t * '/backend/'\n\t\t\t * @param array $navigation\n\t\t\t */\n\t\t\tSymphony::ExtensionManager()->notifyMembers(\n\t\t\t\t'ExtensionsAddToNavigation', '/backend/', array('navigation' => &$nav)\n\t\t\t);\n\n\t\t\t$pageCallback = Administration::instance()->getPageCallback();\n\n\t\t\t$pageRoot = $pageCallback['pageroot'] . (isset($pageCallback['context'][0]) ? $pageCallback['context'][0] . '/' : '');\n\t\t\t$found = self::__findActiveNavigationGroup($nav, $pageRoot);\n\n\t\t\t// Normal searches failed. Use a regular expression using the page root. This is less\n\t\t\t// efficient and should never really get invoked unless something weird is going on\n\t\t\tif(!$found) self::__findActiveNavigationGroup($nav, '/^' . str_replace('/', '\\/', $pageCallback['pageroot']) . '/i', true);\n\n\t\t\tksort($nav);\n\t\t\t$this->_navigation = $nav;\n\t\t}", "public function filterAdminNavigationMain($nav)\n {\n $nav[] = array(\n 'label' => __('Export'),\n 'uri' => url('export'),\n );\n return $nav;\n }", "function custom_nav_item( $menu, stdClass $args ){\n if ( 'primary' != $args->theme_location )\n\n return $menu; \n\t\t// $menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"dashicons dashicons-search\"></i>\n\t\t$menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"fa fa-search\"></i>\n\t\t\t\t<a href=\"#search-container\" class=\"screen-reader-text\"></a>\n\t\t\t\t</div>'; \n return $menu; \n}", "function myaccount_nav_setup()\n\t{\n\t\t// Check for the last_call\n\t\t$additional_nav = (ee()->extensions->last_call) ?\n\t\t\tee()->extensions->last_call :\n\t\t\tarray();\n\n\t\tee()->lang->loadfile($this->module);\n\t\treturn array_merge_recursive(\n\t\t\t$additional_nav,\n\t\t\tarray(\n\t\t\t\t'customize_cp' => array(\n\t\t\t\t\tlang('rte_prefs')\t=> array(\n\t\t\t\t\t\t'extension'\t=> 'rte',\n\t\t\t\t\t\t'method'\t=> 'myaccount_settings'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function hook_menu() {\n\n $items = array();\n \n // Add a notification page...\n $items['thumbwhere/content_collection_item/notify'] = array(\n 'title' => 'Notifications Callback for \"ContentCollectionItem\" Entity',\n 'page callback' => '_thumbwhere_content_collection_item_notify',\n 'access arguments' => array(\n 'send thumbwhere contentcollectionitem notifications'\n ),\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n ); \n \n $id_count = count(explode('/', $this->path));\n $wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%' . $this->entityType;\n\n $items[$this->path] = array(\n 'title' => 'ContentCollectionItem',\n 'description' => 'Add edit and update thumbwhere_contentcollectionitems.',\n 'page callback' => 'system_admin_menu_block_page',\n 'access arguments' => array('access administration pages'),\n 'file path' => drupal_get_path('module', 'system'),\n 'file' => 'system.admin.inc',\n );\n\n // Change the overview menu type for the list of thumbwhere_contentcollectionitems.\n $items[$this->path]['type'] = MENU_LOCAL_TASK;\n\n // Change the add page menu to multiple types of entities\n $items[$this->path . '/add'] = array(\n //'title' => 'Add a ContentCollectionItem',\n 'title' => 'Add',\n 'description' => 'Add a new ContentCollectionItem',\n 'page callback' => 'thumbwhere_contentcollectionitem_form_wrapper',\n 'page arguments' => array(thumbwhere_contentcollectionitem_create(array('type' => 'thumbwhere_contentcollectionitem'))),\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('edit', 'edit ' . 'thumbwhere_contentcollectionitem'),\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n );\n\n\n/*\n // Change the add page menu to multiple types of entities\n $items[$this->path . '/add'] = array(\n //'title' => 'Add a ContentCollectionItem',\n 'title' => 'Add',\n\t 'description' => 'Add a new ContentCollectionItem',\n 'page callback' => 'thumbwhere_contentcollectionitem_add_page',\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('edit'),\n 'type' => MENU_NORMAL_ITEM,\n 'weight' => 20,\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n\n );\n*/ \n/*\n $items[$this->path . '/add/' . 'thumbwhere_contentcollectionitem'] = array(\n 'title' => 'Add ' . 'ThumbWhereContentCollectionItem',\n 'page callback' => 'thumbwhere_contentcollectionitem_form_wrapper',\n 'page arguments' => array(thumbwhere_contentcollectionitem_create(array('type' => 'thumbwhere_contentcollectionitem'))),\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('edit', 'edit ' . 'thumbwhere_contentcollectionitem'),\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n );\n*/\n // Loading and editing thumbwhere_contentcollectionitem entities\n $items[$this->path . '/thumbwhere_contentcollectionitem/' . $wildcard] = array(\n 'page callback' => 'thumbwhere_contentcollectionitem_form_wrapper',\n 'page arguments' => array($id_count + 1),\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('edit', $id_count + 1),\n 'weight' => 0,\n 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n );\n $items[$this->path . '/thumbwhere_contentcollectionitem/' . $wildcard . '/edit'] = array(\n 'title' => 'Edit',\n 'type' => MENU_DEFAULT_LOCAL_TASK,\n 'weight' => -10,\n 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,\n );\n\n $items[$this->path . '/thumbwhere_contentcollectionitem/' . $wildcard . '/delete'] = array(\n 'title' => 'Delete',\n 'page callback' => 'thumbwhere_contentcollectionitem_delete_form_wrapper',\n 'page arguments' => array($id_count + 1),\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('edit', $id_count + 1),\n 'type' => MENU_LOCAL_TASK,\n 'context' => MENU_CONTEXT_INLINE,\n 'weight' => 10,\n 'file' => 'thumbwhere_contentcollectionitem.admin.inc',\n 'file path' => drupal_get_path('module', $this->entityInfo['module'])\n );\n\n // Menu item for viewing thumbwhere_contentcollectionitems\n $items['thumbwhere_contentcollectionitem/' . $wildcard] = array(\n //'title' => 'Title',\n 'title callback' => 'thumbwhere_contentcollectionitem_page_title',\n 'title arguments' => array(1),\n 'page callback' => 'thumbwhere_contentcollectionitem_page_view',\n 'page arguments' => array(1),\n 'access callback' => 'thumbwhere_contentcollectionitem_access',\n 'access arguments' => array('view', 1),\n 'type' => MENU_CALLBACK,\n );\n return $items;\n }", "function renderNav(PageArray $items, array $options = array()) {\n\n\tif(!count($items)) return '';\n\n\t$defaults = array(\n\t\t'fields' => array(), // array of other fields you want to display (title is assumed)\n\t\t'class' => '', // class for the <ul>\n\t\t'active' => 'active', // class for active item\n\t\t'dividers' => false, // add an <li class='divider'> between each item?\n\t\t'tree' => false, // render tree to reach current $page?\n\t\t);\n\n\t$options = array_merge($defaults, $options); \n\t$page = wire('page');\n\t$out = \"<ul class='$options[class]'>\";\n\t$divider = $options['dividers'] ? \"<li class='divider'></li>\" : \"\";\n\n\tforeach($items as $item) {\n\n\t\t// if this item is the current page, give it an 'active' class\n\t\t$class = $item->id == $page->id ? \" class='$options[active]'\" : \"\";\n\t\tif(($item->id > 1 && $page->parents->has($item)) || $page->id == $item->id) $class = \" class='active' \";\n\t\t// render linked item title\n\t\t$out .= \"$divider<li$class><a href='$item->url'>$item->title</a> \"; \n\n\t\t// render optional extra fields wrapped in named spans\n\t\tif(count($options['fields'])) foreach($options['fields'] as $name) {\n\t\t\t$out .= \"<span class='$name'>\" . $item->get($name) . \"</span> \";\n\t\t}\n\n\t\t// optionally render a tree recursively to current $page \n\t\tif($options['tree']) {\n\t\t\tif($page->parents->has($item) || $item->id == $page->id) {\n\t\t\t\t$out .= renderNav($item->children(\"limit=50\"), array(\n\t\t\t\t\t'fields' => $options['fields'],\n\t\t\t\t\t'tree' => true,\n\t\t\t\t\t)); \n\t\t\t}\n\t\t}\n\n\t\t$out .= \"</li>\";\n\t}\n\n\t$out .= \"</ul>\";\n\treturn $out; \t\n}", "public function registerNavigation()\n {\n\n return [\n 'food' => [\n 'label' => 'Food',\n 'url' => Backend::url('milo/food/foods'),\n 'icon' => 'icon-cutlery',\n 'permissions' => ['milo.food.*'],\n 'order' => 400,\n\n\t 'sideMenu' => [\n 'food' => [\n 'label' => 'Food',\n 'url' => Backend::url('milo/food/foods'),\n 'icon' => 'icon-cutlery',\n 'permissions' => ['milo.food.*'],\n ],\n\t \t'categories' => [\n\t\t\t 'label' => 'Food Categories',\n\t\t\t 'url' => Backend::url('milo/food/foodcategories'),\n\t\t\t 'icon' => 'icon-tags',\n\t\t\t 'permissions' => ['milo.food.*'],\n\t\t ],\n 'lunchoffer' => [\n 'label' => 'Lunch Offer',\n 'url' => Backend::url('milo/food/lunchoffers'),\n 'icon' => 'icon-bullhorn',\n 'permissions' => ['milo.food.*'],\n ]\n\t ]\n ],\n ];\n }", "function add_navigation($tp, $page, $npages, $order, $mode, $extra_params)\n{\n #\n # Display links to change mode or ordering\n #\n $params = [\n 'page' => 1,\n 'order' => $order,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($mode == \"thumbnail\") {\n $params[\"mode\"] = \"listing\";\n $tp['alt_display_label'] = 'Listing';\n } else {\n $params[\"mode\"] = \"thumbnail\";\n $tp['alt_display_label'] = 'Thumbnails';\n }\n $tp['ne_alt_display_url'] = encode_argv_url($params);\n\n $params = [\n 'page' => 1,\n 'mode' => $mode,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($order == \"location\") {\n $params[\"order\"] = \"year\";\n $tp['alt_order_label'] = 'Year';\n } else {\n $params[\"order\"] = \"location\";\n $tp['alt_order_label'] = 'Location';\n }\n $tp['ne_alt_order_url'] = encode_argv_url($params);\n\n if ($npages <= 1) {\n return $tp;\n }\n\n if ($mode == \"thumbnail\") {\n #\n # Instantiate the page navigation templates for the top and bottom of\n # the page\n #\n $tp['page'] = $page;\n $tp['npages'] = $npages;\n\n $params = [\n 'mode' => $mode,\n 'order' => $order,\n ];\n $params = array_merge($params, $extra_params);\n\n if ($page > 1) {\n $params['page'] = 1;\n $tp['ne_nav_first_page_url'] = encode_argv_url($params);\n $params['page'] = $page - 1;\n $tp['ne_nav_prev_page_url'] = encode_argv_url($params);\n }\n\n if ($page < $npages) {\n $params['page'] = $page + 1;\n $tp['ne_nav_next_page_url'] = encode_argv_url($params);\n $params['page'] = $npages;\n $tp['ne_nav_last_page_url'] = encode_argv_url($params);\n }\n }\n\n return $tp;\n}" ]
[ "0.65993893", "0.64448273", "0.6174901", "0.6151309", "0.6129851", "0.61211073", "0.61159414", "0.60888", "0.60657674", "0.6065476", "0.60557336", "0.60317767", "0.60122585", "0.60113686", "0.5983655", "0.5976885", "0.59754455", "0.59120333", "0.5902517", "0.5899736", "0.58988184", "0.58768237", "0.5868045", "0.5851379", "0.58389294", "0.58268577", "0.582213", "0.5795779", "0.5783996", "0.57780457", "0.5772432", "0.5742245", "0.57391894", "0.5738205", "0.57269055", "0.57268286", "0.56952435", "0.5681371", "0.5681166", "0.5681166", "0.5677284", "0.567351", "0.5672282", "0.5660656", "0.56165844", "0.5602107", "0.559088", "0.5590438", "0.55875075", "0.55850786", "0.5566563", "0.5563427", "0.5544384", "0.5538339", "0.5538339", "0.5538339", "0.5538339", "0.5538339", "0.5538339", "0.5531117", "0.55304384", "0.5526875", "0.552499", "0.5516046", "0.55134314", "0.551166", "0.5509348", "0.549672", "0.54962337", "0.5495795", "0.54769284", "0.547324", "0.54659027", "0.54637206", "0.54616517", "0.5458821", "0.5456867", "0.5456205", "0.5450324", "0.544952", "0.5438896", "0.54358363", "0.5427345", "0.54258436", "0.54189646", "0.5418611", "0.54183805", "0.5415892", "0.5415403", "0.5402124", "0.53921217", "0.5390299", "0.538658", "0.5383841", "0.5365241", "0.53592", "0.53580016", "0.5355185", "0.53497833", "0.5348523", "0.5347461" ]
0.0
-1
tests the existance of a given filename
public function test($filename) { if (file_exists($filename)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function exists($filename);", "public function exists(string $filename) : bool;", "public function fileExists($name);", "public function file_exists($file);", "public function hasFile(string $name): bool {}", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "function IsFileExist()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === true)\n\t{\n\t\techo '<correct>file exist</correct>';\n\t} else\n\t{\n\t\techo '<correct>file not exist</correct>';\n\t}\n\t\n\treturn;\n}", "function _wp_check_existing_file_names($filename, $files)\n {\n }", "public function file_exists($filename)\n {\n return @file_exists($filename);\n }", "function verify_filename($filename) // Colorize: green\n { // Colorize: green\n return isset($filename) // Colorize: green\n && // Colorize: green\n is_string($filename) // Colorize: green\n && // Colorize: green\n $filename != \"\"; // Colorize: green\n }", "function checkFileExists($fileName, $fileType){\n switch($fileType)\n {\n case \"library\":\n if(file_exists($this->libraryBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"config\":\n if(file_exists($this->configBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"controller\":\n if(file_exists($this->controllerBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"model\":\n if(file_exists($this->modelBasePath . $fileName . '_model' . $this->suffix)){\n return true;\n\n }\n else\n {\n return false;\n }\n default:\n echo 'that filetype is fucked';\n }\n }", "function e_file_exists($filename) {\r\n global $CACHE_FILE_EXIST;\r\n \r\n $CACHE_FILE_EXIST[\"petitions\"]++;\r\n if (!isset($CACHE_FILE_EXIST[$filename])) {\r\n $current=ini_get(\"include_path\")._PATH_SYMBOL.\"/\";\r\n debug(\"PATH: $current\",\"red\");\r\n $dirs=explode(_PATH_SYMBOL,$current);\r\n foreach ($dirs as $k=>$v) {\r\n $res=file_exists($v.\"/$filename\");\r\n debug($v.\"/$filename\");\r\n if ($res) {\r\n debug($v.\"/$filename\".\" OK\",\"blue\");\r\n $CACHE_FILE_EXIST[$filename]=$v.\"/$filename\";\r\n $CACHE_FILE_EXIST[\"cached\"]++;\r\n return ($v.\"/$filename\");\r\n }\r\n }\r\n $CACHE_FILE_EXIST[$filename]=false;\r\n return False;\r\n }\r\n else\r\n return $CACHE_FILE_EXIST[$filename];\r\n}", "public static function exists($filename)\n\t{\n\t\treturn (@file_exists((string) $filename) && is_file((string) $filename));\n\t}", "public function hasFile($filename)\n {\n return file_exists($this->directory() . '/' . $filename);\n }", "public function hasFileName(){\n return $this->_has(3);\n }", "function fileExists($file){\n\treturn is_file($file) || (@fopen($file,'r')==true);\n}", "function file_exists($directory, $filename)\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);\n\n\t\t$this->_chdir($directory);\n\t\t$result = $this->_ls();\n\n\t\tif ($result !== false && is_array($result))\n\t\t{\n\t\t\treturn (in_array($filename, $result)) ? true : false;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isFileExist($fileName, $storageOption = null);", "public function exists($file) {\n\t}", "protected function fileExists($filename)\n {\n return \\file_exists($filename);\n }", "private function file_exists( $path, $filename )\n\t{\n\t\t$finder = new Finder();\n\n\t\ttry {\n\t\t\t$count = $finder\n\t\t\t\t\t\t->files()\n\t\t\t\t\t\t->in($path)\n\t\t\t\t\t\t->name($filename)\n\t\t\t\t\t\t->depth('== 0')\n\t\t\t\t\t\t->count()\n\t\t\t;\n\t\t} catch ( InvalidArgumentException $e ) {\n\t\t\techo json_encode($e->getMessage());\n\t\t\texit;\n\t\t} catch ( Exception $e ) {\n\t\t\t$errors = array(\n\t\t\t\t'error' => $e->getMessage(),\n\t\t\t);\n\n\t\t\t// Set the template here\n\t\t\t$template = File::get( __DIR__ . '/views/error-no-render.html');\n\n\t\t\t$html = Parse::template($template, $errors);\n\n\t\t\theader('Content-Type', 'application/json');\n\t\t\techo self::build_response_json(false, true, FILECLERK_S3_ERROR, $e->getMessage(), 'error', $errors, null, null);\n\t\t\texit;\n\t\t}\n\n\t\treturn $count === 1 ? TRUE : FALSE;\n\t}", "function _bellcom_check_if_file_in_url_exists($file_url) {\n $file_headers = @get_headers($file_url);\n\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n return FALSE;\n }\n else {\n return TRUE;\n }\n}", "private function _checkFile( $fileName = false )\r\n\t{\r\n\t\tif( Configure::read() != 0 )\r\n\t\t{\r\n\t\t\t$fileName = str_replace( \"/\", \"\", $fileName );\r\n\t\t\t$fileName = str_replace( \"\\\\\", \"\", $fileName );\r\n\r\n\t\t\tif( file_exists( SERVICE_BROWSER_PATH . $fileName ) )\r\n\t\t\t{\r\n\t\t\t\treturn $fileName;\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function has_file($name) {\n $stmt = $this->pdo->prepare('select * from file where user_id = :id and filename = :name');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return count($res) == 1;\n }", "public function hasFileName() {\n return $this->_has(2);\n }", "public function isExist(){\n\t\t\tif(file_exists($this->_nameFile)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function exists(){\n\t\t$fichName = $this->getPath();\n\t\treturn file_exists($fichName);\n\t}", "static function fileExists()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::fileExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "private function checkIfExtFileExists($file){\n\t\t\t$b = @fopen($file, \"r\");\n\t\t\t@fclose($b);\n\t\t\treturn $b==true;\n\t\t}", "protected function _fileExists($filename)\n {\n return $this->_file->fileExists($this->_mediaDirectory->getAbsolutePath($filename));\n }", "protected function ciFileExists($filename)\n\t{\n\t\tif (file_exists($filename)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$dir = dirname($filename);\n\t\t$files = glob($dir . '/*');\n\t\t$lCaseFilename = strtolower($filename);\n\n\t\tforeach ($files as $file) {\n\t\t\tif (strtolower($file) == $lCaseFilename) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function hasKey(string $filename, string $key): bool;", "public function isExists(){\n\t\treturn file_exists($this->getFullName());\n\t}", "function does_file_exist($mediatype, $filename, $inout = 'in') {\n $params = Array();\n $params['region'] = $this->region;\n $params['mediatype'] = $mediatype;\n $params['filename'] = $filename;\n $params['inout'] = $inout;\n try {\n $ret = poodlltools::call_cloudpoodll('local_cpapi_does_file_exist',$params);\n if(!$ret || !isset($ret->returnCode)) {return 'failed to get aws remote result';}\n if ($ret->returnCode==\"0\") {\n return $ret->returnMessage == 'true';\n } else {\n return $ret->returnMessage;\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n }", "static function assertFileExists($filename, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertFileExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "private function does_file_exist( string $url ): bool {\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_NOBODY, true );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT_MS, 50 );\n\t\tcurl_exec( $ch );\n\t\t$http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close( $ch );\n\t\treturn $http_code === 200;\n\t}", "public function hasFilename()\n {\n return $this->filename !== null;\n }", "public function hasFilename()\n {\n return $this->filename !== null;\n }", "protected function checkFileExists($filename)\n {\n if (! $this->test($filename)) {\n throw new Exception(\"File doesn't exist\");\n }\n }", "public function check_exists(){\n if(!file_exists($this->file['tmp_name']) ){\n $this->file_name = 'sample.jpg';\n }else{\n $this->tmp_file_name = $this->file['tmp_name'];\n $this->file_type = $this->file['type'];\n $this->file_name = time() . '_' . $this->file['name']; //give name a timestamp to ensure no duplicate images made in the future\n }\n }", "private function checkFileExist(string $file): bool\n {\n return is_file($file);\n }", "function fileExists($filePath) {\n\t\timport('lib.pkp.classes.file.FileManager');\n\t\t$fileMgr = new FileManager();\n\n\t\treturn $fileMgr->fileExists(realpath($filePath));\n\t}", "public function testFileExists()\n {\n $filePointer = 'Core/RandomNonExistentDirectory/RandomFileNamexhjctgyutcgasghj.php';\n //initial test will fail\n $this->assertFalse(FileExists::exists($filePointer));\n\n // test using a file that should definitely exist\n $filePointer = 'Core/Config/bootstrap.php';\n // if the core has not been tampered with, this test should pass\n $this->assertTrue(FileExists::exists($filePointer));\n }", "public function fileExists() {\r\n return file_exists($this->pathname);\r\n }", "private function check_exists()\n\t{\n\t\t// so this is sufficient to test for existence in accordance with\n\t\t// File::check_exists()\n\t\t// However, getFileInfo() is slow, since it involves a DB query,\n\t\t// so we'll cache the result in $this->exists and test that first...\n\t\tif ( $this->exists )\n\t\t\treturn true;\n\t\telse $this->getFileInfo();\n\t}", "public function exists()\n {\n if (empty($this->filename)) {\n return false;\n }\n\n // Since we only have a valid path when the file exists this is a good test.\n $filename = $this->getFullPath();\n\n if (!empty($filename)) {\n return true;\n }\n // else\n return false;\n }", "public function isFileExists()\n {\n $fileNameWithPath = $this->dir . '/' . $this->fileName;\n if(!is_file($fileNameWithPath)) {\n return false;\n }\n\n return true;\n }", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "public static function checkFileExists($file, $url){\n\t\t\n\t\tif(empty($file)) return false;\n\t\tif(!is_file($url.$file)) false;\n\t\treturn true;\n//\t\ttry {\n//\t\t\tfclose(fopen($file, \"r\"));\n//\t\t\treturn true;\n//\t\t} catch (Exception $e) {\n//\t\t\treturn false;\n//\t\t}\n\t}", "public function isFile();", "public static function exists($filename)\n {\n return Storage::disk('public')->exists(static::relativePath($filename));\n }", "function find_file($filename, $required = true)\n\t{\n\t\t$file_locations = array($filename);\n\t\t\n\t\t// check system folder first\n\t\t\n\t\tforeach($file_locations as $file) {\n\t\t\t$file .= '.php';\n\t\t\tif (file_exists(APP_PATH . $file))\n\t\t\t\treturn APP_PATH . $file;\n\t\t}\n\t\t\n\t\t// then check app folder\n\t\t\n\t\tforeach($file_locations as $file) {\n\t\t\t$file .= '.php';\n\t\t\tif (file_exists(SYS_PATH . $file))\n\t\t\t\treturn SYS_PATH . $file;\n\t\t}\n\t\t\n\t\tif ($required)\n\t\t\tthrow new Exception(\"File ($file) does not exist\");\n\t\treturn false;\n\t}", "public function is_file($file);", "function is_uploaded_file($filename)\n{\n return file_exists($filename);\n}", "function doesDateFileExist($ID, $date) {\n\tglobal $DATA_DIR;\n\t$handle = fopen($DATA_DIR.$ID.'/'.$date.'.csv',\"r\");\n\tif ($handle === FALSE) {\n\t\tfclose($handle);\n\t\treturn FALSE;\n\t}\n\telse {\n\t\tfclose($handle);\t\n\t\treturn TRUE;\n\t}\n}", "public function exists(): bool\n {\n return file_exists($this->directory->getPath().'/'.$this->filename);\n }", "function atkexists($type, $name)\n{\n\treturn file_exists(atkgetinclude($type, $name));\n}", "function isFile($file=null)\r\n{\r\n\treturn (!empty($file) && file_exists($file) && is_file($file));\r\n}", "public static function requireExists($fileName) {\n\t\t$paths = explode(PATH_SEPARATOR, get_include_path());\n\t\tforeach ($paths as $path) {\n\t\t\tif (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function fileExists()\n {\n return new Matcher\\FileExists();\n }", "function check_file_existance($path)\n{\n //buld the url\n $image_url=$path;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public function is_empty($filename){\n\t\tif(empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "public function is_empty($filename){\n\t\tif(empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "function image_exist($file, $path=\"\") {\n\tif ($file)\n\t{\n\t\t$checkfile=($path)?$path . \"/\" . $file:$file;\n\t\tif (file_exists($checkfile)) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\t}", "public function url_exists( $src ) {\n\n\t\t// Make arguments supplied are valid\n\t\tif( !is_string( $src ) ) {\n\t\t\texit( '$src is an invalid argument' );\n\t\t}\n\n\t\t// Isolate path to file from URL\n\t\t$url_parts = parse_url( $src );\n\t\t$path = $url_parts['path'];\n\n\t\t// Check if file exists from reassembled path\n\t\tif( file_exists( $_SERVER['DOCUMENT_ROOT'] . $path ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function does_url_exist($url) {\n\t$fd = fopen(\"$url\", \"r\");\n\tif ($fd) {\n\t\tfclose($fd);\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public static function fileExists($path)\n\t{\n\t\t// (Heh!)\n\t\t$result = $GLOBALS['DataBase']->query(\"SELECT fileid FROM files WHERE path='$path'\");\n\t\tif ( $result->numRows() == 1 )\n\t\t\treturn true;\n\t\telse return false; // More than one entry shouldn't be allowed, so it cannot reasonably exist!\n\t}", "function is_file_in_db( $fn ) {\n // Prepare SELECT statement to search for the file.\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $rows = count($stmt->fetchAll());\n\n if( $rows ) {\n return true;\n } else {\n return false;\n }\n }", "public function exists($files);", "public function assertFileExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileExists', func_get_args()));\n }", "public function assertFileExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileExists', func_get_args()));\n }", "function pathExists($path);", "public function hasFiles($name = null);", "private function fileExists()\n {\n return $this->files->exists($this->path) ? new Exception(\"The class exists!\") : false;\n }", "function verifyDeletion($filename, $target_file)\n{\n // Check if file exists\n if (!file_exists($target_file))\n {\n echo \"File not found.<br>\";\n return false;\n }\n\n // check if file in list\n $list = read_file_list();\n\n if(!in_array($filename, $list)) {\n echo \"Not an image.<br>\";\n return false;\n }\n \n return true;\n}", "public function getFileExists()\n {\n return Yii::$app->storage->fileSystemExists($this->filter_id . '_' . $this->file->name_new_compound);\n }", "function check_image_existance($path,$image_name)\n{\n //buld the url\n $image_url=$path.$image_name;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "protected function checkIfFileExistes($file)\n\t\t{\n\t\t\tif (file_exists($this->rutaMini.\"/\".$file))\t\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "public static function exists($name)\n\t{\n\t return file_exists(self::filepath($name));\n\t}", "public function fileExists($name)\n\t{\n\t\treturn file_exists($this->getBasePath() . DIRECTORY_SEPARATOR . $name);\n\t}", "function file_name_exists($name)\r\n{\r\n global $db;\r\n $results = $db->select(tbl(\"video\"),\"videoid,file_name\",\" file_name='$name'\");\r\n\r\n if($db->num_rows >0)\r\n return $results[0]['videoid'];\r\n else\r\n return false;\r\n}", "public function hasFile(string $key): bool\n\t{\n\t\treturn $this->files->has($key);\n\t}", "private function filename_check($filename = null)\n {\n if (is_null($filename))\n {\n if (!isset($this->action_arguments['variable_arguments']))\n {\n return;\n }\n \n $filename = $this->action_arguments['variable_arguments'][count($this->action_arguments['variable_arguments']) - 1];\n }\n if ( $filename == '.DS_Store'\n || substr($filename, 0, 2) == '._')\n {\n $this->logger->log(\"Raising 404 for {$filename} because of filename sanity rules\");\n throw new midcom_exception_notfound(\"OS X DotFiles not allowed\");\n }\n }", "static function assertFileNotExists($filename, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertFileNotExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function isFile($path);", "function filenameCheck($str) {\n return (strpos($str, \".csv\") !== FALSE);\n }", "public function exists($file) {\n\t\treturn false;\n\t}", "public function checkIsFile($path);", "function exists() {\n\t\treturn is_file($this->path);\n\t}", "function is_file_flagged( $fn ){\n // Prepare SELECT statement to retrieve the file\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $result = $stmt->fetch();\n\n if( $result['flaggedfile'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "function is_file_url_correct_in_db( $fn, $furl ) {\n // Prepare SELECT statement to retrieve the file\n $select = \"SELECT * FROM files WHERE\n filename = :filename\";\n $stmt = $this->pdo->prepare($select);\n\n // Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n // Execute statement\n $stmt->execute();\n\n // Count results from SELECT\n $result = $stmt->fetch();\n\n if( $furl === $result['url'] ) {\n return true;\n } else {\n return false;\n }\n }", "public function check_files()\n {\n }", "public static function fileExists($value, $message = '');", "public function is_file($filename)\n {\n return @is_file($filename);\n }", "function exists_request_file($request_id,$file_id)\n\t{\n\t\t$this->db->select('id');\t\t\n\t\t$this->db->from('lic_file_downloads');\t\t\n\t\t$this->db->where('requestid',$request_id);\t\t\n\t\t$this->db->where('fileid',$file_id);\t\t\n\t\tif ($this->db->count_all_results() > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function not_empty($filename){\n\t\tif(!empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "public function not_empty($filename){\n\t\tif(!empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "public function isValidFilename()\n {\n $fileName = $this->fileName;\n if(substr($fileName, 0,1) == '-') {\n return false;\n }\n return true;\n }" ]
[ "0.82252884", "0.78526425", "0.76887476", "0.7615939", "0.7535075", "0.7282166", "0.7251059", "0.7240649", "0.71336645", "0.7074687", "0.70706266", "0.70608723", "0.70556945", "0.7029556", "0.70119125", "0.69909555", "0.6985362", "0.6961941", "0.69607115", "0.69360805", "0.69316006", "0.69148856", "0.6906893", "0.69036025", "0.6900173", "0.68996006", "0.689112", "0.6886653", "0.68713504", "0.6809309", "0.67809117", "0.6770629", "0.6764503", "0.6759813", "0.67550915", "0.67497814", "0.67300767", "0.6717956", "0.67038125", "0.67038125", "0.6671392", "0.66661483", "0.6639708", "0.6630522", "0.6629053", "0.6627798", "0.6608887", "0.6605481", "0.65982145", "0.6567285", "0.65643716", "0.6564191", "0.6551941", "0.6538947", "0.6536765", "0.6535964", "0.6534433", "0.65282893", "0.6520486", "0.65099436", "0.6505346", "0.64820683", "0.6478644", "0.6466329", "0.6466329", "0.64657325", "0.64649004", "0.64630604", "0.6460301", "0.6454083", "0.6453092", "0.64485943", "0.64485943", "0.64470357", "0.6445742", "0.644203", "0.6423551", "0.642", "0.64146787", "0.6414528", "0.6395", "0.63866687", "0.6382779", "0.6382193", "0.6372073", "0.63706446", "0.6362452", "0.635348", "0.63400245", "0.6339797", "0.6334381", "0.6332743", "0.6320852", "0.63182306", "0.6318217", "0.63067615", "0.6304576", "0.6304176", "0.6304176", "0.6279852" ]
0.75038916
5
Saves the content of the file to a provided filename.
public function save($filename) { if (! file_exists(dirname($filename))) { throw new Exception( "Directory [{$filename}] does not exist. Cannot save file" ); } file_put_contents($filename, $this->getContents()); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save($filename) {\r\n file_put_contents($filename, $this->contents);\r\n }", "public function save($filename, $content);", "private function saveFile($filename, $content) {\n\t\t\t$fullpathFile = $this->output_dir.'/'.$filename;\n\t\t\t$objFile = fopen($fullpathFile, 'w');\n\t\t\tfwrite($objFile, $content);\n\t\t\tfclose($objFile);\n\t\t}", "public function save($filename = null)\n {\n $this->writeFile($this->openFile($filename), $this->getContent());\n }", "public function saveToFile($filename) {\n $this->haruDoc->save($filename);\n }", "public function save( $filename )\n {\n \n }", "public function write($filename);", "public function write($filename);", "private function putFileContent(string $filename, string $content): void\n {\n file_put_contents($filename, $content);\n }", "public function save($filename = self::DEFAULT_NAME)\r\n {\r\n $this->dom->save($filename);\r\n }", "public function write($filename, $content){\n\t\treturn file_put_contents($this->dirname.'/'.$filename, $content);\n\t}", "public function save(string $file, string $content): void\n {\n $this->filesystem->dumpFile($file, $content);\n }", "function write($fileName)\n {\n $fd = fopen ($fileName, \"w\");\n fwrite($fd, $this->content);\n fclose ($fd);\n }", "function save($filePath);", "public function save($file, $path);", "public function saveAs($fileName)\n {\n $tempFileName = $this->save();\n\n if (file_exists($fileName)) {\n unlink($fileName);\n }\n\n /*\n * Note: we do not use `rename` function here, because it loses file ownership data on Windows platform.\n * As a result, user cannot open the file directly getting \"Access denied\" message.\n *\n * @see https://github.com/PHPOffice/PHPWord/issues/532\n */\n copy($tempFileName, $fileName);\n unlink($tempFileName);\n }", "public function writeFile($filename)\n {\n $this->file->writePoFile($filename);\n }", "public function save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}", "private function saveFile(string $content, string $filename, string $ext = self::FILE_EXT): void\n {\n $objFile = new File($this->targetDir . '/' . $filename . $ext);\n\n if ($this->objTheme->backupFiles && $objFile->exists())\n {\n $objFile->copyTo($this->targetDir . '/compiler_backup/' . $filename . '_' . date('Y-m-d_H-i') . $ext);\n }\n\n $objFile->truncate();\n\n if ($objFile->write($content . \"\\n/** Compiled with Theme Compiler */\"))\n {\n $this->msg('File saved: ' . $this->targetDir . '/' . $filename . $ext, self::MSG_SUCCESS);\n }\n else\n {\n $this->msg('File could not be saved: ' . $this->targetDir . '/' . $filename . $ext, self::MSG_ERROR);\n }\n\n unset($content);\n $objFile->close();\n }", "public function write($filename)\n {\n // TODO: Implement write() method.\n }", "private function saveFile($filename, $contents, $compress = true)\n\t{\n\t\t$path = $this->settings->outdir . $filename;\n\n\t\t$file = fopen($path, 'w+');\n\t\tif (!$file) {\n\t\t\tthrow new \\Exception('Unable to open output file for writing: ' . $path);\n\t\t}\n\t\tfwrite($file, $contents);\n\t\tfclose($file);\n\n\t\tif ($compress) {\n\t\t\t$this->compress($path);\n\t\t}\n\t}", "public function dumpFile($filename, $content);", "public function saveFile($filename){\n\t\t\n\t\t// set HTTP response header\n\t\theader('Content-Type: application/xml');\n\t\theader('Content-Disposition: attachment; filename='.$filename.'.xml');\n\n\t\techo '<?xml version=\"1.0\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:html=\"http://www.w3.org/TR/REC-html40\">\n <DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\">\n <Author>'.$this->doc_prop['Author'].'</Author>\n <Keywords>'.$this->doc_prop['Keywords'].'</Keywords>\n <LastAuthor>'.$this->doc_prop['LastAuthor'].'</LastAuthor>\n <Created>'.gmdate(\"Y-m-d\\TH:i:s\\Z\").'</Created>\n <Version>12.00</Version>\n </DocumentProperties>\n <Worksheet ss:Name=\"Sheet1\">\n <Table>'.$this->xml_data.'\n </Table>\n </Worksheet>\n</Workbook>';\n\t\t\n\t\t// since there must be no data below XML\n\t\texit();\n\t}", "function file_save_contents($filename, $contents, $append=true){\n\t$method = ($append) ? 'a' : 'w';\n\t$fp = fopen($filename, $method);\n\tfwrite($fp, $contents);\n\tfclose($fp);\n}", "public function saveToFile($file)\n {\n \n }", "function file_write($filename, $content)\n\t{\n\t\t$handle = @fopen($filename, 'w');\n\t\t$result = @fwrite($handle, $content, strlen($content));\n\t\t@fclose($handle);\n\t\treturn $result;\n\t}", "public function save($filename)\n\t{\n\t\treturn $this->document->save($filename);\n\t}", "public function save(IO\\File $file) {\n\t\t\tfile_put_contents($file, $this->render());\n\t\t\t$this->file = $file;\n\t\t}", "public static function editFileByContent($content = '', $fileName = '')\n {\n $fileHandle = fopen($fileName, 'w') or die(\"can't open file\");\n file_put_contents($fileName, $content);\n fclose($fileHandle);\n }", "public function put($filename, $content)\n\t{\n\t\t$directory = $this->directory($filename);\n\n\t\tif (!$this->exists($directory))\n\t\t{\n\t\t\t$this->mkdir($directory);\n\t\t}\n\n\t\treturn file_put_contents($this->path($filename), $content);\n\t}", "public function save(string $path, $filename = null): bool {\n $filename = $filename ?: $this->getName();\n\n return file_put_contents($path.$filename, $this->getContent()) !== false;\n }", "public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\n\t}", "abstract public function writeFile( $fileName );", "protected function writeFile($filename, $content)\n {\n $filepath = pathinfo($filename, PATHINFO_DIRNAME);\n\n if ( ! $this->createPathIfNeeded($filepath)) {\n return false;\n }\n\n if ( ! is_writable($filepath)) {\n return false;\n }\n\n $tmpFile = tempnam($filepath, 'swap');\n\n if (file_put_contents($tmpFile, $content) !== false) {\n if (@rename($tmpFile, $filename)) {\n @chmod($filename, 0666 & ~umask());\n\n return true;\n }\n\n @unlink($tmpFile);\n }\n\n return false;\n }", "public function write_file ( $content ) {\r\n\r\n\t}", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "public function saveFile() {\n return $this->xml->save($this->filename);\n }", "public function file_put_contents($file, $content);", "public function savePreview($filename)\n {\n copy($filename, $this->_previewFilename);\n }", "public static function toFile(string $filename): void\n {\n file_put_contents($filename, self::$csv);\n }", "public function save($filename, $charset = null)\n {\n $data = $this->getData();\n\n /*\n if ($charset === null) {\n $charset = $this->options['charset'];\n }\n\n */\n // UTF-8 : file_put_contents(\"file.txt\", \"\\xEF\\xBB\\xBF\" . $data);\n\n /*\n\n $data = file_get_contents($npath);\n $data = mb_convert_encoding($data, 'UTF-8', 'OLD-ENCODING');\n file_put_contents('tempfolder/'.$a, $data);\n\n Or alternatively, with PHP's stream filters:\n\n $fd = fopen($file, 'r');\n stream_filter_append($fd, 'convert.iconv.UTF-8/OLD-ENCODING');\n stream_copy_to_stream($fd, fopen($output, 'w'));\n *\n * mb_convert_encoding($data, 'UTF-8', 'auto');\n * mb_convert_encoding($data, 'UTF-8', mb_detect_encoding($data));\n */\n\n $ret = file_put_contents($filename, $data);\n if (!$ret) {\n throw new \\Exception(\"Filename $filename cannot be written\");\n }\n }", "public function saveAs(string $path): void;", "public function save($filename = null)\n {\n $storage = $this->storage;\n $storage->setContentDom($this->contentDOM);\n $storage->setMetaDom($this->metaDOM);\n $storage->setSettingsDom($this->settingsDOM);\n $storage->setStylesDom($this->stylesDOM);\n $storage->save($filename);\n }", "function file_write ($filename, $data) {\r\n $fd = fopen($filename, 'w') or die(\"Can't open file $filename for write!\");\r\n fwrite($fd, $data);\r\n fclose($fd);\r\n }", "public function write(string $file, string $content): void;", "public function save() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\tif ($this->rows) {\n\t\t\t$fp = fopen($this->filepath, 'w');\n\t\t\t$rowcount = count($this->rows);\n\t\t\tfor ($index = 0; $index < $rowcount; ++$index) {\n\t\t\t\t$row = $this->rows[$index];\n\t\t\t\tif ($row->isEditable()) {\n\t\t\t\t\t$variableName = $row->variableName();\n\t\t\t\t\t$pattern = '/\\$'.$variableName.'[\\s]+=([^;]+);/';\n\t\t\t\t\t$replacement = $row->toString();\n\t\t\t\t\t$fileContent = preg_replace($pattern, $replacement, $fileContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfwrite($fp, $fileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }", "public static function writeFile($filename, $content, $lock = false)\n\t{\n\t\tif (!file_exists($filename)) {\n\t\t\tself::createFile($filename);\n\t\t}\n\t\tfile_put_contents($filename, $content, $lock ? LOCK_EX : 0);\n\t}", "private function writeFile($file, $content) {\n\t\t$handle = fopen($file, 'w+');\n\t\tfwrite($handle, $content);\n\t\tfclose($handle);\n\t}", "public static function write($content, $file)\n {\n file_put_contents($file, $content);\n }", "function fileWrite($filename, &$content, $mode) {\n\tif (!$fp = @fopen($filename, $mode)) {\n\t\treturn \"Cannot open file ($filename)\";\n\t}\n\tif (!is_writable($filename)) {\n\t\tif (!chmod($filename, 0666)) {\n\t\t\t return \"Cannot change the mode of file ($filename)\";\n\t\t\t \n\t\t\t \n\t\t};\n\t}\n\tif (file_put_contents($filename, $content) === FALSE) {\n\t\treturn \"Cannot write to file ($filename)\";\n\t\t\n\t}\n\tif (!fclose($fp)) {\n\t\treturn \"Cannot close file ($filename)\";\n\t\t\n\t}\n\t\n\treturn TRUE;\n}", "public function saveNewTxtFile()\r\n {\r\n\r\n $fileName = date(\"Y-m-d\") . '-' . rand(0, 512) . \"Question\";\r\n\r\n $file = new StorageFileSaver($fileName);\r\n\r\n foreach ($this->fileContent as $content) {\r\n $file->write($content);\r\n }\r\n\r\n $file->saveAndCloseFile();\r\n }", "function write_file($filename,$destination) {\n\tif(is_uploaded_file($filename)){\n\t\tmove_uploaded_file($filename,$destination);\n\t\tprint \"Saved uploaded file as =$destination\\n\";\n\t}\n}", "public function saveAs($file, $deleteTempFile = true)\n {\n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "public function storeFile($file, $name, $path, $mode = null)\n {\n $contentOrFalseOnFailure = file_get_contents($file);\n file_put_contents($path . \"/\" . $name, $contentOrFalseOnFailure);\n }", "public function putFile($filename, $data)\n {\n $this->createFile($filename);\n return file_put_contents($filename, $data);\n }", "public function save(string $content): void\n {\n $content = $this->getHeader() . $content;\n $result = \\file_put_contents($this->resultFile, $content);\n\n if ($result === false || $result === 0) {\n throw new Exception('JBZoo/Less: File not save - ' . $this->resultFile);\n }\n }", "function saveToTxt(){\n\t\t$text=file_get_contents(DIR.$this->filename);\n\t\t$filename=$this->filename+\".xml\";\n\t\theader(\"Content-type: application/text\");\n\t\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t\tdie($text);\n\t\theader(\"location:index.php\");\n\t}", "public function SaveFile() {\r\n if(empty($this->XlsData))\r\n throw new exception('Xls data not available');\r\n $Path_ = $this->_XlsDir.DIRECTORY_SEPARATOR.$this->_FileName;\r\n $Hnd_ = @fopen($Path_, \"wb\");\r\n if($Hnd_===false)\r\n throw new exception(\"Unable to open Xls file <u><b>$Path_</b></u>\");\r\n fwrite($Hnd_, $this->XlsData);\r\n fclose($Hnd_);\r\n$Msg_ = <<< ABGHereDoc\r\n <div style=\"color: ActiveCaption; font: bold 18px sans-serif; padding-top:48px; text-align: center;\">\r\n File <span style=\"color: red;\">$Path_ </span> now saved to disk\r\n </div>\r\nABGHereDoc;\r\n if($this->PrtMsg)\r\n print($Msg_) ;\r\n }", "function save($name, $data)\n {\n $data = \"#title: $name\\n$data\";\n if (file_put_contents($this->getFilePath($name), trim($data)))\n $this->deleteFileIfNeeded($name);\n\n return $this->getFileName($name);\n }", "function savefile($sFileName = null)\n\t{\n\t\tif ((isset($sFileName)) && ($sFileName != '')) {\n\t\t\t$this->setLocations($sFileName);\n\t\t}\n\n\t\t$this->saveImage();\n\t}", "private function createFile($filename, $content){\n\tfile_put_contents($filename.\".gz\", gzencode($content, 9)) or die(\"\\nCannot write file \".$filename);\t \n\techo \"\\nFilename \" . $filename . \" was successfully written\\n\";\n }", "function writeToFile($filename){\n\t\tif(!file_exists($filename)){\n\t\t\t// File is created with class Files in order to maintain file permissions\n\t\t\tFiles::TouchFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot do touch on $filename ($err_msg)\");\n\t\t\t}\n\t\t}\n\n\t\t$total_length = $this->getLength();\n\t\t$chunk_size = 1024 * 1024; // 1MB\n\t\t$bytes_written = 0;\n\n\t\tif($total_length===0){\n\t\t\tFiles::EmptyFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot empty file $filename ($err_msg)\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$f = fopen($filename,\"w\");\n\t\tif($f === false){\n\t\t\tthrow new Exception(get_class($this).\": cannot open $filename for writing\");\n\t\t}\n\t\twhile($bytes_written < $total_length){\n\t\t\t$length = min($chunk_size,$total_length - $bytes_written);\n\t\t\t$chunk = $this->substr($bytes_written,$length);\n\t\t\t$_bytes = fwrite($f,$chunk,$length);\n\t\t\tif($_bytes !== $length){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot write to $filename\");\n\t\t\t}\n\t\t\t$bytes_written += $length;\n\t\t}\n\t\tfclose($f);\n\t}", "public function writeFile(string $fileContent, string $filepath)\n {\n $this->get('filesystem')->dumpFile($filepath, $fileContent);\n }", "public function saveTo(string $path);", "public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\n }", "public static function save($content, $file = null)\n {\n if (null === $file) {\n $file = static::$dataFile;\n }\n\n $dir = Fluid::getBranchStorage() . '/' . dirname($file);\n if (!is_dir($dir)) {\n mkdir($dir);\n }\n\n $file = Fluid::getBranchStorage() . '/' . $file;\n\n file_put_contents($file, $content);\n\n //self::storeCache($content);\n }", "private function saveRobotsTxtAction()\n\t{\n\t\tinclude_once(ISC_BASE_PATH.'/lib/class.file.php');\n\t\t$fc = new FileClass();\n\t\t$content = $_POST['robotstxtFileContent'];\n\t\t$success = 'RobotsSaveSuccess';\n\n\t\tif (isset($_POST['robotstxtRevertButton'])) {\n\t\t\t// Revert button is clicked instead.\n\t\t\t$content = $this->defaultContent;\n\t\t\t$success = 'RobotsRevertSuccess';\n\t\t}\n\n\t\t$res = $fc->writeToFile($content, $this->filePath);\n\t\tif ($res == true) {\n\t\t\tFlashMessage(GetLang($success), MSG_SUCCESS, $this->mainUrl);\n\t\t} else {\n\t\t\tFlashMessage(GetLang('RobotsSaveError'), MSG_ERROR, $this->mainUrl);\n\t\t}\n\t}", "function write_file($my_file,$new_content){\n\treturn file_put_contents($my_file,$new_content);\n}", "public static function saveFile($path, $content)\r\n {\r\n $content = stripslashes($content);\r\n try {\r\n file_put_contents($path, $content);\r\n return 'Your page was saved successfully';\r\n } catch(Zend_Exception $e) {\r\n return 'Sorry, there was an error saving your page';\r\n }\r\n }", "private\tfunction _writeOutput($filename, $data) {\n\t\tjimport('joomla.filesystem.archive');\n\t\tjimport('joomla.filesystem.file');\n\n\t\t$params = JComponentHelper::getParams('com_j2store');\n\t\t$default_save_path = JPATH_ADMINISTRATOR.'/components/com_j2store/backup';\n\t\t$save_path = $params->get('backupfolderpath', $default_save_path);\n\n\t\t$full_file_path = $save_path.'/'.$filename;\n\t\tif(!JFile::exists($full_file_path)){\n\t\t\tJFile::write(JPath::clean($save_path).'/'.$filename, $data);\n\t\t}\n\n\t}", "public function testFileSaveData() {\n $contents = $this->randomMachineName(8);\n $this->setSetting('file_chmod_file', 0777);\n\n // No filename.\n /** @var \\Drupal\\Core\\File\\FileSystemInterface $file_system */\n $file_system = \\Drupal::service('file_system');\n\n // Provide a filename.\n $filepath = $file_system->saveData($contents, 'public://asdf.txt', FileSystemInterface::EXISTS_REPLACE);\n $this->assertNotFalse($filepath, 'Unnamed file saved correctly.');\n $this->assertEquals('asdf.txt', \\Drupal::service('file_system')->basename($filepath), 'File was named correctly.');\n $this->assertEquals($contents, file_get_contents($filepath), 'Contents of the file are correct.');\n $this->assertFilePermissions($filepath, 0777);\n }", "public function exportFile($filename, $data)\n {\n // TODO\n }", "protected function writeFile($fileHandle, $content)\n {\n fwrite($fileHandle, $content);\n fclose($fileHandle);\n $this->cleanupTempFile();\n }", "function file_put_contents( $file, $text ) {\n\t\t$fp = fopen( $file, \"w\" );\n\t\tfwrite( $fp, $text );\n\t\tfclose( $fp );\n\t}", "function save($html,$filename) {\n\t\tglobal $modx;\n\t\theader('Content-Type: text/html; charset='.$modx->config[\"modx_charset\"]);\n\t\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t\texit($html);\n\t}", "public function saveAs($fileName,$deleteTempFile=true)\n {\n if($this->_errorCode===UPLOAD_ERR_OK)\n {\n if($deleteTempFile)\n return move_uploaded_file($this->_localName,$fileName);\n else if(is_uploaded_file($this->_localName))\n return file_put_contents($fileName,file_get_contents($this->_localName))!==false;\n else\n return false;\n }\n else\n return false;\n }", "public function save($file, string $filename) {\n $success = Storage::disk('s3')->put($filename, $file, 'public');\n\n return $success;\n }", "public function saveToFile($file)\n {\n $data = '<?php return '.var_export($this->all(), true).';';\n\n file_put_contents($file, $data);\n }", "public function write($filename)\n {\n if (count($this) == 0) return;\n $file = fopen($filename, 'w');\n fwrite($file, $this->toJson());\n fclose($file);\n unset($file);\n }", "public static function saveContent ($path, $content) {\n\t\t\\file_put_contents($path, $content);\n\t}", "public function aFileNamedWith($filename, PyStringNode $content)\n {\n file_put_contents($filename, $content->getRaw());\n }", "public function save($path);", "function write_file($file,$content,$mode=\"w\")\n\t\t{\n\t\t\t$fp=@fopen($file,$mode);\n\t\t\tif(!is_resource($fp))\n\t\t\t\treturn false;\n\t\t\tfwrite($fp,$content);\n\t\t\tfclose($fp);\n\t\t\treturn true;\n\t\t}", "public function saveAs($filename)\n {\n $this->name = time() . '-' . $filename;\n return $this;\n }", "public function createFile($filename, $content)\n {\n $r = file_put_contents($filename, $content);\n return $r === strlen($content);\n }", "public function setFileName($file);", "public static function putContents($filename, array $data)\n {\n $contents = static::arrayToString($data);\n File::putContents($filename, $contents);\n }", "public function saveToFile()\n {\n $emails = $this->getEmailTemplatesFromRepository()->toJson();\n\n $this->filesystem->put($this->storagePath, $emails);\n }", "private function saveFile($data, $fileName) {\n \\Storage::put(self::DISK_DATA_OUT . $this->nomeSaidaDat($fileName), $this->templateSaida($data));\n return true;\n }", "public static function saveToFile($path, $data)\n {\n $content = self::encodeContents($data);\n file_put_contents($path, $content);\n }", "function writeFile($filepath, $file_contents) {\n $parent = dirname($filepath);\n if (!is_dir($parent)) {\n mkdir($parent, 0777, TRUE);\n }\n if (file_put_contents($filepath, $file_contents) === FALSE) {\n Logger::log(dt('Error while writing to file @file', array('@file' => $filepath)), 'error');\n }\n else {\n Logger::log(dt('Updated file : @file', array('@file' => $filepath)), 'success');\n }\n }", "public function save($handle = self::DEFAULT_FILE_HANDLE_MODE)\n {\n // File was not edited so skip save\n if(!$this->edit && $this->exists())\n return true;\n\n // Full file path\n $path = $this->getPath();\n\n // Make directory if it does not exists\n if(!file_exists(dirname($path)))\n mkdir(dirname($path), 00777, true);\n\n // Write file\n if($fp = fopen($path, $handle))\n {\n if($result = fwrite($fp, $this->contents) !== false)\n {\n // Contents have been saved\n $this->edit = false;\n\n // Close IO stream\n fclose($fp);\n return ($result);\n\n } else\n {\n fclose($fp);\n trigger_error('Could not write to file', E_USER_WARNING);\n }\n }\n\n return false;\n }", "protected function writeToFile($data, $filename){\n //only write to file if there's a record\n if($data!=NULL){\n $mode = 'a+';\n if(isset(Doo::conf()->LOG_PATH))\n $filename = Doo::conf()->LOG_PATH . $filename;\n\n if($this->rotate_size!=0){\n if(file_exists($filename) && filesize($filename) > $this->rotate_size ){\n $mode = 'w+';\n }\n }\n\t\t\tDoo::loadHelper('DooFile');\n\t\t\t$file = new DooFile(0777);\n\t\t\t$file->create($filename, $data, $mode);\n }\n }", "public static function saveFileRoute( $content ){\n return File::put( self::getRouteFileName(), $content );\n }", "public function saveAs($filePath) {\n move_uploaded_file($_FILES[$this->formName][\"tmp_name\"], $filePath);\n }", "public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }", "public function save()\n {\n return $this->write($this->filename, $this->sections);\n }", "public function saveAs($path)\n {\n return $this->file->saveAs($path);\n }", "public function save()\n {\n App::cliLog(\"Saving to $this->format file\", false);\n\n try {\n call_user_func([$this, 'export' . ucfirst($this->format)]);\n } catch (Exception $e) {\n App::cliLog($e->getMessage());\n }\n }" ]
[ "0.8396921", "0.77139217", "0.76505774", "0.7450124", "0.7245428", "0.7203405", "0.6917827", "0.6917827", "0.69054675", "0.6862391", "0.684936", "0.6679402", "0.6678058", "0.66550326", "0.6620031", "0.65596724", "0.6531928", "0.65003425", "0.64727885", "0.6450856", "0.6437915", "0.6416673", "0.63933116", "0.6334768", "0.63323885", "0.6310284", "0.63076365", "0.62666124", "0.6260903", "0.6235425", "0.62319976", "0.620797", "0.62003165", "0.6183423", "0.61720896", "0.6166096", "0.61434466", "0.6129023", "0.6096251", "0.6095632", "0.608299", "0.60525876", "0.6047971", "0.6022234", "0.6010987", "0.598693", "0.59824675", "0.59662306", "0.595708", "0.5944577", "0.59415054", "0.5938717", "0.59052956", "0.5880858", "0.58620393", "0.5855301", "0.58544946", "0.5848685", "0.5848648", "0.5837489", "0.58373785", "0.58251077", "0.58011883", "0.5800563", "0.57973796", "0.579531", "0.57442564", "0.572397", "0.5717879", "0.5717815", "0.5685344", "0.5673602", "0.5667397", "0.56656593", "0.56579185", "0.56578773", "0.56312203", "0.56298524", "0.5623993", "0.5605711", "0.5562863", "0.55580807", "0.5547013", "0.5545042", "0.5541031", "0.55208886", "0.55153793", "0.5514135", "0.5505591", "0.54969466", "0.5490619", "0.54781365", "0.54647446", "0.54629123", "0.546062", "0.54594326", "0.5449847", "0.5434926", "0.5426999", "0.5424879", "0.54229474" ]
0.0
-1
loads file information to the file instance
public function load($filename) { $this->checkFileExists($filename); $this->setContents(file_get_contents($filename)); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fileInfo() {\n $this->file = file_load($this->fid);\n\n // Creating an array of stream wrappers that will be removed.\n $streams = array();\n foreach (stream_get_wrappers() as $stream) {\n $streams[] = $stream . '://';\n }\n\n // Generate the folder name by the unique URI of the file.\n $file_name = str_replace($streams, '', $this->file->uri);\n $folder_name = str_replace(array('.', '_'), '-', $file_name);\n\n $files_folder = variable_get('file_public_path', conf_path() . '/files');\n\n $this->filePath = $files_folder . '/' . $file_name;\n $this->extractPath = $files_folder . '/' . $folder_name;\n }", "private function loadBasicData()\n\t{\n\t\t$this->filename = basename($this->filepath);\n\t\t$this->title = $this->filename;\n\t\t$this->description = $this->filename;\n\t\t$this->mimetype = mime_content_type($this->filepath);\n\t\t$this->dateGathered = date('Y-m-d').'T'.date('h:i:s');\n\t\t$this->filesize = filesize($this->filepath);\n\n\t\t$this->data['path'] = $this->filepath;\n\t\t$this->data['name'] = basename($this->data['path']);\n\n\t\t$this->data['sizeExact'] = filesize($this->data['path']);\n\t\t$this->data['size'] = Utilities::filesizeInterpreter($this->data['sizeExact']);\n\n\t\t$this->data['accessDateExact'] = fileatime($this->data['path']);\n\t\t$this->data['accessDate'] = date(\"F d Y H:i:s.\", $this->data['accessDateExact']);\n\n\t\t$this->data['modifyDateExact'] = filemtime($this->data['path']);\n\t\t$this->data['modifyDate'] = date(\"F d Y H:i:s.\", $this->data['modifyDateExact']);\n\n\t\t$this->data['mimetype'] = mime_content_type($this->data['path']);\n\t\t$this->data['mimetypeType'] = explode(\"/\", $this->data['mimetype'])[0];\n\n\n\t}", "function loadFileData() {\n if (isset($this->params['file_id'])) {\n if (isset($this->params['version_id']) && $this->params['version_id'] > 0) {\n $this->currentFile = $this->getFile($this->params['file_id'], $this->params['version_id']);\n } else {\n $this->currentFile = $this->getFile($this->params['file_id']);\n }\n $fileData = $this->getFileTrans(\n $this->params['file_id'], $this->lngSelect->currentLanguageId\n );\n if (isset($fileData[$this->params['file_id']])) {\n $this->currentFileData = $fileData[$this->params['file_id']];\n } else {\n unset($this->currentFileData);\n }\n }\n }", "protected function loadMetaInformation()\n {\n try {\n $logger = new Logger('exiftool');\n $reader = BookReader::create($logger);\n $metadataBag = $reader->files($this->file->getRealPath())->first();\n foreach ($metadataBag as $meta) {\n $tagName = $meta->getTag()->getName();\n if (0 === strcasecmp($tagName, 'MIMEType')) {\n $this->mime = $meta->getValue()->asString();\n }\n if (0 === strcasecmp($tagName, 'FileType')) {\n $this->ext = strtolower($meta->getValue()->asString());\n }\n if ($this->ext && $this->mime) {\n break;\n }\n }\n } catch (\\Exception $e) {\n $logger->addNotice($e->getMessage());\n }\n finally {\n $this->mime = empty($this->mime) ? $this->file->getMimeType() : $this->mime;\n $this->ext = empty($this->ext) ? $this->file->guessExtension(): $this->ext;\n }\n }", "public function load(){\n\t\tif (is_file($this->_filename) && is_readable($this->_filename)){\n\t\t\t$this->_storage = require($this->_filename);\n\t\t\t$this->_dataAvailable = true;\n\t\t}\n\t}", "private function loadFileInfo()\n\t{\n\t\t$this->loadBasicData();\n\t\tswitch ($this->data['mimetypeType']) \n\t\t{\n\n\t\t\tcase 'image':\n\t\t\t\tlist($this->data['width'], $this->data['height']) = getimagesize ( $this->filepath );\n\t\t\t\t$this->data['resolution'] = $this->data['width'].'x'.$this->data['height'];\n\n\t\t\t\tswitch ($this->data['mimetype']) \n\t\t\t\t{\n\t\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\tcase 'image/pjpeg':\n\t\t\t\t\tcase 'image/tiff':\n\t\t\t\t\tcase 'image/x-tiff':\n\n\t\t\t\t\t\t$this->loadExfiData();\n\t\t\t\t\t\t$this->loadIPTCKeywords();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'image/png':\n\t\t\t\t\tcase 'image/jp2':\n\t\t\t\t\tcase 'image/jpx':\n\t\t\t\t\tcase 'image/jpm':\n\t\t\t\t\tcase 'image/mj2':\n\t\t\t\t\t\t$this->loadIPTCKeywords();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t# code...\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function _construct() {\n\t\t$this->_fileObj = $this->fileObj();\n\t}", "private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract public function load($filename);", "abstract public function load($file, $context);", "protected function initFileLoader() \n\t{\n\t\t$this->fileLoader = new FileLoader();\n\t}", "public function loadFromFile($file)\n {\n \n }", "public function load($file);", "public function load($file);", "public function load($file);", "public function load() {\n\t\t$this->copyFromTemplateIfNeeded();\n\t\trequire $this->filePath;\n\t\t$this->vars = $vars;\n\t}", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "protected function parseFile() {\n $this->title = $this->val(\"title\");\n $this->originalTitle = $this->val(\"originaltitle\");\n $this->sortTitle = $this->val(\"sorttitle\");\n $this->set = $this->val(\"set\");\n $this->rating = $this->val(\"rating\");\n $this->year = $this->val(\"year\");\n $this->top250 = $this->val(\"top250\");\n $this->votes = $this->val(\"votes\");\n $this->outline = $this->val(\"outline\");\n $this->plot = $this->val(\"plot\");\n $this->tagline = $this->val(\"tagline\");\n $this->runtime = $this->val(\"runtime\");\n $this->thumb = $this->val(\"thumb\");\n $this->mpaa = $this->val(\"mpaa\");\n $this->playCount = $this->val(\"playcount\");\n $this->id = $this->val(\"id\");\n $this->filenameAndPath = $this->val(\"filenameandpath\");\n $this->trailer = $this->val(\"trailer\");\n $this->genres = [];\n $genreNodeList = $this->doc->getElementsByTagName(\"genre\");\n foreach ($genreNodeList as $genre) {\n $this->genres[] = $genre->nodeValue;\n }\n $this->tags = [];\n $tagNodeList = $this->doc->getElementsByTagName(\"tag\");\n foreach ($tagNodeList as $tag) {\n $this->tags[] = $tag->nodeValue;\n }\n $this->credits = $this->val(\"credits\");\n\n //create the skeleton fileinfo object\n $this->fileInfo = (object) [];\n $this->fileInfo->streamDetails = (object) [];\n $this->fileInfo->streamDetails->video = (object) [];\n $this->fileInfo->streamDetails->video->codec = null;\n $this->fileInfo->streamDetails->video->aspect = null;\n $this->fileInfo->streamDetails->video->width = null;\n $this->fileInfo->streamDetails->video->height = null;\n $this->fileInfo->streamDetails->audio = [];\n $this->fileInfo->streamDetails->subtitle = (object) [];\n $this->fileInfo->streamDetails->subtitle->language = null;\n\n\n\n $infoNode = $this->doc->getElementsByTagName(\"fileinfo\")->item(0);\n if ($infoNode !== null) {\n $streamDetailsNode = $infoNode->getElementsByTagName(\"streamdetails\")->item(0);\n if ($streamDetailsNode !== null) {\n $videoNode = $streamDetailsNode->getElementsByTagName(\"video\")->item(0);\n if ($videoNode !== null) {\n $this->fileInfo->streamDetails->video = (object) [];\n $this->fileInfo->streamDetails->video->codec = $this->val(\"codec\", $videoNode);\n $this->fileInfo->streamDetails->video->aspect = $this->val(\"aspect\", $videoNode);\n $this->fileInfo->streamDetails->video->width = $this->val(\"width\", $videoNode);\n $this->fileInfo->streamDetails->video->height = $this->val(\"height\", $videoNode);\n }\n $audioNodes = $streamDetailsNode->getElementsByTagName(\"audio\");\n if ($audioNodes !== null) {\n foreach ($audioNodes as $audioNode) {\n $codec = $this->val(\"codec\", $audioNode);\n $language = $this->val(\"language\", $audioNode);\n $channels = $this->val(\"channels\", $audioNode);\n $audio = (object) [];\n $audio->codec = $codec;\n $audio->language = $language;\n $audio->channels = $channels;\n $this->fileInfo->streamDetails->audio[] = $audio;\n }\n }\n $subtitleNode = $streamDetailsNode->getElementsByTagName(\"subtitle\")->item(0);\n if ($subtitleNode !== null) {\n $this->fileInfo->streamDetails->subtitle->language = $this->val(\"language\", $subtitleNode);\n }\n }\n }\n\n $this->directors = [];\n $directorNodes = $this->doc->getElementsByTagName(\"director\");\n foreach ($directorNodes as $directorNode) {\n $this->directors[] = $directorNode->nodeValue;\n }\n\n $this->actors = [];\n $actorNodeList = $this->doc->getElementsByTagName(\"actor\");\n foreach ($actorNodeList as $actorNode) {\n $actor = (object) [];\n $nameItem = $actorNode->getElementsByTagName(\"name\")->item(0);\n $actor->name = $nameItem != null ? $nameItem->nodeValue : \"\";\n $roleItem = $actorNode->getElementsByTagName(\"role\")->item(0);\n $actor->role = $roleItem != null ? $roleItem->nodeValue : \"\";\n //if we have either an actor name or role, add this actor\n if ($actor->name != \"\" || $actor->role != \"\") {\n $this->actors[] = $actor;\n }\n }\n //if made it to here, all is good. return true\n return true;\n }", "public abstract function load();", "public function __construct($file);", "abstract public function load();", "abstract public function load();", "private function processFile() {\n if ($this->isFileAllowed()) {\n $path_parts = pathinfo($this->filepath);\n $extention = $path_parts['extension'];\n\n $classes = get_declared_classes();\n\n foreach($classes as $class) {\n $reflect = new \\ReflectionClass($class);\n if($reflect->implementsInterface('App\\\\Classes\\\\IFileFormat')) {\n if ($extention === $class::getFileExtension()) {\n $fileFormat = new $class($this->filepath);\n $this->charsCount = $fileFormat->getCharactersCount();\n $this->wordsCount = $fileFormat->getWordsCount();\n }\n }\n }\n }\n }", "public function openFile() {\n $this->file = fopen($this->_dir . $this->_filename,\"r\");\n }", "public function load()\n\t\t{\n\t\t\tif ($this->exists()) {\n\t\t\t\t$this->content = self::read($this->get_path());\n\t\t\t\t$this->is_cached = true;\n\t\t\t\treturn $this;\n\t\t\t} else throw new \\System\\Error\\File('Cannot read file. It does not exists on the filesystem.');\n\t\t}", "public function load() { }", "public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }", "function loadSize()\n\t{\n\t\t$this->size = filesize($this->filename);\n\t}", "private function loadData() {\n // If the file does not yet exists we cancel immediately\n if (!file_exists(DATA_FILE)) return;\n\n // Grab all the contents from the file\n $data = file_get_contents(DATA_FILE);\n // And convert it to a json object\n $data = json_decode($data);\n\n // If something went wrong with decoding we cancel\n if ($data == false) return;\n\n // Store our information in our object\n $this->accessToken = $data->accessToken;\n $this->expirationDate = $data->expirationDate;\n $this->refreshToken = $data->refreshToken;\n }", "public function loadRaw()\n {\n $this->raw = $this->reader->raw($this->path);\n $this->rawLoaded = true;\n }", "public function __construct($file)\n {\n }", "public function __construct($file)\n {\n }", "protected function openFile() {}", "public function __construct($file) {\n $this->file = $file;\n }", "function load_file($path){\n\tif (!file_exists($path)) system_die('File reading error - \"' . $path . '\"', 'Template->load_file');\n\t$this->template = @file($path);\n\tunset($this->result);\n\t$this->filename = $path;\n}", "public function load() {\n $filename = STORAGE_PATH.$this->id.'.fba';\n if (file_exists($filename)) {\n\n // Split the file where the blocks terminate '<!--SPLITME-->'\n $text = file_get_contents($filename);\n $array = explode('<!--SPLITME-->',$text);\n\n // Set the texts for this article\n $this->article_title = $array[0];\n $this->article_body = $array[1];\n $this->article_comments = $array[2];\n if(strpos($this->article_body, '<!--DESCRIPTION-->')) {\n $this->article_description = strip_tags((explode('<!--DESCRIPTION-->', $this->article_body))[0]);\n } else {\n $this->article_description = '';\n }\n // Confirm the existence of the article\n $this->existence = true;\n }\n }", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "function __construct($file){\t\t\n\t\t$this->pathFile = $file;\t\t\t\t\t\t\t\t\t\t// inisialisasi pathFile\n\t\t$this->filename = pathinfo($this->pathFile)['filename'];\t\t//mengambil namafile dari pathFile\n\t\t$this->getTextInside();\t\t\t\t\t\t\t\t\t\t\t//menjalankan fungsi getTextInside\n\t}", "protected function _setFile()\n\t{\n\t\t$this->_moveToImageDir();\n\n\t\tif (!$this->_validateMimeType()) {\n\t\t\tunlink($this->getFilePath()); // delete file\n\t\t\tthrow new Exception('Not Allowed MIME Type File ERROR!');\n\t\t}\n\n\t\t$this->_file = file_get_contents($this->getFilePath());\n\t}", "function readFile(){\n $this->setHeaders();\n $this->readContent();\n\n }", "public function __construct($file)\n {\n $this->file = $file;\n }", "function __construct($file_path)\n {\n $this->open($file_path);\n }", "public function setFile($file) {}", "protected static function file()\n {\n }", "public function setFile($file)\n {\n $this->file = $file;\n $this->load();\n }", "function __construct($file_path, $template_file) {\r\n $this->cachefile = './app/_cache/'.$this->base64_url($file_path);\r\n # collect an md5 of all files\r\n $this->hash = $this->create_hash();\r\n # determine our file type so we know how (and if) to comment \r\n $this->filetype = $this->set_filetype($template_file);\r\n $this->comment_tags = $this->set_comment_tags();\r\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function __load();", "public function __construct(FileInterface $file) {\n $this->file = $file;\n }", "function __construct() {\n\t\t$script = $_SERVER['SCRIPT_FILENAME'];\n\t\t$dir = preg_replace('/index.php/', '', $script);\n\t\t$this->_path = preg_replace('/\\//', DIRECTORY_SEPARATOR, $dir . $this->fileName);\n\t\t$this->_fileContent = file_get_contents($this->_path);\n\t\t$this->read();\n\t}", "public function __construct($filename);", "public function __wakeup() {\n\t\t$this->validateFileContents();\n\t}", "public function open() {\n $this->fileHandle = fopen($this->fileName, 'rb');\n }", "public function load() {\n if ($this->cat === \"url\" && !file_exists($this->sourcepath)) Path::download($this->originalName, $this->sourcepath);\n }", "public function __construct(File $file)\n {\n $this->file = $file;\n }", "public function __construct(File $file)\n {\n $this->file = $file;\n }", "public function __construct(File $file)\n {\n $this->file = $file;\n }", "public function __construct(File $file)\n {\n $this->file = $file;\n }", "public function __construct($file)\n\t{\n\t\t$this->file = $file;\n\t}", "protected function load()\n\t{\n //---------------------\n\t\tif (($handle = simplexml_load_file($this->_origin)) !== FALSE)\n\t\t{\n $this->_fields = array(\"id\",\"task\",\"priority\",\"size\",\"group\",\"deadline\", \"status\",\"flag\");\n foreach($handle as $item){\n $record = new stdClass();\n for ($i = 0; $i < count($this->_fields); $i ++ )\n $record->{$this->_fields[$i]} = (string)$item[$this->_fields[$i]];\n $this->_data[$record->id] = $record;\n }\n\t\t}\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "protected function load()\n {\n if ($this->contentLoaded) {\n return;\n }\n\n $content = file_get_contents($this->path);\n\n if (!$content) {\n $this->contentLoaded = true;\n return;\n }\n\n preg_match_all('/\\@([a-z]+)\\s([^\\r\\n\\@]+)/i', $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $fullMatch = $match[0];\n $variable = $match[1];\n $value = $match[2];\n\n $content = str_replace($fullMatch, '', $content);\n $this->metadata[$variable] = $value;\n }\n\n $this->content = trim($content, \"\\r\\n\");\n $this->contentLoaded = true;\n }", "function __construct($file = null){\n\t\t$this->file = $file;\n\t}", "public function loadFile($filePath);", "function __construct($file=null) {\n $this->file = $file;\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n\t{\n\t\tparent::__construct(\n array(\n 'singular' => 'orghub-upload',\n 'plural' => 'orghub-upload',\n 'ajax' => false\n )\n );\n\n\t\t$columns = $this->get_columns();\n\t\t$hidden = $this->get_hidden_columns();\n\t\t$sortable = $this->get_sortable_columns();\n\t\t$this->_column_headers = array( $columns, $hidden, $sortable );\n\t}", "public function __construct()\n {\n $this->createObjects();\n\n $fileVersion = $this->_fileVersion->get();\n $this->loadResources(array(\n 'css' => $fileVersion['css']['posts'],\n 'js' => $fileVersion['js']['posts'])\n );\n }", "public function __construct(File $file)\n\t{\n\t\t$this->file = $file;\n\t}", "public function __construct(string $file_path);", "public function __construct(File $file) {\n parent::__construct();\n $this->file = $file;\n if ($file->exists() && $file->isFile()) {\n $this->readHandle = \\fopen(FileSystem::getFileSystem()->localFileName($file->getAbsolutePath()), \"rb\");\n } else {\n throw new FileNotFoundException($file->getAbsolutePath());\n }\n }", "public function __construct($filename=''){\t\t\n\t\t$this->_filename = $filename;\n\t}", "public function LoadFile($fileId)\r\n\t{\r\n\t\t$queryFileInfo = \"SELECT filename,upload_date,secret_key,size,user_id,group_id,status FROM files WHERE file_id=\".$fileId;\r\n\t\t$fileInfo = $this->sqlDataBase->query($queryFileInfo);\r\n\t\t$this->fileName = $fileInfo[0]['filename'];\r\n\t\t$this->uploadDate = $fileInfo[0]['upload_date'];\r\n\t\t$this->secretKey = $fileInfo[0]['secret_key'];\r\n\t\t$this->fileSize = $fileInfo[0]['size'];\r\n\t\t$this->userId = $fileInfo[0]['user_id'];\r\n\t\t$this->groupId = $fileInfo[0]['group_id'];\r\n\t\t$this->fileId = $fileId;\r\n\t\t$this->status = $fileInfo[0]['status'];\r\n\t}", "function __construct($source)\r\n\t{\r\n\t\tglobal $user_root;\r\n\t\tif (!file_exists($source))\r\n\t\t\tServer::Error(\"FileInfo: File/Directory does not exist. ({$source})<br/>\\n\");\r\n\r\n\t\tif (!empty($user_root))\r\n\t\t\t$this->owned = strlen(strstr($source, $user_root)) > 0;\r\n\r\n\t\t$this->bitpos = 0;\r\n\t\t$this->path = $source;\r\n\t\t$this->dir = dirname($source);\r\n\t\t$this->filename = basename($source);\r\n\t\t$this->show = true;\r\n\r\n\t\t$finfo = $this->dir.'/.'.$this->filename;\r\n\t\tif (is_file($finfo) && file_exists($finfo))\r\n\t\t{\r\n\t\t\t$this->info = unserialize(file_get_contents($finfo));\r\n\t\t\tif (!isset($this->info))\r\n\t\t\t\tError(\"Failed to unserialize: {$finfo}<br/>\\n\");\r\n\t\t}\r\n\t\telse $this->info = array();\r\n\t}", "public function __construct(FileInterface $file)\n {\n $this->file = $file;\n }", "public function __construct($file = \"\")\n {\n $this->file = $file;\n }", "public function __load(){\n\t\t $this->zajlib->load->controller('system/api/file.ctl.php');\n }", "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public function load(): void;", "public function load(): void;", "function __construct($filePath) {\r\n $this->_file = parse_ini_file($filePath, true);\r\n }" ]
[ "0.7159727", "0.71207863", "0.6846195", "0.67489153", "0.6740292", "0.6719352", "0.6694638", "0.66943544", "0.66710675", "0.6628941", "0.6544299", "0.6512284", "0.65060765", "0.65060765", "0.65060765", "0.6363005", "0.6299895", "0.6299895", "0.6299895", "0.6299895", "0.6278842", "0.6213297", "0.62092173", "0.61707705", "0.61707705", "0.61137825", "0.61017245", "0.60831463", "0.60352373", "0.6034269", "0.6020406", "0.6007679", "0.6006438", "0.6005911", "0.6003697", "0.60008585", "0.59870934", "0.59818155", "0.5973922", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5953282", "0.5941986", "0.59343654", "0.59182966", "0.59129316", "0.59119266", "0.5894247", "0.58841074", "0.5881658", "0.58812463", "0.5876218", "0.58756804", "0.58756804", "0.58756804", "0.58749557", "0.58701074", "0.5867371", "0.5853348", "0.58425254", "0.5841613", "0.5841047", "0.5831675", "0.58159006", "0.58159006", "0.58159006", "0.58159006", "0.58056575", "0.579246", "0.5779079", "0.57721967", "0.57714987", "0.5770937", "0.5766082", "0.5766082", "0.57649964", "0.57580984", "0.575734", "0.5749745", "0.5743469", "0.57421494", "0.57391554", "0.5729025", "0.5723681", "0.5722668", "0.5722633", "0.5716249", "0.5716249", "0.5706845", "0.5706845", "0.5699684" ]
0.0
-1
Deletes a file by filename.
public function delete($filename) { $this->checkFileExists($filename); unlink($filename); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($filename);", "public function file_delete($filename);", "public function delete($filename){\n\t\t$file = $this->$dirname.'/'.$filename;\n\t\tif (file_exists($file)){\n\t\t\tunlink($file);\t\t\t\n\t\t}\n\t}", "public function delete($filepath);", "public function deleteFile($filename) {\r\n global $db;\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n\r\n if(!isset($userId) || !isset($trackingId)) {\r\n throw new Exception(\"Unable to delete file \" . $filePath . \". Missing tracking form information.\");\r\n }\r\n\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n $filePath = realpath($filePath);\r\n if(is_readable($filePath)){\r\n unlink($filePath);\r\n $sql = \"DELETE FROM `forms_tracking_files` WHERE `name` = '\" . $filename . \"' AND `trackingId` = \" . $trackingId;\r\n $db->Execute($sql);\r\n }\r\n\r\n $this->loadFilesFromDir($basePath); // refresh what files are associated with this trackingform\r\n }", "protected function removeFilename($filename){@unlink($filename);}", "abstract function delete_file($filepath);", "public static function deleteFile($filename)\n {\n if (is_file($filename))\n return unlink ($filename);\n if (!is_dir($filename))\n return false;\n foreach (glob($filename . '/*') as $file)\n if (!self::deleteFile($file))\n return false;\n return rmdir($filename);\n }", "public function delete($filename = null)\r\n\t{\r\n\t try\r\n\t {\r\n\t\t//if file name not supplied set it to the last file that was created\r\n\t\t$filename = $filename == '' ? $this->tmp_file : $this->tmp_path . '\\\\' . $filename . '.tmp';\r\n\t\t\r\n\t\t//test to see if still exists\r\n\t\tif(! file_exists($filename))\r\n\t\t{\r\n\t\t\tthrow new FileNotFoundException($filename);\r\n\t\t}\r\n\r\n\t\tunlink($filename) or die(\"Error can't delete file.\");\r\n\t\tif(file_exists($filename . '.out')) unlink($filename . '.out') or die(\"Error can't delete file.\");\r\n\t\t\r\n\t\treturn \"Files deleted.\";\r\n\t }\r\n\t catch(Exception $e)\r\n\t {\r\n\t\t$this->preview($e);\r\n\t }\r\n\t}", "public function deleteFile($id, $filename)\n {\n if ($this->authHelper->checkUserValidation($id)) {\n $this->fileHelper->deleteStoryMediaFile($id, $filename);\n\n $this->story->changeFinalStatus($id, false);\n }\n }", "public function delete($file)\n {\n $file = $this->getFilePath($file);\n\n if (file_exists($file)) {\n unlink($file);\n }\n }", "public function deleteFile($file)\n {\n $this->getParent(explode('/', dirname($file)))->_deleteFile($file);\n }", "protected function deleteFile($file) {\n if (file_exists($file)) {\n unlink($file);\n $this->log(\"Deleted the file \".$file);\n } else {\n $this->log(\"Could not delete file \".$file.\". File not found.\");\n }\n }", "public function unlink($file);", "static public function deleteFile($file = false) {\n\n if ($file)\n unlink($file);\n else\n unlink($this->filePath);\n }", "public static function deleteFile(string $filename): bool\n\t{\n\t\treturn (file_exists($filename) && self::isAuthorizedPath($filename))\n\t\t\t? unlink($filename)\n\t\t\t: false;\n\t}", "public function delete($file) {\n\t}", "public function deleteFile($filename, $dir, $throwNotExistsException = false)\n {\n // TODO: Implement deleteFile() method.\n }", "public static function deleteFile($fileName, $userId);", "public function destroy($filename)\n {\n $file = File::where('name', $filename)->first();\n\n try {\n Storage::cloud()->delete($file->path);\n $file->delete();\n\n return redirect()->route('drives.index')->with([\n 'message' => 'Sukses menghapus file'\n ]);\n } catch (\\Throwable $th) {\n abort(500);\n }\n }", "public static function deleteFile($file)\n {\n @unlink('uploads/'.$file);\n }", "public function DeleteFile()\r\n\t{\r\n\t\t$queryDeleteFile = \"UPDATE files SET status=\\\"DELETED\\\" WHERE file_id=\".$this->fileId;\r\n\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\tunlink(UPLOAD_PATH. DIRECTORY_SEPARATOR .$this->fileId);\r\n\t}", "private function deleteFile(string $name)\n {\n foreach ($this->listFiles($name) as $key) {\n $this->storage->delete($key);\n }\n }", "public static function delete($filename)\n {\n return Storage::disk('public')->delete(static::relativePath($filename));\n }", "private function deleteFileOnClose ( $filename )\n\t{\n\t\tregister_shutdown_function(function($file) {\n\t\t\tif (file_exists($file))\n\t\t\t\tunlink($file);\n\t\t}, $filename);\n\t}", "public function deleteFile($file)\n {\n if (!$this->filesystem->has($file)) {\n return;\n }\n\n $this->filesystem->delete($file);\n $this->cacheManager->remove($file);\n }", "public function deleteFile(int $companyId, string $filename)\n {\n $this->client->mustBeAuthenticated();\n\n return $this->client->delete(\"companies/{$companyId}/files/{$filename}\");\n }", "public static function delete($name, $filename, array $options = array()) {\n\t\t$settings = static::config();\n\n\t\tif (!isset($settings[$name])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$method = static::adapter($name)->delete($filename);\n\t\t$params = compact('filename');\n\t\treturn static::_filter(__FUNCTION__, $params, $method, $settings[$name]['filters']);\n\t}", "public function delete($filePath)\n {\n if (!file_exists($filePath)) {\n throw new FileNonExistentException();\n }\n unlink($filePath);\n }", "public function delete_file($filename) {\n if (!file_exists($this->get_file_path($filename))) {\n return false;\n }\n\n if (!unlink($this->get_file_path($filename)) ||\n !unlink($this->get_key_path($this, $filename))) {\n return false;\n }\n /* the signature might not exists, so we don't check the return value */\n unlink($this->get_signature_path($filename));\n\n\n $stmt = $this->pdo->prepare('select u.name from user u, share s, file f where s.owner_id = :id and f.user_id = u.id and s.file_id = f.id and f.filename = :filename');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':filename', $filename);\n if (!$stmt->execute()) {\n return false;\n }\n $res = $stmt->fetchAll();\n foreach ($res as $username) {\n $user = User::find($username);\n if (!unlink($user->get_key_path($this, $filename))) {\n return false;\n }\n }\n\n /* The database schema uses the on-cascade deletion for the share\n table, so we don't have to delete those items ourselves */\n $stmt = $this->pdo->prepare('delete from file where user_id = :id and filename = :filename');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':filename', $filename);\n if (!$stmt->execute()) {\n return false;\n }\n\n return true;\n }", "private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record from the database.\n }", "public static function deleteFile($file){\n\t\t\t//@-> PARA N MOSTRAR ALGUM TIPO DE AVISO\n\t\t\t@unlink('uploads/'.$file);\n\t\t}", "private function delete_file($file){\n\t\t$fileLink = fopen($file,'w');\n\t\tfclose($fileLink);\n\t\tunlink($file);\n\t}", "public function delete($file_name)\n {\n if (app('files')->delete(LogViewer::pathToLogFile(base64_decode($file_name)))) {\n return 'success';\n }\n\n abort(404, trans('backpack::logmanager.log_file_doesnt_exist'));\n }", "function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\n\t}", "private function _deleteFile($file)\n {\n $this->_files[basename($file)]->delete();\n unset($this->_files[basename($file)]);\n $this->_prune();\n }", "protected function deleteFile($file)\n {\n $oldFile = trim($file, config('app.url'));\n Storage::delete('public/' . $oldFile);\n }", "function delete_file($file) {\n\treturn @unlink($file);\n}", "public function deleteFile($filename, $dir, $throwNotExistsException = false)\n {\n return $this->filesystem->deleteFile($filename, $dir, $throwNotExistsException);\n }", "public function rm($filename)\n {\n $nodes = $this->idx_tree->nodes();\n unset($nodes[$filename]);\n $this->idx_tree->nodes($nodes);\n }", "public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "public function deleted(File $file)\n {\n media()->delete($file->filename);\n }", "public static function deleteFile ($path) {\n\t\t\\unlink($path);\n\t}", "public function removeFile($fileName) {\n\n try {\n $this->deleteFileRecord($fileName);\n shell_exec('sudo rm /Stream/\"' . $fileName . '\"');\n } catch (\\Exception $exception) {\n throw new \\Exception($exception);\n }\n\n }", "public function delete($fileName)\n\t{\n\t\t$targetFile = $this->translatePath($fileName);\n\n\t\ttry\n\t\t{\n\t\t\t$ret = @ssh2_sftp_unlink($this->sftpHandle, $targetFile);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$ret = false;\n\t\t}\n\n\t\treturn $ret;\n\t}", "function deleteFile($filePath){\n if(file_exists($filePath)){\n unlink($filePath);\n }else{\n echo \"DeleteFile Failed : File NOT Exist!\";\n }\n}", "function ajaxdeletefile($filename = null){\n\n\t\t$filename = base64_decode(urldecode($filename));\n\n\t\t//Delete uploaddir\n\t\tif(file_exists($this->uploaddir.$filename)){\n\t\t\tunlink($this->uploaddir.$filename);\n\t\t}\n\n\t\t//Delete torrent\n\t\tif(file_exists($this->torrentdir.$filename.'.torrent')){\n\t\t\tunlink($this->torrentdir.$filename.'.torrent');\n\t\t}\n\n\t\t//Delete from DB\n\t\t$this->Torrent->deleteAll(array('name'=>$filename));\n\n\t\t$this->autoRender = false; //Dont render view. Complete action will update screen\n\t}", "protected function removeFile()\n {\n if (@is_file($this->getFilePath())) {\n @unlink($this->getFilePath());\n }\n }", "public function delete_file( string $blob_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\t\t$blob_client->deleteBlob( $container_name, $blob_name );\n\t}", "public static function deleteFile( string $path = '', string $filename = ''){\n if($path == '' || $filename =='' || !file_exists($path.DS.$filename)) {\n return false;\n }else{\n $fullpath = ROOT.DS.$path.DS.$filename;\n unlink($fullpath);\n return true;\n }\n }", "function fileDelete(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tmysql_query(deleteObject($GLOBALS['objectId']));\n\t\t\tmysql_query(deleteFile($GLOBALS['fileId']));\n\t\t\tdie();\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"filesURL\")));\n\t}", "protected function remove($filename)\n\t{\n\t\tif ($this->debug)\n\t\t{\n\t\t\treturn \"echo {$filename}\";\n\t\t}\n\n\t\tif ($this->isWindowsEnvironment)\n\t\t{\n\t\t\treturn \"DEL /F /S /Q /A {$filename}\";\n\t\t}\n\n\t\treturn \"rm -f {$filename}\";\n\t}", "public function deleteFile($path) {\n \n if($path != null) {\n unlink($path);\n }\n }", "function delFile($path)\n {\n unlink($this->dir . DIRECTORY_SEPARATOR . $path);\n }", "protected function deleteFile($fid, $feed_nid) {\n if ($file = file_load($fid)) {\n file_usage_delete($file, 'feeds', get_class($this), $feed_nid);\n file_delete($file);\n }\n }", "function deleteFile($hash);", "public function delete( $fileID )\n {//--------------->> delete()\n $this->_DAO->delete( $fileID );\n }", "function cemhub_delete_file($file_name) {\n $successfully_deleted = FALSE;\n\n $file_details = cemhub_retrieve_file_details($file_name);\n if (!empty($file_details)) {\n $successfully_deleted = file_delete($file_details, TRUE);\n }\n else {\n $repository_path = cemhub_get_files_repository_path(TRUE);\n $successfully_deleted = file_unmanaged_delete($repository_path . '/' . $file_name);\n }\n\n if ($successfully_deleted) {\n watchdog('cemhub', 'The file \"' . $file_name . '\" was deleted successfully.');\n }\n else {\n watchdog('cemhub', 'It was not possible to delete file \"' . $file_name . '\", checks the Drupal file log to view more details.');\n }\n\n return $successfully_deleted;\n}", "public function deleteFile( $path )\n {\n return unlink( $path );\n }", "public function removeFile($file)\n {\n $this->filesystem->remove($file);\n }", "function deleteFile($fileID){\r\n\t\tglobal $file_upload_folder;\r\n\t\t\r\n\t\t// IMPORTANT: Permission checking is currently not done here. It is done by the web gui. \r\n\t\t// Links to delete files only show up when userCanDeleteFile() returns true.\r\n\t\t// This is something to keep in mind for future pansophy versions.\r\n\t\t\r\n\t\t// delete file from server\r\n\t\tif(file_exists($file_upload_folder.$fileID)){\r\n\t\t\tif(unlink($file_upload_folder.$fileID)){\t\r\n\t\t\t\t// delete references of file from database\r\n\t\t\t\t$query = \"DELETE FROM `attachments` WHERE ID='\".$fileID.\"'\";\r\n\t\t\t\treturn mysql_query( $query );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static function deleteFile($path) {\n if (is_file($path)) {\n return unlink($path);\n } else {\n throw new Visio\\Exception\\FileNotFound('File \\'' . $path . '\\' not found!');\n }\n }", "public function DeleteFile() {\n\n\t\tif ($this->parameter_check) {\n\n\t\t\t/* DATABASE CONNECTION */\n\t\t\t$db=$GLOBALS['db'];\n\n\t\t\t/* DESCRIPTION MUST ALWAYS COME FIRST BEFORE WE DELETE THE RECORDS */\n\t\t\t$description=GetColumnValue(\"filename\",\"document_files\",\"document_id\",$this->document_id,\"\"). \" - deleted\";\n\n\t\t\t/* LOG FIRST */\n\t\t\tLogDocumentFileHistory($this->GetColVal(\"filename\"),$this->GetColVal(\"category_id\"),$this->GetColVal(\"version_number\"),$description);\n\n\t\t\t$sql=\"DELETE FROM \".$GLOBALS['database_prefix'].\"document_files\n\t\t\t\t\t\tWHERE filename = '\".$this->GetColVal(\"filename\").\"'\n\t\t\t\t\t\t\";\n\t\t\t$result=$db->Query($sql);\n\t\t\tif ($db->AffectedRows($result) > 0) {\n\t\t\t\treturn True;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn False;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->Errors(\"Parameter check failed\");\n\t\t\treturn False;\n\t\t}\n\t}", "public function deleteAsset($path_to_file)\n\t{\n\t\t$path_to_file = rawurlencode(urldecode($path_to_file));\n\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=filemgr&filemgraction=delete&filename=\".$path_to_file;\n\t\t$result = json_decode($this->curlObj->fetch_url($url),true);\n \n\t\treturn $result[\"MSG\"];\n\t}", "public function deleteFile($task_id, $file_id)\n {\n $fileDB = \\App\\File::find($file_id);\n Storage::delete($fileDB->path);\n\n $fileDB->delete();\n\n return redirect('/tasks/'. $task_id . '/edit');\n }", "public function delete($files);", "public function delete($file){\n\t\t\n\t\t//If the users file exists try to delete it\n\t\tif(file_exists($file))\n\t\t{\n\t\t\tunlink($file) or die($this->openFile(\"core/fragments/errors/error34.phtml\"));\n\t\t}\n\t}", "public static function deleteUploadedFile($filename) {\n\n $resultOk = false;\n\n $uploadPath = Configuration::getPath('uploadsMedium');\n $tmbUploadPath = Configuration::getPath('uploadsThumb');\n\n if ( ! $filename) {\n $resultOk = true;\n }\n else {\n if (file_exists($uploadPath . $filename)) {\n if (unlink($uploadPath . $filename)) {\n if (file_exists($tmbUploadPath . $filename)) {\n if (unlink($tmbUploadPath . $filename)) {\n $resultOk = true;\n }\n }\n }\n }\n }\n return $resultOk;\n }", "public static function delete_file_on_disk($file_id)\n {\n $hash = self::get_hash_by_file_id($file_id);\n if (!$hash) {\n return;\n }\n\n $filepath = self::get_storage_file_path($hash);\n @unlink($filepath);\n // remove leftover dirs if empty\n for ($i = 0; $i <= 4; $i++) {\n $filepath = dirname($filepath);\n if (!@rmdir($filepath)) {\n break;\n }\n }\n DB::Execute('UPDATE utils_filestorage_files SET deleted=1 WHERE id=%d', array($file_id));\n DB::Execute('UPDATE utils_filestorage SET deleted=1 WHERE file_id=%d', array($file_id));\n }", "public function detachFile($filename) {\r\n\t\tunset($this->_attachedFiles[$filename]);\r\n\t}", "public function deleteFiles( string $fileName)\n {\n \n if (unlink($fileName)) {\n return true;\n } else {\n $this->setError('Ooops...Error to delete ' . $fileName);\n return false;\n }\n }", "function remove_file_from_db( $fn ) {\n // Prepare DELETE statement for selected file\n $delete = \"DELETE FROM files WHERE filename = :filename\";\n $stmt = $this->pdo->prepare($delete);\n\n //Bind parameters\n $stmt->bindParam(':filename', $fn);\n\n //Execute statement\n $stmt->execute();\n\n return;\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function deleted(File $file)\n {\n //\n }", "protected function deleteFile($alias)\n {\n $path = \\Yii::getAlias($alias);\n if (file_exists($path)) {\n @unlink($path);\n }\n }", "protected function delete($path) \n\t{\n\t $path = $this->absolutePath($path);\n\t \n\t if (file_exists($path))\n\t {\n\t unlink($path);\n\t $this->log(\"File $path deleted.\");\n\t }\n\t else\n\t {\n\t $this->log(\"File $path not found.\");\n\t }\n\t}", "function deleteFile($uuid) {\r\n $sql = '\r\n DELETE FROM\r\n files\r\n WHERE\r\n uuid = ?\r\n ';\r\n\r\n return $this->query_exec($sql, array($uuid));\r\n }", "public function handleDeleting($filePath): string\n {\n if ($this->shouldRemove($filePath)) {\n unlink($this->getWebpPath($filePath));\n }\n return $filePath;\n }", "protected function deleteFile($attribute)\n {\n try {\n Yii::$app->fs->delete($this->getUploadPath() . $this->$attribute);\n } catch (Exception $e) {\n // If the file couldn't be remove, silence the error.\n }\n }", "public function delete(string $fileName = '') : int\n\t\t{\n\t\t$count = 0;\n\n\t\tforeach (\\glob($this->getSerializedName($fileName, '.*')) as $file)\n\t\t\t{\n\t\t\t\\unlink($file);\n\t\t\t++$count;\n\t\t\t}\n\n\t\treturn $count;\n\t\t}", "function file_delete($route) {\n\tif (file_exists($route)) {\n\t\tunlink($route);\n\t}\n}", "function delete_file($file) {\n return @unlink($file);\n}", "public function delete_file($key)\n {\n }", "function delete($name) {\n @unlink($this->path . \"/$name\");\n }", "function file_delete($file,$path)\n{\n\tif(unlink($path.\"/\".$file))\n\t{\n\t\treturn true;\n\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "protected function deleteFileRequest(Requests\\DeleteFileRequest $request)\n {\n\n $resourcePath = '/slides/storage/file/{path}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->storageName !== null) {\n $queryParams['storageName'] = ObjectSerializer::toQueryValue($request->storageName);\n }\n // query params\n if ($request->versionId !== null) {\n $queryParams['versionId'] = ObjectSerializer::toQueryValue($request->versionId);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"path\", $request->path);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'DELETE');\n }", "function delete_file($fname, $dir = 'avatars/')\n{\n\tglobal $sql;\n\t$fname = trim($fname);\n\tif (!$fname) return false;\n\n\tif (preg_match(\"#Binary (.*?)/#\", $fname, $match))\n\t{\n\t\treturn $sql -> db_Delete(\"rbinary\", \"binary_id='\".$tp -> toDB($match[1]).\"'\");\n\t}\n\telseif (file_exists(e_UPLOAD.$dir.$fname))\n\t{\n\t\tunlink(e_UPLOAD.$dir.$fname);\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function delete(string $inPath, ?string $filename): void\n {\n // if there is no image filename provided we can't do anything\n if ($filename === null || $filename === '') {\n return;\n }\n $finder = new Finder();\n foreach ($finder->directories()->in($inPath) as $directory) {\n $fileName = $directory->getRealPath() . '/' . $filename;\n if (is_file($fileName)) {\n $this->filesystem->remove($fileName);\n }\n }\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 }", "function DeleteFile()\n{\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>file not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$bIsFileDelete = false; \n\t\n\tif(is_dir($sFileUrl) === true)\n\t{\n\t\t$bIsFileDelete = UnlinkRecursive($sFileUrl);\n\t} else\n\t{\n\t\t$bIsFileDelete = unlink($sFileUrl);\n\t}\n\t\n\tif($bIsFileDelete === true)\n\t{\n\t\tif(file_exists($sFileUrl) === false)\n\t\t{\n\t\t\techo '<correct>correct delete file</correct>';\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant delete file</fail>';\n\t}\n\t\n\treturn;\n}", "public function delete($filename)\n {\n $sessionVideo = Video::where('file_name', 'like', $filename)->first();\n\n if (empty($sessionVideo)) {\n $sessionVideo = Video::where('display_name', 'like', $filename)->first();\n if (empty($sessionVideo)) {\n return Response::json([\n 'status' => false,\n 'file_name' => $filename,\n 'code' => 400\n ], 400);\n }\n }\n $path = storage_path($this->full_save_path . $filename);\n if (File::exists($path)) {\n Storage::delete('uploads/images/' . $filename);\n }\n if (!empty($sessionVideo)) {\n $sessionVideo->delete();\n }\n return Response::json([\n 'status' => true,\n 'id' => $sessionVideo->id,\n 'filename' => $filename,\n 'message' => 'تم حذف الفيديو بنجاح',\n 'code' => 200\n ], 200);\n }", "public static function deleteByFileId($file_id) {\n\t\tif (!$file_id) return false;\n\t\treturn self::_getDao()->deleteByFileId(intval($file_id));\n\t}", "public function delete($path);", "public function delete($path);", "protected function unlink($filename)\n {\n return $this->fileExists($filename) ? \\unlink($filename) : false;\n }", "public function delete(string $dirName, string $fileName, string $extension)\n {\n try {\n // Delete from only the active datasource\n if ($this->forceDeleting) {\n $this->getActiveDatasource()->forceDelete($dirName, $fileName, $extension);\n } else {\n $this->getActiveDatasource()->delete($dirName, $fileName, $extension);\n }\n }\n catch (Exception $ex) {\n // Only attempt to do an insert-delete when not force deleting the record\n if (!$this->forceDeleting) {\n // Check to see if this is a valid path to delete\n $path = $this->makeFilePath($dirName, $fileName, $extension);\n\n if (in_array($path, $this->getValidPaths($dirName))) {\n // Retrieve the current record\n $record = $this->selectOne($dirName, $fileName, $extension);\n\n // Insert the current record into the active datasource so we can mark it as deleted\n $this->insert($dirName, $fileName, $extension, $record['content']);\n\n // Perform the deletion on the newly inserted record\n $this->delete($dirName, $fileName, $extension);\n } else {\n throw (new DeleteFileException)->setInvalidPath($path);\n }\n }\n }\n\n // Refresh the cache\n $this->populateCache(true);\n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "public function deleteFileFromServer($p_fileToRemove)\n {\n unlink($p_fileToRemove);\n }", "abstract public function deleteFile(FileData $fileData);", "public function removeFile(File $file)\n {\n $this->files->removeElement($file);\n }" ]
[ "0.8597109", "0.81556153", "0.78803617", "0.77359736", "0.76310647", "0.72014946", "0.7197813", "0.71353656", "0.70992905", "0.70850694", "0.7084064", "0.6961735", "0.6946252", "0.6930064", "0.6902851", "0.6901438", "0.68636125", "0.6862713", "0.685725", "0.68372184", "0.6785343", "0.6742407", "0.6713239", "0.6692708", "0.6676768", "0.66630393", "0.66594243", "0.66558564", "0.6639087", "0.66324717", "0.6613833", "0.66071415", "0.65898275", "0.64970386", "0.6487555", "0.64826405", "0.6475184", "0.64609355", "0.6460633", "0.64170265", "0.64141846", "0.6396511", "0.6387779", "0.63823473", "0.6362662", "0.6343487", "0.6330638", "0.6280515", "0.6263932", "0.6256067", "0.62450635", "0.6240469", "0.62296003", "0.62186134", "0.6213703", "0.61921805", "0.6186478", "0.61820316", "0.616191", "0.6154941", "0.61540025", "0.6150265", "0.6147622", "0.6143126", "0.613131", "0.61217976", "0.6100442", "0.60997134", "0.6097243", "0.60880363", "0.6082741", "0.6075968", "0.6075166", "0.6066383", "0.60617316", "0.60503894", "0.60474473", "0.60356116", "0.6015754", "0.60024506", "0.5978297", "0.59511006", "0.5942421", "0.5932933", "0.59175146", "0.59091866", "0.58997136", "0.58994925", "0.5896571", "0.5888765", "0.58857185", "0.5882926", "0.58828014", "0.58828014", "0.5878644", "0.5871521", "0.58591455", "0.5856182", "0.5846359", "0.5837723" ]
0.6465237
37
Getter for the _contents property
public function getContents() { return $this->contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contents() { return $this->_m_contents; }", "public function getContents() \r\n { \r\n return $this->_contents; \r\n }", "public function contents()\n\t{\n\t\treturn $this->contents;\n\t}", "public function get()\n {\n return $this->contents;\n }", "public function getContent() { return $this->content; }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function getContents(): string\n {\n return $this->contents;\n }", "public function __invoke()\n {\n return $this->contents;\n }", "public function getContent()\r\n {\r\n return $this->content;\r\n }", "function getContent()\n {\n return $this->content;\n }", "function getContent()\n {\n return $this->content;\n }", "public function getContent()\r\n {\r\n return $this->_content;\r\n }", "function getContent()\n {\n return $this->content;\n\n }", "public function getContent()\n {\n return $this->_content;\n }", "protected function getContent() {\n return $this->content;\n }", "function get_content() {\r\n\t\treturn $this->content;\r\n\t}", "public function getContent () {\r\n\t\treturn $this->content;\r\n\t}", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->content;\n }", "public function get_content() {\n return $this->content;\n }", "public function getContents(): array\n {\n return $this->content;\n }", "public function getContent() {\n return $this->content;\n }", "public function getContent()\n\t{\n\t\treturn $this->content_;\n\t}", "public function getContent() {\r\n\t\treturn $this->content;\r\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContent() {\n\t\treturn $this->content;\n\t}", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "public function getContent(){\n\t\treturn $this->content;\n\t}", "public function getContent()\n {\n return $this->content;\n }", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->_content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "public function getContent()\n\t{\n\t\treturn $this->content;\n\t}", "function get_contents(){\n return $this->input_content;\n }", "public function getContent()\n {\n \t$content = $this->content;\n return $content;\n }", "public function getContent(){\n\t\treturn $this->content? $this->content:$this->content = file_get_contents($this->getFullName());\n\t}", "public function getContent(): string\n {\n return $this->_content;\n }", "public function content()\n {\n return $this->content;\n }", "public function content()\n {\n return $this->content;\n }", "public function content()\n {\n return $this->content;\n }", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function Content()\n {\n return $this->content;\n }", "public static function getContent() {\n\t\treturn self::$_content;\n\t}", "function getContent()\n {\n return $this->getAttribute(\"content\");\n }", "public function getContent()\n {\n return file_get_contents($this->fullPath);\n }", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content;\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent()\n {\n return $this->get(self::_CONTENT);\n }", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "public function getContent() : string {\n return $this->content;\n }", "public function getValue(){\n return $this->_content;\n }", "public function getContents()\n {\n }", "public function getContent() : string\n {\n return $this->content;\n }", "public function getContent() : string\n {\n return $this->content;\n }", "public function getContents()\n {\n return $this->getContents();\n }", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "public function get_content() {\n // Check if no content is yet loaded\n if (empty($this->content)) {\n $this->content = @file_get_contents($this->name);\n }\n\n return $this->content;\n }", "public function getContent(): string\n {\n return $this->content->content();\n }", "public function getContent()\n {\n return $this->data;\n }", "public function getContent()\n {\n return $this->data['fields']['content'];\n }", "public function getContents(): string;", "public function getContents(): string;", "public function getContent(): Content\n {\n return $this->content;\n }", "public function content(): string\n {\n return $this->content;\n }", "private function getContents()\n {\n if ($this->contents) {\n return $this->contents;\n }\n\n return $this->contents = $this->directory->getContents();\n }", "public function contents() {\n\t\treturn file_get_contents($this->path);\n\t}" ]
[ "0.87148654", "0.8665406", "0.8361419", "0.83538735", "0.8283608", "0.82739747", "0.82739747", "0.8196425", "0.8168247", "0.81675404", "0.81675404", "0.8148477", "0.81428415", "0.8127802", "0.81182754", "0.81060266", "0.80888414", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8084184", "0.8075007", "0.80576557", "0.80572957", "0.803827", "0.8036101", "0.8023266", "0.8023266", "0.8023266", "0.8021352", "0.8005569", "0.79994875", "0.7979599", "0.7979599", "0.7967277", "0.7967277", "0.7967277", "0.795278", "0.79264337", "0.7913535", "0.7906481", "0.790362", "0.790362", "0.790362", "0.7897004", "0.7897004", "0.7897004", "0.7897004", "0.789694", "0.78940207", "0.7891614", "0.7861823", "0.7827485", "0.78113467", "0.78113467", "0.78113467", "0.7805971", "0.7805971", "0.7805971", "0.7777339", "0.77611005", "0.77294105", "0.7720895", "0.7713874", "0.7713874", "0.7701579", "0.7680318", "0.7680318", "0.7680318", "0.7680318", "0.7680318", "0.76527566", "0.76522183", "0.76373655", "0.75874513", "0.7571871", "0.7571871", "0.75563717", "0.7549411", "0.7516454", "0.75123674" ]
0.8481929
2
Setter for the contents property.
public function setContents($contents = null) { $this->contents = $contents; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setContents($contents) {\n $this->_contents = $contents;\n }", "public function setContent()\n {\n }", "public function setContents($contents)\n {\n $this->_contents = $contents;\n\n return $this;\n }", "protected function setContent() {}", "public function setContents($contents, $encoding = 'UTF-8') {}", "abstract function setContent();", "public function setContent( string $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 setContent($content);", "public function setContent($content){\n $this->_content = $content;\n }", "public function setContent ($content) {\r\n\t\t$this->content = (string)$content;\r\n\t}", "public function setContent($content)\r\n {\r\n $this->content = $content;\r\n }", "public function setContent($content)\r\n {\r\n $this->_content = $content;\r\n }", "function setContent($value)\n {\n $this->setAttribute(\"content\", $value);\n return $this;\n }", "public function content($value) {\n return $this->setProperty('content', $value);\n }", "public function setContent($value)\n {\n return $this->set('Content', $value);\n }", "public function setContent($value)\n {\n return $this->set('Content', $value);\n }", "public function setContent($content)\n {\n $this->_content = $content;\n }", "public function setContent($content)\n\t{\n\t\t$this->content = $content;\n\t}", "public function setContent($content)\n\t{\n\t\t$this->content = $content;\n\t}", "public function setContent($content)\n\t{\n\t\t$this->content = $content;\n\t}", "public function setContent($content) {\n $this->content = $content;\n }", "public function setContent($content)\n {\n $this->content = $content;\n }", "public function setContent($content)\n {\n $this->content = $content;\n }", "public function setContent($content)\n {\n $this->content = $content;\n }", "public function setContent(?string $value): void {\n $this->getBackingStore()->set('content', $value);\n }", "public function setEncapsulateContent($value)\n {\n $this->_encapsulateContent = $value;\n }", "public function setContent($content) {\n\n $this->content = $content;\n }", "public function setContent($content) {\n\n $this->content = $content;\n }", "private function setContentsFromFile()\n {\n $this->file->typeChecker()->assertMarkdown();\n $this->contents = $this->file->contents();\n }", "public function setContent($value)\n {\n return $this->set(self::_CONTENT, $value);\n }", "public function setContent($value)\n {\n return $this->set(self::_CONTENT, $value);\n }", "public function set_content ($content) {\n $this->content = $content;\n }", "public function setFatContent($value)\n {\n $this->fatContent = $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 setFileContents($value)\n {\n return $this->set('FileContents', $value);\n }", "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 setSugarContent($value)\n {\n $this->sugarContent = $value;\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 setContent(string $content): void\n {\n $this->content = $content;\n }", "public function setContent( string $content ) : void\n {\n $this->content = $content;\n }", "public function contents() { return $this->_m_contents; }", "public function setContent(string $content): void\n {\n $this->_content = $content;\n }", "public function setContentAttribute($value)\n {\n $data = [\n 'raw' => $value,\n 'html' => (new Markdowner)->convertMarkdownToHtml($value)\n ];\n\n $this->attributes['content'] = json_encode($data);\n }", "public function setCholesterolContent($value)\n {\n $this->cholesterolContent = $value;\n }", "public function setContent($content){\n $this->_content = $this->checkFormat($content);\n }", "public function setTransFatContent($value)\n {\n $this->transFatContent = $value;\n }", "function setTextContent(&$content) {\n\t\t$this->lobSub->lobText =& $content;\n\t\t$this->repoObj->lobSubType = 'text';\n\t\t$this->repoObj->lobBytes = strlen($content);\n\t\t$this->lobSub->lobBinary = null;\n\t}", "public function setContents($key, $contents, $append = false)\n {\n return $this->getDriver()->setContents($key, $contents, $append);\n }", "public function setSodiumContent($value)\n {\n $this->sodiumContent = $value;\n }", "public function setParsedContentAttribute($value)\n {\n $this->attributes['content'] = $value;\n }", "public function setContent($newContent) {\n\t\t$this->content = $newContent; \n\t}", "public function set_content(string $content) {\n $this->content = $content;\n }", "public function setContent($content) {\n\t\t$this->buffer['content'] = $content;\n\t}", "public function set_content() {\n\n\t\t$this->content = get_the_term_list( $this->data, $this->taxonomy, $this->prepend, $this->delimiter, $this->append );\n\t}", "public function set_cart_contents( $value ) {\n\t\t$this->cart_contents = (array) $value;\n\t}", "public function setContents($contents) : self\n {\n //==============================================================================\n // Safety Check\n if (!is_array($contents) && !($contents instanceof ArrayObject)) {\n return $this;\n }\n //==============================================================================\n // Import Main\n $this->importMainContents($contents);\n //==============================================================================\n // Import Date\n $this->importDateContents($contents);\n\n return $this;\n }", "public function setRawContent($content);", "public function setContent(?StreamInterface $value): void {\n $this->getBackingStore()->set('content', $value);\n }", "public function setContents(string $contents, string $charset): MessagePart\n {\n $this->contents = $contents;\n $this->setCharset($charset);\n return $this;\n }", "public function getContents() \r\n { \r\n return $this->_contents; \r\n }", "public function set_content($content) {\n if (!is_string($content)) { return false; }\n $this->_content = $content;\n return true;\n }", "public function setContent($content)\n {\n return $this->setData(self::CONTENT, $content);\n }", "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 setContent($value) {\n\t\tif(strlen($value) < 1)\n\t\t\tthrow new \\Exception('Comment::setContent() failed: value must be longer than 0');\n\n\t\t$this->content = \\common\\Filter::sanitize($value);\n\t}", "protected function setPlainContent() {}", "public function setContent($content){\n\t\t$this->content = $content;\n\t\t\n\t\treturn $this;\n\t}", "public function appendContents(Contents $value) {\n return $this->append(self::CONTENTS, $value);\n }", "public function set($key, $contents)\n {\n $this->filesystem->put($key, $contents);\n }", "public function silo_contents()\n\t{\n\t}", "public function getContents()\n {\n return $this->contents;\n }", "public function getContents()\n {\n return $this->contents;\n }", "function setContent($c) {\n\t\t$this->set(\"content\",$c);\n\t}", "public function contents()\n\t{\n\t\treturn $this->contents;\n\t}", "public function setCarbohydrateContent($value)\n {\n $this->carbohydrateContent = $value;\n }", "protected function setResourceContents( $path, $content )\n {\n $this->content[$path] = $content;\n }", "function add_to_file_contents($content) {\n\t\t$this->contents .= $content;\n\t}", "public function getContent() { return $this->content; }", "public function setContent($content)\n {\n $this->content = $content;\n return $this;\n }", "public function setContent($content)\n {\n $this->content = $content;\n return $this;\n }", "public function setContent($content)\n {\n $this->content = $content;\n return $this;\n }", "public function setContent($content)\n {\n $this->content = $content;\n return $this;\n }", "public function getContentAttribute()\n\t{\n\t\treturn $this->content;\n\t}", "public function setContent($content)\n {\n $this->content = $content;\n\n return $this;\n }", "protected function saveContents($contents)\n {\n $this->contents = $contents;\n\n try {\n $this->files->put($this->getFilepath(), json_encode($contents));\n } catch (Exception $e) {\n // ...\n }\n }", "abstract public function setContentFromFile($file);", "public function setContent($content = '')\n {\n $this->content = $content;\n $this->size = strlen($content);\n\n return $this;\n }", "public function getContents(): array\n {\n return $this->content;\n }", "function setContent(string $content_html): void\n {\n $this->data['content'] = $content_html;\n }", "public function setContent(string $content): self\n {\n $this->content = $content;\n return $this;\n }" ]
[ "0.8017248", "0.70839447", "0.703775", "0.7002866", "0.69644123", "0.69576067", "0.6836081", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6824474", "0.6760867", "0.6723382", "0.66645396", "0.6642908", "0.66381437", "0.6637179", "0.65961933", "0.65961933", "0.6568709", "0.6544669", "0.6544669", "0.6544669", "0.6540291", "0.65313274", "0.65313274", "0.65313274", "0.6530347", "0.64619154", "0.6460874", "0.6460874", "0.6419572", "0.6418812", "0.6418812", "0.63725704", "0.63644654", "0.63476264", "0.63476264", "0.63476264", "0.6346741", "0.62994426", "0.6277645", "0.62745637", "0.62621564", "0.6251812", "0.6250961", "0.6236481", "0.62342215", "0.61974216", "0.61928225", "0.613153", "0.61286885", "0.61212057", "0.61201084", "0.610931", "0.608301", "0.60633045", "0.6058144", "0.6023082", "0.6019135", "0.6005948", "0.59747183", "0.5972812", "0.5950307", "0.593866", "0.5936068", "0.5926324", "0.59102786", "0.5909753", "0.5889144", "0.5829371", "0.58217174", "0.5818751", "0.5816199", "0.58086056", "0.58086056", "0.58058333", "0.5803864", "0.5793078", "0.5791167", "0.5789043", "0.57758015", "0.5759203", "0.5759203", "0.5759203", "0.5759203", "0.57533634", "0.57386684", "0.5721368", "0.57072604", "0.5695433", "0.568408", "0.56827074", "0.56790847" ]
0.68869364
6
method to throw an exception if a given filename doesn't exist
protected function checkFileExists($filename) { if (! $this->test($filename)) { throw new Exception("File doesn't exist"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function checkFile($filename): void\n {\n if (!file_exists($filename)) {\n throw new FileNotFoundException('\"'.$filename.'\" could not be found');\n }\n }", "private static function checkFileNameExists($fileName)\n {\n if (!file_exists($fileName))\n {\n $functionContext = get_defined_vars();\n throw new gosException_InvalidArgument('File ' . $fileName . ' does not exist', $functionContext);\n }\n }", "public static function getInvalidFile()\n {\n return 'some/non/existing/file.txt';\n }", "static function assertFileNotExists($filename, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertFileNotExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public static function getInvalidFile(): string\n {\n return \"some/non/existing/file.txt\";\n }", "private function filename_check($filename = null)\n {\n if (is_null($filename))\n {\n if (!isset($this->action_arguments['variable_arguments']))\n {\n return;\n }\n \n $filename = $this->action_arguments['variable_arguments'][count($this->action_arguments['variable_arguments']) - 1];\n }\n if ( $filename == '.DS_Store'\n || substr($filename, 0, 2) == '._')\n {\n $this->logger->log(\"Raising 404 for {$filename} because of filename sanity rules\");\n throw new midcom_exception_notfound(\"OS X DotFiles not allowed\");\n }\n }", "public function checkFilePath($file)\n {\n if(!file_exists($file))\n {\n throw new Exception(\"Invalid file\");\n }\n }", "public static function assertFileDoesNotExist(string $filename, string $message = ''): void\n {\n static::assertThat($filename, new LogicalNot(new FileExists()), $message);\n }", "public function testFileExceptions() {\n $xsl_service = new ExcelFileProcessorService();\n\n try {\n $xsl_service->processFile('foo');\n $this->fail();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), 'The file does not exists');\n }\n }", "public function assertFileNotExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileNotExists', func_get_args()));\n }", "public function assertFileNotExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileNotExists', func_get_args()));\n }", "public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }", "static function assertFileExists($filename, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertFileExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }", "public function fileExists($name);", "function find_file($filename, $required = true)\n\t{\n\t\t$file_locations = array($filename);\n\t\t\n\t\t// check system folder first\n\t\t\n\t\tforeach($file_locations as $file) {\n\t\t\t$file .= '.php';\n\t\t\tif (file_exists(APP_PATH . $file))\n\t\t\t\treturn APP_PATH . $file;\n\t\t}\n\t\t\n\t\t// then check app folder\n\t\t\n\t\tforeach($file_locations as $file) {\n\t\t\t$file .= '.php';\n\t\t\tif (file_exists(SYS_PATH . $file))\n\t\t\t\treturn SYS_PATH . $file;\n\t\t}\n\t\t\n\t\tif ($required)\n\t\t\tthrow new Exception(\"File ($file) does not exist\");\n\t\treturn false;\n\t}", "public function file_exists($file);", "public static function checkFileExistence($path , $result){\n if(!$result){\n throw new Exception('Unable to locate message file('.$path.').');\n }\n }", "static function fileExists()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::fileExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }", "public function testToGetJsonFileIfNotExist()\n {\n // when\n $actual = $this->tested->getJsonFromFile('file.json');\n\n // then\n $this->expectException($actual);\n }", "public function testReadNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n try {\n file_get_contents($filename);\n\n $this->fail('Expected read of non-existing file to fail');\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->assertContains('failed to open stream', $e->getMessage());\n }\n }", "protected function validateFileDoesExist($file)\n {\n if (! $this->files->exists($file)) {\n throw new FileNotFoundException();\n }\n }", "private function getFile(string $fileName): string\n {\n $file = $this->defaultPath . \"$fileName.\" . $this->defaultExtension;\n if ($this->checkFileExist($file)) {\n return $file;\n }\n\n throw new FileNotExistException($fileName);\n }", "public function testCsvReaderThrowsFileNotFoundExceptionIfFileNotFound() {\n \n $this->expectException(new Csv_Exception_FileNotFound('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/nonexistant.csv');\n \n }", "protected function throwExceptionImageFileIfNotExists($file)\n {\n if( ! file_exists($file) )\n {\n throw new Exception\\ImageNotFoundException(NULL, $file);\n }\n }", "public function exists(string $message = ''): self {\n if (file_exists(filename: $this->path)) {\n return $this;\n }\n\n throw new \\InvalidArgumentException(\n message: $message ?: \"Path '{$this->path}' does not belong to an existing file or directory.\",\n );\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 fileExists()\n {\n return $this->files->exists($this->path) ? new Exception(\"The class exists!\") : false;\n }", "public function testGetLinesFromFileThrowsExceptionIfFileDoesNotExist(): void\n {\n $file = '/hopefully/this/file/does/not/exist';\n $parser = new IniParser($file);\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('File not found: ' . $file);\n\n $parser->getLinesFromFile();\n }", "protected function detectMissingFiles() {}", "public function testConstructNoExistingFile(): void\n {\n $this->expectException(NotReadableException::class);\n $this->getThumbCreatorInstance('noExistingFile.gif');\n }", "public function exists($filename);", "private function checkSourceExists()\n {\n // Check if source exists\n if (!@file_exists($this->getSource())) {\n throw new TargetNotFoundException('File or directory not found: ' . $this->getSource());\n }\n }", "public static function fileExists($value, $message = '');", "function _bellcom_check_if_file_in_url_exists($file_url) {\n $file_headers = @get_headers($file_url);\n\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n return FALSE;\n }\n else {\n return TRUE;\n }\n}", "public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }", "private function validateFileName($file_name) \r\n {\r\n if (is_null($file_name)) \r\n {\r\n throw new ArgumentNullException(\"fileName is null\");\r\n }\r\n\r\n if (strlen($file_name) == 0) \r\n {\r\n throw new ArgumentException(\"The file name is empty, contains only white spaces, or contains invalid characters.\");\r\n }\r\n \r\n if (strlen($file_name) > 248) \r\n {\r\n throw new PathTooLongException(\"The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.\");\r\n }\r\n }", "function notfound($name, $func = '', $file = '')\n {\n throw new Tonic\\NotFoundException;\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function assertFileExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileExists', func_get_args()));\n }", "public function assertFileExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileExists', func_get_args()));\n }", "static public function IncludeFile($fileName)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t// if file does not exist, then an exception would be generated\r\n\t\t\tif (! file_exists ( Site::$m_indexRoot . $fileName ))\r\n\t\t\t{\r\n\t\t\t\t// if class ExceptionMissFile exist the generate it's instance\r\n\t\t\t\tif (class_exists ( 'ExceptionMissFile' ))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new ExceptionMissFile ( $fileName, $fileName );\r\n\t\t\t\t}\r\n\t\t\t\t// generates regular exception\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception ( $fileName );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn include_once Site::$m_indexRoot . $fileName;\r\n\t\t}\r\n\t\tcatch ( Exception $e )\r\n\t\t{\r\n\t\t\tprint (\"The missed file: \" . $e->getMessage () . \"<br />\\n\") ;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "private function _checkFile( $fileName = false )\r\n\t{\r\n\t\tif( Configure::read() != 0 )\r\n\t\t{\r\n\t\t\t$fileName = str_replace( \"/\", \"\", $fileName );\r\n\t\t\t$fileName = str_replace( \"\\\\\", \"\", $fileName );\r\n\r\n\t\t\tif( file_exists( SERVICE_BROWSER_PATH . $fileName ) )\r\n\t\t\t{\r\n\t\t\t\treturn $fileName;\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function test_upload_file_not_exist() {\n\t\t$filename = '*/:<>?\\|';\n\t\t$upload_path = '';\n\t\t$bucket = '';\n\t\t$response = 'response';\n\t\t$expected_argument = array();\n\t\t$expected_response = false;\n\t\t$s3_helper = $this->create_s3_helper_partial_mock( $this->create_s3_client_partial_mock( $expected_argument, $response ) );\n\t\t$this->assertEquals( $expected_response, $s3_helper->upload( Path_Creator::create_file_path( $filename ), $upload_path, $bucket ) );\n\t}", "public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}", "function testPathNotFoundMovie() {\n try {\n $v = $this->loadMovie(\"path_that_doesnt_exist/movie.mp4\");\n //this assert should never be called\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }", "public function testGetBackupWithInvalidFile()\n {\n $bad_file_name = 'no-file.tar.gz';\n\n $this->backups->expects($this->once())\n ->method('getBackupByFileName')\n ->with($this->equalTo($bad_file_name))\n ->will($this->throwException(new TerminusNotFoundException()));\n\n $this->setExpectedException(TerminusNotFoundException::class);\n\n $this->command->getBackup('mysite.dev', ['file' => $bad_file_name,]);\n }", "public function exists(string $filename) : bool;", "private function file_exists( $path, $filename )\n\t{\n\t\t$finder = new Finder();\n\n\t\ttry {\n\t\t\t$count = $finder\n\t\t\t\t\t\t->files()\n\t\t\t\t\t\t->in($path)\n\t\t\t\t\t\t->name($filename)\n\t\t\t\t\t\t->depth('== 0')\n\t\t\t\t\t\t->count()\n\t\t\t;\n\t\t} catch ( InvalidArgumentException $e ) {\n\t\t\techo json_encode($e->getMessage());\n\t\t\texit;\n\t\t} catch ( Exception $e ) {\n\t\t\t$errors = array(\n\t\t\t\t'error' => $e->getMessage(),\n\t\t\t);\n\n\t\t\t// Set the template here\n\t\t\t$template = File::get( __DIR__ . '/views/error-no-render.html');\n\n\t\t\t$html = Parse::template($template, $errors);\n\n\t\t\theader('Content-Type', 'application/json');\n\t\t\techo self::build_response_json(false, true, FILECLERK_S3_ERROR, $e->getMessage(), 'error', $errors, null, null);\n\t\t\texit;\n\t\t}\n\n\t\treturn $count === 1 ? TRUE : FALSE;\n\t}", "public function verifyFile($fileName){\n if (empty($fileName)){\n throw new Exception(\"Filename can not be empty.\");\n }\n return $this->verify($fileName, null);\n }", "private function validateFilename($filePath)\n {\n if (!file_exists($filePath)) {\n throw new \\InvalidArgumentException(\"File Path specified did not exist\");\n }\n return true;\n }", "function IsFileExist()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === true)\n\t{\n\t\techo '<correct>file exist</correct>';\n\t} else\n\t{\n\t\techo '<correct>file not exist</correct>';\n\t}\n\t\n\treturn;\n}", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "public function test_non_existent_uploadedfile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/uploadedfile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "public function doesNotExists(string $message = ''): self\n {\n Assert::assertFileDoesNotExist($this->actual, $message);\n return $this;\n }", "function validate_file( $file ){\n\tif( strpos( $file, '..' ) !== false )\n\t\treturn false;\n\n\t$file = HOME . $file;\n\n\tif( !file_exists( $file ) )\n\t\treturn false;\n\n\treturn true;\n}", "function fileExists($file){\n\treturn is_file($file) || (@fopen($file,'r')==true);\n}", "function checkFileExists($fileName, $fileType){\n switch($fileType)\n {\n case \"library\":\n if(file_exists($this->libraryBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"config\":\n if(file_exists($this->configBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"controller\":\n if(file_exists($this->controllerBasePath . $fileName . $this->suffix)){\n return true;\n }\n else\n {\n return false;\n }\n case \"model\":\n if(file_exists($this->modelBasePath . $fileName . '_model' . $this->suffix)){\n return true;\n\n }\n else\n {\n return false;\n }\n default:\n echo 'that filetype is fucked';\n }\n }", "public function testExecuteWithBadFile()\n {\n\n $this->commandTester->execute(\n array(\n 'file_path' => __DIR__. '/../Fixtures/stockd.csv',\n '--test_run' => true,\n )\n );\n// $this->assertEquals('File could not be found.' . PHP_EOL, $this->commandTester->getDisplay());\n $this->assertRegexp('/File could not be found./', $this->commandTester->getDisplay());\n\n }", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "public static function file_exists($id, $throw_exception = false)\n {\n \ttry {\n \t\t$meta = is_numeric($id) ? self::meta($id) : $id;\n \t} catch (Exception $e) {\n \t\tif ($throw_exception)\n \t\t\tthrow $e;\n \t\telse \n \t\t\treturn false;\n \t} \n \n if (!file_exists($meta['file'])) {\n if ($throw_exception) {\n throw new Utils_FileStorage_FileNotFound('Exception - file not found: ' . $meta['file']);\n } else {\n return false;\n }\n }\n return true;\n }", "function does_file_exist($mediatype, $filename, $inout = 'in') {\n $params = Array();\n $params['region'] = $this->region;\n $params['mediatype'] = $mediatype;\n $params['filename'] = $filename;\n $params['inout'] = $inout;\n try {\n $ret = poodlltools::call_cloudpoodll('local_cpapi_does_file_exist',$params);\n if(!$ret || !isset($ret->returnCode)) {return 'failed to get aws remote result';}\n if ($ret->returnCode==\"0\") {\n return $ret->returnMessage == 'true';\n } else {\n return $ret->returnMessage;\n }\n } catch (\\Exception $e) {\n return $e->getMessage();\n }\n\n }", "private function checkFile()\n {\n $absDir = DIRREQ.$this->dir;\n if (file_exists($absDir.$this->file.'.php')) {\n $this->page = $absDir.$this->file.'.php';\n } elseif (file_exists($absDir.'index.php')) {\n $this->page = $absDir.'index.php';\n } else {\n $this->page = DIRREQ.'views/404.php'; \n }\n }", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "public function message()\n {\n return \"File not found!\";\n }", "public function testExceptionConfiFileNotFound() {\r\n $this->model->create($this->post());\r\n }", "public function throwNameOfFile( $sName ){\n\t\t$aExp = explode( '.', $sName );\n if( isset( $aExp[0] ) && isset( $aExp[1] ) ){\n unset( $aExp[count( $aExp )-1] );\n $sName = implode( '.', $aExp );\n return $sName;\n }\n else\n return $sName;\n\t}", "private static function _curlFile($filename)\n {\n // set realpath\n $filename = realpath($filename);\n // check a file\n if (!is_file($filename)) {\n throw new Exception('File does not exists');\n }\n // PHP 5.5 introduced a CurlFile object that deprecates\n // the old @filename syntax\n // See: https://wiki.php.net/rfc/curl-file-upload\n if (function_exists('curl_file_create')) {\n return curl_file_create($filename);\n }\n // Use the old style if using an older version of PHP\n return \"@$filename\";\n \n }", "public static function buildNotExistingFileName($path, $filename) {\n\t\treturn \\OC_Helper::buildNotExistingFileName($path, $filename);\n\t}", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public function testFileExists()\n {\n $filePointer = 'Core/RandomNonExistentDirectory/RandomFileNamexhjctgyutcgasghj.php';\n //initial test will fail\n $this->assertFalse(FileExists::exists($filePointer));\n\n // test using a file that should definitely exist\n $filePointer = 'Core/Config/bootstrap.php';\n // if the core has not been tampered with, this test should pass\n $this->assertTrue(FileExists::exists($filePointer));\n }", "public function checkPathExists($path);", "public function testUploadFileNotFound()\n {\n $this->expectException(FilestackException::class);\n $this->expectExceptionCode(400);\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $client->upload('/some/bad/filepath');\n }", "public function check_exists(){\n if(!file_exists($this->file['tmp_name']) ){\n $this->file_name = 'sample.jpg';\n }else{\n $this->tmp_file_name = $this->file['tmp_name'];\n $this->file_type = $this->file['type'];\n $this->file_name = time() . '_' . $this->file['name']; //give name a timestamp to ensure no duplicate images made in the future\n }\n }", "public function testDownloadNotFound()\n {\n $mock_response = new MockHttpResponse(\n 404,\n 'file not found'\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $this->expectException(FilestackException::class);\n $this->expectExceptionCode(404);\n\n $destination = __DIR__ . '/testfiles/my-custom-filename.jpg';\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $client->download('some-bad-file-handle-testing', $destination);\n }", "public function file_exists($filename)\n {\n return @file_exists($filename);\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "public function isFileExist($fileName, $storageOption = null);", "public static function missing() {\n\t\t// -- Construct the 404 error template path\n\t\t$file = APP_ROOT . 'errors' . DS . Error::$not_found . EXT_PHP;\n\n\t\t// -- Check if the 404 error template exists. \n\t\t// -- If it does, require it to the screen. \n\t\t// -- Otherwise, display a simple text message.\n\t\tif( file_exists( $file ) ) {\n\t\t\trequire_once $file;\n\t\t} else {\n\t\t\techo Error::$not_found . ' : Internal Error!';\n\t\t}\n\n\t\texit;\n\t}", "function checkFileIsValid($file) \n {\n if (!is_file($file)) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a file or not exists.', $file)\n );\n }\n if (is_file($file) && mb_stripos($file, '.htm') === false) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a valid file.', $file)\n );\n }\n }", "public function testThrowsExceptionWhenNoTemplateIsFound()\n {\n $this->setExpectedException(\n 'Asar\\Template\\Exception\\TemplateFileNotFound',\n \"No template file found in '/foo/Namespace/Representation/' for resource 'FooResource' with method 'PUT' and type 'json'.\"\n );\n $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'json', 'method' => 'PUT', 'status' => 200),\n 'foundFiles' => array()\n ));\n }", "public function testTemplateFileNotExists1()\n {\n $tpl = $this->smarty->createTemplate('notthere.tpl');\n $this->assertFalse($tpl->source->exists);\n }", "public function testCreateDataCollectionFailsBecauseOfMissingFiles(): void\n {\n $path = __DIR__ . '/../../../fixtures/missing-file';\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" does not exist.', $path));\n\n $this->object->createDataCollection($path);\n }", "public function test_non_existent_servefile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/servefile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "public static function findFile($path)\n {\n if (file_exists($path)) {\n return $path;\n } else if (file_exists(Settings::get(\"TEMPLATE_DIR\") . \"/\" . $path)) {\n return Settings::get(\"TEMPLATE_DIR\") . \"/\" . $path;\n } else {\n throw new Exception(\"Il file $path non puo essere trovato\");\n }\n }", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public static function assertIsFile($path) {\n if (!is_file($path)) {\n throw new FilesystemException(\n $path,\n pht(\"Requested path '%s' is not a file.\", $path));\n }\n }", "public function testReturnFileDownloadFileNotFound() {\n $response = $this->archiveService->returnFileDownload('php://pii_data/filename.zip');\n }", "public function is_file(string $message = ''): self {\n if (is_file(filename: $this->path)) {\n return $this;\n }\n\n throw new \\InvalidArgumentException(\n message: $message ?: \"Path '{$this->path}' must be a file.\",\n );\n }", "public function testMalformedFilePath() {\n $configuration = [\n 'path' => 'non-existent-path',\n 'ids' => ['id'],\n ];\n\n $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n $this->expectException(Warning::class);\n $this->expectExceptionMessage('fopen(non-existent-path): failed to open stream: No such file or directory');\n $csv->initializeIterator();\n }", "public function testGetReadMeFileContents_ThrowsExceptionWhenMissingFile() {\n $this->expectException( ReadMeFileDoesNotExists::class );\n $mockFileSystem = vfsStream::setup();\n $spider = new Spider( $mockFileSystem->url(), false );\n unlink( $mockFileSystem->url() . '/' . Spider::README_FILE_NAME );\n $spider->getReadMeFileContents();\n }", "function check_file_existance($path)\n{\n //buld the url\n $image_url=$path;\n if (file_exists($image_url) !== false) {\n return true;\n }\n}", "public function hasFile(string $name): bool {}", "public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }", "function _wp_check_existing_file_names($filename, $files)\n {\n }", "public function FileNotFound() {\n $this->Render();\n }", "protected function _checkFileWritable($filename)\n {\n if (file_exists($filename) && !is_writable($filename)) {\n throw new Exception(Mage::helper('googletrustedstore')->__(\"Filesystem error: feed file '%s' is not writable\", $filename));\n }\n }", "public static function pathExists($path)\n {\n if (!file_exists($path)) {\n throw new \\InvalidArgumentException(sprintf(Resources::INVALID_PATH_MSG, $path));\n }\n }" ]
[ "0.7347006", "0.714903", "0.71379143", "0.7115594", "0.7087462", "0.70381194", "0.69505614", "0.69297504", "0.69209903", "0.684219", "0.6743852", "0.6743852", "0.66181135", "0.65567094", "0.65299904", "0.6460872", "0.6435339", "0.6433977", "0.6410545", "0.64047885", "0.63908356", "0.6390103", "0.63893193", "0.636397", "0.6351024", "0.6342973", "0.6323228", "0.6296067", "0.6279984", "0.62699926", "0.62353534", "0.62312806", "0.6223532", "0.6204087", "0.61975896", "0.61737114", "0.616849", "0.6142296", "0.61074793", "0.6100595", "0.60873175", "0.60664743", "0.60664743", "0.6027635", "0.6018614", "0.6014543", "0.601248", "0.5995691", "0.59876317", "0.59813964", "0.59749776", "0.5967795", "0.593823", "0.5937203", "0.5899551", "0.58957535", "0.58806443", "0.58796424", "0.5872947", "0.5836786", "0.58347714", "0.5832033", "0.5830112", "0.5824288", "0.5806768", "0.5804024", "0.5799146", "0.57931495", "0.5792864", "0.5777562", "0.5773165", "0.57719463", "0.5769444", "0.57662475", "0.5764852", "0.5759767", "0.57271355", "0.571146", "0.5701823", "0.5684606", "0.5680402", "0.5678951", "0.56769156", "0.56712395", "0.56631064", "0.56593007", "0.5654572", "0.56443524", "0.56304646", "0.5623328", "0.5614354", "0.56067985", "0.5605161", "0.5595163", "0.5591678", "0.5588051", "0.55822325", "0.5579083", "0.55779755", "0.5574637" ]
0.7204192
1
customer id; Overrides parent implementation.
public function behaviors() { $behaviors = parent::behaviors(); $behaviors['verbs'] = [ 'class' => \yii\filters\VerbFilter::className(), 'actions' => [ 'authorize' => ['POST'], 'accesstoken' => ['POST'], 'index' => ['GET'], 'order' => ['GET'], 'order-detail' => ['GET'], ] ]; return $behaviors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomerId() {\n return $this->customerID;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomer_Id() {\n return $this->customer_Id; \n }", "public function customerId(): int\n {\n return $this->customerId;\n }", "public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }", "public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }", "function customer_id($customer_id=null)\n {\n if (isset($customer_id)) $this->customer_id = intval($customer_id);\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->getValue('nb_customer_id');\n }", "public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }", "public function getExtCustomerId();", "public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }", "public function getCustomerId()\n {\n return $this->_customerSession->getCustomerId();\n }", "public function getCustomerId() : int\n {\n return (int)$this->session->getCustomerId();\n }", "protected function getCustomerId()\n {\n return $this->customerSession->getCustomer()->getId();\n }", "public function getCustomerId()\n {\n return $this->getSavedCustomer()->id;\n }", "public function getCustid()\n {\n return $this->custid;\n }", "public function getCustomerId()\n {\n $value = $this->get(self::customer_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getCustomerId()\n {\n return $this->getParameter('customerId');\n }", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public function setCustomerId($id);", "private function getCustomerId()\n {\n $customerSession = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(\\Magento\\Customer\\Model\\SessionFactory::class);\n return $customerSession->create()->getId();\n }", "private function getCustomerId()\n {\n $customer_id = session('customer_id');\n\n return (int) $customer_id;\n }", "protected function getCustomerId()\n {\n $_customerSession = Mage::getSingleton('customer/session');\n \n if ($_customerSession->isLoggedIn())\n return $_customerSession->getCustomer()->getId();\n\n return false;\n }", "public function getCustomerId()\n {\n if (is_null($this->customerId)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_CUSTOMER_ID);\n if (is_null($data)) {\n return null;\n }\n $this->customerId = (string) $data;\n }\n\n return $this->customerId;\n }", "public function setExtCustomerId($id);", "protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }", "public function setCustomerId($val)\n {\n $this->_propDict[\"customerId\"] = $val;\n return $this;\n }", "public function getCustomerIdentity()\n {\n return $this->customerIdentity;\n }", "public function getStripeCustomerId() {\n return $this->stripe_customer_id;\n\n }", "function getCustomerNo() {\n return $this->customerNo;\n }", "public function getCustomerId(): ?string\n {\n if (count($this->customerId) == 0) {\n return null;\n }\n return $this->customerId['value'];\n }", "public function getExternalCustomerId()\n {\n return $this->external_customer_id;\n }", "public function setCustomerId($value)\n {\n return $this->set(self::customer_id, $value);\n }", "protected function _getAuthenticatedCustomerId()\n {\n // get customer session object\n $session = $this->_getCustomerSession();\n\n // return authenticated customer ID, if any\n return $session->getCustomerId();\n }", "public function getCustomerId(): ?int\n {\n return $this->customerId;\n }", "public static function fakeCustomerId() {\n\t\t\t\n\t\t\t$lastCustomerId = Customer::select('customer_id')->orderBy('customer_id', 'desc')->take(1)->get()->first();\n\t\t\tif ($lastCustomerId == null) {\n\t\t\t\t$lastCustomerId = 0;\n\t\t\t}\n\t\t\treturn ++$lastCustomerId;\n\t\t}", "public function getCustomerOrderId();", "function jpid_next_customer_id() {\n\treturn JPID()->db_customers->get_next_id();\n}", "protected function get_customer_id() {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn null;\n\t\t}\n\t\t$current = get_current_user_id();\n\t\tif ( 0 == $current ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $current;\n\t}", "public function setCustomerId($var)\n {\n GPBUtil::checkString($var, True);\n $this->customer_id = $var;\n\n return $this;\n }", "public function getOrderId($customer_id);", "public function getCustomer($customer_id);", "public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }", "public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }", "public function customerId(?string $value): self\n {\n $this->instance->setCustomerId($value);\n return $this;\n }", "public function setCustomerId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->customer_id !== $v) {\n $this->customer_id = $v;\n $this->modifiedColumns[KluBillTableMap::COL_CUSTOMER_ID] = true;\n }\n\n return $this;\n }", "protected function _getIdentifier()\n\t{\n\t\treturn $this->_getCookieValue(Df_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');\n\t}", "public function setCustomerIdAttribute($input)\n {\n $this->attributes['customer_id'] = $input ? $input : null;\n }", "public function setCustomerIdAttribute($input)\n {\n $this->attributes['customer_id'] = $input ? $input : null;\n }", "public function getCustomerSessionID(){\r\n\t\treturn $this->customerSessionID;\r\n\t}", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "public function setCustomerID($customer_id)\n {\n $this->_customer_id = $customer_id;\n }", "public function setCustomerId($value)\n {\n return $this->setParameter('customerId', $value);\n }", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function setCustomerID($customer_id)\n {\n $this->customer_id = $customer_id;\n }", "public function setId($customerAddressId);", "function getStripeCustomerId(){\n\n $getCusId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n if($getCusId){\n return $getCusId->stripeCustomerId;\n }else{\n return FALSE;\n }\n\n }", "public function setCustid($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->custid !== $v) {\n $this->custid = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_CUSTID] = true;\n }\n\n return $this;\n }", "public function setCustomerIdentifier($var)\n {\n GPBUtil::checkString($var, True);\n $this->customer_identifier = $var;\n }", "function set_customer_id($blog_id, $customer_id) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_stripe_customers WHERE blog_id = %d\", $blog_id) );\t\t\t\t\t\t\t\t\t\n\t\tif ( $exists ) {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET customer_id = %s WHERE blog_id = %d\", $customer_id, $blog_id) );\t\t\t\t\t\t\t\n\t\t} else {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO {$wpdb->base_prefix}pro_sites_stripe_customers(blog_id, customer_id) VALUES (%d, %s)\", $blog_id, $customer_id) );\t\t\t\t\t\t\t\n\t\t}\n\t}", "public function getCustomerName(){\n return $this->customer_name;\n }", "abstract public function getCustomer($ID);", "public function setCustomerTransactionId($id) {\n \t$this->customerTransactionId = $id;\n }", "public function getID()\n {\n return $this->billingId;\n }", "public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}", "function getCustomerById_customer($id_customer)\n {\n\n\n\n $query = \"SELECT * FROM `customer` WHERE id_customer = '$id_customer'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }", "public function getCustomer($_ID)\n {\n return $this->getUnique(\"customers\", $_ID);\n }", "public function setCustomerId(?int $customerId): self\n {\n $this->customerId = $customerId;\n\n return $this;\n }", "public function getGravityCustomerId()\n {\n return $this->getGravityHelper()->getApiUser();\n }", "protected function _getCustomer()\n {\n return Mage::registry('current_customer');\n }", "function getCustomerID($userID) {\n $customerModel = $this->loadModel('Customers');\n $query = $customerModel->find()->select('id')->where([\n 'user_id' => $userID\n ])->first();\n return $query->id;\n }", "function trgetcustomerid($productid)\n\t{\n\t\t$customerid=\"SELECT customer_id from mapping_table where product_id = '\".$productid.\"'\";\n\t\t$customeriddata = $this->get_results($customerid);\n\t\treturn $customeriddata;\n\t}", "private function saveCustomer($customer){\n \n $customermodel = new CustomerModel();\n $customermodel->save($customer);\n return $this->insertID();\n }", "public function setCustomersIdAttribute($value)\n {\n $value = ($value) ? : null;\n $this->attributes['customers_id'] = $value;\n }", "function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public function __construct($id, $customer_id)\n {\n $this->id = $id;\n $this->customer_id = $customer_id;\n }", "public function buildCustomerId($prefix,$customer_id)\n {\n return $prefix.'_ps_'.$customer_id.'_'.date('YmdHis');\n }", "public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }", "function add_customer()\n\t{\n\t\t$table = \"customer\";\n\t\t$where = \"customer_email = '\".$this->input->post('user_email').\"'\";\n\t\t$items = \"customer_id\";\n\t\t$order = \"customer_id\";\n\t\t\n\t\t$result = $this->select_entries_where($table, $where, $items, $order);\n\t\t\n\t\tif(count($result) > 0)\n\t\t{\n\t\t\t$customer_id = $result[0]->customer_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'customer_email'=>$this->input->post('user_email'),\n\t\t\t\t'customer_name'=>$this->input->post('seller_name'),\n\t\t\t\t'customer_phone'=>$this->input->post('user_phone')\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"customer\";\n\t\t\t$customer_id = $this->insert($table, $data);\n\t\t}\n\t\t\n\t\treturn $customer_id;\n\t}", "public function setCustomerID($customerID)\n {\n $this->customerID = $customerID;\n return $this;\n }", "public function setCustomerId(?string $customerId): void\n {\n $this->customerId['value'] = $customerId;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getMerchantId(): string\n {\n return $this->merchant_id;\n }", "public function getCustomerTransactionId($id) {\n \treturn $this->customerTransactionId;\n }", "public function getCustomerCode(): string\n {\n return $this->getData(self::CUSTOMER_CODE);\n }", "public function setCustomerId(int $nb_customer_id = null) : CNabuDataObject\n {\n $this->setValue('nb_customer_id', $nb_customer_id);\n \n return $this;\n }", "public function getCustomer();", "public function getCustomer() {\n return $this->customer;\n }", "public function getAutoPurchaseCustomerId($customerData) {\n //Get last purchase Id\n $purchaseOrderData = DB::table('purchase_order')->select('id')->orderBy('id', 'desc')->first();\n\n //Generate Po_id\n if ($purchaseOrderData == null) {\n $autoId = str_pad(1, 4, '0', STR_PAD_LEFT);\n } else {\n $autoId = str_pad($purchaseOrderData->id + 1, 4, '0', STR_PAD_LEFT);\n }\n return $customerData->id . \"-\" . $autoId;\n }", "public static function get_customer( $id=0 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}customers WHERE id = %d\", $id ) );\r\n\t}", "public function get_customer_byid($customer_id = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('customer_id' => $customer_id));\r\n return $query->row_array();\r\n }", "function setCustomeruuid($customer_uuid)\n {\n $this->customer_uuid = $customer_uuid;\n }", "public function getCustomerName()\n {\n return $this->customerName;\n }", "function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \n if ($this->Customer->exists($customer_id))\n {\n $this->sale_lib->set_customer($customer_id);\n if($this->config->item('automatically_email_receipt'))\n {\n $this->sale_lib->set_email_receipt(1);\n }\n }\n else\n {\n $data['error']=lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public function getCustomerStoreId(Mage_Customer_Model_Customer $customer){\r\n\t\tif(!($storeId = $customer->getSendemailStoreId())){\r\n\t\t\t/*\r\n\t\t\t* store_id might be zero if the account was created in the admin interface\r\n\t\t\t*/\r\n\t\t\t$storeId = $customer->getStoreId();\r\n\t\t\tif(!$storeId && $customer->getWebsiteId()){\r\n\t\t\t\t/*\r\n\t\t\t\t* Use the default store groups store of the customers website\r\n\t\t\t\t*/\r\n\t\t\t\tif($store = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()){\r\n\t\t\t\t\t$storeId = $store->getId();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// In case the website_id is not yet set on the customer, and the\r\n\t\t\t// current store is a frontend store, use the current store ID\r\n\t\t\tif(!$storeId && !Mage::app()->getStore()->isAdmin()){\r\n\t\t\t\t$storeId = Mage::app()->getStore()->getId();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $storeId;\r\n\t}" ]
[ "0.85015273", "0.8473471", "0.8473471", "0.8394293", "0.8394293", "0.8394293", "0.8264277", "0.8077212", "0.80704474", "0.80704474", "0.8048851", "0.80165076", "0.7958485", "0.7939221", "0.7930309", "0.7903374", "0.7879496", "0.781619", "0.777232", "0.7752299", "0.7680021", "0.7612346", "0.75501436", "0.7536818", "0.745562", "0.74108213", "0.7375486", "0.73684627", "0.7236466", "0.72280806", "0.722657", "0.72228324", "0.7183988", "0.7097474", "0.70429", "0.70396835", "0.70153123", "0.7008459", "0.70052207", "0.6981609", "0.6978198", "0.6958521", "0.6945263", "0.6894661", "0.685702", "0.68303794", "0.67991835", "0.67991835", "0.67991835", "0.67891663", "0.67789197", "0.67289007", "0.67289007", "0.6684002", "0.6647475", "0.6647475", "0.6625661", "0.66152585", "0.6582195", "0.6563068", "0.6541758", "0.6536834", "0.65265614", "0.65245473", "0.65223247", "0.65161514", "0.6508806", "0.6503892", "0.6476727", "0.64718854", "0.647157", "0.64574915", "0.6443058", "0.64169973", "0.6411832", "0.6391701", "0.6366323", "0.63410723", "0.6333668", "0.632835", "0.63282746", "0.6310852", "0.62955433", "0.6283747", "0.62719524", "0.62689644", "0.62689644", "0.62689644", "0.62676984", "0.62669957", "0.62668884", "0.62615156", "0.625962", "0.62508553", "0.62382406", "0.62293154", "0.6223029", "0.62010443", "0.61975443", "0.6188222", "0.6185992" ]
0.0
-1
Performs accesstoken check before executing action
public function beforeAction($action) { if (!parent::beforeAction($action)) { return false; } if ($action->id == 'authorize' || $action->id == 'accesstoken') { return true; } $request = Yii::$app->getRequest(); $authHeader = $request->getHeaders()->get('Authorization'); // Find access token using HttpBearer method if ($authHeader !== null && preg_match('/^Bearer\s+(.*?)$/', $authHeader, $matches)) { $token = $matches[1]; } // Find access token from query parameter if no token from HttpBearer if (!isset($token)) { $token = $request->getQueryParam('access_token'); } $customer = Customer::find()->where(['token_code' => $token])->andWhere(['>', 'token_expired', time()])->one(); if ($customer !== null) { $this->customer_id = $customer->id; return true; } throw new UnauthorizedHttpException('Unauthorized access!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize(){\n $token = $this->retrieveToken(); $this->setToken($token);\n }", "public function is_accesstoken($accesstoken){\n $this->accessToken = false;\n\n if(!empty($accesstoken)){\n $isAuthorized = $this->wpdb->get_row( \"SELECT id FROM {$this->wpdb_prefix}access_tokens WHERE accessToken = '{$accesstoken}' LIMIT 1\" ); \n if(!empty($isAuthorized)) {\n $this->accessToken = true;\n }\n }\n }", "public function beforeAction($action) {\n\n parent::beforeAction($action);\n\n if(!in_array($_SERVER['HTTP_USER_AGENT'],Yii::$app->params['AgentWhiteList']))\n throw new \\yii\\web\\HttpException(403, 'Not Authorized.');\n\n $headers = apache_request_headers();\n foreach($headers as $header=>$value) {\n if($header == 'Authorization') {\n if(strlen(trim($value)) != 256)\n throw new \\yii\\web\\HttpException(403, 'Not Authorized.');\n $this->_token = trim($value);\n }\n }\n\n if (!parent::beforeAction($action)) {\n return false;\n }\n\n\n\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return true;\n }", "protected function check_login()\n\t{\n\t\tif (isset($_GET['oauth_token']))\n\t\t{\n\n $this->handle_callback();\n\n\t\t\t$tokens = $this->get_access_token();\n\n if ( ! empty($tokens['access_key']) && ! empty($tokens['oauth_token'] ) )\n\t\t\t{\n\n $this->set_shard_id( $tokens['shard_id'] );\n $this->set_evernote_user_id( $tokens['evernote_user_id'] );\n $this->set_expires( $tokens['expires'] );\n\t\t\t}\n\n\t\t\t\\Response::redirect(\\Uri::current());\n\t\t\treturn null;\n\t\t}\n\n\t}", "function fb_authorize_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_fb_authorize_nonce'], 'afap_fb_authorize_action')) {\n\n include('inc/cores/fb-authorization.php');\n\n } else {\n\n die('No script kiddies please');\n\n }\n\n }", "function action_gatekeeper()\n {\n \t$token = get_input('__elgg_token');\n \t$ts = get_input('__elgg_ts');\n \t$session_id = session_id();\n \t\n \tif (($token) && ($ts) && ($session_id))\n \t{\n\t \t// generate token, check with input and forward if invalid\n\t \t$generated_token = generate_action_token($ts);\n\t \t\n\t \t// Validate token\n\t \tif (strcmp($token, $generated_token)==0)\n\t \t{\n\t \t\t$hour = 60*60;\n\t \t\t$now = time();\n\t \t\t\n\t \t\t// Validate time to ensure its not crazy\n\t \t\tif (($ts>$now-$hour) && ($ts<$now+$hour))\n\t \t\t{\n\t \t\t\t$returnval = true; // We have already got this far, so unless anything else says something to the contry we assume we're ok\n\t \t\t\t\n\t \t\t\t$returnval = trigger_plugin_hook('action_gatekeeper:permissions:check', 'all', array(\n\t \t\t\t\t'token' => $token,\n\t \t\t\t\t'time' => $ts\n\t \t\t\t), $returnval);\n\t \t\t\t\n\t \t\t\tif ($returnval)\n\t \t\t\t\treturn true;\n\t \t\t\telse\n\t \t\t\t\tregister_error(elgg_echo('actiongatekeeper:pluginprevents'));\n\t \t\t}\n\t \t\telse\n\t \t\t\tregister_error(elgg_echo('actiongatekeeper:timeerror'));\n\t \t}\n\t \telse\n\t \t\tregister_error(elgg_echo('actiongatekeeper:tokeninvalid'));\n \t}\n \telse\n \t\tregister_error(elgg_echo('actiongatekeeper:missingfields'));\n \t\t\n \tforward();\n \texit;\n }", "public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}", "public function authorize()\n { \n //放入購物車時驗證權限 無則發送403\n $v = Auth::user()->verify;\n if(!$v){\n return false;\n }\n return true;\n \n }", "public function hasAccessToken();", "public function loginCheckAction()\n {\n throw new \\Exception('This should never be reached!');\n }", "public function beforeAction($action)\n {\n // which are triggered on the [[EVENT_BEFORE_ACTION]] event, e.g. PageCache or AccessControl\n if (!parent::beforeAction($action)) {\n return false;\n }\n if (Service::verifyAccess(Yii::$app->getRequest()->getQueryParam('app_id'),Yii::$app->getRequest()->getQueryParam('app_secret'))) {\n return true;\n } else {\n echo 'your api keys are from the dark side';\n Yii::$app->end();\n }\n }", "protected function loginIfRequested() {}", "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 loginCheckAction()\n {\n\n\n throw new \\Exception('This should never be reached!');\n }", "public function preDispatch()\n {\n parent::preDispatch();\n $action = $this->getRequest()->getActionName();\n $loginUrl = Mage::helper('customer')->getLoginUrl();\n if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {\n $this->setFlag('', self::FLAG_NO_DISPATCH, true);\n }\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function accessAction() {\n if (!$_SESSION['request_token']) {\n return self::redirect('request');\n }\n\n $tok = $_SESSION['request_token'];\n $this->api->setOAuthToken($tok->getKey(), $tok->getSecret());\n $this->api->login('access')->post()->loadTokenFromResponse();\n $_SESSION['access_token'] = $this->api->getOAuthToken();\n $_SESSION['username'] = $this->api->getUsername();\n $_SESSION['subdomain'] = $this->api->getSubdomain();\n\n return self::redirect('index');\n }", "public function indexAction() {\n\t\t\n\t\t$consumer = new Zend_Oauth_Consumer ( $this->config );\n\t\t\n\t\t// Holt den Anfragetoken\n\t\t$token = $consumer->getRequestToken ();\n\t\t// Den token im Speicher fixieren\n\t\t$this->oCacheReq->writeCache ( serialize ( $token ) );\n\t\t\n\t\t// Den Benutzer umleiten\n\t\t$consumer->redirect ();\n\t\n\t}", "public function authorize ()\n\t{\n\t\treturn true;\n\t}", "public function authorize ()\n\t{\n\t\treturn true;\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function maybe_authorize() {\n\t\tglobal $socialflow;\n\t\t$socialflow_params = filter_input_array( INPUT_GET );\n\t\t// Validate token.\n\t\tif ( isset( $socialflow_params['oauth_token'] ) && $socialflow_params['oauth_token'] === $socialflow->options->get( 'oauth_token' ) ) {\n\n\t\t\t$api = $socialflow->get_api( $socialflow->options->get( 'oauth_token' ), $socialflow->options->get( 'oauth_token_secret' ) );\n\n\t\t\t// Store access tokens.\n\t\t\t$socialflow->options->set( 'access_token', $api->get_access_token( $socialflow_params['oauth_verifier'] ) );\n\n\t\t\t// Unset temporary token and secret.\n\t\t\t$socialflow->options->delete( 'oauth_token' );\n\t\t\t$socialflow->options->delete( 'oauth_token_secret' );\n\n\t\t\t// Get list of all user account and enable sf by default for each account.\n\t\t\t$accounts = $api->get_account_list();\n\n\t\t\tif ( is_wp_error( $accounts ) ) {\n\t\t\t\twp_safe_redirect( add_query_arg( 'page', 'socialflow', admin_url( 'admin.php' ) ) );\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Enable all publishing accounts by default.\n\t\t\t$enabled = array();\n\t\t\tforeach ( $accounts as $key => $account ) {\n\t\t\t\tif ( 'publishing' === $account['service_type'] ) {\n\t\t\t\t\t$enabled[] = $key;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store all user accounts.\n\t\t\t$socialflow->options->set( 'accounts', $accounts );\n\n\t\t\t// Remove initial nag.\n\t\t\t$socialflow->options->set( 'initial_nag', 0 );\n\n\t\t\t// Set send to and visible accounts.\n\t\t\t$socialflow->options->set( 'show', $enabled );\n\t\t\t$socialflow->options->set( 'send', $enabled );\n\n\t\t\t// Save update options.\n\t\t\t$socialflow->options->save();\n\n\t\t\twp_safe_redirect( add_query_arg( 'page', 'socialflow', admin_url( 'admin.php' ) ) );\n\t\t\texit;\n\n\t\t} elseif ( isset( $socialflow_params['sf_unauthorize'] ) && current_user_can( 'manage_options' ) ) {\n\t\t\t// To-Do Check temporary token.\n\t\t\t// Remove all options.\n\t\t\tdelete_option( 'socialflow' );\n\n\t\t\twp_safe_redirect( add_query_arg( 'page', 'socialflow', admin_url( 'admin.php' ) ) );\n\t\t\texit;\n\t\t}\n\t}", "public function checkToken(): void\n {\n $fromSession = BackendModel::getSession()->get('csrf_token', '');\n $fromGet = $this->getRequest()->query->get('token');\n\n if ($fromSession !== '' && $fromGet !== '' && $fromSession === $fromGet) {\n return;\n }\n\n // clear the token\n BackendModel::getSession()->set('csrf_token', '');\n\n $this->redirect(\n BackendModel::createUrlForAction(\n $this->url->getDefaultActionForCurrentModule(),\n null,\n null,\n [\n 'error' => 'csrf',\n ]\n )\n );\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function checkToken(): void\n {\n $fromSession = BackendModel::getSession()->get('csrf_token', '');\n $fromGet = $this->getRequest()->query->get('token');\n\n if ($fromSession !== '' && $fromGet !== '' && $fromSession === $fromGet) {\n return;\n }\n\n // clear the token\n BackendModel::getSession()->set('csrf_token', '');\n\n $this->redirect(\n BackendModel::createUrlForAction(\n $this->getContainer()->get('url')->getDefaultActionForCurrentModule(),\n null,\n null,\n [\n 'error' => 'csrf',\n ]\n )\n );\n }", "public function token() {\r\n\t\t\r\n\t\t$response = $this->OAuth2->getAccessTokenData();\r\n\t\t\r\n\t\tif (empty($response)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->set($response);\r\n\t\t\r\n\t}", "public function checkAccess()\n {\n // need to be modified for security\n }", "protected function isAccessTokenPresent()\n {\n if (!isset($this->params['access_token'])) {\n throw new InstagramRequestException(\"{$this->path} - api requires an authenticated users access token.\", 400);\n }\n }", "private function performAuth() {\r\n\t\t\r\n\t\tGLOBAL $wgYammerConsumerKey, $wgYammerConsumerSecret, $wgEnableParserCache;\r\n\t\t\r\n\t\t$wgEnableParserCache = false;\r\n\t\t\r\n\t\t$status = $this->namespaceGet('status','init',true);\r\n\t\t\r\n\t\t# Consumer key is required\r\n\t\tif(empty($wgYammerConsumerKey) || empty($wgYammerConsumerSecret)) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerConsumerKey</code> and <code>$wgYammerConsumerSecret</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the accesstoken/accesstokensecret are available, display those\r\n\t\tif(($atk =$this->namespaceGet('accesstoken',false)) !== false && ($ats = $this->namespaceGet('accesstokensecret',false)) !== false) {\r\n\t\t\treturn $this->createErrorResponse('Please configure <code>$wgYammerAccessKey=\"'.$atk.'\";</code> and <code>$wgYammerAccessSecret=\"'.$ats.'\";</code> in your LocalSettings.php. Then <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are not available, request one\r\n\t\t$rtk = $this->namespaceGet('requesttoken', false);\r\n\t\t$rts = $this->namespaceGet('requesttokensecret', false);\r\n\t\tif(false === ($rtk) && false === ($rts)) {\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_REQUESTTOKEN, $wgYammerConsumerKey, $wgYammerConsumerSecret,'','',false,'PLAINTEXT');//$this->http(self::YAMMER_URI_REQUESTTOKEN, 'get');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\t\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('requesttoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('requesttokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('A new request token was retrieved from the Yammer server. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a> for further instructions');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('<pre>Invalid response: '.htmlspecialchars($resp[1]).'</pre>');\r\n\t\t} else if(!empty($_POST['oauth_verifier'])) {\r\n\t\t\t$verifier = $_POST['oauth_verifier'];\r\n\t\t\t$resp = $this->oauth_get(self::YAMMER_URI_ACCESSTOKEN.'?callback_token='.urlencode($verifier), $wgYammerConsumerKey, $wgYammerConsumerSecret, $rtk, $rts, false, 'PLAINTEXT', 'POST');\r\n\t\t\tparse_str($resp[1], $arr);\r\n\t\t\tif(!empty($arr['oauth_token']) && !empty($arr['oauth_token_secret'])) {\r\n\t\t\t\t$this->namespaceSet('accesstoken', $arr['oauth_token']);\r\n\t\t\t\t$this->namespaceSet('accesstokensecret', $arr['oauth_token_secret']);\r\n\t\t\t\treturn $this->createErrorResponse('Request token was exchanged for an access token. Please <a href=\"'.$_SERVER['REQUEST_URI'].'\">reload the page</a>.');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->createErrorResponse('Failed to verify using code '.$verifier. '<br />The Yammer server sent the following response:<code>'.htmlspecialchars($resp[1]).'</code>');\r\n\t\t} else {\r\n\t\t\treturn $this->createVerifyFormResponse($rtk);//'rtk='.var_export($rtk, true).', rts='.var_export($rts, true));\r\n\t\t}\r\n\t\t\r\n\t\t# If the request token/request token secret are available\r\n\t\t# a) If the $_POST[verifier] is available, try and exchange the request token with an access token\r\n\t\t# b) Else show the authorisation url + the form where the member can input the Yammer oauth token\r\n\t\tif($rtk = $this->namespaceGet('requesttoken') && $rts = $this->namespaceGet('requesttokensecret', false)) {\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->createErrorResponse('Unexpected error in '.__CLASS__.'::'.__FUNCTION__);\r\n\t}", "protected function checkSessionToken() {}", "public function token() {\n\t\t$this->autoRender = false;\n\t\t$this->OAuth->setVariable('access_token_lifetime', 60);\n\t\ttry {\n\t\t\t$this->OAuth->grantAccessToken();\n\t\t} catch (OAuth2ServerException $e) {\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t}", "public function setup_check_security_token() {\n\t\tif ( ! $this->wsal->settings()->CurrentUserCan( 'edit' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Access Denied.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\t$nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : false;\n\t\t$token = isset( $_POST['token'] ) ? sanitize_text_field( wp_unslash( $_POST['token'] ) ) : false;\n\n\t\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-verify-wizard-page' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Nonce verification failed.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\tif ( empty( $token ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Invalid input.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'success' => true,\n\t\t\t\t'token' => $token,\n\t\t\t\t'tokenType' => esc_html( $this->get_token_type( $token ) ),\n\t\t\t)\n\t\t);\n\t\tdie();\n\t}", "public function __handleAuthentication() {\n $allowActions = array('adminLogin');\n\n if(strpos($this->action, 'admin') !== false && !in_array($this->action, $allowActions)) {\n $params = $this->getParams();\n\n if(empty($params['token']) || !$this->Session->check($params['token'])) {\n $this->sendError(API_MSG_INCORRECT_INPUT, API_CODE_NG, API_HTTP_CODE_200);\n }\n }\n }", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "public function execute()\n {\n if (!$this->formKeyValidator->validate($this->getRequest())) {\n $this->messageManager->addErrorMessage(__('Invalid Form Key. Please refresh the page.'));\n $this->_redirect('*/*/settings');\n\n return;\n }\n $customerId = $this->session->getCustomerId();\n $policyTypeToRevoke = $this->consentRepository\n ->getByCustomerIdAndStatus(\n $customerId,\n CookiePolicyConsent::STATUS_RECIEVED\n )->getConsentType();\n\n if ($this->cookieManager->isAllowCookies() !== null) {\n $this->cookieManager->unsetIsAllowCookies();\n $this->consentLogger->logCookieConsent(\n $customerId,\n $policyTypeToRevoke,\n CookiePolicyConsent::STATUS_REVOKED\n );\n $this->messageManager->addSuccessMessage(__('Cookies has been revoked'));\n } else {\n $this->messageManager->addNoticeMessage(__('No cookie decision has been made yet'));\n }\n\n $this->_redirect('*/*/settings');\n }", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "public function authorize()\n {\n //return false;\n\t\treturn true;\n }", "public function sendAccess() {\n $request = \\Drupal::request();\n $acquia_key = Storage::getKey();\n if (!empty($acquia_key) && $request->get('key')) {\n $key = sha1(\\Drupal::service('private_key')->get());\n if ($key === $request->get('key')) {\n return AccessResultAllowed::allowed();\n }\n }\n return AccessResultForbidden::forbidden();\n }", "function ExchangeRequestForAccess()\n{\n $consumer_key = $_GET['consumer_key'];\n $oauth_token = $_GET['oauth_token'];\n $user_id = $_GET['usr_id'];\n\n try\n {\n OAuthRequester::requestAccessToken($consumer_key, $oauth_token, $user_id);\n }\n catch (OAuthException $e)\n {\n // Something wrong with the oauth_token.\n // Could be:\n // 1. Was already ok\n // 2. We were not authorized\n die($e->getMessage());\n }\n \n echo 'Authorization Given. <a href=\"index.php?action=Request\">Click to make a signed request</a>.';\n}", "public function authorize()\t{\n\t\treturn true;\n\t}", "public function asfap_access_token_ajax_action(){\n\n if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'apfap_backend_ajax_nonce')) {\n\n // $fbfor =sanitize_text_field($_POST['fbfor']);\n\n $fb_email =sanitize_text_field($_POST['fb_email']);\n\n $fb_password = sanitize_text_field($_POST['fb_password']);\n\n\n\n if( !empty( $fb_email ) && !empty($fb_password ) ) {\n\n $token_url = $this->get_token_url($fb_email , $fb_password);\n\n if( $token_url != false ) {\n\n $response = array(\n\n 'type' => 'success',\n\n 'message' => $token_url\n\n );\n\n }\n\n } else{\n\n $response = array(\n\n 'type' => 'error',\n\n 'message' => __( 'Please provide your facebook Username and Password.', 'accesspress-facebook-auto-post' )\n\n );\n\n }\n\n wp_send_json($response);\n\n exit;\n\n }\n\n }", "private function validateAccessToken() {\n $this->userID = $this->facebook->getUser();\n }", "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "public function authorize () : bool\n\t{\n\t\treturn true;\n\t}", "public function authorize () : bool\n\t{\n\t\treturn true;\n\t}", "public function authorize () : bool\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n {\n //return false; //return False will stop everything\n\t\treturn true;\n }", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}" ]
[ "0.6551691", "0.64286906", "0.63444906", "0.6271096", "0.62171835", "0.61947626", "0.6171653", "0.61493415", "0.6139344", "0.6123799", "0.61112446", "0.6071691", "0.60427356", "0.6005506", "0.5992822", "0.59769887", "0.5972079", "0.59356314", "0.5933057", "0.5933057", "0.59252137", "0.59232193", "0.59232193", "0.5917901", "0.5908563", "0.5903231", "0.58955264", "0.5886225", "0.58644426", "0.5862638", "0.58575743", "0.5851958", "0.58482134", "0.58448255", "0.5836514", "0.583051", "0.5825724", "0.58251125", "0.5822554", "0.5822554", "0.5822554", "0.58147687", "0.58125675", "0.57993674", "0.5799088", "0.579898", "0.5798881", "0.57922304", "0.57922304", "0.57922304", "0.57885593", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417", "0.5788417" ]
0.61572766
7
Authorizes a customer using email.
public function actionAuthorize() { $model = Customer::findOne(['email' => Yii::$app->getRequest()->getBodyParam('email')]); if ($model !== null) { $model->auth_code = md5(uniqid()); $model->auth_expired = time() + (60 * 5); // 5 minutes $model->save(false); $data = [ 'authorization_code' => $model->auth_code, 'expired_at' => $model->authExpired ]; return $data; } throw new NotFoundHttpException('{email} : Email address is not available!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCustomerEmail($customerEmail);", "public function setCustomerEmail($customerEmail);", "public function setCustomerEmail($customer_email){\n $this->customer_email = $customer_email;\n }", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function bookAsCustomer($custEmail)\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return false;\n }\n \n require_once('models/Customer.class.php');\n\n if (!filter_var($custEmail, FILTER_VALIDATE_EMAIL)) {\n $error = 'email';\n $this->redirect(\"bookAsCustomer.php?error=$error\"); //Check email\n return false;\n } \n \n // Get the customer from the database\n try {\n $cust = new Customer($custEmail,$this->db);\n return $cust;\n } catch (Exception $e) {\n $this->redirect(\"bookAsCustomer.php?error=custNotFound\");\n }\n \n \n }", "private function loginCustomer(string $email): void\n {\n $customer = $this->customerRepository->get($email);\n $this->customerSession->loginById($customer->getId());\n }", "public function getCustomerEmail(){\n return $this->customer_email;\n }", "public function setCustomerEmail($value)\n {\n return $this->setParameter('customerEmail', $value);\n }", "public function activateAccount($email){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($email, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT_ACTIVATE_ACCOUNT),\n Mage::helper('core')->jsonEncode(['email' => $email])\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasFailed()) {\n Mage::log(\"User account activation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account activation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User account activation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "public function getCustomerEmail()\n {\n return $this->customerEmail;\n }", "public function edit(CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "public function setCustomerEmail($customerEmail){\n return $this->setData(self::CUSTOMER_EMAIL, $customerEmail);\n }", "public function show(CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "private function emailAtLogin() {}", "public function getCustomerEmail()\n {\n return $this->getParameter('customerEmail');\n }", "static function confirm_account_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n $code = confirm_account_email($user->email);\n\n if ($code === -1) {\n flash('Sua conta já está confirmada, basta acessá-la.', 'warning');\n } else if ($code == true)\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você confirmar sua conta.\");\n else\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "public function authorize()\n {\n return auth('customer')->check();\n }", "public function setCustomerEmail($customerEmail = '') {\n $email = array(\n 'x_email'=>$this->truncateChars($customerEmail, 255),\n );\n $this->NVP = array_merge($this->NVP, $email); \n }", "public function actionEmailverification() {\n if (Yii::$app->request->get('id') && Yii::$app->request->get('key')) {\n\n $access_token = Yii::$app->request->get('id');\n $key = Yii::$app->request->get('key');\n\n $customers = \\app\\models\\Customers::find()\n ->leftjoin('user_token', 'user_token.user_id=users.id')\n ->where(['access_token' => $access_token])\n ->andWhere(['token' => $key])\n ->one();\n\n\n if (count($customers)) {\n\n $customers->profile_status = 'ACTIVE';\n $customers->save();\n $user_token = \\app\\models\\UserToken::find()\n ->where(['token' => $key])\n ->andWhere(['user_id' => $customers->id])\n ->one();\n $user_token->delete();\n Yii::$app->session->setFlash('success', 'Your account verified successfully.');\n \\app\\components\\EmailHelper::welcomeEmail($customers->id);\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt1.');\n }\n } else {\n Yii::$app->session->setFlash('danger', 'Illegal attempt2.');\n }\n return $this->render('emailverification');\n }", "public function getCustomerEmail(){\n return $this->_getData(self::CUSTOMER_EMAIL);\n }", "public function send($customer)\n {\n $emailTemplate = $this->scopeConfigInterface->getValue(\n 'customer/create_account/customer_account_activation_confirmation_template',\n ScopeInterface::SCOPE_STORE,\n $customer->getStoreId()\n );\n\n if (!$emailTemplate) {\n $emailTemplate = 'enrico69_activation_email';\n }\n\n $this->transportBuilder->setTemplateIdentifier($emailTemplate)\n ->setTemplateOptions(\n [\n 'area' => Area::AREA_FRONTEND,\n 'store' => $customer->getStoreId(),\n ]\n )\n ->setTemplateVars(['email' => $customer->getEmail()]);\n\n $this->transportBuilder->addTo($customer->getEmail());\n $this->transportBuilder->setFrom(\n [\n 'name'=> $this->storeManagerInterface->getStore($customer->getStoreId())->getName(),\n 'email' => $this->scopeConfigInterface->getValue(\n 'trans_email/ident_sales/email',\n ScopeInterface::SCOPE_STORE,\n $customer->getStoreId()\n )\n ]\n );\n\n $this->transportBuilder->getTransport()->sendMessage();\n }", "public function indexAction() {\n //backend just in case user trys anything funny. \n $email = $_POST['email'];\n $email_confirm = $_POST['email_confirm'];\n $password = $_POST['password'];\n $first_name = $_POST['firstname'];\n $middle_name = $_POST['middlename'];\n $last_name = $_POST['lastname'];\n \n $customer_array = array(\n \"email\" => $email,\n \"password\" => $password,\n \"first_name\" => $first_name,\n \"middle_name\" => $middle_name,\n \"last_name\" => $last_name\n );\n \n if (!$this->validateEmail($email)){\n return;\n }\n \n // next, is to check if the email address is no already on the system\n if (!$this->checkEmailExists($email)){\n return;\n }\n \n // check to see if email matches second email\n if (!$this->checkEmailMatches($email, $email_confirm)){\n return;\n }\n \n // if all validated, now add user to system\n if (!$this->addCustomer($customer_array)){\n return;\n }\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "public function confirmAction() {\n if (Zend_Auth::getInstance()->hasIdentity())\n $this->_redirect($this->getUrl());\n\n $errors = array();\n\n $action = $this->getRequest()->getParam('a');\n\n switch ($action) {\n case 'email':\n $id = $this->getRequest()->getParam('id');\n $key = $this->getRequest()->getParam('key');\n\n $result = $this->em->getRepository('Champs\\Entity\\User')->activateAccount($id, $key);\n\n if (!$result) {\n $errors['email'] = 'Error activating your account';\n }\n\n break;\n }\n\n $this->view->errors = $errors;\n $this->view->action = $action;\n }", "public function test_auth_code_redemption_with_email() {\n\t\tstatic::$test_auth_code['scope'] = 'profile email';\n\t\t$code = $this->set_auth_code();\n\t\t$response = $this->create_form( 'POST', \n\t\t\t\tarray(\n\t\t\t\t\t'grant_type' => 'authorization_code',\n\t\t\t\t\t'code' => $code,\n\t\t\t\t\t'client_id' => 'https://app.example.com',\n\t\t\t\t\t'redirect_uri' => 'https://app.example.com/redirect',\n\t\t\t\t)\n\t\t);\n\t\t$this->assertEquals( 200, $response->get_status(), 'Response: ' . wp_json_encode( $response ) );\n\t\t$data = $response->get_data();\n\t\t$this->assertArrayNotHasKey( 'access_token', $data );\n\t\t$this->assertEquals( \n\t\t\tarray( \n\t\t\t\t'me' => get_author_posts_url( static::$author_id ),\n\t\t\t\t'profile' => indieauth_get_user( static::$author_id, true )\n\t\t\t), \n\t\t\t$data, \n\t\t\t'Response: ' . wp_json_encode( $data ) \n\t\t);\n\t\t// Reset Just in Case.\n\t\tunset( static::$test_auth_code['scope'] );\n\t}", "function booking_approve_cancellation_email($useremail) {\n\t\t\t//to customer\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear Customer,<br>\";\n\t\t\t\t$message .= \"Your booking has been cancelled.<br>\";\n\t\t\t\t$message .= \"Thanks For using our service.\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($useremail);\n\t\t\t\t$this->email->subject('Your Booking Cancellation has been Processed.');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function confirmationEmail()\n {\n $email = new Email;\n $email->sendEmail('submitted', 'applicant', Auth::user()->email);\n }", "public function updateByEmail(Request $request) {\n\n if(!isset($reuqest->email) || empty($reuqest->email)) {\n return \\Response::json(array('message' => 'Email is requried'), 404);\n }\n $email = $reuqest->email;\n $user = \\Acelle\\Model\\User::findByEmail($email);\n\n // check if item exists\n if (!is_object($user)) {\n return \\Response::json(array('message' => 'User not found'), 404);\n }\n $uid = $user->uid;\n\n // Get current user\n $current_user = \\Auth::guard('api')->user();\n $customer = \\Acelle\\Model\\Customer::findByUid($uid);\n\n // check if item exists\n if (!is_object($customer)) {\n return \\Response::json(array('message' => 'Item not found'), 404);\n }\n\n // authorize\n if (!$current_user->can('update', $customer)) {\n return \\Response::json(array('message' => 'Unauthorized'), 401);\n }\n\n // save posted data\n if ($request->isMethod('post')) {\n\n if($this->isDemoMode()) {\n return $this->notAuthorized();\n }\n\n $rules = $customer->apiUpdateRules($request);\n\n $validator = \\Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return response()->json($validator->messages(), 403);\n }\n\n // Update user account for customer\n $user = $customer->user;\n if (!empty($request->email)) {\n $user->email = $request->email;\n }\n // Update password\n if (!empty($request->password)) {\n $user->password = bcrypt($request->password);\n }\n $user->save();\n\n // Save current user info\n $customer->fill($request->all());\n $customer->save();\n\n // Upload and save image\n if ($request->hasFile('image')) {\n if ($request->file('image')->isValid()) {\n // Remove old images\n $customer->removeImage();\n $customer->image = $customer->uploadImage($request->file('image'));\n }\n }\n\n // Remove image\n if ($request->_remove_image == 'true') {\n $customer->removeImage();\n $customer->image = '';\n }\n\n return \\Response::json(array(\n 'message' => trans('messages.customer.updated'),\n 'customer_uid' => $customer->uid\n ), 200);\n }\n }", "public function setEmail($email);", "public function setEmail($email);", "public function setEmail($email);", "public function emailConfirmationAction($email, $token){\n $userManager = new UserManager();\n $user = $userManager->findByEmail($email);\n if ($user){\n if ($user->getToken() === $token){\n $user->setEmailValidated(true);\n //change the token \n $user->setToken( SH::randomString() );\n $userManager->update($user);\n }\n }\n Router::redirect( Router::url(\"graph\") );\n }", "protected function _customerEmailExists($email)\n {\n\t\t$websiteId = Mage::app()->getWebsite()->getId();\n $customer = Mage::getModel('customer/customer');\n \n\t\tif ($websiteId) {\n $customer->setWebsiteId($websiteId);\n }\n $customer->loadByEmail($email);\n\t\tif ($customer->getId()) {\n return $customer;\n }\n return false;\n }", "function select_customer() {\n $data = array();\n $customer_id = $this->input->post(\"customer\");\n\n if ($this->Customer->account_number_exists($customer_id)) {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n\n if ($this->Customer->exists($customer_id)) {\n $this->sale_lib->set_customer($customer_id);\n if ($this->config->item('automatically_email_receipt')) {\n $this->sale_lib->set_email_receipt(1);\n }\n } else {\n $data['error'] = lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public function setEmail(?CustomerTextFilter $email): void\n {\n $this->email = $email;\n }", "public function store(Request $request)\n {\n // Check if session exist\n if (Auth::guard('customer')->check()) {\n return redirect()->route('customer.dashboard');\n }\n\n $this->validate($request,[\n 'username' => 'required',\n 'phone' => 'required|numeric|digits:10',\n 'email' => 'required|unique:customers,email',\n 'password' => 'required|min:6'\n ]);\n\n $customer = new Customer;\n $customer->username = $request->username;\n $customer->email = $request->email;\n $customer->phone = $request->phone;\n $customer->email_verified_at = '';\n $customer->password = bcrypt($request->password);\n $customer->save();\n \n // Send the verify email verification to customer\n //$this->sendMail(array('username'=>$customer->username,'email'=>$customer->email));\n\n return redirect()->back()->with('message','Registered successfully!.'); \n }", "public function authenticateCustomer($observer) {\n\t\t$this->authUserId = $observer->getCustomer()->getId();\n\t\t$this->authenticateSecondFactor();\n\t}", "function activate_account_via_email_link() {\r\n\t\t\tif ( isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && is_string($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 &&\r\n\t\t\t isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id']) ) { // valid token\r\n\r\n\t\t\t\t$user_id = absint( $_REQUEST['user_id'] );\r\n\t\t\t\tdelete_option( \"um_cache_userdata_{$user_id}\" );\r\n\r\n\t\t\t\tum_fetch_user( $user_id );\r\n\r\n\t\t\t\tif ( strtolower($_REQUEST['hash']) !== strtolower( um_user('account_secret_hash') ) )\r\n\t\t\t\t\twp_die( __( 'This activation link is expired or have already been used.','ultimate-member' ) );\r\n\r\n\t\t\t\tUM()->user()->approve();\r\n\t\t\t\t$redirect = ( um_user('url_email_activate') ) ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');\r\n\t\t\t\t$login = (bool) um_user('login_email_activate');\r\n\r\n\t\t\t\t// log in automatically\r\n\t\t\t\tif ( ! is_user_logged_in() && $login ) {\r\n\t\t\t\t\t$user = get_userdata($user_id);\r\n\t\t\t\t\t$user_id = $user->ID;\r\n\r\n\t\t\t\t\t// update wp user\r\n\t\t\t\t\twp_set_current_user( $user_id, $user->user_login );\r\n\t\t\t\t\twp_set_auth_cookie( $user_id );\r\n\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\r\n\t\t\t\t\tob_end_clean();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tum_reset_user();\r\n\t\t\t\t/**\r\n\t\t\t\t * UM hook\r\n\t\t\t\t *\r\n\t\t\t\t * @type action\r\n\t\t\t\t * @title um_after_email_confirmation\r\n\t\t\t\t * @description Action on user activation\r\n\t\t\t\t * @input_vars\r\n\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t\t * @change_log\r\n\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t * @usage add_action( 'um_after_email_confirmation', 'function_name', 10, 1 );\r\n\t\t\t\t * @example\r\n\t\t\t\t * <?php\r\n\t\t\t\t * add_action( 'um_after_email_confirmation', 'my_after_email_confirmation', 10, 1 );\r\n\t\t\t\t * function my_after_email_confirmation( $user_id ) {\r\n\t\t\t\t * // your code here\r\n\t\t\t\t * }\r\n\t\t\t\t * ?>\r\n\t\t\t\t */\r\n\t\t\t\tdo_action( 'um_after_email_confirmation', $user_id );\r\n\r\n\t\t\t\texit( wp_redirect( $redirect ) );\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function testLoginWithEmail()\n\t{\n\t\t$oauthLogin = Store_Feature::isEnabled('OAuthLogin');\n\t\tStore_Feature::override('OAuthLogin', false);\n\n\t\t$testUsername = 'test_'.uniqid();\n\t\t$testEmail = 'test+'.uniqid().'@bigcommerce.com';\n\t\t$testPassword = 'password1';\n\n\t\t$user = $this->_createDummyUser($testUsername, $testEmail, $testPassword);\n\n\t\t$res = $this->_postAction(array(\n\t\t\t'username' => $testEmail,\n\t\t\t'password' => $testPassword,\n\t\t));\n\n\t\t$this->assertEquals(3, count($res));\n\t\t$this->assertEquals($user->getUsertoken(), $res[0]);\n\t\t$this->assertEquals($user->getUsername(), $res[2]);\n\n\t\tStore_Feature::override('OAuthLogin', $oauthLogin);\n\t}", "public function setEmailAddress($email);", "function add_customer()\n\t{\n\t\t$table = \"customer\";\n\t\t$where = \"customer_email = '\".$this->input->post('user_email').\"'\";\n\t\t$items = \"customer_id\";\n\t\t$order = \"customer_id\";\n\t\t\n\t\t$result = $this->select_entries_where($table, $where, $items, $order);\n\t\t\n\t\tif(count($result) > 0)\n\t\t{\n\t\t\t$customer_id = $result[0]->customer_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'customer_email'=>$this->input->post('user_email'),\n\t\t\t\t'customer_name'=>$this->input->post('seller_name'),\n\t\t\t\t'customer_phone'=>$this->input->post('user_phone')\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"customer\";\n\t\t\t$customer_id = $this->insert($table, $data);\n\t\t}\n\t\t\n\t\treturn $customer_id;\n\t}", "public function setCustomerEmailAddress($val)\n {\n $this->_propDict[\"customerEmailAddress\"] = $val;\n return $this;\n }", "public function getUserActivation($email,$code){\n\t\t$emptyModelInstance = Sentry::getUserProvider()->getEmptyUser();\n\n\t\t// Now, you have any methods available that you'd like. Retrieve a new instance, query\n\t\t// against anything. Because our User model implements the right interfaces, it plays nicely\n\t\t// with Sentry.\n\t\t$user = $emptyModelInstance->where('email', '=', $email)->first();\n\n\t\t// Continue on as you were...\n\t\ttry\n\t\t{\n\t\t // Find the user using the user id\n\t\t //$user = Sentry::findUserById(1);\n\n\t\t // Attempt to activate the user\n\t\t if ($user->attemptActivation($code))\n\t\t {\n\t\t return Redirect::to('/')\n\t\t\t\t\t->with('success','You\\' ve logged in successfully!');\n\t\t }\n\t\t else\n\t\t {\n\t\t // User activation failed\n\t\t }\n\t\t}\n\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t{\n\t\t echo 'User was not found.';\n\t\t}\n\t\tcatch (Cartalyst\\Sentry\\Users\\UserAlreadyActivatedException $e)\n\t\t{\n\t\t echo 'User is already activated.';\n\t\t}\n\t}", "function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \n if ($this->Customer->exists($customer_id))\n {\n $this->sale_lib->set_customer($customer_id);\n if($this->config->item('automatically_email_receipt'))\n {\n $this->sale_lib->set_email_receipt(1);\n }\n }\n else\n {\n $data['error']=lang('sales_unable_to_add_customer');\n }\n $this->_reload($data);\n }", "public static function email_confirm_account() {\n\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n # definindo conta como não confirmada.\n $u->hash_confirm_account = $u->hash_confirm_account ?: \\Security::random(32);\n\n if ($u->emailConfirmAccount())\n flash('Email com as instruções para Confirmação de conta para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function isEnableCustomerEmail ()\n {\n return $this->scopeConfig->isSetFlag(\n 'b2bregistration/email_setting/customer_email_enable',\n ScopeInterface::SCOPE_STORE\n );\n }", "public function activate($user_id, $email_key) {\n $activated = $this->authm->activate_user_account($user_id, $email_key);\n if($activated === TRUE) {\n $this->login($user_id, 2);\n redirect('/relationship');\n } else {\n if($activated === 1) {\n show_error($this->lang->line('auth_activate_error_1'));\n } else {\n show_error($this->lang->line('auth_activate_error_2'));\n }\n }\n }", "public function validateCustomerEdit()\n {\n $customer = $this->_objectManager->create(\n \\Magento\\Customer\\Model\\Customer::class\n )->load(\n $this->_request->getParam('id')\n );\n if ($customer->getId() && !in_array($customer->getWebsiteId(), $this->_role->getRelevantWebsiteIds())) {\n $this->_forward();\n }\n }", "private function testUser($email) {\r\n\t\t$verifiedEmails = Configure::read('Shop.email');\r\n\t\tif(in_array($email, $verifiedEmails)) {\r\n\t\t\t$this->Session->write('admin', 1);\r\n\t\t\t$this->BsRedirect('Logged in');\r\n\t\t} else {\r\n\t\t\tdie('Not a valid email address');\r\n\t\t}\r\n }", "public function subscribeCustomer($customer)\n {\n //prüfen ob Magento Plugin aktiviert ist.\n if (!$this->helper->isMailingworkEnabled()) {\n return parent::subscribeCustomer($customer);\n }\n $this->loadByCustomer($customer);\n\n if ($customer->getImportMode()) {\n $this->setImportMode(true);\n }\n\n if (!$customer->getIsSubscribed() && !$this->getId()) {\n // If subscription flag not set or customer is not a subscriber\n // and no subscribe below\n return $this;\n }\n\n if(!$this->getId()) {\n $this->setSubscriberConfirmCode($this->randomSequence());\n }\n\n /*\n * Logical mismatch between customer registration confirmation code and customer password confirmation\n */\n $confirmation = null;\n if ($customer->isConfirmationRequired() && ($customer->getConfirmation() != $customer->getPassword())) {\n $confirmation = $customer->getConfirmation();\n }\n\n $sendInformationEmail = false;\n if ($customer->hasIsSubscribed()) {\n $status = $customer->getIsSubscribed()\n ? (!is_null($confirmation) ? self::STATUS_UNCONFIRMED : self::STATUS_SUBSCRIBED)\n : self::STATUS_UNSUBSCRIBED;\n /**\n * If subscription status has been changed then send email to the customer\n */\n if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) {\n $sendInformationEmail = true;\n }\n } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && (is_null($confirmation))) {\n $status = self::STATUS_SUBSCRIBED;\n $sendInformationEmail = true;\n } else {\n $status = ($this->getStatus() == self::STATUS_NOT_ACTIVE ? self::STATUS_UNSUBSCRIBED : $this->getStatus());\n }\n\n if($status != $this->getStatus()) {\n $this->setIsStatusChanged(true);\n }\n\n $this->setStatus($status);\n\n if(!$this->getId()) {\n $storeId = $customer->getStoreId();\n if ($customer->getStoreId() == 0) {\n $storeId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();\n }\n $this->setStoreId($storeId)\n ->setCustomerId($customer->getId())\n ->setEmail($customer->getEmail());\n } else {\n $this->setStoreId($customer->getStoreId())\n ->setEmail($customer->getEmail());\n }\n\n $sendSubscription = $customer->getData('sendSubscription') || $sendInformationEmail;\n if (is_null($sendSubscription) xor $sendSubscription) {\n if ($this->getIsStatusChanged() && $status == self::STATUS_UNSUBSCRIBED) {\n $result = $this->mwOptoutRecipient(true);\n } elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) {\n $result = $this->mwOptinRecipient(true);\n }\n }\n\n $this->save();\n return $this;\n }", "public function testAuthenticateEmailUser ()\n {\n $result = $this->storage->authenticateUser($this->email1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->email1, $result['email_address']);\n }", "public function testCustomerInvoicesV2SendEmail()\n {\n }", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function processGuestToCustomer()\n {\n }", "public function byemailAction(Request $request)\n {\n $maincompany = $this->getUser()->getMaincompany();\n $email = $request->query->get('email');\n $emailConstraint = new Email();\n $errorList = $this->get('validator')->validateValue($email, $emailConstraint);\n $result = array();\n $result['error'] = 0; \n if (count($errorList) != 0) {\n $result['error'] = -1;\n $result['id'] = -1;\n $result['name'] = '';\n goto next;\n }\n $em = $this->getDoctrine()->getManager();\n $customer = $em->getRepository('NvCargaBundle:Customer')->findoneBy(['maincompany'=>$maincompany,'email'=>$email]);\n \n if ($customer) {\n $result['id'] = $customer->getId();\n $result['name'] = $customer->getName() . ' ' . $customer->getLastname();\n } else {\n $result['id'] = 0;\n $result['name'] = '';\n }\n next:\n return new JsonResponse($result); \n }", "public function AddCustomer($email_address, $password, $first_name, $last_name) {\n \n //set up the query\n $this->sql = \"INSERT INTO customers (emailAddress, password, firstName, lastName)\n VALUES (:email_address, :password, :first_name, :last_name)\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':email_address' => $email_address,\n ':password' => $password,\n ':first_name' => $first_name,\n ':last_name' => $last_name,\n ], true);\n }", "function add(){\n // create new oject \n $customer = new customerModel();\n // set the attributes of customer\n $customer->name = $_POST['name'];\n $customer->email = $_POST['email'];\n $customer->phone = $_POST['phone'];\n $customer->address = $_POST['address'];\n $customer->address2 = $_POST['address2'];\n $customer->city = $_POST['city'];\n $customer->state = $_POST['state'];\n $customer->zipcode = $_POST['zipcode'];\n $customer->username = $_POST['username'];\n $customer->password = $_POST['password'];\n $customer->usergroup = $_POST['usergroup'];\n $customer->verified = 0;\n $customer->token = bin2hex(random_bytes(50)); // generate unique token\n if($customer->addCust() > 0){\n\n $to = $_POST['email']; // Send email to our user\n $subject = 'Verification'; // Give the email a subject \n $msg = '\n \n Thanks for signing up!\n Your account has been created, you can login with the following emails after you have activated your account by pressing the url below.\n \n ------------------------\n Email: '.$_POST[\"email\"].'\n ------------------------\n \n Please click this link to activate your account:\n http://localhost/sdw/sdw_group1/ApplicationLayer/ManageLoginInterface/verify.php?email='.$_POST['email'].'&token='.$customer->token.'\n \n '; // Our message above including the link\n \n $headers = 'From:noreply@yourwebsite.com' . \"\\r\\n\"; // Set from headers\n \n if(mail($to, $subject, $msg, $headers)){\n $message = \"Successfully Registered! Please check your email for authorize your account.\";\n echo \"<script type='text/javascript'>alert('$message');\n window.location = '../../ApplicationLayer/ManageLoginInterface/login.php';</script>\";\n } // Send our email\n else\n {\n $message = \"Failed while sending email\";\n echo \"<script type='text/javascript'>alert('$message');\n window.location = '../../ApplicationLayer/ManageLoginInterface/CustomerSignup.php';</script>\";\n }\n\n $message = \"Customer Successfully Registered\";\n\t\techo \"<script type='text/javascript'>alert('$message');\n\t\twindow.location = '../../ApplicationLayer/ManageLoginInterface/login.php';</script>\";\n // send to customerModel\n }\n }", "public static function addCustomer() {\n \n // We get appointment information then set up our validator\n $info = Session::get('appointmentInfo');\n $validator = Validator::make(\n array(\n 'first_name' => $info['fname'],\n 'last_name' => $info['lname'],\n 'email' => $info['email']\n ),\n array(\n 'first_name' => 'exists:customers,first_name',\n 'last_name' => 'exists:customers,last_name',\n 'email' => 'exists:customers,email'\n )\n );\n \n // If the validator fails, that means the user does not exist\n // If any of those three variables don't exist, we create a new user\n // This is so that families can use the same e-mail to book, but\n // We stil create a new user for them in the database.\n if ($validator->fails()) {\n // Registering the new user\n return Customer::create(array(\n 'first_name' => $info['fname'],\n 'last_name' => $info['lname'],\n 'contact_number' => $info['number'],\n 'email' => $info['email'],\n 'wants_updates' => Session::get('updates')\n ))->id;\n } else {\n return Customer::where('email', $info['email'])->pluck('id');\n }\n \n }", "public function new_customer_email($edata) {\n\t\t\t\t$template = $this->shortcode_variables(\"customerregisteradmin\");\n\t\t\t\t$details = email_template_detail(\"customerregisteradmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregisteradmin\");\n\t\t\t\t$values = array($edata['name'], $edata['email'], $edata['address'], $edata['phone']);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"supplierregisteradmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($this->adminemail);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function setCustomerEmail($customerEmail)\n {\n $this->customerEmail = $customerEmail;\n\n return $this;\n }", "public function EmailCuponToCustomer($cuponToken,$control,$first,$last,$email,$validez,$maildescription,$brandname,$brandinfo)\n\t{\n\t $GLOBALS['CuponToken'] = $cuponToken;\n\t $GLOBALS['Control'] = $control;\n\t $GLOBALS['First'] = $first;\n\t $GLOBALS['Last'] = $last;\n\t $GLOBALS['Email'] = $email;\n\n\t $GLOBALS['Validez'] = substr($validez,0,10);\n\t $GLOBALS['Maildescription'] = $maildescription;\n\t $GLOBALS['Validez'] = substr($validez, 0, 10);\n\t $GLOBALS['Maildescription'] = nl2br($maildescription);\n\t $GLOBALS['Brandname'] = $brandname;\n\t $GLOBALS['Brandinfo'] = $brandinfo;\n\t $GLOBALS['Control'] = $control;\n\t \n\t \n\t $emailTemplate = FetchEmailTemplateParser();\n\t \n\t \n\t $emailTemplate->SetTemplate(\"cupon_email\");\n\t\t$message = $emailTemplate->ParseTemplate(true);\n\n\t\t// Create a new email API object to send the email\n\t\t$store_name = GetConfig('StoreName');\n\t\t$obj_email = GetEmailClass();\n\t\t$obj_email->From(GetConfig('OrderEmail'), $store_name);\n\t\t$obj_email->Set(\"Subject\", sprintf(GetLang('YourCuponFrom'), $store_name));\n\t\t$obj_email->AddBody(\"html\", $message);\n\t\t$obj_email->AddRecipient($email, \"\", \"h\");\n\t\t$email_result = $obj_email->Send();\n\t\t\n\t\t// If the email was sent ok, show a confirmation message\n\t\tif ($email_result['success']) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\t// Email error\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function create_customer($email,$password){\n\t\t\n\t\t$explode = explode('@',$email);\n\t\t$name = $explode[0];\n\t\t//$password = $this->general_model->random_password(8);\n\t\t$token = $this->general_model->getToken(15);\n\t\t$roleid =4;\n\t\t$create_customer_arr = array(\n\t\t\t'Name'=>$name,\n\t\t\t'Email'=>$email,\n\t\t\t'Password'=> md5($password),\n\t\t\t'RoleId'=>$roleid,\n\t\t\t'Token'=>$token\n\t\t);\n\t\t$customer_result = $this->usermaster_model->insert_customer($create_customer_arr);\n\t\treturn $customer_result;\n\t}", "public function execute()\n {\n $customerId = (int) $this->getRequest()->getParam('customer_id');\n \t$this->customerHelper->confirmCustomerEmail($customerId);\n $resultRedirect = $this->resultRedirectFactory->create();\n $resultRedirect->setPath('customer/index/index');\n return $resultRedirect;\n }", "public function customerLogin($observer) {\n\t\tif ($customerId = $observer->getCustomer()->getId()) {\n\t\t\t$helper = Mage::helper('rublonmodule');\n\t\t\t$helper->setModule(RublonMagentoModule::FRONT);\n\t\t\tif ($helper->isRublonConfigured() AND $helper->isRublonEnabled() AND $helper->isRublonSecuredUser($customerId)) {\n\t\t\t\t$helper->authenticateCustomer($observer);\n\t\t\t}\n\t\t}\n\t}", "abstract public function authorize();", "abstract public function authorize();", "public function setGiftcardRecipientEmail($value);", "public function traerPorMail($email) {\n\n}", "public function sendActivationEmail()\n\t{\n\t\t$mailData = [\n\t\t\t'to' => $this->email,\n\t\t\t'from' => 'noreply@jasompeter.com',\n\t\t\t'nameFrom' => 'Peter Štovka'\n\t\t];\n\n\n\t\tMail::send('email.activation', ['token' => $this->token], function ($message) use ($mailData) {\n\t\t\t$message->to($mailData['to'], 'Aktivačný email')\n\t\t\t\t->subject('Aktivácia účtu')\n\t\t\t\t->from($mailData['from'], $mailData['nameFrom']);\n\t\t});\n\t}", "public function create()\n {\n $this->sesClient->verifyEmailIdentity(\n [\n 'EmailAddress' => $this->identity->getIdentity(),\n ]\n );\n }", "public function setEmail(?string $email): void;", "public function setEmail(?string $email): void;", "public function postLogin()\n\t{\n\t\t$email = Input::get('email');\n\n\t\t// Checks if the email field contains a valid email address\n\t\t$validation = Validator::make(array('email' => $email), array('email' => 'required|max:45|email'));\n\t\tif($validation->fails()){\n\t\t\t// Return with input and errors\n\t\t\treturn Redirect::back()->withInput()->withErrors($validation->errors());\n\t\t}\n\n\t\t// Finds customer with the given email address\n\t\t$user = Customer::where('cust_email', '=', $email)->first();\n\n\t\t// Create new customer if none found\n\t\tif(!$user){\n\t\t\t$user = new Customer;\n\t\t\t$user->cust_email = $email;\n\t\t\t\n\t\t\tif (!$user->save()) {\n \treturn Redirect::to('/login')->withErrors($user->errors());\n \t}\n\t\t}\n\t\t$id = $user->cust_id;\n\n\t\t// Creates session\n\t\tSession::put('customer.loggedin', true);\n\t\tSession::put('customer.id', $id);\n\t\tSession::put('customer.email', $email);\n\n\t\treturn Redirect::to('/');\n\t}", "function the_author_email()\n {\n }", "public function create($email);", "public function post_signedin(){\n\n\t\t$customerdata = array(\n\t\t\t'customer_emailAddress' => Input::get('customer_emailAddress'),\n\t\t\t'password' => Input::get('customer_password')\n\t\t);\n\n\t\t$validation = Customer::validate_login();\n\n\t\tif($validation->fails()) {\n\t\t \treturn Redirect::back()\n\t\t \t\t->withErrors($validation)\n\t\t \t\t->withInput();\n\t\t}\n\n\t\telse{\n\t\t\tif (Auth::attempt($customerdata)) {\n\n\t\t\t\t$session_customer_id = Auth::user()->customer_id;\n\t \t\t\treturn Redirect::to('/')->with('message', 'You are now logged in!');\n\n\t\t\t} else {\n\t \t\t\treturn Redirect::route('customerlogin')\n\t \t\t\t->with('error-message', 'Your email address/password combination was incorrect. Please try again.')\n\t \t\t\t->withInput();\n\t\t\t}\n\t\t}\n\t}", "public function customer()\n {\n \n // Sustomer is stil step 0\n $this->set_step(0);\n\n\n\n // You are logged in, you dont have access here\n if($this->current_user)\n {\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n }\n\n\n\n // Check to see if a field is available\n if( $this->input->post('customer') )\n {\n\n $input = $this->input->post();\n switch($input['customer'])\n {\n case 'register':\n $this->session->set_userdata('nitrocart_redirect_to', NC_ROUTE .'/checkout/billing');\n redirect('users/register');\n break;\n case 'guest':\n $this->session->set_userdata('user_id', 0);\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n break;\n default:\n break;\n }\n //more like an system error!\n $this->session->set_flashdata( JSONStatus::Error , 'Invalid selection');\n redirect( NC_ROUTE . '/checkout');\n }\n\n $this->set_step(0);\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('User Account')\n ->build( $this->theme_layout_path . 'customer');\n }", "public function authorize();", "public function authorize();", "public function getUserCustomerEmail($customerId)\n {\n $query = craft()->db->createCommand()\n ->select('email')\n ->from('customerpoints_user')\n ->where('id=' . $customerId)\n ->queryAll();\n\n return (count($query) == 0) ? 0 : $query[0]['email'];\n }", "public function email($account, $email)\n {\n return $this->requestGet(\n sprintf('users/%s/invitations/%s', $account, $email)\n );\n }", "function rnf_postie_inreach_author($email) {\n // So we can inspect the domain, refer to $domain[1]\n $domain = explode('@', $email);\n\n // Get the whitelisting options\n $options = get_option( 'rnf_postie_settings' );\n $accept_addresses = $options['emails'];\n $accept_domains = $options['domains'];\n\n // Test the email address and change it to mine if it's allowable.\n if (in_array($email, $accept_addresses) || in_array($domain[1], $accept_domains)) {\n // For a multi-author site, this should be a setting. For me, this is fine.\n $admin = get_userdata(1);\n return $admin->get('user_email');\n }\n return $email;\n}", "public function verifyEmailAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n if ($this->userRegistrationService->verifyEmail($user, $token)) {\n // email verified\n return $this->redirectToPostVerificationRoute();\n }\n\n // email not verified, probably invalid token\n $vm = new ViewModel();\n $vm->setTemplate('ht-user-registration/user-registration/verify-email-error.phtml');\n\n return $vm;\n\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "function authenticateCustomer($prj_id, $customer_id, $contact_id)\n {\n $tpl = new Template_Helper();\n $backend =& self::_getBackend($prj_id);\n if (method_exists($backend, 'authenticateCustomer')) {\n $backend->authenticateCustomer($customer_id, $contact_id);\n } else {\n // check if customer is expired\n $usr_id = Auth::getUserID();\n $contact_id = User::getCustomerContactID($usr_id);\n if ((!empty($contact_id)) && ($contact_id != -1)) {\n $status = self::getContractStatus($prj_id, User::getCustomerID($usr_id));\n $email = User::getEmailByContactID($contact_id);\n if ($status == 'expired') {\n self::sendExpirationNotice($prj_id, $contact_id, true);\n Auth::saveLoginAttempt($email, 'failure', 'expired contract');\n\n Auth::removeCookie(APP_PROJECT_COOKIE);\n\n $contact_id = User::getCustomerContactID($usr_id);\n $tpl->setTemplate(\"customer/\" . self::getBackendImplementationName($prj_id) . \"/customer_expired.tpl.html\");\n $tpl->assign('customer', self::getContractDetails($prj_id, $contact_id, false));\n $tpl->displayTemplate();\n exit;\n } elseif ($status == 'in_grace_period') {\n self::sendExpirationNotice($prj_id, $contact_id);\n $tpl->setTemplate(\"customer/\" . self::getBackendImplementationName($prj_id) . \"/grace_period.tpl.html\");\n $tpl->assign('customer', self::getContractDetails($prj_id, $contact_id, false));\n $tpl->assign('expiration_offset', self::getExpirationOffset($prj_id));\n $tpl->displayTemplate();\n exit;\n }\n // check with cnt_support to see if this contact is allowed in this support contract\n if (!self::isAllowedSupportContact($prj_id, $contact_id)) {\n Auth::saveLoginAttempt($email, 'failure', 'not allowed as technical contact');\n Auth::redirect(\"index.php?err=4&email=\" . $email);\n }\n }\n }\n }", "public function doemail() {\r\n \tif (isset($_SESSION['userid'])) {\n \t if (isset($_POST['useremail'])) {\n \t \tif ($this->model->putemail($_SESSION['userid'],$_POST['useremail'])) {\n \t \t $this->view->set('infomessage', \"Adres email został zmieniony.\"); \r\n \t \t $this->view->set('redirectto', \"?v=project&a=show\");\r\n \t \t $this->view->render('info_view');\n \t \t} else {\n \t \t $this->view->set('errormessage', \"Nieudana zmiana adresu email.\");\r\n \t $this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t $this->view->render('error_view');\n \t \t}\n \t } else {\n \t \t$this->view->set('errormessage', \"Błędny adres email.\");\r\n \t \t$this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t$this->view->render('error_view');\n \t }\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "private function login_user($email) {\n }", "public function customers()\n {\n if ($_SESSION['role'] == 1)\n { \n //get customers info from the database\n $Customer = $this->model('Customer');\n $this->customers = $Customer->adminGetCustomers(); \n $this->view('AdminDashboard/customers', ['viewName' => 'Dashboard - Customers']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n\n }", "public function getUserByEmail($email);", "public static function authorizeUser($email)\n {\n $isCommit = FALSE;\n $conn = new MySqlConnect();\n $ts = $conn -> getCurrentTs();\n\n $updateSql = \"UPDATE Users\";\n $updateSql .= \" SET isValidated = 'YES'\";\n $updateSql .= \" WHERE emailAddress = '{$email}'\";\n\n // update existing user record in the database\n $isCommit = $conn -> executeQuery($updateSql);\n $conn -> freeConnection();\n\n return $isCommit;\n }", "static function add_email(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::email, [\r\n\t\t\t'label' => 'Email',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => '(Optional)',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'placeholder' => 'someone@themedium.ca'\r\n\t\t]);\r\n\t}", "public function setCustomer($name, $identity, $email = '', $phone = '') {\n\n $this->jsonData['Customer'] = array(\n 'Identity' => $this->validateNumber($identity, 14),\n 'FullName' => $this->validateString($name, 288),\n 'Email' => $this->validateEmail($email),\n 'Phone' => $this->validateNumber($phone, 11)\n );\n }", "public function getCustomerByEmail($email)\n {\n try {\n return $this->customerRepositoryInterface->get($email, $this->getWebsiteId());\n } catch (\\Exception $e) {\n $this->logger->critical($e);\n return false;\n }\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "function addEmail(\n\t\t$email_address,\n\t\t$activation_email_subject = null,\n\t\t$activation_email_view = null,\n\t\t$html = true,\n\t\t$fields = array())\n\t{\n\t\tif (!Pie_Valid::email($email_address)) {\n\t\t\tthrow new Pie_Exception_WrongValue(array(\n\t\t\t\t'field' => 'Email', \n\t\t\t\t'range' => 'a valid address'\n\t\t\t), 'email_address');\n\t\t}\n\t\tPie::event(\n\t\t\t'users/validate/email_address',\n\t\t\tarray('email_address' => & $email_address)\n\t\t);\n\t\t$e = new Users_Email();\n\t\t$e->address = $email_address;\n\t\tif ($e->retrieve() and $e->state !== 'unverified') {\n\t\t\tif ($e->user_id === $this->id) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Otherwise, say it's verified for another user,\n\t\t\t// even if it unsubscribed or was suspended.\n\t\t\tthrow new Users_Exception_AlreadyVerified(array(\n\t\t\t\t'key' => $e->address,\n\t\t\t\t'user_id' => $e->user_id\n\t\t\t), 'email_address');\n\t\t}\n\t\t\n\t\t// If we are here, then the email record either\n\t\t// doesn't exist, or hasn't been verified yet.\n\t\t// In either event, update the record in the database,\n\t\t// and re-send the email.\n\t\t$minutes = Pie_Config::get('users', 'activationCodeExpires', 60*24*7);\n\t\t$e->state = 'unverified';\n\t\t$e->user_id = $this->id;\n\t\t$e->activation_code = Pie_Utils::unique(5);\n\t\t$e->activation_code_expires = new Db_Expression(\n\t\t\t\"CURRENT_TIMESTAMP + INTERVAL $minutes MINUTE\"\n\t\t);\n\t\t$e->auth_code = md5(microtime() + mt_rand());\n\t\t$e->save();\n\t\t\n\t\tif (!isset($activation_email_view)) {\n\t\t\t$activation_email_view = Pie_Config::get(\n\t\t\t\t'users', 'activationEmailView', 'users/email/activation.php'\n\t\t\t);\n\t\t}\n\t\tif (!isset($activation_email_subject)) {\n\t\t\t$activation_email_subject = Pie_Config::get(\n\t\t\t\t'users', 'activationEmailSubject', \"Welcome! Please confirm your email address.\" \n\t\t\t);\n\t\t}\n\t\t$fields2 = array_merge($fields, array('user' => $this, 'email' => $e));\n\t\t$e->sendMessage(\n\t\t\t$activation_email_subject, \n\t\t\t$activation_email_view, \n\t\t\t$fields2,\n\t\t\tarray('html' => $html)\n\t\t);\n\t\t\n\t\tPie::event('users/addEmail', compact('email_address'), 'after');\n\t}", "public function setGiftcardSenderEmail($value);" ]
[ "0.6678356", "0.6678356", "0.6442672", "0.6358633", "0.6358633", "0.6358633", "0.62636316", "0.6262686", "0.6206845", "0.6014553", "0.59279007", "0.5918939", "0.5856887", "0.58378744", "0.58344966", "0.5830605", "0.5813763", "0.58059925", "0.5766606", "0.576602", "0.5722885", "0.5687863", "0.56715196", "0.56475556", "0.56284136", "0.56002516", "0.55868834", "0.55083996", "0.5496319", "0.5487209", "0.5483418", "0.5483418", "0.5483418", "0.5467441", "0.5465711", "0.5457487", "0.5445005", "0.54404294", "0.54363436", "0.543419", "0.54334605", "0.5421388", "0.5406977", "0.54060364", "0.5401401", "0.5397275", "0.5395071", "0.53825295", "0.5379751", "0.5377238", "0.53755313", "0.53721225", "0.53604555", "0.53499115", "0.5343623", "0.53393495", "0.5337652", "0.5337568", "0.5333544", "0.53284544", "0.5305234", "0.5303291", "0.53021556", "0.527705", "0.5260632", "0.5256773", "0.52557373", "0.5252305", "0.52495074", "0.52495074", "0.5247242", "0.52278215", "0.52254915", "0.52186733", "0.52147514", "0.52147514", "0.5212668", "0.52112895", "0.5210103", "0.5209959", "0.5209567", "0.52065015", "0.52065015", "0.52017677", "0.5196225", "0.5194337", "0.5194317", "0.51892424", "0.51866955", "0.5186158", "0.51845175", "0.5183905", "0.5170817", "0.51694536", "0.51642334", "0.51623654", "0.516142", "0.5160467", "0.5158406", "0.51522475" ]
0.63218826
6
Obtain a new access token for customer.
public function actionAccesstoken() { $authParam = Yii::$app->getRequest()->getBodyParam('auth'); if (!$authParam) { throw new NotFoundHttpException("There's no authorization code provided."); } $model = Customer::find()->where(['auth_code' => $authParam])->andWhere(['>', 'auth_expired', time()])->one(); if ($model === null) { throw new NotFoundHttpException("Invalid authorization code."); } $model->token_code = md5(uniqid()); $model->token_expired = time() + (60 * 60 * 24 * 60); // 60 days $model->save(false); $data = [ 'access_token' => $model->token_code, 'expired_at' => $model->tokenExpired ]; return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_access_token() {\n $access_token = get_transient( 'yith-wcbk-gcal-access-token' );\n if ( !$access_token ) {\n $refresh_token = $this->get_option( 'refresh-token' );\n if ( $refresh_token ) {\n $data = array(\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'refresh_token' => $refresh_token,\n 'grant_type' => 'refresh_token',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token refreshed successfully', compact( 'access_token', 'expires_in', 'body' ) );\n } else {\n $this->error( 'Error while refreshing Access Token: ', $response );\n }\n }\n }\n\n return $access_token;\n }", "private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }", "public function getNewAccessToken()\n {\n return $this->get('NewAccessToken');\n }" ]
[ "0.67623466", "0.67221767", "0.6699777", "0.6699777", "0.6699777", "0.6699777", "0.6699777", "0.6699777", "0.6699777", "0.6699777", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.66991764", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937", "0.6698937" ]
0.6837009
0
Shows list of customer orders.
public function actionOrder() { $request = Yii::$app->getRequest(); $requestParams = $request->getBodyParams(); if (empty($requestParams)) { $requestParams = $request->getQueryParams(); } $query = Order::find() ->where(['customer_id' => $this->customer_id]) ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT]) // filter based on date range ->andFilterWhere([ 'between', 'ordered_at', $request->getBodyParam('order_from'), $request->getBodyParam('order_to') ]); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => ['params' => $requestParams], 'sort' => ['params' => $requestParams], ]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showOrders()\r\n\t{\r\n\t\t$orderNumbers = Orders::getAll();\r\n\r\n\t\t$ordersList = array_map(function ($orderNumber) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\treturn new Orders($orderNumber);\r\n\r\n\t\t\t\t\t}, $orderNumbers);\r\n\r\n\t\t$orders = (new Collection($ordersList))->paginate(10);\r\n\r\n\t\treturn view('admin/orders', compact('orders'));\r\n\t}", "public function index()\n {\n $orders = Auth::user()->orders;\n\n return view('customer.dashboard.order.index', compact('orders'));\n }", "public function index()\n\t{\n\t\t$orders = Order::with('customer')->get();\n\n\t\treturn view('orders.index', compact('orders'));\n\t}", "public function index()\n {\n $customerOrder = CustomerOrder::all();\n return view('customerOrder')->with($customerOrder);\n }", "public function index()\n {\n $customers = Customers::all();\n return view('orders.index',compact('customers'));\n }", "public function actionOrders(){\n\t\t$orders = $this->_getOrderModel()->getAllOrder();\n\t\t\n\t\t$viewParams = array(\n\t\t\t'orders' => $orders\n\t\t);\n\t\t\n\t\treturn $this -> responseView('DTUI_ViewPublic_EntryPoint_Orders','dtui_order_list',$viewParams);\n\t}", "public function index()\n {\n $orders = Order::with('customer','spec', 'product', 'variation', 'address')->latest()->paginate(10);\n\n return view('admin.orders-list')\n ->withOrders($orders);\n\n }", "public function showOrderList() {\n\n $orders = history::orderBy('customer_id')->orderBy('command_at','desc')->paginate(10);\n return view('admin.orderList',compact('orders'));\n }", "public function list(){\n $list = $this->getOrders();\n return view('orders.form-order', compact('list'));\n // dd($list);\n }", "public function index()\n {\n $orders = Order::all();\n\n return view('customer.home')->with([\n 'orders' => $orders\n ]);\n }", "public function index()\n {\n $orders = Order::all();\n \n return view('orderList')->with('orders', $orders);\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function index()\n {\n $orders = Order::active()->paginate(10);\n return view('auth.orders.index', compact('orders'));\n }", "public function show(orders $orders)\n {\n //\n }", "public function index()\n {\n $getorders = Order::with('users')->get();\n return view('orders',compact('getorders'));\n }", "public function index()\n {\n $orders = Order::all();\n return view('orders/list', compact('orders'));\n }", "public function listOrdersAction(){\n\t\t$user = $this->get('security.token_storage')->getToken()->getUser();\n\t\t$orders = $this->getDoctrine()->getManager()->getRepository('EcommerceBundle:UserOrder')->findBy(\n\t\t\t['user' => $user, 'valid' => 1],\n\t\t\t['id' => 'DESC']\n\t\t);\n\t\treturn $this->render('UserBundle:Default:orderIndex.html.twig', array(\n\t\t\t'orders' => $orders\n\t\t));\n\t}", "public function getCustomerOrders()\n {\n $customer = auth()->user();\n $orders = Order::where('customer_id', $customer->getKey())->get();\n\n return response()->json($orders->transform(function($order) use ($customer) {\n return [\n 'order_id' => $order->order_id,\n 'total_amount' => $order->total_amount,\n 'created_on' => $order->created_on,\n 'shipped_on' => $order->shipped_on,\n 'name' => $customer->name,\n ];\n }));\n }", "public function index()\n {\n $orders = Order::orderby('created_at', 'desc')->paginate(4);\n return view('orders.list_order', compact('orders'));\n\n }", "public function index() {\n return view('admin.orders');\n }", "public function listOrder()\n {\n //\n $orders = Order::where('user_id','=',Auth::user()->id)->get();\n //dd($orders);\n return view('orders.list-order',compact('orders'));\n }", "public function index()\n {\n $orders = \\App\\Models\\Order::all();\n\n return view('orders', [\n 'allOrders' => $orders\n ]);\n }", "public function listCustomers()\n {\n return $this->view( 'pages.dashboard.customers' );\n }", "public function getOrdersAction()\n {\n $em = $this->getDoctrine()->getManager();\n $currencies = $em->getRepository('ApiBundle:CurrencyOrder')->findBy(array(), array('id' => 'DESC'));\n $view = $this->view($currencies);\n return $this->handleView($view);\n }", "public function list()\n {\n $orders= Order::orderBy('status')->orderBy('orderdate')->orderBy('id','desc')->paginate(20);\n return view('admin.orders.index',compact('orders'));\n }", "public function index()\n {\n $orders = Order::with([\n 'user',\n ])->withCount('orderDetails')->orderBy('status', 'desc')->paginate(config('app.number_paginate'));\n\n return view('admin.orders.index', compact('orders'));\n }", "public function index()\n {\n $orders = $this->orderRepository->paginate();\n return view('admin.orders.index', compact('orders'));\n }", "public function index()\n {\n $orders = Auth::user()->orders;\n\n return view('orders.index', compact('orders'));\n\n }", "public function view_orders()\n\n {\n $itemData['item'] = Product::getorderItem();\n\n $data = ['itemData' => $itemData];\n\n return view('admin.orders')->with($data);\n }", "public function index()\n {\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n return view('orders.index')->with('orders', $user->orders);\n }", "public function index()\n {\n $customers = Customer::all();\n return view('admin.customer.customer',compact('customers'));\n }", "public function show(CustomerOrder $customerOrder)\n {\n //\n }", "public function show(CustomerOrder $customerOrder)\n {\n //\n }", "public function index()\r\n {\r\n $userInfo = $this->UserRepository->getUserInfoByUserId(Auth::user()->id);\r\n $nameOfPage = 'Orders Page';\r\n $orders = $this->OrdersRepository->getOrders();\r\n $ordersGuests = $this->OrdersRepository->getOrdersForGuests();\r\n $orders = $this->paginateCollection($orders->merge($ordersGuests)\r\n ->sortByDesc('id'), self::PAGINATE);\r\n\r\n return view('admin.orders', compact(self::viewShareVarsAdminPanelOrders));\r\n }", "public function viewAllOrders()\n {\n $customers = [];\n $orders = Order::paginate(30);\n if ($orders->count()) {\n foreach ($orders as $order) {\n $allCustomerId[] = $order->userId;\n }\n // to remove duplicates\n $customerId = array_unique($allCustomerId);\n // to renumber the array index after using array_unique() i.e after using array_unique() the array may look like\n // index => value\n // 0 => 1\n // 2 => 3\n // 7 => 9\n // to fix this we use array_values()\n // which will give the result\n // index => value\n // 0 => 1\n // 1 => 3\n // 2 => 9\n $arrangedCustomerId = array_values($customerId);\n for ($i = 0; $i < count($arrangedCustomerId); $i++) {\n $customers[$i] = User::whereId($arrangedCustomerId[$i])->first();\n }\n }\n return view('admin.orders.viewAllOrders', compact('orders', 'customers'));\n }", "public function orders($customerId)\n {\n return view($this->_config['view'], compact('customerId'));\n }", "public function index()\n {\n $orders = Order::paginate(10);\n return view('backend.orders.index', compact('orders'));\n }", "public function index()\n {\n return view('orders.all');\n }", "public function index()\n {\n $orders = Order::buyer(auth()->id())->paginate(10);\n $salescount = Order::salescount(auth()->id());\n\n return view('frontend.order.index', compact('orders', 'salescount'));\n }", "public function get_customers () {\n \t$customers = $this->service->get_customers();\n \treturn view('admin.customers', ['customers' => $customers]);\n }", "public function show(Order $orders)\n {\n //\n }", "public function index()\n\t{\n\t\t$orders = Order::all();\n\n\t\treturn View::make('admin.orders.index', compact('orders'));\n\t}", "public function index()\n {\n $orders = Orders::paginate(10);\n return view('backend.orders.index', compact('orders'));\n }", "public function index()\n\t{\t$customers = Customer::all();\n\t\treturn view('admin.customer.customers',['customers' => $customers]);\n\t}", "public function index()\n {\n $orders = CustomerOrder::where('user_id',Auth::user()->id)->get();\n if ($orders) {\n return response()->json(['orders' => $orders]);\n } else {\n return response(0);\n }\n }", "public function index()\n {\n $orders = Order::orderBy('id','desc')->get();\n return view('admin.order.order',compact('orders'));\n }", "public function index()\n {\n $customers = Customer::where('type',Customer::CUSTOMER)->paginate(5);\n return view('admin.customers.customers',compact('customers'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $repo = $em->getRepository('AppBundle:CarOrder');\n\n $user = $this->get('security.token_storage')->getToken()->getUser();\n\n $orders = $repo->getOrdersForUser($user);\n\n return $this->render('AppBundle:Orders:index.html.twig', array(\n 'orders' => $orders\n ));\n }", "public function index()\n {\n return view('pages.admin.orders.index')->with('orders',Orders::all());\n }", "public function index()\n {\n $orders = Order::orderBy('id', 'DECS')->paginate(5);\n return view('back-end.orders.index')->with(['orders' => $orders]);\n }", "public function customer(){\n\n $data['title'] = 'Customers';\n return view('admin.customer_list')->with($data);\n }", "public function index()\n {\n $orders = Order::all()->sortBy('updated_at');\n return view('admin.orders.index', compact('orders'));\n }", "public function index()\n {\n $orders= Order::orderBy('created_at','desc')->get();\n\n return view('admin.order.index',compact('orders'));\n }", "public static function GetOrders() {\n $orders = [];\n $users_order = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->orderBy('orders.created_at', 'desc')\n ->paginate(8);\n foreach ($users_order as $new_users_order) {\n $orders[] = (array) $new_users_order;\n }\n foreach ($orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n\n self::$data['orders'] = $orders;\n self::$data['users_order'] = $users_order;\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Orders';\n return view('cms.orders', self::$data);\n }", "public function index()\n {\n $orders = Order::latest()->get();\n\n return view('admin.orders.index',compact('orders'));\n }", "public function index()\n {\n //\n $orders = Order::all();\n return view('admin.order.index', compact('orders'));\n }", "public function index()\n {\n $orders = Order::simplePaginate(15);\n\n return view('orders', ['orders' => $orders]);\n }", "public function index()\n {\n //we keep completed and refunded orders for 3 days in tracking section\n //so added below conditions\n // ->whereRaw('((status = ' . ORDER_COMPLETED .') OR (status = ' . ORDER_REFUNDED . '))')\n // ->where('updated_at', '<=', $time)\n \n //$time = date('Y-m-d, H:i:s', strtotime('-3 days'));\n $time = date('Y-m-d, H:i:s', strtotime('-3 minutes'));\n $orders = Order::where('customer_id', $this->current_customer->id)\n ->whereRaw('((status = ' . ORDER_COMPLETED .') OR (status = ' . ORDER_REFUNDED . '))')\n ->where('updated_at', '<=', $time)\n ->orderBy('created_at', 'desc')\n ->paginate(5);\n \n return $this->view('customer.orderList', compact('orders')); \n }", "public function index()\n {\n $orders = Order::all();\n return view('order.index', compact('orders'));\n }", "public function index()\n {\n return view('order.list');\n }", "public function index() {\n $orders = Order::all()->load('orderitems', 'shippings');\n return view('backend.admin.order.list')->with('orders', $orders);\n }", "public function index()\n {\n $orders = Order::all();\n return view('admin.order.index' , compact('orders'));\n }", "public function order_show()\n {\n //\n $orders = Order::all();\n \n return view('productions.order_show',['orders' => $orders,]);\n }", "public function index()\n {\n $orders = Order::with(['user', 'selectedProducts'])->latest()->paginate(10);\n return view('orders.index', compact(['orders']));\n }", "public function index()\n {\n $orders = Order::all();\n\n return view('backend.order.index', compact('orders'));\n }", "public function index()\n {\n return view('marchant.orders.order');\n }", "public function list()\n {\n $customer_result = User::select('id', 'first_name', 'last_name', 'email', 'contact_no', 'status')\n ->orderBy(\"created_at\", \"ASC\")\n ->paginate(5);\n \n return view('admin.customer_list', ['customers' => $customer_result]);\n }", "public function index()\n {\n $orders = Order::latest()->get();\n return view('admin.orders.index', compact('orders'));\n }", "public function adminOrderIndex()\n {\n $orders = Order::with(['products', 'user'])->whereNotNull('paid_datetime')->latest()->get()->all();\n return view('admin.orders.index', compact('orders'));\n }", "public function index()\n {\n $orders = DB::table('orders_products')\n ->leftJoin('products','products.id','=','orders_products.products_id')\n ->leftJoin('orders','orders.id','=','orders_products.orders_id')\n ->orderBy('orders.created_at','desc')->paginate(10);\n return view('admin.orders.index',compact('orders'));\n }", "public function index()\n {\n $orders = Order::all();\n $cnt = 0;\n\n return view('admin.orders.index', compact('orders', 'cnt'));\n }", "public function index()\n {\n $customer = customer::orderby('id', 'desc')->get();\n return View('customer.index',['customer'=>$customer]);\n }", "public function index()\n {\n $orders = Order::all();\n return view('backend.order.index', compact('orders'));\n }", "public function index()\n {\n $results = User::getQueriedResult();\n\n return view('admin.customers.list',compact('results'));\n }", "public function orders () {\n if(!Auth::user()->isAdmin){\n return redirect ('/');\n };\n\n $orders = Order::with('pizza', 'user')->get();\n\n return view ('pizzas.orders', ['orders' => $orders]);\n }", "public function index()\n\t{\n\n\t\t\n\t\t$orders = Order::all();\n\n\t\tdd($orders);\n\t}", "public function index()\n {\n $orders = Order::all();\n return view('Order.index', compact('orders'));\n }", "public function index()\n {\n $customer = Customer::orderBy('id', 'desc')->get();\n return view('admin.customer.index', ['customer' => $customer]);\n }", "public function orders()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the user's orders\n $buyorders = TradesModel::OpenOrders('buy');\n $sellorders = TradesModel::OpenOrders('sell');\n\n $this->View->RenderPage_sidebar('dashboard/orders', ['buyorders' => $buyorders, 'sellorders' => $sellorders]);\n }", "public function index()\n {\n //\n $orders = Order::orderBy('id','desc')->get();\n\n return view('admin.order.index',compact('orders'));\n }", "public function index()\n {\n $orders = Order::with('user','ear','eye','nose','mouth','tail','shoe','creator','updater')->paginate(25);\n\n return view('orders.index', compact('orders'));\n }", "public function show()\n {\n try {\n $orders = Order::with('product', 'user')\n ->where('deleted', 0)\n ->orderBy('order_id', 'desc')\n ->paginate($_ENV['PAGINATION']);\n //echo '<pre>'; print_r($orders); exit;\n\n return View::make('orders.show')\n ->with('orders', $orders);\n\n } catch (Exception $e) {\n Flash::message('Something went wrong ' . $e->getMessage());\n }\n }", "public function index()\n {\n View::share([\n 'title' => 'Order Management',\n 'sideBar' => NavigatorHelper::getSideBarBE()\n ]);\n $status = Status_orders::all(['name', 'id'])->toArray();\n\n return view('order.list')->with('status', $status);\n }", "function orders()\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 to view orders.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t// Get an array of all saved orders. \n\t\t\t// Using a flexi cart SQL function, set the order the order data so that dates are listed newest to oldest.\n\t\t\t$this->flexi_cart_admin->sql_where($this->flexi_cart_admin->db_column('order_summary', 'user'), $this->data['user']->id);\n\t\t\t$this->flexi_cart_admin->sql_order_by($this->flexi_cart_admin->db_column('order_summary', 'date'), 'desc');\n\t\t\t$this->data['order_data'] = $this->flexi_cart_admin->get_db_order_query()->result_array();\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/orders_view', $this->data);\n\t\t}", "public function index()\n {\n $arOrders = array();\n $orders = Order::all();\n $statuses = Status::all()->toArray();\n foreach($orders as $order) {\n $arOrders[] = array(\n 'user' => $order->user()->first()->toArray(),\n 'status' => $order->status()->first()->toArray(),\n 'products' => $order->products()->get()->toArray(),\n 'id' => $order->id\n );\n }\n\n return view('orders')->with(['orders'=> $arOrders, 'statuses' => $statuses]);\n }", "public function index()\n {\n $datos['orders'] = Order::query()\n ->addSelect([\n 'currency_name' => Currency::select('alpha_code')\n ->where([\n 'id' => function ($query) {\n $query->select([\n 'product_id' => Product::select('currency_id')\n ->whereColumn('orders.product_id', 'products.id')\n ->limit(1)\n ]);\n }\n ])\n ->limit(1),\n 'product_photo' => Product::select('photo')\n ->whereColumn('orders.product_id', 'products.id')\n ->limit(1),\n 'product_name' => Product::select('name')\n ->whereColumn('orders.product_id', 'products.id')\n ->limit(1),\n 'country_name' => Country::select('alpha_2_code')\n ->whereColumn('id', 'orders.country_id')\n ->limit(1),\n ])->paginate();\n return view('orders.index', $datos);\n }", "public function show(Customers $customers)\n {\n //\n }", "public function index()\n {\n $orders = Order::paginate(5);\n return view('admin.order.index')->with('orders',$orders);\n }", "public function index()\n {\n $data = Customer::orderBy('company_name', 'asc')->paginate(12);\n return view('admin.customers.index', compact('data'));\n }", "public function index()\n {\n $users = User::orderBy('id', 'desc')->paginate(30);\n return view('admin.customers.all_customer', ['customers' => $users]);\n }", "public function index()\n {\n $customers = Customer::orderBy('created_at', 'desc')->get();\n\n return view('customer.index', compact('customers'));\n }", "public function index()\n\t{\n\t\t//\n\t\t$store = Store::where('user_id', $GLOBALS['user']->id)->first();\n\t\t$orders = Order::where('store_id', $store->id)->orderBy('id', 'desc')->paginate(10);\n\t\treturn View::make('stores.admin.order_index', compact('store', 'orders'));\n\t}", "public function orders()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n $orderModel = new OrderModel();\n\n $orders = $orderModel->ordersByUserId(Session::get('userId'));\n\n $this->data['ordersInfo'] = $orders;\n\n if ($orders) {\n\n $productArrays = array();\n\n foreach ($orders as $order) {\n\n $productArrays[$order['id']] = json_decode($order['products'], true);\n }\n\n $this->data['idsAndAmountsByOrder'] = $productArrays;\n\n foreach ($productArrays as $product) {\n\n foreach ($product as $productId => $amount) {\n\n $productIdAndAmount[$productId] = $amount;\n }\n }\n\n $dataForIdsString = array_keys($productIdAndAmount);\n\n $idsString = implode(', ', $dataForIdsString);\n\n if ($idsString) {\n\n $productModel = new ProductModel();\n\n $productsInfo = $productModel->getProductsByIds($idsString);\n\n $this->data['productsInfo'] = $productsInfo;\n }\n\n }\n \n $this->render('orders');\n }", "public function index()\n {\n $produk = Product::all();\n $customer = Customer::all();\n return view('orders.index',compact('produk','customer'));\n }", "public function index()\n {\n $orders = Order::where('status',0)->get();\n return view('Backend.order_list',compact('orders'));\n }", "public function show(Orders $orders)\r\n {\r\n $orders = Orders::all();\r\n $products = Products::all();\r\n\r\n return view('user.transaction', compact('orders'), compact('products'));\r\n }", "public function index()\n {\n //获取所有订单数据\n $data = DB::table('order')->paginate(1);\n return view('admin.Order',compact('data'));\n }", "public function index()\n {\n $customers = Customer::all();\n\n return view('transaction.customer.index', compact('customers'));\n }", "public function index()\n {\n $orders = Order::with('totalitems')->get();\n $date = date('Y-m-d');\n return view('admin.orders.index',compact('orders','date'));\n }" ]
[ "0.79354054", "0.7854168", "0.7813215", "0.7768123", "0.76906127", "0.7668146", "0.7612337", "0.7547445", "0.75202197", "0.751998", "0.74361515", "0.7426985", "0.7426985", "0.7426985", "0.7393193", "0.7382605", "0.7379553", "0.73760307", "0.73525393", "0.73458564", "0.73404753", "0.7338803", "0.7331198", "0.73130995", "0.7296234", "0.7282284", "0.72772", "0.7276323", "0.7275183", "0.7273169", "0.7271308", "0.7264402", "0.7257087", "0.7252326", "0.7252326", "0.72490203", "0.72303295", "0.72148365", "0.7201475", "0.71963656", "0.71926606", "0.7188739", "0.71714795", "0.71480054", "0.71458066", "0.7145029", "0.7136347", "0.7133987", "0.71332145", "0.71330214", "0.71223485", "0.71200657", "0.7115485", "0.70979923", "0.7083814", "0.7082671", "0.7076181", "0.70678514", "0.7046381", "0.70418924", "0.70416856", "0.70404303", "0.7039105", "0.70368373", "0.7032084", "0.70270354", "0.7025218", "0.702262", "0.70198965", "0.7008486", "0.7007358", "0.7004591", "0.7002492", "0.7002106", "0.700152", "0.7001369", "0.70003396", "0.6999907", "0.6997275", "0.6969522", "0.69643813", "0.6961272", "0.69605803", "0.6958825", "0.69580704", "0.69552773", "0.6945544", "0.69443744", "0.6943577", "0.6939669", "0.69359565", "0.69214547", "0.6921454", "0.69194895", "0.69185483", "0.6910359", "0.69101924", "0.6907844", "0.6904532", "0.6900754", "0.68931526" ]
0.0
-1
Shows a single order detail.
public function actionOrderDetail($id) { $order = Order::find() ->where(['id' => $id, 'customer_id' => $this->customer_id]) ->andWhere(['<>', 'status_id', Order::STATUS_DRAFT]) ->one(); if ($order !== null) { return $order; } throw new NotFoundHttpException("Order transaction ({$id}) is not available."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Order $order)\n {\n\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n { \n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n }", "public function show(Order $order)\n {\n //\n\n }", "public function show(Order $order)\n {\n \n return view('Backend.order_detail',compact('order'));\n }", "public function show(Order $order)\n {\n $items = $order->items;\n return view('backend.order.detail', compact('items', 'order'));\n }", "public function show(order $order)\n {\n //\n }", "public function show(Order $order)\n {\n $this->authorize('view',$order);\n return $this->helper->get($order->id);\n }", "public function show() //(Order $order)\n {\n $data = Orders::all();\n return view('seller/viewOrders', ['orders'=>$data]);\n \n }", "public function show($orderId)\n {\n //\n\t\t\n\t\t//$orderDetails = OrderDetail::where('order_id' , $orderId)->get();\n\t\t//return view('order.order-detail' , compact('orderDetails'));\n }", "public function show(Order $order)\n {\n\n $data['order']=$order;\n return view('backend.orders.show')->with($data);\n\n\n }", "public function orderDetail($order_id){\n $data = $this->order->getOrderById($order_id);\n return view('dashboard.order-detail', ['data' => $data, 'list_status' => $this->order->list_status]);\n }", "public function show($id)\n {\n $order = Order::find($id);\n $order_detail = Order_detail::where('order_id',$id)->get();\n return view('backend.order.detail',compact('order','order_detail')); \n }", "public function show(Order $order)\n {\n $items = Item::all();\n // $order = $order->load('user');\n return view('orders/show', compact('order', 'items'));\n }", "public function show($id)\n {\n //\n // // dd($id);\n // $data = ORDERDETAIL::find($id);\n\n // dd($data);\n // $data = ORDERDETAIL::find($id);\n $data = DB::table('orderdetail')->where('oid',$id)->first();\n\n return view('admin.Orderdetail',compact('data'));\n }", "public function show(TxShopDomainModelOrderItem $order)\n {\n //\n }", "public function show(Order $order)\n {\n $order->load('orderItems')->orderBy('supplier_sequence');\n return view('order.show', compact('order'));\n }", "public function show($id)\n {\n $order_details = Order_detail::find($id);\n return view('admin.order.detail', compact('order_details'));\n }", "public function show(Order $order)\n {\n return view('orders.show',compact('order'));\n }", "public function show($id)\n {\n $order = Order::find($id);\n return view('order.show')->with('order', $order);\n }", "public function show(Order $order)\n {\n $order = Order::find($order);\n return view('Order.show', compact('order'));\n }", "public function show(Order $order)\n {\n return view('inventory.orders.show', compact('order'));\n }", "public function show($id)\n {\n $order=Order::find($id);\n // return $order;\n return view('backend.order.show')->with('order',$order);\n }", "public function show(Order $orders)\n {\n //\n }", "public function show(Order $order)\n {\n return view('orders.show', compact('order'));\n }", "public function show(Order $order)\n {\n return view('orders.show', compact('order'));\n }", "public function show(Order $order)\n {\n return $order;\n }", "public function show($id)\n {\n //\n $this->AuthLoginCheck();\n $order = Order::find($id);\n $orders = Customer::find($order->customer_id)->order_one->toArray();\n $order_detail = Order::find($id)->order_detail->toArray();\n $customer = Customer::where('id',$order->id)->first();\n $shipping = Shipping::find($order->shipping_id);\n // echo '<pre>';\n // var_dump($customer);\n // echo '</pre>';\n \n return view('admin.manage.order_detail',compact('orders','order_detail','customer','shipping'));\n }", "public function show($id)\n {\n return view('orders.show')->with([\n 'order' => Order::findOrFail($id) \n ]);\n }", "public function order_show()\n {\n //\n $orders = Order::all();\n \n return view('productions.order_show',['orders' => $orders,]);\n }", "public function show(Order $order)\n\t{\n $order->load('products', 'products.images');\n\t\treturn view('orders.show', compact('order'));\n\t}", "public function show(Order $order)\n {\n return $order->getData();\n }", "public function show(Order $order)\n {\n $orderItems = OrderItem::getOrderItems($order->id);\n return view('bakery.order.show', ['order' => $order, 'orderItems' => $orderItems]);\n }", "public function show($id)\n {\n //$order=Order::find($id);\n $order=Order::getAllOrder($id);\n //return $order;\n return view('backend.order.show')->with('order',$order);\n }", "public function show(Order $order)\n {\n return api_response(200, 'success', new OrderResource($order));\n }", "public function show(Order $order)\n {\n return view('vendor.voyager.order.show', compact('order'));\n }", "public function actionDetail($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\t$detail = new OrderDetail('search');\n\t\t$detail->orId = $id;\n\t\t$this->render('detail',array(\n\t\t\t'model'=>$model,'detail'=>$detail\n\t\t));\n\t}", "public function show(Order $order)\n {\n return view('frontend.order.show', compact('order'));\n }", "public function show($id)\n {\n $order = $this->orderRepository->find($id);\n\n if (empty($order)) {\n Flash::error(__('models/orders.singular') . ' ' . __('messages.not_found'));\n\n return redirect(route('orders.index'));\n }\n\n return view('orders.show')->with('order', $order);\n }", "public function show(Order $order)\n {\n $order->load(['host','user', 'promocodes','items.product.images', 'disputes']);\n return $this->respond($order);\n }", "public function show(Order $order)\n {\n return view('admin.orders.show', compact('order'));\n }", "public function show($id)\n\t{\n $order = \\Order::find($id);\n $statuses = \\OrderStatus::all();\n\t return \\View::make('admin.orders.show', array(\n 'order' => $order,\n 'statuses' => $statuses,\n ));\n\t}", "public function show(ProductOrder $productOrder)\n {\n //\n }", "public function show($order_id)\n {\n //\n $obj = DB::table('orders')\n ->select('orders.id', 'registers.name as register','first_name', 'last_name', 'customer_type', \n 'delivery_address', 'balance', 'orders.total', 'discount', 'orders.sales_tax', 'orders.shipping',\n 'orders.status', 'orders.fulfillment', 'orders.created_at')\n ->join('transactions', 'orders.id', '=', 'transactions.order_id')\n ->join('registers', 'transactions.register_id', '=', 'registers.id')\n ->join('profile_patients', 'profile_patients.user_id', '=', 'orders.user_id')\n ->where('orders.id', $order_id)\n ->get();\n\n $order['order'] = $obj[0];\n $order['items'] = DB::table('order_items')\n ->select('qty', 'name', 'tax')\n ->join('products', 'products.id', '=', 'order_items.product_id')\n ->where('order_items.order_id', $order_id)\n ->get();\n return $order;\n }", "public function show($id)\n\t{\n\t\t$order = Order::findOrFail($id);\n\n\t\treturn View::make('admin.orders.show', compact('order'));\n\t}", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show(Orders $orders)\n {\n //\n }", "public function show($id)\n {\n $order = Orders::findOrFail($id);\n return view('backend.orders.show', compact('order'));\n }", "public function orderDetails($id)\n {\n //dd($id);\n $orderId = $id;\n $getProducts = Products::get(); //sidebar\n $getLineItemInfo = OrderLineItem::where('order_id', $id)->get(); //sidebar\n $getCustomerInfo = OrderCustomerDetails::where('order_id', $id)->get(); //sidebar\n return view('shopify-app::tool.order-detail',compact('getProducts','getLineItemInfo','getCustomerInfo', 'orderId'));\n }", "public function show($id)\n {\n $details = OrderDetails::with('products')->where('order_id', $id)->get();\n return view('backend.orders.details', compact('details'));\n }", "public function show($id)\n {\n $order = Order::where('id', $id)->first();\n $orderitem = OrderItem::where('order_id', $id)->first();\n $product = Product::where('id', $orderitem->product_id)->first();\n\n return view(\"admin.detail_order\")->with('product', $product)->with('order', $order)->with('orderitem', $orderitem);\n }", "public function show($id)\n {\n $order = Order::find($id);\n\n return view('admin.orders.show', ['order' => $order]);\n }", "public function show($id)\n {\n $order_detail = DB::table('tpl_order')\n ->select(\n 'tpl_order.order_id',\n 'tpl_order.created_at',\n 'tpl_order.updated_at',\n 'tpl_order.status',\n 'tpl_order.note',\n 'users.id',\n 'users.lastName',\n 'users.firstName',\n 'users.username',\n 'users.phone',\n 'users.address',\n 'users.email',\n )\n ->join('users', 'users.id', '=', 'tpl_order.user_id')\n ->where('tpl_order.order_id', $id)->first();\n\n $order = DB::table('tpl_order')\n ->join('tpl_order_dt', 'tpl_order.order_id', '=', 'tpl_order_dt.order_id')\n ->join('tpl_product', 'tpl_order_dt.product_id', '=', 'tpl_product.product_id')\n ->where('tpl_order.order_id', $id)->get();\n\n\n return view('pages.server.order.show')\n ->with('order_detail', $order_detail)\n ->with('order', $order);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CoreShopBundle:Order')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Order entity.');\n }\n\n return $this->render('CoreShopBundle:Order:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function show($id)\n {\n $orderProducts = OrderProduct::where('order_id',$id)->get();\n $order = Order::findOrFail($id);\n \n return view('admin.orders.show',compact('order','orderProducts'));\n }", "public function details($id) {\n\n $order = Order::find($id);\n $delivery_status_id = (isset($order->delivery_status_id)) ? (int)$order->delivery_status_id : '';\n $delivery = $this->delivery_status($delivery_status_id);\n \n \\ViewHelper::setPageDetails('Storefronts | Order View', 'Order #' . $order->invoice_number, '');\n\n View::share('delivery_status', $delivery);\n View::share('order', $order);\n\n $delivery_modal_info = $this->delivery_status_modal_info($delivery_status_id);\n\n View::share('modals_info', $delivery_modal_info['info']);\n View::share('modals_btn', $delivery_modal_info['btn']);\n\n \treturn view('backoffice.orders.details');\n \n }", "public function show(orders $orders)\n {\n //\n }", "public function show($order_no)\n {\n $order = Order::where('order_no', $order_no)->first();\n return view('admin.orders.show', compact('order'));\n }", "public function show(Order $order)\n {\n return view('user.orders.show', compact('order'));\n }", "public function orderDetail()\n\t{\n\t\t//\tSi el carro esta vacio lleva al home.\n\t\tif(count(\\Session::get('cart')) <= 0) return redirect()->route('home');\n\t\t//\tObteniendo datos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tCalculando total.\n\t\t$total = $this->total();\n\n\t\treturn view('home.order-detail',compact('cart','total'));\n\t}", "public function show($id)\r\n {\r\n $userInfo = $this->UserRepository->getUserInfoByUserId(Auth::user()->id);\r\n $nameOfPage = 'View Order';\r\n $order = $this->OrdersRepository->getOrderByOrderId($id);\r\n $products = $this->convertProductsForOrderPage($order->products, $order->attributes_values);\r\n $statuses = $this->OrdersStatusesRepository->getStatuses();\r\n\r\n return view('admin.order.view', compact(self::viewShareVarsAdminPanelOrder));\r\n }", "public function show($id)\n {\n //\n $order = Order::where('id', $id)->firstOrFail();\n return view('admin.viewItem.viewOrder')->with([\n 'order' => Order::find($id),\n 'products' => Product::all()\n \n ]);\n }", "public function show(Order $order)\n {\n return $order->load([\n 'orderDetail',\n 'orderProgress',\n 'user',\n 'sarana',\n 'jenisSarana',\n 'dipo',\n 'jenisPekerjaan'\n ]);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function show($id)\n {\n return Order::find($id);\n }", "public function show(Order $order)\n {\n $ordersArray = json_decode($order->products, true);\n $ids = array_keys($ordersArray);\n $status = $this->status;\n\n $products = Product::whereIn('id', $ids)->get();\n return view('admin.orders.show', compact('order', 'products', 'ordersArray', 'status'));\n }", "public function show(StatusOrder $statusOrder)\n {\n //\n }", "public function show(CustomerOrder $customerOrder)\n {\n //\n }", "public function show(CustomerOrder $customerOrder)\n {\n //\n }", "public function show($id)\n {\n $order = Order::with('user', 'details', 'address')->findOrFail($id);\n\n return view('admin.order.show', compact('order'));\n }", "public function show(Order $order)\n {\n return [\n 'status'=>1,\n 'data'=>new OrderResource($order)\n ];\n }", "public function viewAction()\n {\n $this->loadLayout();\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('oggetto_oneclick/order')->load($id);\n Mage::register('order', $model);\n $this->renderLayout();\n }", "public function show($id)\n {\n $dataOrder = Orders::find($id);\n\n return view('admin.orders.show', compact('dataOrder'));\n }", "public function show($id)\n {\n $order = Order::find($id);\n $tab =1;\n return view('admin/orders/show',compact('order','tab'));\n }", "public function show(Order $order)\n {\n $settings = Setting::where('title','currency')\n ->get()\n ->pluck('value', 'title');\n $products = json_decode($order->products_json, true);\n return view('admin.orders.show', compact('order', 'products', 'settings'));\n }", "public function show(Order $order, Calification $calification)\n {\n //\n }", "public function show(Order $order)\n {\n $cart = cartGet();\n //if (count($cart)) {\n $pids = array_keys($cart);\n $products = \\App\\Models\\Product::whereIn('id', $pids)->get();\n\n $minPrice = \\App\\Models\\ProductPrice::where('qty', 1)->min('price');\n meta(\"cart\")\n ->with(['%min_price%' => $minPrice]);\n breadcrumbs()\n ->root()\n ->to(\"Корзина\");\n\n return view('pages.cart.index', [\n 'cart' => $cart,\n 'products' => $products,\n 'title' => 'Оформление заказа',\n 'view' => 'order-cart',\n ]);\n /* } else {\n return redirect('/');\n } */\n }", "public function show($order_id)\n {\n $order = $this->orderRepository->findById($order_id);\n\n return response()->json(['data' => $order,'status' => 'success']);\n }", "public function show($id)\n {\n $order = Order::where('id', decrypt($id))->with([\"get_customer\", \"get_payment\"])->first();\n if (!$order) {\n return abort(404);\n }\n if (Auth::user()->type !== \"Admin\") {\n return abort(404);\n }\n return view(\"backendViews.orders.show\", compact('order'));\n }", "public function order_details($id){\n $user = Auth::id(); \n $order = Order::where(['slug' => $id,'user_id' => $user])->first();\n if($order){\n return view('order-details', compact('order'));\n }\n return view('errors.404');\n }", "public function edit(Order $order)\n {\n // return view('backend.order.detail');\n }", "public function show()\n {\n try {\n $orders = Order::with('product', 'user')\n ->where('deleted', 0)\n ->orderBy('order_id', 'desc')\n ->paginate($_ENV['PAGINATION']);\n //echo '<pre>'; print_r($orders); exit;\n\n return View::make('orders.show')\n ->with('orders', $orders);\n\n } catch (Exception $e) {\n Flash::message('Something went wrong ' . $e->getMessage());\n }\n }", "public function show($id)\n {\n try {\n $order = Order::findOrFail($id);\n // $/ = OrderProduct::where('order_id', $id)->get();\n $products = OrderProduct::select(\n \"order_products.id\",\n \"order_products.qty\",\n \"order_products.sub_total\",\n \"products.id\",\n \"products.product_name\",\n \"products.price\"\n )\n ->leftJoin(\"products\", \"products.id\", \"=\", \"order_products.product_id\")\n ->where('order_id', $id)\n ->get();\n\n return view('orders.show', compact('order', 'products'));\n } catch (\\Exception $e) {\n Session::flash('errors', $e->getMessage());\n return redirect()->back();\n }\n }", "public function show($id)\n {\n $order = $this->orderRepository->findWithoutFail($id);\n\n if (empty($order)) {\n Flash::error('Order not found');\n\n return redirect(route('orders.index'));\n }\n\n return view('admin.orders.show')->with('order', $order);\n }", "public function show($id)\n {\n $order = $this->orderRepository->findWithoutFail($id);\n\n if (empty($order)) {\n Flash::error('Order not found');\n\n return redirect(route('admin.products.orders.index'));\n }\n\n return view('admin.products.orders.show')->with('order', $order);\n }" ]
[ "0.82385075", "0.82269365", "0.82023346", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8202282", "0.8194006", "0.80146754", "0.7978374", "0.7950958", "0.79223865", "0.78929234", "0.78814596", "0.78188974", "0.7800642", "0.7745656", "0.7670126", "0.76496094", "0.7635832", "0.7626881", "0.7613044", "0.76016", "0.76002055", "0.75621814", "0.7556964", "0.75537527", "0.7551971", "0.75300854", "0.75300854", "0.75111866", "0.75022185", "0.7499401", "0.74984646", "0.7472604", "0.7471631", "0.7456587", "0.7455793", "0.7450787", "0.7445651", "0.74427235", "0.7426114", "0.7421247", "0.7410195", "0.7404233", "0.73998034", "0.73988366", "0.7393431", "0.7388506", "0.73712885", "0.73712885", "0.73712885", "0.7368111", "0.7364784", "0.7363654", "0.7351876", "0.73474854", "0.7345828", "0.7344625", "0.73264253", "0.73236006", "0.73200995", "0.7307164", "0.73030525", "0.72969127", "0.729587", "0.7291928", "0.7287002", "0.7286563", "0.7286563", "0.7283495", "0.7278993", "0.72669315", "0.72669315", "0.72554696", "0.72508943", "0.72451776", "0.72393847", "0.7200731", "0.7187774", "0.7185372", "0.71737313", "0.716501", "0.7145061", "0.71442074", "0.7143861", "0.7141347", "0.7136683", "0.71262777", "0.71243155" ]
0.0
-1
Returns update message to user
public function update($id = null,$payment = null, $amount = null) { $trasactionId = $this->_request->getParam('id'); $transUrl = $this->config->getPaymentConfigData('gateway_url') . '/' . $this->config->getPaymentConfigData('transaction') . '/' . $trasactionId; $responseGetTrans = $this->serviceConfig->getCurlDataTags($transUrl); $status = $responseGetTrans->status; switch ($status) { case 'SETTLEMENT_REQUESTED': $paymentStatus = 'capture'; break; case 'AUTHORIZED': $paymentStatus = 'authorization'; break; case 'AUTHORIZATION_VOIDED': $paymentStatus = 'void'; break; case 'SETTLEMENT_CANCELLED': $paymentStatus = 'void'; break; } $collection = $this->settlements->getCollection()->addFieldToFilter('transaction_id',$trasactionId); foreach($collection as $data){ $reportId = $data->getReportId(); $settlementData = $this->settlements->load($reportId); $settlementData->setSettlementStatus($status); $settlementData->save(); } $orderCollection = $this->order->getCollection()->addFieldToFilter('txn_id',$trasactionId); foreach($orderCollection as $orderData){ $transId = $orderData->getTransactionId(); $this->order->load($transId)->setTxnType($paymentStatus)->save(); if($paymentStatus == 'capture'){ $orderId = $orderData->getOrderId(); $order = $this->_orderRepository->get($orderId); if($order->canInvoice()) { $invoice = $this->_invoiceService->prepareInvoice($order); $invoice->register(); $invoice->save(); $transactionSave = $this->_transaction->addObject( $invoice )->addObject( $invoice->getOrder() ); $transactionSave->save(); } } return $responseGetTrans->status; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated_message() {\n\t\t$tab = Template::current_tab();\n\n\t\t// Show updated notice.\n\t\tadd_action( 'beehive_admin_top_notices', function () use ( $tab ) {\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'tracking':\n\t\t\t\t\t$this->notice( __( 'Tracking ID updated successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->notice( __( 'Changes were saved successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} );\n\t}", "function updateUser()\n{\n return 'Updating user';\n}", "public function get_message() {\t\t\t\t\t## displaying database message function starts\n\t\t\tif ( isset( $this->_update ) && $this->_update == '1' ) {\n\t\t\t\t$this->_msg = 'Settings Updated Successfully ...';\n\t\t\t} else if ( $this->_update == '0' ) {\n\t\t\t\t$this->_msg = 'Settings Not Updated Successfully ...';\n\t\t\t}\n\t\t\treturn $this->_msg;\n\t\t}", "function wp_get_auto_update_message()\n {\n }", "private function send_user_update_mail( $data ) {\n\t\t$this->email->to( 'secretaris@hydrofiel.nl' );\n\t\t$this->email->from( 'no-reply@hydrofiel.nl', 'Ledennotificatie' );\n\t\t$this->email->subject( \"Lid bewerkt\" );\n\t\t$this->email->message( $this->load->view( 'mail/update', $data, TRUE ) );\n\n\t\treturn $this->email->send();\n\t}", "function jmw_buddypress_profile_update( $user_id, $posted_field_ids, $errors, $old_values, $new_values ) {\n\t\n\tif( current_user_can( 'manage_options' ) ) {\n\t\t// If administrator is making the changes don't email\n\t\treturn;\n\t}\n\n $message_subject = sprintf( '%s: Profile moderation required for %s',\n \tesc_html( get_bloginfo( 'name' ) ),\n \tesc_html( bp_core_get_user_displayname( $user_id ) )\n );\n\n $message = sprintf( 'Member %s has updated their profile. See %s',\n \tesc_html( bp_core_get_user_displayname( $user_id ) ),\n \tesc_url( bp_loggedin_user_domain() )\n );\n\n wp_mail( get_bloginfo( 'admin_email' ), $message_subject, $message );\n }", "function update_right_now_message()\n {\n }", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "function messageUpdate(Message $new, ?Message $old);", "protected function getUserInputForUpdate() {}", "public static function updatedSuccess(string $message = null): string\n {\n if ($message) {\n return __($message);\n }\n return __('Record updated successfully!');\n }", "public function getMemberUpdate() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n $Membership_number = filter_input(INPUT_POST, \"Membership_number\");\n\n // Get the member by the membership number\n $member = $memberModel->getOneByMemberNumber($Membership_number);\n\n $data = array(\"member\" => $member);\n return $this->render(\"updateMember\", $data);\n }", "private function _sendNewStatusUpdateEmailToUser()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n\t\t\t$user = \\JFactory::getUser();\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$body = \"Thank you for submitting a new status update for project named: \\\"\" . $project['0'] . \"\\\". It has been added to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }", "public function getOneMemberUpdate() {\n\n // Get the member by the membership number\n $this->getMemberInfo();\n return $this->render(\"updateInformation\");\n }", "public function updateMessage(){\n\t\tuser_login_required();\n\n\t\t$messageID = postInt(\"messageID\");\n\t\t$newContent = postString(\"content\");\n\n\t\tif(!check_string_before_insert($newContent))\n\t\t\tRest_fatal_error(401, \"Invalid new message content!\");\n\n\t\t//Check whether the user own or not conversation message\n\t\tif(!components()->conversations->isOwnerMessage(userID, $messageID))\n\t\t\tRest_fatal_error(401, \"You do not own this conversation message!\");\n\t\t\n\t\t//Update the message\n\t\t$message = new ConversationMessage();\n\t\t$message->set_id($messageID);\n\t\t$message->set_message($newContent);\n\t\tif(!components()->conversations->updateMessage($message))\n\t\t\tRest_fatal_error(500, \"Could not update the content of the message!\");\n\t\t\n\t\treturn array(\"success\" => \"The conversation message has been successfully updated!\");\n\t}", "public function update(Request $request, Message $message) {\n //\n }", "function edit($message = '') {\n\t$add_certificates = open_table_form('Edit Admin User','edit_admin_user',SITE_ADMIN_SSL_URL.'?sect=admin_users&mode=edit_user_check&uid='.$_GET['uid'],'post',$message);\n\t$add_certificates .= $this->form();\n\t$add_certificates .= close_table_form();\n return $add_certificates;\n }", "public function actionMessage($id)\n\t{\n\t\t$model = $this->findModel($id);\n\t\t$model->scenario = UserLevel::SCENARIO_MESSAGE;\n\t\t\n if (Yii::$app->request->isPost) {\n $model->load(Yii::$app->request->post());\n // $postData = Yii::$app->request->post();\n // $model->load($postData);\n // $model->order = $postData['order'] ? $postData['order'] : 0;\n\n if ($model->save()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'User level success updated.'));\n return $this->redirect(['message', 'id' => $model->level_id]);\n\t\t\t}\n\t\t}\n\t\n\t\t$this->view->title = Yii::t('app', 'Update User Level: {name}', ['name' => $model->title->message]);\n\t\t$this->view->description = Yii::t('app', 'Facilitating user interactivity is the key to developing a successful social network. Allowing private messages between users is an excellent way to increase interactivity. From this page, you can enable the private messaging feature and configure its settings.');\n\t\t$this->view->keywords = '';\n\t\treturn $this->render('admin_message', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "protected function doUpdate() {\n return '';\n }", "function updateUser()\r\n {\r\n return $this->UD->user_update($_GET['uid']);\r\n }", "private function Update() {\n $Update = new Update;\n $Update->ExeUpdate(self::Entity, $this->Data, \"WHERE id = :id\", \"id={$this->Post}\");\n if ($Update->getResult()):\n $this->Error = [\"As informações de <b>contato</b> foram atualizadas com sucesso!\", WS_ACCEPT];\n $this->Result = true;\n endif;\n }", "public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }", "function post_updated_messages($messages)\n {\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function update(Request $request, Message $message)\n {\n //\n }", "public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}", "public function update($id) {\n\t\t$subject = Input::get('message.subject');\n\t\t$text = Input::get('message.text');\n\t\t$has_been_seen = Input::get('message.has_been_seen');\n\n\t\t// test the DB-Connection\n\t\ttry {\n\t $pdo = DB::connection('mysql')->getPdo();\n\t }\n\t catch(PDOException $exception) {\n\t return Response::make('Database error! ' . $exception->getCode() . ' - ' . $exception->getMessage());\n\t }\n\n\t // check if message already exists\n\t $message = DB::table('messages')->where('id', $id)->first();\n\n\t $date = new \\DateTime;\n\n\t \t// update message - because it already exists\n\t \tif($message) {\n\t \t\t$id = $message->id;\n\n\t \t\tDB::table('messages')\n ->where('id', $id)\n ->update(\n \tarray(\n \t\t\t'subject' => $subject,\n \t\t\t'text' => $text,\n \t\t\t'has_been_seen' => $has_been_seen,\n \t\t\t'updated_at' => $date\n \t\t)\n \t);\n\t \t}\n\n\t $message = Message::findOrFail($id);\n\n\t return '{ \"message\":'.$message.' }';\n\t}", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function patch(User $user, \\Swift_Message $message);", "public function pendingAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERUPDATE);\n \t$user = $this->_user;\n if($user->{User::COLUMN_STATUS} == User::STATUS_MEMBER ){\n // Redirect to update if is a member already\n $this->_helper->redirectToRoute('userupdate');\n }\n\n $form = new User_Form_Update($user, true);\n\n // Populate form with data from DB in case user comes back to this page\n $form->populateFromDatabaseData($user->toArray());\n\n $data = $this->_request->getPost();\n if(!$data){\n // Display default data form\n $this->view->form = $form;\n return;\n }\n\n if (!$form->isValid($data)) {\n // Display form with errors\n $this->view->form = $form;\n return;\n }\n\n if(!$this->_updateUser($user, $form->getFormattedValuesForDatabase(), false)){\n // Update failed\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::UPDATE_FAILED));\n }\n\n // Update succeeded, redirect to next page\n $this->_helper->redirectToRoute('userwaitforconfirmation');\n }", "function editEmailHandler1() {\n global $inputs;\n\n updateDb('mail', [\n 'title' => $inputs['title'],\n 'sender_id' => $inputs['sender_id'],\n 'sender' => $inputs['sender_name'],\n 'receiver_id' => $inputs['receiver_id'],\n 'receiver' => $inputs['receiver_name'],\n 'content' => $inputs['content'], \n ], [\n 'id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "public function update($controller, $message,$level) ;", "function updateNotification(){\n $id= $_GET['id'];\n $userid = $_SESSION[ADMIN_USER_SESS_KEY]['userId'];\n $where = array('referenceId'=>$id,'notificationFor'=>$userid);\n $data = array('isRead'=>1); \n $update = $this->common_model->updateFields(NOTIFICATIONS, $data, $where);\n if($update){\n echo json_encode(array('status'=>1));die(); \n }\n }", "function edit_message() {\n\tglobal $core, $document, $user, $boards, $threads, $posts, $db;\n\n\tif (!isset($_POST['thread_id']) || !isset($_POST['board_id']) || !isset($_POST['post_id']) || !isset($_POST['post_name']) || !isset($_POST['post_message'])) {\n\t\tfatal_error(\"Some or all of the information needed to post a new message are missing. Please try again\");\n\t}\n\n\t//Make fields safe\n\t$postid = make_safe(\"int\",$_POST['post_id']);\n\t$boardid = make_safe(\"int\",$_POST['board_id']);\n\t$threadid = make_safe(\"int\",$_POST['thread_id']);\n\t$postname = make_safe(\"text\",$_POST['post_name']);\n\t$postmessage = make_safe(\"text\",$_POST['post_message']);\n\n\t//Sanity check fields\n\tif (strlen($postname) < 2 || strlen($postmessage) < 10) { \n\t\tfatal_error(\"Your message title or message text is too short. Please try again\");\n\t}\n\tif (!$posts->get_post($postid)) {\n\t\tfatal_error(\"Invalid post specified. Please try again\");\n\t}\n\tif (!$boards->get_board($boardid)) {\n\t\tfatal_error(\"Invalid board specified. Please try again\");\n\t} \n\tif (!$threads->get_thread($threadid)) {\n\t\tfatal_error(\"Invalid thread specified. Please try again\");\n\t}\n\n\t//Now post the message\n\t$posts->edit_post($postid,$postname,$postmessage);\n\n\t//Now go back to the forum\n\t$core->do_redirect(\"showthread.php?t=$threadid\");\t\t\n}", "public function update(?Message $message): ?Message;", "public function update(Request $request, Message $message)\n {\n Message::find(1)->update($request->all());\n return redirect(route('home'))->with('success', \"Chairman's message successfully updated.\");\n }", "public function admin_update_user($table_name, $data, $id)\n \t{\n\t\t$this->db->where('u_id',$id);\n\t\t$this->db->update($table_name,$data);\n\n\t\t$this->db->select('*')\n\t\t ->from($table_name)\n\t\t ->where('u_id', $id);\n\t\t$query = $this->db->get();\n\t $rslt=$query ->result_array();\n\t\t\n\t\t// $email = $rslt[0]['email'];\n\t\t // $username = $rslt[0]['u_firstname'].\" \" .$rslt[0]['u_lastname'];\n\t\t // $username = $rslt[0]['u_firstname'].\" \" .$rslt[0]['u_lastname'];\n\t\t//$msg = 'Updated';\n\t\t\n\t\t//$result_email = $this->send_email($email, $msg, '', $username);\n\t\t//return $result_email;\n \t}", "public function getUpdateNotification(){\n\t\t//render the view\n\t\treturn $this->renderView('update-notification-partial');\n\t}", "public function updateAction() : object\n {\n if (isset($_SESSION['username'])) {\n $form = new UpdateForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/update\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Update an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function getAskUpdateUser($id){\n return $this->rootUrl().'updateUser';\n }", "function Admin_Messages_admin_update($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($mid,\n\t $objectid,\n $title,\n $content,\n $language,\n $active,\n $expire,\n $oldtime,\n $changestartday,\n $whocanview) = pnVarCleanFromInput('mid',\n\t\t 'objectid',\n 'title',\n 'content',\n 'language',\n 'active',\n 'expire',\n 'oldtime',\n 'changestartday',\n 'whocanview');\n\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n \n // At this stage we check to see if we have been passed $objectid, the\n // generic item identifier. This could have been passed in by a hook or\n // through some other function calling this as part of a larger module, but\n // if it exists it overrides $mid\n //\n // Note that this module couuld just use $objectid everywhere to avoid all\n // of this munging of variables, but then the resultant code is less\n // descriptive, especially where multiple objects are being used. The\n // decision of which of these ways to go is up to the module developer\n if (!empty($objectid)) {\n $mid = $objectid;\n } \n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // Notable by its absence there is no security check here. This is because\n // the security check is carried out within the API function and as such we\n // do not duplicate the work here\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array.\n //\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if(pnModAPIFunc('Admin_Messages',\n 'admin',\n 'update',\n array('mid' => $mid,\n 'title' => $title,\n 'content' => $content,\n 'language' => $language,\n 'active' => $active,\n 'expire' => $expire,\n 'oldtime' => $oldtime,\n 'changestartday' => $changestartday,\n 'whocanview' => $whocanview))) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESUPDATED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n\n // Return\n return true;\n}", "public function actionRequest() {\n $post = Yii::$app->request->post();\n if (isset($post['postid']) && $post['reasonmodification'] != '') {\n $sharePageStatus = PostAd::STATUS_WARNING;\n $updateStatus = PostAd::findOne($post['postid']);\n $updateStatus->status = $sharePageStatus;\n if ($updateStatus->save()) {\n $userDetail = UserProfile::getUserDetail($updateStatus['user_id']);\n $FullMessage = $this->Message($post['warn_reason'], $post['warn_reason_next'], $post['reasonmodification']);\n //$subject = 'Admin Warn ' . $userDetail['firstname'] . ' about ' . $updateStatus['title'];\n $warning=new AdsWarning();\n $warning->ad_id=$updateStatus['id'];\n $warning->message=$FullMessage;\n $warning->save();\n }\n return $this->redirect(Yii::$app->request->referrer);\n }\n }", "public function update($id)\n\t{\n\t\tif (!$this->validate(true)) {\n\t\t\treturn $this->getRedirect()\n\t\t\t->withErrors($this->validator)\n\t\t\t->withInput();\n\t\t} else {\n\t\t\t// store\n\t\t\t$message = Message::find($id);\n\t\t\t$message->name = \\Input::get('name');\n\t\t\t$message->project_id = \\Input::get('project_id');\n\t\t\t$message->user_id = \\Input::get('user_id');\n\t\t\t$message->save();\n\n\t\t\t// redirect\n\t\t\t\\Flash::push('success', 'Successfully updated message!');\n\t\t\treturn $this->getRedirect();\n\t\t}\n\t}", "public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }", "public function updateMessage( $id, $request )\n\t{\n\t\t$record = Message::find( $id );\n\t\t$record->message = $request->message;\n\t\t$record->save();\n\t}", "public function testUpdateUser()\n {\n }", "protected function setSuccessfulEditMessage()\n\t{\n\t\t$message = str_replace( array(\"%succeed%\", \"%total%\"), array( \"<strong>\".$this->nUpdated.\"</strong>\", \"<strong>\".$this->nSelected.\"</strong>\" ), \"%succeed% out of %total% records updated successfully.\");\n\t\t$this->setMessage( $message );\n\t\t\n\t\tif( $this->nUpdated != $this->nSelected ) {\n\t\t\t$message = str_replace( \"%failed%\", \"<strong>\".($this->nSelected - $this->nUpdated).\"</strong>\" , \"%failed% records failed.\");\n\t\t\t$this->setMessage( $message );\n\t\t}\n\t}", "public function updateAction()\n {\n // _POST values.\n $request = $this->container->get(\"request\");\n\n // Get the restaurant service.\n $emailTemplatesService = $this->container->get('dft_foapi.email_templates');\n\n // Update settings.\n $emailTemplatesService->updateEmailTemplates(\n $this->container->get('dft_foapi.login')->getAuthenticatedUserId(),\n $request->get('order_accepted_email_subject'),\n $request->get('order_accepted_email_content'),\n $request->get('order_rejected_email_subject'),\n $request->get('order_rejected_email_content')\n );\n\n return $this->render('dftFoapiBundle:Common:success.json.twig');\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }", "public function update_info()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->update_info($this->mUser->id, $this->input->post());\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully updated account info.');\n\t\t\t$this->mUser->full_name = $this->input->post('full_name');\n\t\t\t$this->session->set_userdata('admin_user', $this->mUser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to update info.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function account_update_info()\n\t{\n\t\t$data = $this->input->post();\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "static function updateUser() : string\n {\n return \"UPDATE users\n SET nickname = :nickname, password = :password, type = :type, mail = :mail\n WHERE id = :id;\";\n }", "public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "function message_update($data,$id)\n\t{\n\t$this->db->where('message_id', $id);\n\t$this->db->update('message', $data);\n\t}", "public function userupdatesuccessAction()\n {\n }", "function getUpdateCommand()\r\n\t{\r\n\t\t\t//\t\t\t\t->update( )\r\n\t}", "public function update(){\n\t\t\t$matk = $_POST['matk'];\n\t\t\t$tentk = $_POST['tentk'];\n\t\t\t$pass = $_POST['pass'];\n\t\t\t$fullname = $_POST['fullname'];\n\n\t\t\t$post = array(\n\t\t\t\t'matk' => $matk,\n\t\t\t\t'tentk' => $tentk,\n\t\t\t\t'pass' => $pass,\n\t\t\t\t'fullname' => $fullname,\n\t\t\t);\n\n\t\t\trequire_once('model/model.php');\n\t\t\t$Model = new Model();\n\t\t\t$update = $Model -> updateData($post);\n\n\t\t\trequire_once('view/View.php');\n\t\t\t$View = new View();\n\t\t\t$View ->alertupdate($update);\n\t\t}", "public function updateAccount()\n\t{\n\t\tif (in_array('newsletter', $this->Config->getActiveModules()))\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('newsletter;', 'newsletter,newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('assignDir;', 'assignDir;{newsletter_legend:hide},newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\t\n\t\t$intUser = $this->Input->get('id');\n\n\t\t// Front end call\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$this->import('FrontendUser', 'User');\n\t\t\t$intUser = $this->User->id;\n\t\t}\n\n\t\t// Edit account\n\t\tif (TL_MODE == 'FE' || $this->Input->get('act') == 'edit')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t// E-mail address has changed\n\t\t\t\tif (!empty($_POST) && $this->Input->post('email', true) != $objUser->email)\n\t\t\t\t{\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_news_recipients SET email=? WHERE email=?\")\n\t\t\t\t\t\t\t\t ->execute($this->Input->post('email', true), $objUser->email);\n\n\t\t\t\t\t$objUser->email = $this->Input->post('email', true);\n\t\t\t\t}\n\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT pid FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\n\t\t\t\t$strNews = serialize($objSubscriptions->fetchEach('pid'));\n\n\t\t\t\t$this->Database->prepare(\"UPDATE tl_member SET newsalert=? WHERE id=?\")\n\t\t\t\t\t\t\t ->execute($strNews, $intUser);\n\n\t\t\t\t// Update the front end user object\n\t\t\t\tif (TL_MODE == 'FE')\n\t\t\t\t{\n\t\t\t\t\t$this->User->newsalert = $strNews;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delete account\n\t\telseif ($this->Input->get('act') == 'delete')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"DELETE FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\t\t\t}\n\t\t}\n\t}", "public function getUserUpdated()\n {\n return $this->user_updated;\n }", "public function getUserUpdated()\n {\n return $this->user_updated;\n }", "public function getUpdateUser($id){\n return $this->rootUrl().'confirmUpdateUser';\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function update($mambot);", "public function update(Request $request): JsonResponse\n {\n $message =Message::find($request->id);\n $message->text_body=$request->text_body;\n $message->save();\n return \\response()->json(['done']);\n }", "public function updateMember() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n \n $memb = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n\n $givenOldLogin_Password = filter_input(INPUT_POST, \"givenOldLogin_Password\");\n $givenNewLogin_Password = filter_input(INPUT_POST, \"givenNewLogin_Password\");\n if (($givenOldLogin_Password != NULL) && ($givenNewLogin_Password != NULL)) {\n $oldLogin_Password_encrypted = sha1($givenOldLogin_Password);\n\n if ($oldLogin_Password_encrypted == $memb[\"Login_Password\"]) {\n $givenNewLogin_Password = sha1($givenNewLogin_Password);\n }\n } else {\n $givenNewLogin_Password = $memb[\"Login_Password\"];\n //kanskje en error beskjed ?\n }\n \n \n // set the values in the $update... \n $updateFirst_name = filter_input(INPUT_POST, 'First_name');\n $updateLast_name = filter_input(INPUT_POST, 'Last_name');\n $updateBirth = filter_input(INPUT_POST, 'Birth');\n $updatePhone_Number = filter_input(INPUT_POST, 'Phone_Number');\n $Membership_number = filter_input(INPUT_POST, 'Membership_number');\n\n $memberModel->updateMember($updateFirst_name, $updateLast_name, $updateBirth, $updatePhone_Number, $Membership_number,$givenNewLogin_Password);\n $GLOBALS[\"included_members\"] = $memberModel->getAll();\n\n return $this->render(\"listMembers\");\n }", "public function updateNotyf()\n {\n $id = $_POST['id_not'];\n $subject = $_POST['subject'];\n $notification = $_POST['notification'];\n\n $sql = \"UPDATE `notifications`\";\n $sql.= \" SET subject='$subject', notification='$notification'\";\n $sql.= \" WHERE id='$id'\";\n $con = $this->db();\n $res = $con->query($sql);\n if($res){\n return 'Success';\n }else{\n return \"Db error\";\n }\n\n }", "protected function confirm_edit()\n\t{\n\t\t$msg =\n\t\t\t$this->fields['FirstName'] . \" \" . $this->fields['LastName'] .\n\t\t\t\" successfully modified.\"\n\t\t;\n\n\t\treturn '<font color=\"green\">' . $msg . '</font><br>';\n\n\t}", "public function indexApUpdate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'update'); \n }", "public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }", "public function update(Request $request, MassageMail $massageMail)\n {\n //\n }", "public function postUpdate() /* /tickets/update */\n\t{\n\t\t$input = Input::all();\n\t\t\n\t\t$ticket = Ticket::find($input['id']);\n\t\tif($ticket->department != $input['department'])\n\t\t\t$ticket->department = $input['department'];\n\t\tif($input['status'] == 'closed'){\n\t\t\t$ticket->status = 'closed';\n\t\t\t$subject = 'This ticket is now closed';\n\t\t\t$message = 'The ticket: '.$ticket->title.', with description: '.$ticket->description.', is now closed.';\n\t\t\t$email = User::find($ticket->user_id)->email;\n\t\t\t//Queue::push('SendEmail', array('email' => $email, 'message' => $message, 'subject' => $subject));\n\t\t}\n\t\t\n\t\t$ticket->save();\n\t\t\n\t\treturn $ticket;\n\t}", "function process_message($message)\r\n{\r\n $updateid = $message[\"update_id\"];\r\n $message_data = $message[\"message\"];\r\n if (isset($message_data[\"text\"])) {\r\n $chatid = $message_data[\"chat\"][\"id\"];\r\n $message_id = $message_data[\"message_id\"];\r\n $text = $message_data[\"text\"];\r\n $response = create_response($text, $message_data);\r\n if (!empty($response))\r\n send_reply($chatid, $message_id, $response);\r\n }\r\n return $updateid;\r\n}", "public function notification_message_time_update()\n {\n echo $this->Home_model->notification_message_time_update_model();\n }", "public function update(int $id, Request $request) : JsonResponse\n {\n $this->validate(request(), [\n 'message' => 'required'\n ]);\n $user = Message::findOrFail($id);\n $user->update(request()->all());\n\n return response()->json($user, 200);\n\n }", "public function updating()\n {\n # code...\n }", "function getChatUpdate(){\r\n\t\t$state = $_POST['state'];\r\n\t\t$file = $_POST['file'];\r\n\r\n\t\t//get the json encoded data from this function\r\n\t\t$dataChatUpdate = sendChatUpdate($state, $file);\r\n\r\n\t\t//echo back to the calling domain with jsone encoded data\r\n\t\techo $dataChatUpdate;\r\n\r\n\t}", "public function update(User $user, Message $message)\n {\n return $user->isAdmin;\n }", "public function update() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET mail=?, name=?, password=?, state=? WHERE id = ?\");\n\t\t$stmt->execute(array($this->mail, $this->name, $this->password, $this->state, $this->id));\n\t}", "protected function update(){\n // als er geen gebruiker is ingelogd, check session.. daarna maak session message\n if(!isset($_SESSION['isLoggedIn'])){\n $_SESSION['message'] = \"<div class=\\\"alert alert-dismissible alert-danger\\\">\n <button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\"></button>\n <strong>U moet ingelogd zijn om deze pagina te bezoeken! </strong>\";\n header('Location: '. ROOT_PATH . 'todos/all');\n }\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->update(),true);\n }", "protected function send_core_update_notification_email($item)\n {\n }", "function updategoal()\n {\n $goalid = $this->value('id');\n $status = $this->value('status');\n $userdetails = $this->userInfo();\n\t\t\n\t\t\n\t\t\n\t\t$application_path = $this->config['application_path'];\n\t\t$telespine_id = $this->config['telespineid'];\n\t\t\n\t\t$business_url = $this->config['business_telespine']; \n\t\t$support_email = $this->config['email_telespine'];\n\t\t$images_url=$this->config['images_url'];\n\t\t$data['images_url'] = $images_url;\n\t\t$data['support_email'] = $support_email ;\n $data['loginurl']=$this->config['telespine_login'];\n\t\t$result = $this->execute_query(\"UPDATE patient_goal SET status = {$status},update_date=now() WHERE patient_goal_id = {$goalid}\");\n\t\t\n\t\t\n\t\tif($status==2){\n\t\t$templatePath = $application_path.\"mail_content/telespine/goal_completed.php\";\n\t\t$fullname = $userdetails['name_first'].' '.$userdetails['name_last'];\n\t\t$data['fullname'] = $fullname;\n\t\t$message = $this->build_template($templatePath,$data);\n\t\t$data['support_email'] = $support_email;\n\t\t\n\t\t$to = $fullname.'<'.$userdetails['username'].'>';\n\t\t$subject =\"Telespine Update - Good for You!\";\n\t\t// To send HTML mail, the Content-type header must be set\n\t\t$headers = 'MIME-Version: 1.0' . \"\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\n\t\t$headers .= \"From: Telespine Support<\".$support_email.\">\" . \"\\n\";\n\t\t$returnpath = \"-f\".$support_email;\n\t\t@mail($to, $subject, $message, $headers, $returnpath); \n\t\t}\n\t\t\n\n echo $this->getCompletedGoals($userdetails['user_id']);\n }", "function sendUpdateEmail($email, $registrant)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" registration information updated.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'];\n $mailContent .= \":\\n\\n\";\n $mailContent .= \"Your information for the \" . $name . \" has been updated.\\n\";\n $mailContent .= \"\\nIf you did not edit your registration information, \" .\n \"please write to the administrator:\\n\";\n $mailContent .= \"mailto:\" . ADMIN_EMAIL . \"?subject=account%20compromised\\n\";\n $mailContent .= \"\\nright away, or simply reply to this note.\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($email, $subject, $mailContent, $headers);\n}", "function form_action()\r\n {\r\n // After passing validation, all of the meet data\r\n // should be stored in the Swim Meet class instance.\r\n\r\n $swimmeet = $this->getSwimMeet() ;\r\n\r\n $success = $swimmeet->UpdateSwimMeet() ;\r\n\r\n // If successful, store the updated meet id in so it can be used later.\r\n\r\n if ($success) \r\n {\r\n $swimmeet->setSwimMeetId($success) ;\r\n $this->set_action_message(html_div('ft-note-msg', 'Swim Meet successfully updated.')) ;\r\n }\r\n else\r\n {\r\n $this->set_action_message(html_div('ft-warning-msg', 'Swim Meet was not successfully updated.')) ;\r\n }\r\n\r\n return $success ;\r\n }", "public function account_updated(){\n $this->log();\n http_response_code(200);\n ob_end_flush();\n }", "public function get_update_request(){\n\t\t$user_data = $this->session->userdata;\n\t\t$restaurant_id = $user_data['id'];\n\t\t$this->load->model('model_notifications');\n\t\t$result = $this->model_notifications->get_update_request($restaurant_id);\n\t\techo json_encode($result);\n\t}", "function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}", "public function update(User $user, Msg $msg)\n {\n //\n\t\tif(!isset($msg->user_id))return true;\n\t\tif( $user->hasPermission('update.msg'))return true;\n\t\treturn $user->id == $msg->user_id;\n }", "public function doUpdate()\n {\n // Update user attached to person\n $user = User::find($this->user_id);\n $user->email = Input::get('email');\n $user->save();\n\n // perform actual password reset\n $user->resetPassword();\n\n // Update person\n $this->first = Input::get('first');\n $this->middle = Input::get('middle');\n $this->last = Input::get('last');\n\n return $this->save();\n }" ]
[ "0.6869139", "0.6856026", "0.6820751", "0.6701776", "0.66061807", "0.6460634", "0.6458321", "0.64471555", "0.64348954", "0.6384491", "0.6322829", "0.63138574", "0.62748766", "0.627378", "0.625705", "0.6243955", "0.62167555", "0.6214157", "0.6210967", "0.619851", "0.6197937", "0.6197216", "0.6165831", "0.616294", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.6147533", "0.611956", "0.6090807", "0.60881585", "0.60881585", "0.6080979", "0.6060442", "0.60493624", "0.60462147", "0.6037682", "0.60226023", "0.60095054", "0.6005145", "0.59870356", "0.59714127", "0.5957847", "0.5954857", "0.595412", "0.59466743", "0.5943328", "0.59335554", "0.59053665", "0.59028155", "0.5892452", "0.58876216", "0.58791256", "0.58740747", "0.58736455", "0.5872689", "0.586387", "0.5859045", "0.5837379", "0.5830657", "0.58187264", "0.5814744", "0.5814727", "0.5814102", "0.5814102", "0.580849", "0.58054566", "0.58052665", "0.58050936", "0.5802748", "0.58010906", "0.57967764", "0.5794835", "0.57923573", "0.5790283", "0.57898563", "0.5777836", "0.57755864", "0.5771812", "0.576741", "0.57491714", "0.57476586", "0.57439226", "0.57396287", "0.573809", "0.57322204", "0.5728271", "0.5727518", "0.57263273", "0.5725429", "0.5722612", "0.5718053", "0.5717087" ]
0.0
-1
Calculates the refund amount from the selected attendees from the ticket price perspective. It will add the tax value from the organiser if it's set and build the refund amount to equal the amount of tickets purchased by the selected attendees. Ex:
protected function setRefundTotal() { $organiserTaxRate = $this->organiserTaxRate; $currency = $this->currency; /** * Subtotal = (Ticket price + Organiser Fee) * Tax Amount = Subtotal * Tax rate * Refund Amount = Subtotal + Tax Amount */ $this->refundAmount = new Money($this->attendees->map(function (Attendee $attendee) use ( $organiserTaxRate, $currency ) { $ticketPrice = new Money($attendee->ticket->price, $currency); $organiserFee = new Money($attendee->event->getOrganiserFee($ticketPrice), $currency); $subTotal = $ticketPrice->add($organiserFee); Log::debug(sprintf("Ticket Price: %s", $ticketPrice->display())); Log::debug(sprintf("Ticket Organiser Fee: %s", $organiserFee->display())); Log::debug(sprintf("Ticket Tax: %s", $subTotal->multiply($organiserTaxRate)->display())); return $subTotal->add($subTotal->multiply($organiserTaxRate)); })->reduce(function ($carry, $singleTicketWithTax) use ($currency) { $refundTotal = (new Money($carry, $currency)); return $refundTotal->add($singleTicketWithTax)->format(); }), $currency); Log::debug(sprintf("Requested Refund should include Tax: %s", $this->refundAmount->display())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubtotalRefunded();", "public function getTaxRefunded();", "function _refundItemAmount($type = '', $itemIds = array())\r\n {\r\n $ItemUserConditions = array(\r\n 'OR' => array(\r\n array(\r\n 'ItemUser.is_paid' => 1,\r\n 'ItemUser.is_repaid' => 0,\r\n 'ItemUser.is_canceled' => 0,\r\n 'ItemUser.payment_gateway_id' => ConstPaymentGateways::Wallet\r\n ) ,\r\n array(\r\n 'ItemUser.is_paid' => 0,\r\n 'ItemUser.is_repaid' => 0,\r\n 'ItemUser.is_canceled' => 0,\r\n 'ItemUser.payment_gateway_id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::PayPalAuth,\r\n ConstPaymentGateways::AuthorizeNet,\r\n )\r\n )\r\n )\r\n );\r\n if (!empty($itemIds)) {\r\n $conditions['Item.id'] = $itemIds;\r\n } elseif (!empty($type) && $type == 'cron') {\r\n $conditions['Item.item_status_id'] = array(\r\n ConstItemStatus::Expired,\r\n ConstItemStatus::Canceled\r\n );\r\n }\r\n $items = $this->find('all', array(\r\n 'conditions' => $conditions,\r\n 'contain' => array(\r\n 'ItemUser' => array(\r\n 'User' => array(\r\n 'fields' => array(\r\n 'User.username',\r\n 'User.email',\r\n 'User.id',\r\n 'User.cim_profile_id',\r\n ) ,\r\n 'UserProfile' => array(\r\n 'fields' => array(\r\n 'UserProfile.first_name',\r\n 'UserProfile.last_name'\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'PaypalDocaptureLog' => array(\r\n 'fields' => array(\r\n 'PaypalDocaptureLog.authorizationid',\r\n 'PaypalDocaptureLog.dodirectpayment_amt',\r\n 'PaypalDocaptureLog.id',\r\n 'PaypalDocaptureLog.currencycode'\r\n )\r\n ) ,\r\n 'PaypalTransactionLog' => array(\r\n 'fields' => array(\r\n 'PaypalTransactionLog.id',\r\n 'PaypalTransactionLog.authorization_auth_exp',\r\n 'PaypalTransactionLog.authorization_auth_id',\r\n 'PaypalTransactionLog.authorization_auth_amount',\r\n 'PaypalTransactionLog.authorization_auth_status'\r\n )\r\n ) ,\r\n 'AuthorizenetDocaptureLog' => array(\r\n 'fields' => array(\r\n 'AuthorizenetDocaptureLog.id',\r\n 'AuthorizenetDocaptureLog.authorize_amt',\r\n )\r\n ) ,\r\n 'conditions' => $ItemUserConditions,\r\n ) ,\r\n 'Merchant' => array(\r\n 'fields' => array(\r\n 'Merchant.name',\r\n 'Merchant.id',\r\n 'Merchant.url',\r\n 'Merchant.zip',\r\n 'Merchant.address1',\r\n 'Merchant.address2',\r\n 'Merchant.city_id'\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n 'State' => array(\r\n 'fields' => array(\r\n 'State.id',\r\n 'State.name'\r\n )\r\n ) ,\r\n 'Country' => array(\r\n 'fields' => array(\r\n 'Country.id',\r\n 'Country.name',\r\n 'Country.slug',\r\n )\r\n )\r\n ) ,\r\n 'Attachment' => array(\r\n 'fields' => array(\r\n 'Attachment.id',\r\n 'Attachment.dir',\r\n 'Attachment.filename',\r\n 'Attachment.width',\r\n 'Attachment.height'\r\n )\r\n ) ,\r\n 'City' => array(\r\n 'fields' => array(\r\n 'City.id',\r\n 'City.name',\r\n 'City.slug',\r\n )\r\n ) ,\r\n ) ,\r\n 'recursive' => 3,\r\n ));\r\n App::import('Model', 'EmailTemplate');\r\n $this->EmailTemplate = new EmailTemplate();\r\n App::import('Core', 'ComponentCollection');\r\n $collection = new ComponentCollection();\r\n App::import('Component', 'Email');\r\n $this->Email = new EmailComponent($collection);\r\n if (!empty($items)) {\r\n $itemIds = array();\r\n App::import('Component', 'Paypal');\r\n $this->Paypal = new PaypalComponent($collection);\r\n $paymentGateways = $this->User->Transaction->PaymentGateway->find('all', array(\r\n 'conditions' => array(\r\n 'PaymentGateway.id' => array(\r\n ConstPaymentGateways::CreditCard,\r\n ConstPaymentGateways::AuthorizeNet\r\n ) ,\r\n ) ,\r\n 'contain' => array(\r\n 'PaymentGatewaySetting' => array(\r\n 'fields' => array(\r\n 'PaymentGatewaySetting.key',\r\n 'PaymentGatewaySetting.test_mode_value',\r\n 'PaymentGatewaySetting.live_mode_value',\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'recursive' => 1\r\n ));\r\n foreach($paymentGateways as $paymentGateway) {\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::CreditCard) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_UserName') {\r\n $paypal_sender_info['API_UserName'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Password') {\r\n $paypal_sender_info['API_Password'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'directpay_API_Signature') {\r\n $paypal_sender_info['API_Signature'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n $paypal_sender_info['is_testmode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n if ($paymentGateway['PaymentGateway']['id'] == ConstPaymentGateways::AuthorizeNet) {\r\n if (!empty($paymentGateway['PaymentGatewaySetting'])) {\r\n foreach($paymentGateway['PaymentGatewaySetting'] as $paymentGatewaySetting) {\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_api_key') {\r\n $authorize_sender_info['api_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n if ($paymentGatewaySetting['key'] == 'authorize_net_trans_key') {\r\n $authorize_sender_info['trans_key'] = $paymentGateway['PaymentGateway']['is_test_mode'] ? $paymentGatewaySetting['test_mode_value'] : $paymentGatewaySetting['live_mode_value'];\r\n }\r\n }\r\n }\r\n $authorize_sender_info['is_test_mode'] = $paymentGateway['PaymentGateway']['is_test_mode'];\r\n }\r\n }\r\n foreach($items as $item) {\r\n if (!empty($item['ItemUser'])) {\r\n $ItemUserIds = array();\r\n\t\t\t\t\t$itemUserIdData = array();\r\n\t\t\t\t\t$itemIds = array();\r\n foreach($item['ItemUser'] as $item_user) {\r\n //do void for credit card\r\n if ($item_user['payment_gateway_id'] != ConstPaymentGateways::Wallet) {\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::AuthorizeNet) {\r\n require_once (APP . 'vendors' . DS . 'CIM' . DS . 'AuthnetCIM.class.php');\r\n if ($authorize_sender_info['is_test_mode']) {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key'], true);\r\n } else {\r\n $cim = new AuthnetCIM($authorize_sender_info['api_key'], $authorize_sender_info['trans_key']);\r\n }\r\n $cim->setParameter('customerProfileId', $item_user['User']['cim_profile_id']);\r\n $cim->setParameter('customerPaymentProfileId', $item_user['payment_profile_id']);\r\n $cim->setParameter('transId', $item_user['cim_transaction_id']);\r\n $cim->voidCustomerProfileTransaction();\r\n // And if enbaled n Credit docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($item_user['AuthorizenetDocaptureLog']['authorize_amt'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['AuthorizenetDocaptureLog']['authorize_amt'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n if ($cim->isSuccessful()) {\r\n if (!empty($itemuser['AuthorizenetDocaptureLog']['id'])) {\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['id'] = $itemuser['AuthorizenetDocaptureLog']['id'];\r\n $data_authorize_docapture_log['AuthorizenetDocaptureLog']['payment_status'] = 'Cancelled';\r\n $this->ItemUser->AuthorizenetDocaptureLog->save($data_authorize_docapture_log);\r\n }\r\n return true;\r\n }\r\n } else {\r\n $payment_response = array();\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $post_info['authorization_id'] = $item_user['PaypalDocaptureLog']['authorizationid'];\r\n } else if ($item_user['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n $post_info['authorization_id'] = $item_user['PaypalTransactionLog']['authorization_auth_id'];\r\n }\r\n $post_info['note'] = __l('Item Payment refund');\r\n //call void function in paypal component\r\n $payment_response = $this->Paypal->doVoid($post_info, $paypal_sender_info);\r\n //update payment responses\r\n if (!empty($payment_response)) {\r\n if ($item_user['payment_gateway_id'] == ConstPaymentGateways::CreditCard) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['id'] = $item_user['PaypalDocaptureLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['dovoid_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['dovoid_response'] = serialize($payment_response);\r\n $data_paypal_docapture_log['PaypalDocaptureLog']['payment_status'] = 'Cancelled';\r\n //update PaypalDocaptureLog table\r\n $this->ItemUser->PaypalDocaptureLog->save($data_paypal_docapture_log);\r\n // And if enbaled n Credit docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($data_paypal_docapture_log['PaypalDocaptureLog']['original_amount'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['PaypalDocaptureLog']['dodirectpayment_amt'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n\r\n } else if ($item_user['payment_gateway_id'] == ConstPaymentGateways::PayPalAuth) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['id'] = $item_user['PaypalTransactionLog']['id'];\r\n foreach($payment_response as $key => $value) {\r\n $data_paypal_capture_log['PaypalTransactionLog']['void_' . strtolower($key) ] = $value;\r\n }\r\n $data_paypal_capture_log['PaypalTransactionLog']['void_data'] = serialize($payment_response);\r\n $data_paypal_capture_log['PaypalTransactionLog']['payment_status'] = 'Cancelled';\r\n $data_paypal_capture_log['PaypalTransactionLog']['error_no'] = '0';\r\n //update PaypalTransactionLog table\r\n $this->ItemUser->PaypalTransactionLog->save($data_paypal_capture_log);\r\n // And if enabled n PayPal docapture amount and item discount amount is not equal, add amount to user wallet and update transactions //\r\n if (Configure::read('wallet.is_handle_wallet')) {\r\n if ($item_user['PaypalTransactionLog']['orginal_amount'] != $item['Item']['discount_amount']) {\r\n $update_wallet = '';\r\n $update_wallet = ($item['Item']['price']*$item_user['quantity']) -$item_user['PaypalTransactionLog']['authorization_auth_amount'];\r\n //Updating transactions\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $update_wallet;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $update_wallet\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n }\r\n } // END act like groupon wallet funct., //\r\n\r\n }\r\n }\r\n }\r\n //authorization_auth_amount\r\n\r\n } else {\r\n $transaction['Transaction']['user_id'] = $item_user['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $item_user['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $item_user['discount_amount'];\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($item_user['is_gift'])) ? ConstTransactionTypes::ItemGiftRefund : ConstTransactionTypes::ItemBoughtRefund;\r\n $this->ItemUser->User->Transaction->log($transaction);\r\n //update user balance\r\n $this->ItemUser->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $item_user['discount_amount'],\r\n ) , array(\r\n 'User.id' => $item_user['user_id']\r\n ));\r\n }\r\n /* sending mail to all subscribers starts here */\r\n $city = (!empty($item['Merchant']['City']['name'])) ? $item['Merchant']['City']['name'] : '';\r\n $state = (!empty($item['Merchant']['State']['name'])) ? $item['Merchant']['State']['name'] : '';\r\n $country = (!empty($item['Merchant']['Country']['name'])) ? $item['Merchant']['Country']['name'] : '';\r\n $address = (!empty($item['Merchant']['address1'])) ? $item['Merchant']['address1'] : '';\r\n $address.= (!empty($item['Merchant']['address2'])) ? ', ' . $item['Merchant']['address2'] : '';\r\n $address.= (!empty($item['Merchant']['City']['name'])) ? ', ' . $item['Merchant']['City']['name'] : '';\r\n $address.= (!empty($item['Merchant']['State']['name'])) ? ', ' . $item['Merchant']['State']['name'] : '';\r\n $address.= (!empty($item['Merchant']['Country']['name'])) ? ', ' . $item['Merchant']['Country']['name'] : '';\r\n $address.= (!empty($item['Merchant']['zip'])) ? ', ' . $item['Merchant']['zip'] : '';\r\n $language_code = $this->getUserLanguageIso($item_user['User']['id']);\r\n $template = $this->EmailTemplate->selectTemplate('Item Amount Refunded', $language_code);\r\n $emailFindReplace = array(\r\n '##SITE_URL##' => Cache::read('site_url_for_shell', 'long') ,\r\n '##USER_NAME##' => $item_user['User']['username'],\r\n '##SITE_NAME##' => Configure::read('site.name') ,\r\n '##ITEM_NAME##' => $item['Item']['name'],\r\n '##MERCHANT_NAME##' => $item['Merchant']['name'],\r\n '##MERCHANT_ADDRESS##' => $address,\r\n '##CITY_NAME##' => $item['City']['0']['name'],\r\n '##FROM_EMAIL##' => $this->changeFromEmail(($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from']) ,\r\n '##BUY_PRICE##' => Configure::read('site.currency') . $item['Item']['price'],\r\n '##MERCHANT_SITE##' => $item['Merchant']['url'],\r\n '##CONTACT_URL##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', 'contactus', 1) ,\r\n '##ITEM_URL##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'view',\r\n $item['Item']['slug'],\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n '##ITEM_LINK##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'view',\r\n $item['Item']['slug'],\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n '##SITE_LOGO##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n 'controller' => 'img',\r\n 'action' => 'blue-theme',\r\n 'logo-email.png',\r\n 'admin' => false\r\n ) , false) , 1) ,\r\n );\r\n $this->Email->from = ($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from'];\r\n $this->Email->replyTo = ($template['reply_to'] == '##REPLY_TO_EMAIL##') ? Configure::read('EmailTemplate.reply_to_email') : $template['reply_to'];\r\n $this->Email->to = $this->formatToAddress($item_user);\r\n $this->Email->subject = strtr($template['subject'], $emailFindReplace);\r\n $this->Email->content = strtr($template['email_content'], $emailFindReplace);\r\n $this->Email->sendAs = ($template['is_html']) ? 'html' : 'text';\r\n $this->Email->send($this->Email->content);\r\n $ItemUserIds[] = $item_user['id'];\r\n\t\t\t\t\t\t$itemIds[] = $item['Item']['id'];\r\n // SubItem: Resetting the actual item array //\r\n if (!empty($temp_item)) {\r\n $item['Item'] = $temp_item;\r\n }\r\n\t\t\t\t\t\t// after save fields //\r\n\t\t\t\t\t\t$data_for_aftersave = array();\r\n\t\t\t\t\t\t$data_for_aftersave['item_id'] = $item['Item']['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['item_user_id'] = $item_user['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['user_id'] = $item_user['user_id'];\r\n\t\t\t\t\t\t$data_for_aftersave['merchant_id'] = $item['Merchant']['id'];\r\n\t\t\t\t\t\t$data_for_aftersave['payment_gateway_id'] = $item_user['payment_gateway_id'];\r\n\t\t\t\t\t\t$itemUserIdData[] = $data_for_aftersave;\r\n }\r\n if (!empty($ItemUserIds)) {\r\n //is_repaid field updated\r\n $this->ItemUser->updateAll(array(\r\n 'ItemUser.is_repaid' => 1,\r\n ) , array(\r\n 'ItemUser.id' => $ItemUserIds\r\n ));\r\n\t\t\t\t\t\t$this->updateAll(array(\r\n\t\t\t\t\t\t\t'Item.item_user_count' => 0,\r\n\t\t\t\t\t\t) , array(\r\n\t\t\t\t\t\t\t'Item.id' => $itemIds\r\n\t\t\t\t\t\t));\r\n\t\t\t\t\t\tforeach($itemUserIdData as $itemUserData) {\r\n\t\t\t\t\t\t\t$this->_updateAfterPurchase($itemUserData, 'cancel');\r\n\t\t\t\t\t\t}\r\n }\r\n }\r\n $refundedItemIds[] = $item['Item']['id'];\r\n }\r\n if (!empty($refundedItemIds)) {\r\n foreach($refundedItemIds as $refunded_item_id) {\r\n $data = array();\r\n $data['Item']['id'] = $refunded_item_id;\r\n $data['Item']['item_status_id'] = ConstItemStatus::Refunded; // Already updated in model itself, calling it again for affiliate behaviour\r\n $this->save($data);\r\n }\r\n }\r\n }\r\n }", "public function refund()\n\t{\n\t\trequirePermission(\"canRefund\");\n\n\t\t$id = intval($this->input->get(\"id\"));\n\t\t$costDp = intval($this->input->get(\"costDp\"));\n\t\t$accountId = intval($this->input->get(\"accountId\"));\n\t\t\n\t\tif(!$id || !is_numeric($id))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif(!$costDp || !is_numeric($costDp))\n\t\t\t{\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\tif(!$accountId || !is_numeric($accountId))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif ($costDp > 0) {\n\t\t\t\t$userDp = intval($this->recup_model->getDp($accountId));\n\t\t\t\tif(!$userDp || !is_numeric($userDp))\n\t\t\t\t{\n\t\t\t\t\tdie(\"Problème lors de l'acquisition des users dps.\");\n\t\t\t\t}\n\t\t\t\t$this->internal_user_model->setDp($accountId, $userDp+$costDp);\n\t\t\t}\n\t\t}\n\t\t$this->recup_model->editEtat($this->realms->getRealm(1)->getCharacters()->getConnection(), $id, 8);\n\t}", "public function getTaxInvoiced();", "public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n $countrycode = \"\";\n\n $address = edd_get_customer_address();\n\n if ( isset($address['country']) && !empty($address['country']) && \"\" !== $address['country'] ) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n if ( !empty( $cart_items ) ) { \n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n }\n\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }", "public function get_taxes() {\n\t\treturn apply_filters( 'woocommerce_cart_get_taxes', wc_array_merge_recursive_numeric( $this->get_shipping_taxes(), $this->get_cart_contents_taxes(), $this->get_fee_taxes() ), $this );\n\t}", "public function get_company_refundpayment() {\n $invoice_id = $this->input->post('invoice');\n $company_id = $this->input->post('company');\n $company_received = $this->classtraineemodel->company_payment_recd($invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = $v->amount_recd;\n }\n $company_received = $this->classtraineemodel->company_payment_refund($invoice_id);\n $user_refund = array();\n foreach ($company_received as $k => $v) {\n $user_refund[$v->user_id] = $v->refund_amount;\n }\n $company_invoice = $this->classtraineemodel->company_invoice($invoice_id);\n $company_invoice->invoice_excess_amt = (empty($company_invoice->invoice_excess_amt)) ? 0 : $company_invoice->invoice_excess_amt;\n $excess_paid = $company_invoice->invoice_excess_amt;\n $excess_refunded = empty($user_refund[0]) ? 0 : $user_refund[0];\n $excess_remain = round($excess_paid, 2) - round($excess_refunded, 2);\n $company_invoice->excess_refunded = round($excess_refunded, 2);\n $company_invoice->excess_remain = round($excess_remain, 2);\n\n $company_invoice->invoiced_on = ($company_invoice->invoiced_on == NULL || $company_invoice->invoiced_on == '0000-00-00 00:00:00') ? '' : date('d-m-Y', strtotime($company_invoice->invoiced_on));\n $company_invoice->discount_label = rtrim($this->course->get_metadata_on_parameter_id($company_invoice->discount_type), ', ');\n $gst_label = ($company_invoice->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($company_invoice->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($company_invoice->gst_rule), ', ');\n }\n $company_invoice->gst_label = $gst_label;\n $company_invoice->trainees = $this->classtraineemodel->get_company_trainees_by_payid1($company_invoice->pymnt_due_id);\n foreach ($company_invoice->trainees as $k => $row) {\n $company_invoice->trainees[$k]->subsidy_recd_date = (($row->subsidy_recd_date == '0000-00-00') || ($row->subsidy_recd_date == null)) ? '' : date('d-m-Y', strtotime($row->subsidy_recd_date));\n $amount_paid = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $amount_refund = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $company_invoice->trainees[$k]->amount_paid = round($amount_paid, 2);\n $company_invoice->trainees[$k]->amount_refund = round($amount_refund, 2);\n $company_invoice->trainees[$k]->amount_remain = round(($amount_paid - $amount_refund), 2);\n }\n $company_invoice->subsidy_type = $this->classtraineemodel->get_subsidy_type($this->tenant_id);\n \n echo json_encode($company_invoice);\n exit();\n }", "private function refundDetection($ticket)\n {\n $depart_time = strtotime($ticket->booking_for);\n $current_time = strtotime(date('Y-m-d H:m:i'));\n $diff_in_minutes = round(($depart_time - $current_time) / 60);\n\n $amount = $ticket->total_fare - $ticket->discount;\n\n if ($depart_time > $current_time && $diff_in_minutes >= 20) {\n if ($diff_in_minutes >= 60) {\n // 25% deduction\n $per = 25;\n $deduction = round($amount * .25);\n } else if ($diff_in_minutes >= 20) {\n // 40% deduction\n $per = 40;\n $deduction = round($amount * .4);\n }\n\n } else {\n // 50% deduction\n $per = 50;\n $deduction = round($amount * .5);\n }\n\n return $deduction;\n }", "private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }", "public function getDiscountTaxCompensationRefunded();", "function submit_refund_to_taxamo( $payment_id, $new_status, $old_status ) {\n\n global $edd_options;\n\n if ( 'refunded' != $new_status )\n return;\n\n\n // Get Taxamo Tansaction Key.\n $payment_meta = edd_get_payment_meta( $payment_id );\n $taxamo_transaction_lines = $payment_meta['taxamo_transaction_lines'];\n $transaction_key = $payment_meta['taxamo_transaction_key'];\n\n // Get Order Total and create an array for it.\n foreach ( $taxamo_transaction_lines as $taxamo_transaction_line ) {\n $line_key = $taxamo_transaction_line['taxamo_line_key'];\n $amount = $taxamo_transaction_line['taxamo_total_amount'];\n\n $taxamo_body_array = array( \"total_amount\"=>$amount,\n \"line_key\" => $line_key );\n $taxamo_body_json = json_encode( $taxamo_body_array );\n\n // Create Taxamo Object and Submit a refund\n $private_key = $edd_options['taxedd_private_token'];\n $refundtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n $resp = $refundtaxamo->createRefund( $transaction_key, $taxamo_body_array );\n }\n }", "public function getTotalRefunded();", "function referalRefunding($item_id = null)\r\n {\r\n App::import('Model', 'ItemUser');\r\n $this->ItemUser = new ItemUser();\r\n $item_users = $this->ItemUser->find('all', array(\r\n 'conditions' => array(\r\n 'Item.id' => $item_id,\r\n 'Item.item_status_id' => ConstItemStatus::Tipped,\r\n 'ItemUser.referred_by_user_id !=' => '0'\r\n ) ,\r\n 'fields' => array(\r\n 'ItemUser.referred_by_user_id',\r\n 'ItemUser.item_id',\r\n 'ItemUser.user_id',\r\n 'SUM(ItemUser.quantity) as referred_user_total_purchased_quantity',\r\n ) ,\r\n 'group' => array(\r\n 'ItemUser.referred_by_user_id'\r\n ) ,\r\n 'contain' => array(\r\n 'Item' => array(\r\n 'fields' => array(\r\n 'Item.id',\r\n 'Item.price',\r\n )\r\n ) ,\r\n ) ,\r\n 'recursive' => 1\r\n ));\r\n foreach($item_users as $item_user) {\r\n if ($item_user[0]['referred_user_total_purchased_quantity'] >= Configure::read('referral.no_of_refer_to_get_a_refund')) { // If creteria matches for refund\r\n $check_refer = $this->ItemReferrer->find('first', array(\r\n 'conditions' => array(\r\n 'ItemReferrer.user_id' => $item_user['ItemUser']['referred_by_user_id'],\r\n 'ItemReferrer.item_id' => $item_user['ItemUser']['item_id'],\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n $refer_data = $this->ItemUser->find('first', array(\r\n 'conditions' => array(\r\n 'ItemUser.user_id' => $item_user['ItemUser']['referred_by_user_id'],\r\n 'ItemUser.item_id' => $item_user['ItemUser']['item_id'],\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n if (empty($check_refer)) { // If empty, refer amount\r\n // Add amount to referral user amount //\r\n if (Configure::read('referral.refund_type') == ConstReferralRefundType::RefundItemAmount) {\r\n $refund_amount = $refer_data['ItemUser']['discount_amount']/$refer_data['ItemUser']['quantity'];\r\n } else {\r\n $refund_amount = Configure::read('referral.refund_amount');\r\n }\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount + ' . $refund_amount,\r\n\t\t\t\t\t\t'User.total_referral_earned_amount' => 'User.total_referral_earned_amount + ' . $refund_amount,\r\n ) , array(\r\n 'User.id' => $item_user['ItemUser']['referred_by_user_id']\r\n ));\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount + ' . $refund_amount,\r\n\t\t\t\t\t\t'User.total_referral_earned_amount' => 'User.total_referral_earned_amount + ' . $refund_amount,\r\n ) , array(\r\n 'User.id' => $item_user['ItemUser']['user_id']\r\n ));\r\n\t\t\t\t\t$this->User->ItemUser->updateAll(array(\r\n\t\t\t\t\t\t'ItemUser.referral_commission_amount ' => $refund_amount,\r\n\t\t\t\t\t\t'ItemUser.is_referral_commission_sent ' => 1,\r\n\t\t\t\t\t\t'ItemUser.referral_commission_type ' => ConstReferralCommissionType::XRefer\r\n\t\t\t\t\t) , array(\r\n\t\t\t\t\t\t'ItemUser.id' => $item_user['ItemUser']['user_id']\r\n\t\t\t\t\t));\r\n $data = array();\r\n $data['Transaction']['user_id'] = $item_user['ItemUser']['referred_by_user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $refund_amount;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::ReferralAddedToWallet;\r\n $this->User->Transaction->save($data);\r\n // Insert Record into ItemReferrrer //\r\n $referrer = array();\r\n $referrer['ItemReferrer']['user_id'] = $item_user['ItemUser']['referred_by_user_id'];\r\n $referrer['ItemReferrer']['item_id'] = $item_user['Item']['id'];\r\n $referrer['ItemReferrer']['earned_amount'] = $refund_amount;\r\n $referrer['ItemReferrer']['refferral_count'] = Configure::read('referral.no_of_refer_to_get_a_refund');\r\n $this->ItemReferrer->save($referrer);\r\n } else {\r\n $this->ItemReferrer->updateAll(array(\r\n 'ItemReferrer.total_purchased_referral_count' => 'ItemReferrer.total_purchased_referral_count + ' . 1,\r\n ) , array(\r\n 'ItemReferrer.item_id' => $item_user['Item']['id'],\r\n 'ItemReferrer.id' => $check_refer['ItemReferrer']['id']\r\n ));\r\n }\r\n }\r\n }\r\n }", "function AddProduct() {\n\t$customer_id=$_GET['customer_id'];\n\n\t$invoice_id=$_GET['invoice_id'];\n\n\t$invoice_item_id = $_POST['invoice_item_id'];\n\n\t$service_type = $_POST['service_type'];\n\n\t$service_range = $_POST['service_range'];\n\n\t$price = $_POST['price'];\n\n\t$value = ($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\t$vat_percent = $_POST['vat'];\n\n\t$vat= ($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']));\n\n\t$vat_value =(($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))+\n\t(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\tif ($_POST['rebate']>0) {\n\t\t$rabat = (($_POST['price'] * $_POST['service_range']/100)*$_POST['rebate']);\n\t}else{\n\t\t$rebate = $_POST['rebate'];}\n\n\t\tif ($_POST['rebate']>0) {\n\t\t\t$total_value = ((($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']\n\t\t\t\t/(100+$_POST['vat']))))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))\n\t\t\t-(($_POST['price']*$_POST['service_range'])/100*$_POST['rebate']);\n\t\t}else{\n\t\t\t$total_value = (($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])\n\t\t\t\t*($_POST['vat']/(100+$_POST['vat'])))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))));}\n\n\t\t\t$query = \"INSERT INTO invoice_item (invoice_item_id,invoice_id,customer_id, service_range, service_type, price, value,\n\t\t\t vat ,vat_percent,vat_value,rebate,total_value)\n\t\t\tVALUES (NULL,'$invoice_id','$customer_id','$service_range','$service_type','$price','$value',\n\t\t\t\t'$vat','$vat_percent','$vat_value','$rebate','$total_value')\";\n\t\t\t$result = mysql_query($query);\n\n\t\t\tif(!$result) \n\t\t\t{\n\t\t\t\tdie(mysql_error());\n\t\t\t}\n\n\t\t}", "public function getTaxAmount();", "public function process_refund( WC_Order_Refund $refund ) {\n\n\t\t$order = wc_get_order( SV_WC_Order_Compatibility::get_prop( $refund, 'parent_id' ) );\n\n\t\tif ( ! $order ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\t/**\n\t\t\t * Fire before processing tax for a refund.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param int $refund_id The refund ID.\n\t\t\t */\n\t\t\tdo_action( 'wc_avatax_before_refund_processed', SV_WC_Order_Compatibility::get_prop( $refund, 'id' ) );\n\n\t\t\t// Make the call\n\t\t\t$response = wc_avatax()->get_api()->calculate_refund_tax( $refund );\n\n\t\t\t// Store the refund amount estimated by the standard WooCommerce methods\n\t\t\t$estimated_total = $refund->get_total();\n\n\t\t\tforeach ( $response->get_lines() as $line ) {\n\n\t\t\t\t$line_id = $line['id'];\n\t\t\t\t$line_tax = $line['total'];\n\n\t\t\t\t// Handle the shipping line items\n\t\t\t\tif ( SV_WC_Helper::str_starts_with( $line_id, 'shipping_' ) ) {\n\n\t\t\t\t\t$item_id = str_replace( 'shipping_', '', $line_id );\n\n\t\t\t\t\t$taxes = maybe_unserialize( wc_get_order_item_meta( $item_id, 'taxes', true ) );\n\n\t\t\t\t\t// Remove this item's estimated tax amount from the total\n\t\t\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t\t\t\t$estimated_total -= $taxes['total']['avatax'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$estimated_total += abs( $taxes['avatax'] );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the newly calculated amount\n\t\t\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t\t\t\t$taxes['total']['avatax'] = $line_tax;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$taxes['avatax'] = $line_tax;\n\t\t\t\t\t}\n\n\t\t\t\t\twc_update_order_item_meta( $item_id, 'taxes', $taxes );\n\n\t\t\t\t// Handle all other line items\n\t\t\t\t} else {\n\n\t\t\t\t\t$estimated_line_tax = wc_get_order_item_meta( $line_id, '_line_tax', true );\n\n\t\t\t\t\t// Remove this item's estimated tax amount from the total\n\t\t\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t\t\t\t$estimated_total -= $estimated_line_tax;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$estimated_total += abs( $estimated_line_tax );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the newly calculated amounts\n\t\t\t\t\twc_update_order_item_meta( $line_id, '_line_tax', $line_tax );\n\t\t\t\t\twc_update_order_item_meta( $line_id, '_line_subtotal_tax', $line_tax );\n\n\t\t\t\t\t$tax_data = maybe_unserialize( wc_get_order_item_meta( $line_id, '_line_tax_data', true ) );\n\n\t\t\t\t\t$tax_data['total']['avatax'] = $line_tax;\n\t\t\t\t\t$tax_data['subtotal']['avatax'] = $line_tax;\n\n\t\t\t\t\twc_update_order_item_meta( $line_id, '_line_tax_data', $tax_data );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set the newly calculated amount\n\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\t\t\t\t$total = $estimated_total + $response->get_total_tax();\n\t\t\t} else {\n\t\t\t\t$total = $estimated_total - $response->get_total_tax();\n\t\t\t}\n\n\t\t\t// Phew! Finally, set the total refund amount (positive)\n\t\t\tupdate_post_meta( SV_WC_Order_Compatibility::get_prop( $refund, 'id' ), '_refund_amount', abs( $total ) );\n\n\t\t\tif ( SV_WC_Plugin_Compatibility::is_wc_version_gte_3_0() ) {\n\n\t\t\t\t// Get a fresh refund object with the meta loaded that we set above.\n\t\t\t\t$refund = wc_get_order( $refund );\n\t\t\t}\n\n\t\t\t// Update the total tax values for the refund\n\t\t\t$refund->update_taxes();\n\n\t\t\t// Set the grand total\n\t\t\t$refund->set_total( $total );\n\n\t\t\t// Add the refunded status to the original order\n\t\t\t$this->add_status( $order, 'refunded' );\n\n\t\t\t$order->add_order_note( sprintf( __( 'Refund #%s sent to Avalara.', 'woocommerce-avatax' ), SV_WC_Order_Compatibility::get_prop( $refund, 'id' ) ) );\n\n\t\t\t/**\n\t\t\t * Fire after processing tax for a refund.\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t * @param int $refund_id The refund ID.\n\t\t\t */\n\t\t\tdo_action( 'wc_avatax_after_refund_processed', SV_WC_Order_Compatibility::get_prop( $refund, 'id' ) );\n\n\t\t} catch ( SV_WC_API_Exception $e ) {\n\n\t\t\tif ( wc_avatax()->logging_enabled() ) {\n\t\t\t\twc_avatax()->log( $e->getMessage() );\n\t\t\t}\n\n\t\t\t$this->add_status( $order, 'error' );\n\n\t\t\t$order->add_order_note(\n\t\t\t\t/* translators: Placeholders: %1$s - error indicator, %2$s - error message */\n\t\t\t\tsprintf( __( '%1$s Refund could not be sent. %2$s Please add the refund manually from your Avalara Control Panel.', 'woocommerce-avatax' ),\n\t\t\t\t\t$this->error_prefix,\n\t\t\t\t\t$e->getMessage()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function getBaseTaxRefunded();", "public function getFinalTaxesTotal()\n {\n return $this->getProductsSalesTaxTotal() +\n $this->getProductsImportTaxTotal();\n }", "public function recalc_totals()\n\t{\n\t\tglobal $wpdb;\n\t\t\n\t\t// Set customer location to order location\n\t\tif ( $this->billing_country )\n\t\t\tWC()->customer->set_country( $this->billing_country );\n\t\tif ( $this->billing_state )\n\t\t\tWC()->customer->set_state( $this->billing_state );\n\t\tif ( $this->billing_postcode )\n\t\t\tWC()->customer->set_postcode( $this->billing_postcode );\n\n\t\t\t//\tget info for taxes \n\t\t$country = WC()->countries->get_base_country();\n\t\t$state = isset(WC()->countries->get_base_state) ? WC()->countries->get_base_state : '';\n\t\t$postcode = '';\n\t\t$city = '';\n\t\t\n\t\t$shipping_address = $this->get_shipping_address();\n\t\t$billing_address = $this->get_billing_address ();\n\t\t\n\t\tif(! empty($shipping_address))\n\t\t{\n\t\t\t$country = $this->shipping_country;\n\t\t\t$state = $this->shipping_state;\n\t\t\t$postcode = $this->shipping_postcode;\n\t\t\t$city = $this->shipping_city;\n\t\t}\n\t\telse if( ! empty($billing_address))\n\t\t{\n\t\t\t$country = $this->billing_country;\n\t\t\t$state = $this->billing_state;\n\t\t\t$postcode = $this->billing_postcode;\n\t\t\t$city = $this->billing_city;\n\t\t}\n\t\t\n\t\t$line_item_total = $line_item_subtotal = (float) 0.0;\n\t\t$line_item_total_tax_sum = $line_item_subtotal_tax_sum = (float) 0.0;\n\t\t$line_item_total_tax = $line_item_subtotal_tax = array();\n\t\t\n\t\t$shipping_total = (float) 0.0;\n\t\t$order_discounts_before_tax = $order_discount_after_tax = (float) 0.0;\n\t\t$cart_discounts_before_tax = $cart_discount_after_tax = (float) 0.0;\n\t\t\n\t\t$shipping_tax = $discount_tax = array();\n\t\t$taxes = $shipping_taxes = array();\n\t\t\n\t\t\t//\tGet all defined linetypes for this order\n\t\t$line_types_obj = $wpdb->get_results( $wpdb->prepare( \n\t\t\t\t\t\"SELECT DISTINCT order_item_type FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\tWHERE order_id = %d\", $this->id\n\t\t\t\t), OBJECT);\n\t\t\n\t\t$line_types = array();\t\t\t\n\t\tforeach ($line_types_obj as $line_type) \n\t\t{\n\t\t\t$line_types[] = $line_type->order_item_type;\n\t\t}\t\t\t\n\t\t\n\t\t$tax = new WC_Tax();\t\t\n\t\t\t\n\t\t$items = $this->get_items($line_types);\n\t\tforeach ( $items as $item_key => $item ) \n\t\t{\n\t\t\tswitch(strtolower($item['type']))\n\t\t\t{\n\t\t\t\tcase 'line_item':\t\t\t\t\n\t\t\t\t\t$line_item_subtotal += $item['line_subtotal'];\n\t\t\t\t\t$line_item_total += $item['line_total'];\n\t\t\t\t\t$line_item_subtotal_tax_sum += $item['line_subtotal_tax'];\n\t\t\t\t\t$line_item_total_tax_sum += $item['line_tax'];\n\t\t\t\t\t$line_tax = $item['line_tax'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'fee':\n\t\t\t\t\t$line_item_subtotal += $item['line_total'];\t\t// '_order_discount' = $line_item_total - $line_item_subtotal !!!!!\n\t\t\t\t\t$line_item_total += $item['line_total'];\n\t\t\t\t\t$line_tax = $item['line_tax'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'shipping':\n\t\t\t\t\t$shipping_total += $item['cost'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'tax':\n\t\t\t\t\tif(!empty($item['shipping_tax_amount']))\t\t//\tvalues are not stored with shipment\n\t\t\t\t\t{\n\t\t\t\t\t\t$shipping_tax[$item['rate_id']] = $item['shipping_tax_amount'];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'coupon':\n\t\t\t\t\t$coupon = new WC_Coupon($item['name']);\n\t\t\t\t\tif(in_array( $coupon->type, array( 'percent_product', 'fixed_product')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($coupon->apply_before_tax())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$order_discounts_before_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$order_discount_after_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif($coupon->apply_before_tax())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cart_discounts_before_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cart_discount_after_tax += $item['discount_amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\t//\t'line_item' and 'fee'\n\t\t\tif(isset($item['tax_class']))\n\t\t\t{\n\t\t\t\t$tax_rates = $tax->find_rates( array(\n\t\t\t\t\t\t\t'country' \t=> $country,\n\t\t\t\t\t\t\t'state' \t=> $state,\n\t\t\t\t\t\t\t'postcode' \t=> $postcode,\n\t\t\t\t\t\t\t'city'\t\t=> $city,\n\t\t\t\t\t\t\t'tax_class' => $item['tax_class']\n\t\t\t\t\t\t) );\n\t\t\t\t\n\t\t\t\t$key = '';\n\t\t\t\tif(count($tax_rates) > 0)\n\t\t\t\t{\n\t\t\t\t\t$keys = array_keys($tax_rates);\n\t\t\t\t\t$key = $keys[0];\n\t\t\t\t}\n\n\t\t\t\t$line_item_total_tax[$key] = $line_tax;\n\t\t\t}\n\t\t\t\t// Sum the taxes\n\t\t\tforeach ( array_keys( $taxes + $line_item_total_tax ) as $key )\n\t\t\t\t $taxes[ $key ] = ( isset( $line_item_total_tax[ $key ] ) ? $line_item_total_tax[ $key ] : 0 ) + ( isset( $taxes[ $key ] ) ? $taxes[ $key ] : 0 );\n\n\t\t\tforeach ( array_keys( $shipping_taxes + $shipping_tax ) as $key )\n\t\t\t\t $shipping_taxes[ $key ] = ( isset( $shipping_tax[ $key ] ) ? $shipping_tax[ $key ] : 0 ) + ( isset( $shipping_taxes[ $key ] ) ? $shipping_taxes[ $key ] : 0 );\n\n\t\t\t$line_item_total_tax = $shipping_tax = array();\n\t\t}\n\t\t\t\n\t\t$total_tax = array_sum($taxes) + array_sum($shipping_taxes);\n\t\t\n\t\t\n\t\tif($this->round_at_subtotal)\n\t\t{\n\t\t\t$line_item_total = round($line_item_total, $this->dp);\n\t\t\t$shipping_total = round($shipping_total, $this->dp);\n\t\t\t$total_tax = round($total_tax, $this->dp);\n\t\t\t$cart_discounts_before_tax = round($cart_discounts_before_tax, $this->dp);\n\t\t\t$order_discounts_before_tax = round($order_discounts_before_tax, $this->dp);\n\t\t\t$order_discount_after_tax = round($order_discount_after_tax, $this->dp);\n\t\t\t$cart_discount_after_tax = round($cart_discount_after_tax, $this->dp);\n\t\t}\n\t\t\n\t\t$cart_discount = $cart_discounts_before_tax + $order_discounts_before_tax;\n\t\t$order_discount = $order_discount_after_tax + $cart_discount_after_tax;\n\t\t\n\t\t$total = round($line_item_total + $shipping_total + $total_tax - $order_discount, $this->dp) ;\n\t\t\n\t\t\t// Remove old tax rows\n\t\t$wpdb->query( $wpdb->prepare( \n\t\t\t\t\"DELETE FROM {$wpdb->prefix}woocommerce_order_itemmeta \n\t\t\t\t\tWHERE order_item_id IN ( \n\t\t\t\t\t\tSELECT order_item_id FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\t\t\tWHERE order_id = %d AND order_item_type = 'tax' )\", \n\t\t\t\t$this->id ) );\n\t\t\t\t\t\t\n\t\t$wpdb->query( $wpdb->prepare( \n\t\t\t\t\"DELETE FROM {$wpdb->prefix}woocommerce_order_items \n\t\t\t\t\tWHERE order_id = %d AND order_item_type = 'tax'\", \n\t\t\t\t$this->id) );\n\n\t\t\t\n\t\t\t// Get tax rates\n\t\t$rates = $wpdb->get_results( \n\t\t\t\t\"SELECT tax_rate_id, tax_rate_country, tax_rate_state, tax_rate_name, tax_rate_priority \n\t\t\t\t\tFROM {$wpdb->prefix}woocommerce_tax_rates ORDER BY tax_rate_name\" \n\t\t\t\t);\n\t\t\n\t\t$tax_codes = array();\n\n\t\tforeach( $rates as $rate ) \n\t\t{\n\t\t\t$code = array();\n\n\t\t\t$code[] = $rate->tax_rate_country;\n\t\t\t$code[] = $rate->tax_rate_state;\n\t\t\t$code[] = $rate->tax_rate_name ? sanitize_title( $rate->tax_rate_name ) : 'TAX';\n\t\t\t$code[] = absint( $rate->tax_rate_priority );\n\n\t\t\t$tax_codes[ $rate->tax_rate_id ] = strtoupper( implode( '-', array_filter( $code ) ) );\n\t\t}\n\n\t\t// Now merge to keep tax rows\n\t\tforeach ( array_keys( $taxes + $shipping_taxes ) as $key ) \n\t\t{\n\n\t\t \t$item \t\t\t\t\t\t\t= array();\n\t\t \t$item['rate_id']\t\t\t \t= $key;\n\t\t\t$item['name'] \t\t\t\t\t= isset($tax_codes[ $key ]) ? $tax_codes[ $key ] : '';\n\t\t\t$item['label'] \t\t\t\t\t= $tax->get_rate_label( $key );\n\t\t\t$item['compound'] \t\t\t\t= $tax->is_compound( $key ) ? 1 : 0;\n\t\t\t$item['tax_amount'] \t\t\t= wc_format_decimal( isset( $taxes[ $key ] ) ? $taxes[ $key ] : 0 );\n\t\t\t$item['shipping_tax_amount'] \t= wc_format_decimal( isset( $shipping_taxes[ $key ] ) ? $shipping_taxes[ $key ] : 0 );\n\n\t\t\tif ( ! $item['label'] )\n\t\t\t\t$item['label'] = WC()->countries->tax_or_vat();\n\n\t\t\t// Add line item\n\t\t \t$item_id = wc_add_order_item( $this->id, array(\n\t\t \t\t'order_item_name' \t\t=> $item['name'],\n\t\t \t\t'order_item_type' \t\t=> 'tax'\n\t\t \t) );\n\n\t\t \t// Add line item meta\n\t\t \tif ( $item_id ) {\n\t\t \t\twc_add_order_item_meta( $item_id, 'rate_id', $item['rate_id'] );\n\t\t \t\twc_add_order_item_meta( $item_id, 'label', $item['label'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'compound', $item['compound'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'tax_amount', $item['tax_amount'] );\n\t\t\t \twc_add_order_item_meta( $item_id, 'shipping_tax_amount', $item['shipping_tax_amount'] );\n\t\t \t}\n\t\t}\n\t\t\n\t\tupdate_post_meta( $this->id, '_order_total', \t\twc_format_decimal($total));\n\t\tupdate_post_meta( $this->id, '_order_tax',\t\t\twc_format_decimal(array_sum($taxes)));\n\t\tupdate_post_meta( $this->id, '_order_shipping', \twc_format_decimal($shipping_total));\n\t\tupdate_post_meta( $this->id, '_order_shipping_tax', wc_format_decimal(array_sum($shipping_taxes)));\n\t\tupdate_post_meta( $this->id, '_order_discount', \twc_format_decimal($order_discount));\n\t\tupdate_post_meta( $this->id, '_cart_discount', \t\twc_format_decimal($cart_discount));\n\t}", "public function refund($options);", "public function refund_mail_send($tourwise_id,$total_refund,$refund_date,$refund_mode){\n global $app_email_id, $app_name, $app_contact_no, $admin_logo_url, $app_website, $currency_logo;\n global $mail_em_style, $mail_em_style1, $mail_font_family, $mail_strong_style, $mail_color,$encrypt_decrypt,$secret_key;\n \n $sq_sq_train_info = mysql_fetch_assoc(mysql_query(\"select * from tourwise_traveler_details where id='$tourwise_id'\"));\n $date = $sq_sq_train_info['form_date'];\n $yr = explode(\"-\", $date);\n $year =$yr[0];\n $sq_total_tour_paid_amount = mysql_fetch_assoc(mysql_query(\"select sum(amount) as sum from payment_master where tourwise_traveler_id='$tourwise_id' and payment_for='Tour' and clearance_status!='Pending' AND clearance_status!='Cancelled'\"));\n\n $sq_total_travel_paid_amount = mysql_fetch_assoc(mysql_query(\"select sum(amount) as sum from payment_master where tourwise_traveler_id='$tourwise_id' and payment_for='Travelling' and clearance_status!='Pending' AND clearance_status!='Cancelled'\"));\n\n $paid_amount = $sq_total_travel_paid_amount['sum'] + ($sq_total_tour_paid_amount['sum']);\n $sq_tour_info = mysql_fetch_assoc(mysql_query(\"select * from refund_traveler_estimate where tourwise_traveler_id='$tourwise_id'\"));\n \n $cust_email = mysql_fetch_assoc(mysql_query(\"select * from customer_master where customer_id='$sq_sq_train_info[customer_id]'\"));\n $customer_email_id = $encrypt_decrypt->fnDecrypt($cust_email['email_id'], $secret_key);\n \n $content = '\n <tr>\n <table width=\"85%\" cellspacing=\"0\" cellpadding=\"5\" style=\"color: #888888;border: 1px solid #888888;margin: 0px auto;margin-top:20px; min-width: 100%;\" role=\"presentation\">\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Service Type</td> <td style=\"text-align:left;border: 1px solid #888888;\">Group Tour</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Selling Amount</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$currency_logo.' '.number_format($sq_sq_train_info['total_tour_fee'],2).'</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Paid Amount</td> <td style=\"text-align:left;border: 1px solid #888888;\" >'.$currency_logo.' '.number_format($paid_amount,2).'</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Cancellation Charges</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$currency_logo.' '.number_format($sq_tour_info['cancel_amount'],2).'</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Refund Amount</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$currency_logo.' '.number_format($total_refund,2).'</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Refund Mode</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$refund_mode.'</td></tr>\n <tr><td style=\"text-align:left;border: 1px solid #888888;\">Refund Date</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.get_date_user($refund_date).'</td></tr>\n </table>\n </tr>\n ';\n $subject = 'Group Tour Refund Confirmation (Booking ID : '.get_group_booking_id($tourwise_id,$year).' )';\n\n global $model;\n $model->app_email_send('27',$cust_email['first_name'],$customer_email_id, $content, $subject);\n }", "public function getTotalTaxAmount();", "function ewtComputation($total_purchased,$discount,$is_vat,$ewt){\n $total_amount = 0;\n $non_vat_value = $total_purchased;\n $ewt = ewtTypes($ewt);\n $vat = 0;\n if($is_vat == true){\n // for vat\n $vat = ( $total_purchased - $discount ) / 1.12;\n $non_vat_value = $vat;\n $vat = ( $total_purchased - $discount ) - $non_vat_value;\n $vat = round($vat,6);\n }else{\n $non_vat_value = $non_vat_value - $discount;\n }\n\n $total_amount = ( $non_vat_value ) + $vat ; // total amount less vat value\n $total_amount = round($total_amount,6);\n\n $ewt_amount = $non_vat_value * $ewt;\n if($ewt > 0) {\n $ewt_amount = $non_vat_value * $ewt;\n $ewt_amount = round($ewt_amount,6);\n }\n $non_vat_value = round($non_vat_value,6);\n\n $grand_total = $total_amount - $ewt_amount;\n $grand_total = round($grand_total,6);\n return array(\n 'total_purchased'=> $non_vat_value,\n 'total_amount'=> $total_amount,\n 'vat'=> $vat,\n 'ewt_base'=> $ewt,\n 'ewt_amount'=> $ewt_amount,\n 'grand_total'=> $grand_total,\n );\n}", "public function getSubtotalInclTax();", "private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}", "protected function calculate_fee_totals() {\n\t\t$this->get_fees_from_cart();\n\n\t\t$this->set_total( 'fees_total', array_sum( wp_list_pluck( $this->fees, 'total' ) ) );\n\t\t$this->set_total( 'fees_total_tax', array_sum( wp_list_pluck( $this->fees, 'total_tax' ) ) );\n\n\t\t$this->cart->fees_api()->set_fees( wp_list_pluck( $this->fees, 'object' ) );\n\t\t$this->cart->set_fee_total( wc_remove_number_precision_deep( array_sum( wp_list_pluck( $this->fees, 'total' ) ) ) );\n\t\t$this->cart->set_fee_tax( wc_remove_number_precision_deep( array_sum( wp_list_pluck( $this->fees, 'total_tax' ) ) ) );\n\t\t$this->cart->set_fee_taxes( wc_remove_number_precision_deep( $this->combine_item_taxes( wp_list_pluck( $this->fees, 'taxes' ) ) ) );\n\t}", "public function calculateTaxAction()\n {\n $data = $this->Request()->getParams();\n\n //init variables\n $positions = json_decode($data['positions']);\n $shippingCosts = $data['shippingCosts'];\n $net = $data['net'];\n $total = 0;\n $taxSums = [];\n $totalWithoutTax = 0;\n $articleNumber = 0;\n $shippingCostsNet = 0;\n\n foreach ($positions as $position) {\n $total += $position->price * $position->quantity;\n $priceWithoutTax = $this->calculateNetPrice($position->price, $position->taxRate) * $position->quantity;\n $totalWithoutTax += $priceWithoutTax;\n\n if (!isset($taxSums[$position->taxRate])) {\n $taxSums[$position->taxRate] = [];\n $taxSums[$position->taxRate]['sum'] = 0;\n $taxSums[$position->taxRate]['count'] = 0;\n }\n $taxSums[$position->taxRate]['sum'] += $this->calculateNetPrice($position->price, $position->taxRate);\n $taxSums[$position->taxRate]['count'] += $position->quantity;\n\n $articleNumber += $position->quantity;\n }\n\n if ($shippingCosts != 0 && !is_null($shippingCosts) && $shippingCosts != '') {\n foreach ($taxSums as $taxRate => $taxRow) {\n $taxRelation = $articleNumber / $taxRow['count'];\n $shippingCostsRelation = $shippingCosts / $taxRelation;\n\n $shippingCostsNet += $this->calculateNetPrice($shippingCostsRelation, $taxRate);\n }\n if (count($taxSums) == 0) {\n $shippingCostsNet = $shippingCosts;\n }\n }\n\n $sum = $total;\n if ($net === 'true') {\n $total = $shippingCostsNet + $total;\n } else {\n $total = $shippingCosts + $total;\n }\n $totalWithoutTax = $shippingCostsNet + $totalWithoutTax;\n\n $taxSum = $total - $totalWithoutTax;\n if ($totalWithoutTax == 0) {\n $taxSum = 0;\n }\n\n if ($net === 'true') {\n $shippingCosts = $shippingCostsNet;\n $totalWithoutTax = $total;\n $taxSum = 0;\n }\n\n $result = [\n 'totalWithoutTax' => $this->roundPrice($totalWithoutTax),\n 'sum' => $this->roundPrice($sum),\n 'total' => $this->roundPrice($total),\n 'shippingCosts' => $this->roundPrice($shippingCosts),\n 'shippingCostsNet' => $this->roundPrice($shippingCostsNet),\n 'taxSum' => $this->roundPrice($taxSum)\n ];\n\n $this->view->assign(\n [\n 'data' => $result,\n 'success' => true\n ]\n );\n }", "function reffer_amount() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue_sum('refferal_records', 'refferal_frnd_id', $user_id, 'refferal_amount');\n\t\t\t$user_reffer_amount = $records[0]['total'];\n\t\t\tif (!empty($user_reffer_amount)) {\n\t\t\t\t$user_reffer_amount = $user_reffer_amount;\n\t\t\t} else {\n\t\t\t\t$user_reffer_amount = '0';\n\t\t\t}\n\t\t\t$post = array(\"status\" => \"true\", 'reffer_amount' => $refferal_amount, 'user_total_reffer_amount' => $user_reffer_amount, 'user_id' => $user_id);\n\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", 'message' => 'missing parameter', 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function refundAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n /**\n * Initilize refund variables\n */\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Collect the produts from the order details.\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Check whether product id is in array\n */\n if (in_array ( $produtId, $orderPrdouctIds ) && $orderStatusFlag == 1) {\n\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $produtId, $orderId, Mage::getSingleton ( 'customer/session' )->getId (), '', 2 );\n\n try {\n\n /**\n * Sending order email\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n $adminEmailId = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n $toMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/email\" );\n $toName = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailId/name\" );\n /**\n * Select email template\n */\n if ($templateId) {\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load product collection for cancel\n */\n $productCollection = Mage::getModel ( 'catalog/product' )->getCollection ()->addAttributeToSelect ( '*' )->addUrlRewrite ()->addAttributeToFilter ( 'entity_id', array (\n 'eq' => $produtId\n ) );\n\n $productDetails = \"<ul>\";\n /**\n * Prepare product details for cancel email\n */\n foreach ( $productCollection as $product ) {\n $productDetails .= \"<li>\";\n $productDetails .= \"<div><a href='{$product->getProductUrl()}'>{$product->getName()}</a><div>\";\n $productDetails .= \"</li>\";\n }\n\n $productDetails .= \"</ul>\";\n /**\n * load order details\n * @var object\n */\n $incrementId = Mage::getModel ( 'sales/order' )->load ( $orderId )->getIncrementId ();\n\n /**\n * Get seller information.\n */\n $customer = Mage::getModel ( 'customer/customer' )->load ( $sellerId );\n /**\n * Initilize variable for send mail to seller\n */\n $sellerEmail = $customer->getEmail ();\n $sellerName = $customer->getName ();\n $recipient = $toMailId;\n $emailTemplate->setSenderName ( $sellerName );\n $emailTemplate->setSenderEmail ( $sellerEmail );\n\n /**\n * Prepare temail templave variables\n */\n $emailTemplateVariables = array (\n 'ownername' => $toName,\n 'productdetails' => $productDetails,\n 'order_id' => $incrementId,\n 'customer_email' => $sellerEmail,\n 'customer_firstname' => $sellerName,\n 'reason' => $this->__ ( 'Buyer wants to refund the item' ),\n 'requesttype' => $this->__ ( 'refund' ),\n 'requestperson' => $this->__ ( 'Seller' )\n );\n $emailTemplate->setDesignConfig ( array (\n 'area' => 'frontend'\n ) );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailTemplate->send ( $recipient, $toName, $emailTemplateVariables );\n\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"The item refund request has been sent.\" ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n /**\n * when error message occured, redirected to view order page.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Check the permission.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function getBaseTotalRefunded();", "public function __tallyUpInvoice() {\n\n $this->__itemTotals();\n\n $subTotal = $this->__subtotal($this->request->data['items']);\n\n //$taxTotal = $this->__tax($subTotal, $this->request->data['Invoice']['taxRate']);\n\n //$taxTotal = $this->__tax($this->request->data['items']);\n\n //$this->request->data['total'] = $subTotal + $taxTotal;\n $this->request->data['total'] = $subTotal;\n\n //$this->request->data['subTotal'] = $subTotal;\n\n //$this->request->data['taxTotal'] = $taxTotal;\n\n return true;\n }", "function restaurant_check($meal,$tax,$tip){\n $tax_amount=$meal*($tax/100);\n $tip_amount=$meal*($tip/100);\n $total_amount=$meal+$tax_amount+$tip_amount;\n return $total_amount;\n}", "public function calculate_char_total_tax($start, $end, $owner_id) {\n\t\tglobal $wpdb;\n\t\t$summ = null;\n\t\t\n\t\t$sql = \"SELECT * FROM `\" . $wpdb->prefix . \"tr_ratting_data` WHERE `date_acquired` BETWEEN '\" . $start . \"' AND '\" . $end . \"' AND `owner_id`='\" . $owner_id . \"'\";\n\t\t// echo $ql;\n\t\t$arry_of_ticks = $wpdb->get_results ( \"$sql\", ARRAY_A );\n\t\t\n\t\t// echo var_dump($arry_of_ticks);\n\t\t\n\t\tif (count ( $arry_of_ticks ) > 0) {\n\t\t\t\n\t\t\tforeach ( $arry_of_ticks as $tick ) {\n\t\t\t\t\n\t\t\t\t$summ += $tick ['amount'];\n\t\t\t}\n\t\t}\n\t\treturn $summ;\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}", "public function getShippingTaxRefunded();", "function BuyableCalculatedAdditionalTax(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->AdditionalTax();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->AdditionalTax();\n\t}", "public function get_total_tax_refunded( $order ) {\n\t\tglobal $wpdb;\n\n\t\t$total = $wpdb->get_var( $wpdb->prepare( \"\n\t\t\tSELECT SUM( order_itemmeta.meta_value )\n\t\t\tFROM {$wpdb->prefix}woocommerce_order_itemmeta AS order_itemmeta\n\t\t\tINNER JOIN $wpdb->posts AS posts ON ( posts.post_type = 'shop_order_refund' AND posts.post_parent = %d )\n\t\t\tINNER JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON ( order_items.order_id = posts.ID AND order_items.order_item_type = 'tax' )\n\t\t\tWHERE order_itemmeta.order_item_id = order_items.order_item_id\n\t\t\tAND order_itemmeta.meta_key IN ('tax_amount', 'shipping_tax_amount')\n\t\t\", $order->get_id() ) );\n\n\t\treturn abs( $total );\n\t}", "public function getRefundAmount()\n {\n return $this->refundAmount;\n }", "public function getAmountRefunds()\n {\n return $this->getIfSet('refunds', $this->data->amount);\n }", "public function testPostTaxTotal()\n {\n $items = [1, 2, 5, 8];\n $tax = 0.20;\n $coupon = null;\n\n // Create a mock receipt class\n $Receipt = $this->getMockBuilder('TDD\\Receipt')\n ->setMethods(['tax', 'total'])\n ->getMock();\n\n // Make sure that the total method in mock Receipt will return 10.00\n $Receipt->expects($this->once())// Total assumes it will be called once\n ->method('total')\n ->with($items, $coupon)// Make sure total is called with these values\n ->will($this->returnValue(10.00));\n\n // Make sure that the tax method in mock Receipt will return 1.00\n $Receipt->expects($this->once())// Tax assumes it will be called once\n ->method('tax')\n ->with(10.00, $tax)// Make sure tax is called with these values\n ->will($this->returnValue(1.00));\n\n // Execute postTaxTotal with random values\n $result = $Receipt->postTaxTotal([1, 2, 5, 8], 0.20, null);\n $this->assertEquals(\n 11.00, // Expected value\n $result // Value returned by postTaxTotal() using mocked values 10.00 and 1.00\n );\n }", "public function get_company_invoice_payment_refund() {\n $invoice = $this->input->post('invoice');\n $data = $this->classtraineemodel->company_invoice($invoice);\n if ($data->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($data->company_id);\n $data->company_name = $tenant_details->tenant_name;\n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $data->company_id);\n $data->company_name = $company_details[0]->company_name;\n }\n $data->discount_label = rtrim($this->course->get_metadata_on_parameter_id($data->discount_type), ', ');\n $gst_label = ($data->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($data->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($data->gst_rule), ', ');\n }\n $data->gst_label = $gst_label;\n $data->inv_date = date('d/m/Y', strtotime($data->inv_date));\n $data->amount_refund = round($data->amount_refund, 2);\n $refund_details = $refund_details = $this->classtraineemodel->get_refund_paid_details($invoice);\n foreach ($refund_details as $k => $row) {\n if ($row->refnd_reason != 'OTHERS') {\n $refund_details[$k]->refnd_reason = $this->course->get_metadata_on_parameter_id($row->refnd_reason);\n } else {\n $refund_details[$k]->refnd_reason = 'Others (' . $row->refnd_reason_ot . ')';\n }\n\n $refund_details[$k]->refund_on = date('d/m/Y', strtotime($row->refund_on));\n $refund_details[$k]->mode_of_refund = $this->course->get_metadata_on_parameter_id($row->mode_of_refund);\n }\n $res = array('data' => $data, 'refund' => $refund_details);\n echo json_encode($res);\n exit();\n }", "public function woocommerce_monthly_taxes() {\n\t\t// TODO Implement Monthly Taxes report\n\t\tglobal $start_date, $end_date, $woocommerce, $wpdb;\n\t\t$this->set_reporting_flag(true);\n\n\t\t$first_year = $wpdb->get_var(\"SELECT post_date FROM $wpdb->posts WHERE post_date != 0 ORDER BY post_date ASC LIMIT 1;\");\n\n\t\tif($first_year) {\n\t\t\t$first_year = date('Y', strtotime($first_year));\n\t\t}\n\t\telse {\n\t\t\t$first_year = date('Y');\n\t\t}\n\n\t\t$current_year = isset($_POST['show_year']) \t? $_POST['show_year'] \t: date('Y', current_time('timestamp'));\n\t\t$start_date = strtotime($current_year . '0101');\n\n\t\t$total_tax = $total_sales_tax = $total_shipping_tax = $count = 0;\n\t\t$taxes = $tax_rows = $tax_row_labels = array();\n\n\t\tfor($count = 0; $count < 12; $count++) {\n\t\t\t$time = strtotime(date('Ym', strtotime('+ ' . $count . ' MONTH', $start_date)) . '01');\n\n\t\t\tif($time > current_time('timestamp')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$month = date('Ym', strtotime(date('Ym', strtotime('+ ' . $count . ' MONTH', $start_date)) . '01'));\n\n\t\t\t$gross = $wpdb->get_var($wpdb->prepare(\"\n\t\t\t\tSELECT SUM(meta.meta_value) AS order_tax\n\t\t\t\tFROM {$wpdb->posts} AS posts\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id\n\t\t\t\tLEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID=rel.object_ID\n\t\t\t\tLEFT JOIN {$wpdb->term_taxonomy} AS tax USING(term_taxonomy_id)\n\t\t\t\tLEFT JOIN {$wpdb->terms} AS term USING(term_id)\n\t\t\t\tWHERE \tmeta.meta_key \t\t= '_order_total_base_currency'\n\t\t\t\tAND \tposts.post_type \t= 'shop_order'\n\t\t\t\tAND \tposts.post_status \t= 'publish'\n\t\t\t\tAND \ttax.taxonomy\t\t= 'shop_order_status'\n\t\t\t\tAND\t\tterm.slug\t\t\tIN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')\n\t\t\t\tAND\t\t%s\t\t\t\t\t= date_format(posts.post_date,'%%Y%%m')\n\t\t\t\", $month));\n\n\t\t\t$shipping = $wpdb->get_var($wpdb->prepare(\"\n\t\t\t\tSELECT SUM(meta.meta_value) AS order_tax\n\t\t\t\tFROM {$wpdb->posts} AS posts\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id\n\t\t\t\tLEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID=rel.object_ID\n\t\t\t\tLEFT JOIN {$wpdb->term_taxonomy} AS tax USING(term_taxonomy_id)\n\t\t\t\tLEFT JOIN {$wpdb->terms} AS term USING(term_id)\n\t\t\t\tWHERE \tmeta.meta_key \t\t= '_order_shipping_base_currency'\n\t\t\t\tAND \tposts.post_type \t= 'shop_order'\n\t\t\t\tAND \tposts.post_status \t= 'publish'\n\t\t\t\tAND \ttax.taxonomy\t\t= 'shop_order_status'\n\t\t\t\tAND\t\tterm.slug\t\t\tIN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')\n\t\t\t\tAND\t\t%s\t\t \t\t\t= date_format(posts.post_date,'%%Y%%m')\n\t\t\t\", $month));\n\n\t\t\t$order_tax = $wpdb->get_var($wpdb->prepare(\"\n\t\t\t\tSELECT SUM(meta.meta_value) AS order_tax\n\t\t\t\tFROM {$wpdb->posts} AS posts\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id\n\t\t\t\tLEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID=rel.object_ID\n\t\t\t\tLEFT JOIN {$wpdb->term_taxonomy} AS tax USING(term_taxonomy_id)\n\t\t\t\tLEFT JOIN {$wpdb->terms} AS term USING(term_id)\n\t\t\t\tWHERE \tmeta.meta_key \t\t= '_order_tax_base_currency'\n\t\t\t\tAND \tposts.post_type \t= 'shop_order'\n\t\t\t\tAND \tposts.post_status \t= 'publish'\n\t\t\t\tAND \ttax.taxonomy\t\t= 'shop_order_status'\n\t\t\t\tAND\t\tterm.slug\t\t\tIN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')\n\t\t\t\tAND\t\t%s\t\t \t\t\t= date_format(posts.post_date,'%%Y%%m')\n\t\t\t\", $month));\n\n\t\t\t$shipping_tax = $wpdb->get_var($wpdb->prepare(\"\n\t\t\t\tSELECT SUM(meta.meta_value) AS order_tax\n\t\t\t\tFROM {$wpdb->posts} AS posts\n\t\t\t\tLEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_id\n\t\t\t\tLEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID=rel.object_ID\n\t\t\t\tLEFT JOIN {$wpdb->term_taxonomy} AS tax USING(term_taxonomy_id)\n\t\t\t\tLEFT JOIN {$wpdb->terms} AS term USING(term_id)\n\t\t\t\tWHERE \tmeta.meta_key \t\t= '_order_shipping_tax_base_currency'\n\t\t\t\tAND \tposts.post_type \t= 'shop_order'\n\t\t\t\tAND \tposts.post_status \t= 'publish'\n\t\t\t\tAND \ttax.taxonomy\t\t= 'shop_order_status'\n\t\t\t\tAND\t\tterm.slug\t\t\tIN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')\n\t\t\t\tAND\t\t%s\t\t \t\t\t= date_format(posts.post_date,'%%Y%%m')\n\t\t\t\", $month));\n\n\t\t\t$tax_rows = $wpdb->get_results($wpdb->prepare(\"\n\t\t\t\tSELECT\n\t\t\t\t\torder_items.order_item_name as name,\n\t\t\t\t\tSUM(order_item_meta.meta_value) as tax_amount,\n\t\t\t\t\tSUM(order_item_meta_2.meta_value) as shipping_tax_amount,\n\t\t\t\t\tSUM(order_item_meta.meta_value + order_item_meta_2.meta_value) as total_tax_amount\n\n\t\t\t\tFROM \t\t{$wpdb->prefix}woocommerce_order_items as order_items\n\n\t\t\t\tLEFT JOIN \t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id\n\t\t\t\tLEFT JOIN \t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON order_items.order_item_id = order_item_meta_2.order_item_id\n\n\t\t\t\tLEFT JOIN \t{$wpdb->posts} AS posts ON order_items.order_id = posts.ID\n\t\t\t\tLEFT JOIN \t{$wpdb->term_relationships} AS rel ON posts.ID = rel.object_ID\n\t\t\t\tLEFT JOIN \t{$wpdb->term_taxonomy} AS tax USING(term_taxonomy_id)\n\t\t\t\tLEFT JOIN \t{$wpdb->terms} AS term USING(term_id)\n\n\t\t\t\tWHERE \t\torder_items.order_item_type = 'tax'\n\t\t\t\tAND \t\tposts.post_type \t= 'shop_order'\n\t\t\t\tAND \t\tposts.post_status \t= 'publish'\n\t\t\t\tAND \t\ttax.taxonomy\t\t= 'shop_order_status'\n\t\t\t\tAND\t\t\tterm.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')\n\t\t\t\tAND\t\t\t%s = date_format(posts.post_date,'%%Y%%m')\n\t\t\t\tAND \t\torder_item_meta.meta_key = 'tax_amount'\n\t\t\t\tAND \t\torder_item_meta_2.meta_key = 'shipping_tax_amount'\n\n\t\t\t\tGROUP BY \torder_items.order_item_name\n\t\t\t\", $month));\n\n\t\t\tif($tax_rows) {\n\t\t\t\tforeach ($tax_rows as $tax_row) {\n\t\t\t\t\tif ($tax_row->total_tax_amount > 0)\n\t\t\t\t\t\t$tax_row_labels[] = $tax_row->name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$taxes[date('M', strtotime($month . '01'))] = array(\n\t\t\t\t'gross' => $gross,\n\t\t\t\t'shipping' => $shipping,\n\t\t\t\t'order_tax' => $order_tax,\n\t\t\t\t'shipping_tax' => $shipping_tax,\n\t\t\t\t'total_tax' => $shipping_tax + $order_tax,\n\t\t\t\t'tax_rows' => $tax_rows\n\t\t\t);\n\n\t\t\t$total_sales_tax += $order_tax;\n\t\t\t$total_shipping_tax += $shipping_tax;\n\t\t}\n\t\t$total_tax = $total_sales_tax + $total_shipping_tax;\n\n\t\tinclude($this->get_view('woocommerce_monthly_taxes.php'));\n\t\t$this->set_reporting_flag(false);\n\t}", "public function getBaseSubtotalRefunded();", "public function getRefundAmount()\n {\n return $this->refund_amount;\n }", "public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }", "public function getDiscountTaxCompensationAmount();", "public function getTaxCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->TotalTax) {\n $total += $item->TotalTax;\n }\n }\n\n if ($this->postage && $this->postage->Cost && $this->postage->Tax) {\n $total += ($this->postage->Cost / 100) * $this->postage->Tax;\n }\n \n return $total;\n }", "public function getSubtotalInvoiced();", "function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}", "public function getRefundFromTransactionFee()\n {\n return $this->refund_from_transaction_fee;\n }", "function tep_calculate_tax($price, $tax) {\n return $price * $tax / 100;\n }", "public function getTaxedPrice();", "public function getRefundAmount()\n {\n if ($this->orderRefund === null) {\n return new Money('0');\n }\n return $this->orderRefund->getRefundAmount();\n }", "protected function addDonationToFundraisersTotalRaise()\n {\n $this->fundraiser_profile->addDonation( $this->data['amount'] );\n $this->fundraiser_profile->update();\n }", "function testTaxModifier() {\n\t\t$this->get('product-1b/add');\n\t\t$this->get('product-1b/add');\n\n\t\t/* Log our NZ member in so we can assert they see the GST component */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t\n\t\t/* 12.5% GST appears to our NZ user logged in */\n\t\t$this->get('checkout/');\n\t\t$this->assertPartialMatchBySelector('tr.taxmodifier td', array(\n\t\t\t'12.5% GST (included in the above price)'\n\t\t));\n\n\t\t/* Let's check the totals to make sure GST wasn't being added (which is important!) */\n\t\t/* NZD is shown as the label, since it was set as the site currency in setUp() */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,205.00 NZD');\n\t\t\n\t\t/* Let's sneakily change the GST to be exclusive, altering the checkout total */\n\t\tTaxModifier::set_for_country('NZ', 0.125, 'GST', 'exclusive');\n\t\t\n\t\t/* See what the checkout page has got now */\n\t\t$this->get('checkout/');\n\t\t\n\t\t/* Check the total, it has changed since the GST is now exclusive */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,355.63 NZD');\n\t\t\t\t\n\t\t/* Member logs out */\n\t\t$this->session()->inst_set('loggedInAs', null);\n\t}", "public function getBaseTaxInvoiced();", "function calculatePriceForRabatt(){\r\n// @ToDo remove static Values \r\n\r\n\t $basketIns = array_merge($this->basket->get_articles_by_article_type_uid_asuidlist(1)); //,$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']),$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType'])); // 4 and 5\r\n\t $value = array('net'=>0,'gross'=>0);\r\n\t \r\n\t foreach ($basketIns as $itemObjId) {\r\n\t\t$temp = $this->basket->basket_items[$itemObjId];\r\n\t\t$temp->recalculate_item_sums();\r\n\t\t\r\n\t\t$value['net'] += $temp->get_item_sum_net();\r\n\t\t$value['gross'] += $temp->get_item_sum_gross();\r\n\t }\r\n\r\n\t if($value['net']< 0){\r\n\t\t$value['net'] = 0;\r\n\t }\r\n\r\n\t if($value['gross'] < 0){\r\n\t\t$value['gross'] = 0;\r\n\t }\r\n\t return $value;\r\n\t}", "public function fillPayArrearsRpt(Request $request)\n {\n $TF = new TermFee();\n $YTFO = $TF->getYrlyTFoutstanding($request->year,$request->term);\n return $YTFO;\n }", "public function getTotalRefundToBuyer()\n {\n return $this->totalRefundToBuyer;\n }", "function tep_calculate_tax($price, $tax) {\n global $currencies;\n\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n}", "public function getTaxTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getTaxTotal();\n }\n\n // Add any tax from postage\n $total += $this->PostageTax;\n\n return $total;\n }", "function agst_pmpro_tax($tax, $values, $order)\n{ \t\n\t$tax = round((float)$values[price] * 0.1, 2);\n\treturn $tax;\n}", "public function getRefundableAmount()\n {\n $amount = $this->getAmount()->subtract($this->getRefundedAmount());\n\n return $amount->isNegative() ? new Money(0, $this->amount->getCurrency()) : $amount;\n }", "function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function addRefund($bill, $refund, $order);", "public function getBaseDiscountTaxCompensationRefunded();", "public function get_total_ex_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_total_ex_tax', wc_price( max( 0, $this->get_total( 'edit' ) - $this->get_total_tax() ) ) );\n\t}", "public function getFeeIncludingAllTaxes()\n {\n return $this->fee_including_all_taxes;\n }", "public function get_company_updatepayment() {\n $invoice_id = $this->input->post('invoice');\n $company_id = $this->input->post('company');\n $company_received = $this->classtraineemodel->company_payment_recd($invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = $v->amount_recd;\n }\n $company_invoice = $this->classtraineemodel->company_invoice($invoice_id);\n $company_invoice->discount_label = rtrim($this->course->get_metadata_on_parameter_id($company_invoice->discount_type), ', ');\n \n //$company_invoice->total_inv_amount = number_format((float)round($company_invoice->total_inv_amount,1), 2, '.', '');\n \n $gst_label = ($company_invoice->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($company_invoice->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($company_invoice->gst_rule), ', ');\n }\n $company_invoice->gst_label = $gst_label;\n $company_received = $this->classtraineemodel->company_payment_refund($invoice_id);\n $user_refund = array();\n foreach ($company_received as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n $company_invoice->user_refunded = $user_refund;\n $company_invoice->trainees = $this->classtraineemodel->get_company_trainees_by_payid($company_invoice->pymnt_due_id);\n foreach ($company_invoice->trainees as $k => $row) {\n $amount_paid = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $company_invoice->trainees[$k]->amount_paid = $amount_paid;\n $amt_refunded = (!empty($user_refund[$row->user_id]))?$user_refund[$row->user_id]:0;\n $company_invoice->trainees[$k]->amount_remain = round(($row->total_amount_due - $amount_paid + $amt_refunded), 2);\n// $company_invoice->trainees[$k]->amount_remain = round(($row->total_amount_due - $amount_paid + $amt_refunded), 3);skm\n }\n// print_r($company_invoice);\n ///added by shubhranshu to disable the update payment dropdown for everest\n $company_invoice->tenant_id = $this->tenant_id;\n echo json_encode($company_invoice);\n \n exit();\n }", "function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}", "public function refund();", "public function refund_report_pdf() {\n $tenant_id = $this->tenant_id;\n $company = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $companies = array();\n foreach ($company as $row) {\n $companies[$row->company_id] = $row->company_name;\n }\n $company = $this->input->get('company');\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'inv.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_refund_paid($tenant_id, NULL, NULL, $field, $order_by, $company, $invoice_id, $start_date, $end_date);\n $invs = array();\n foreach ($tabledata as $k => $row) {\n if ($row->refnd_reason == 'OTHERS') {\n $tabledata[$k]->refnd_reason = \"Others (\" . $row->refnd_reason_ot . \")\";\n } else {\n $tabledata[$k]->refnd_reason = $this->courseModel->get_metadata_on_parameter_id($row->refnd_reason);\n }\n if ($row->refund_type == 'INDV') {\n $invs[$row->invoice_id] = $row->invoice_id;\n }\n }\n $tb_user = $this->reportsModel->get_refund_paid_user($invs);\n $tableuser = array();\n foreach ($tb_user as $row) {\n $tableuser[$row->invoice_id]['name'] = $row->first_name . ' ' . $row->last_name;\n $tableuser[$row->invoice_id]['taxcode'] = $this->mask_format($row->tax_code);\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return refunds_report_pdf($tabledata, $tableuser, $tenant_details, $companies);\n }", "public function returnSellPost(Request $request)\n { \n $transactionId = $request->get('transaction_id');\n $transaction = Transaction::find($transactionId);\n \n if (!$transaction) {\n return redirect()->back()->withMessage('Transaction was not found.');\n }\n\n $previousTotal = $transaction->total;\n $previosInvoiceTax = $transaction->invoice_tax;\n //$previosProductTax = $transaction->total_tax - $previosInvoiceTax;\n\n $total = 0;\n $updatedCostPrice = 0;\n $total_product_tax = 0;\n $total_return_quantity = 0;\n\n $client = Client::find($transaction->client_id);\n $due = $client->transactions->sum('net_total') - $client->payments->where('type', 'credit')->sum('amount');\n\n foreach ($transaction->sells as $sell) {\n\n $returnQuantity = intval($request->get('quantity_'. $sell->id)) ?: 0;\n $total_return_quantity += $returnQuantity;\n\n //new\n $unitProductTax = $sell->product_tax / $sell->quantity;\n \n if ($returnQuantity === 0) {\n $total = $total + $sell->sub_total;\n $total_product_tax = $total_product_tax + $sell->product_tax;\n continue;\n }\n\n $returnUnitPrice = floatval($request->get('unit_price_'. $sell->id));\n \n $sellId = $request->get('sell_'. $sell->id);\n\n $sell = Sell::find($sellId);\n\n if($returnQuantity > $sell->quantity){\n $warning = \"Return Quantity (\".$returnQuantity.\") Can't be greater than the Selling Quantity (\".$sell->quantity.\")\";\n return redirect()->back()->withWarning($warning);\n }\n\n $updatedSellQuantity = $sell->quantity - $returnQuantity;\n $updatedProductTax = $unitProductTax * $updatedSellQuantity;\n $subTotal = $updatedSellQuantity * $returnUnitPrice;\n\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $return_tax_amount = (settings('invoice_tax_rate') * ($returnQuantity * $returnUnitPrice)) / 100;\n }else{\n $return_tax_amount = settings('invoice_tax_rate');\n }\n }else{\n $return_tax_amount = 0;\n }\n\n $sell->quantity = $updatedSellQuantity;\n $sell->sub_total = $subTotal;\n $sell->product_tax = $updatedProductTax;\n $sell->save();\n\n //update the cost price to deduct from transaction table\n $updatedCostPrice += $returnQuantity * $sell->unit_cost_price;\n\n $product = $sell->product;\n $currentStock = $product->quantity;\n $product->quantity = $currentStock + $returnQuantity;\n $product->save();\n \n $total += $subTotal;\n $total_product_tax = $total_product_tax + $updatedProductTax;\n\n // Save Return statement\n $return = new ReturnTransaction;\n $return->sells_id = $sell->id;\n $return->client_id = $sell->client_id;\n $return->return_vat = $unitProductTax * $returnQuantity;\n $return->sells_reference_no = $sell->reference_no;\n $return->return_units = $returnQuantity;\n $return->return_amount = ($returnQuantity * $returnUnitPrice) + $return_tax_amount + ($unitProductTax * $returnQuantity);\n $return->returned_by = \\Auth::user()->id;\n $return->save();\n }\n\n //invoice tax\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $invoice_tax = (settings('invoice_tax_rate') * $total) / 100;\n }else{\n $invoice_tax = settings('invoice_tax_rate');\n }\n }else{\n $invoice_tax = 0;\n }\n //ends\n\n if($total_return_quantity <= 0){\n $quantityerror = \"You Can't return Zero Quantity\";\n return redirect()->back()->withQuantityerror($quantityerror);\n }\n \n //update transaction for this return\n $transaction->total = $total;\n $transaction->invoice_tax = $invoice_tax;\n $transaction->total_tax = $total_product_tax + $invoice_tax;\n $transaction->net_total = $total + $invoice_tax + $transaction->labor_cost + $total_product_tax;\n $transaction->total_cost_price = $transaction->total_cost_price - $updatedCostPrice;\n $transaction->return = true;\n $transaction->save();\n\n $diff = ( $previousTotal + $previosInvoiceTax /*+ $previosProductTax*/) - ($total + $invoice_tax + $total_product_tax);\n\n //if difference is greater than due amount then we need to return some money to the customer\n if ($diff > $due) {\n $payment = new Payment;\n $payment->client_id = $client->id;\n $payment->amount = $due < 0 ? $diff : $diff - $due;\n $payment->method = 'cash';\n $payment->type = \"return\";\n $payment->reference_no = $transaction->reference_no;\n $payment->note = \"Return for \".$transaction->reference_no;\n $payment->save();\n }\n\n return redirect()->route('sell.index');\n }", "public function getAmountRefunded()\n {\n return $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded;\n }", "public function getBaseTotalInvoiced();", "function tep_add_tax($price, $tax, $override = false) {\n if ( ( (DISPLAY_PRICE_WITH_TAX == 'true') || ($override == true) ) && ($tax > 0) ) {\n return $price + tep_calculate_tax($price, $tax);\n } else {\n return $price;\n }\n }", "public function getRefundedAmount()\n {\n $refunded = new Money(0, $this->amount->getCurrency());\n\n foreach ($this->refunds as $refund) {\n $refunded = $refunded->add($refund->getAmount());\n }\n\n return $refunded;\n }", "function calcTotals(){\n\t\t\n\t\tif($this->Review == true){/*\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_percent` FROM `billship_tax_states` WHERE `tax_state` = '\".$this->CustBill['State'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_percent FROM billship_tax_states WHERE tax_state = '\".$this->CustBill['State'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_percent']/100);\n\t\t\t}\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_count_percent` FROM `billship_tax_county` WHERE `tax_count_zip` = '\".$this->CustBill['Zip'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_count_percent FROM billship_tax_county WHERE tax_count_zip = '\".$this->CustBill['Zip'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_count_percent']/100);\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Totals['Ship2'] > 0){\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_price` >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_price >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t\t\t\t\n\t\t\t\tif($getRate->TotalRows() == 0){\n\t\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_upper` = 'y';\");\n\t\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_upper = 'y';\");\n\t\t\t\t}\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t$test_1 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_2 = $this->Totals['Total']*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_weight` >= '$weight';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_weight >= '$weight';\");\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t\n\t\t\t\t$test_3 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_4 = $total*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$this->Totals['Ship2'] = ($test_1 < $test_2) ? $test_2 : $test_1;\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_3) ? $test_3 : $this->Totals['Ship2'];\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_4) ? $test_4 : $this->Totals['Ship2'];\n\t\t\t\tif(strlen(trim($this->Totals['Ship2'])) > 0) $this->Totals['Ship'] = $this->Totals['Ship2'];\n\t\t\t}\n\t\t*/\n\t\t}\n\t\t$this->Totals['Grand'] = $this->Totals['Total']+$this->Totals['Ship']+$this->Totals['Tax']-$this->Totals['Disc']+$this->Totals['Ext']+$this->Totals['Freight'];\n\t}", "public function getTaxRefunded() {\n return $this->item->getTaxRefunded();\n }", "public function refund($requestParameters = array());", "public function calculateVoucherAmount(){\n return $this->getBrutto() -\n $this->getCommBruttoTotal();\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function refund_order(Refund $refund,RetailerOrder $order){\n $walletController = new WalletController();\n if ($order->has_user != null) {\n $user = User::find($order->has_user->id);\n if ($user->has_wallet == null) {\n\n $wallet = $walletController->wallet_create($order->has_user->id);\n } else {\n $wallet = $user->has_wallet;\n }\n } else {\n $shop = $order->has_store;\n if (count($shop->has_user) > 0) {\n if ($shop->has_user[0]->has_wallet == null) {\n $wallet = $walletController->wallet_create($shop->has_user[0]->id);\n } else {\n $wallet = $shop->has_user[0]->has_wallet;\n }\n }\n else {\n return redirect()->back()->with('error', 'Order Cant Refund Automatically Because No Wallet Found!');\n }\n }\n\n $wallet->available = $wallet->available+(double)$order->cost_to_pay;\n $wallet->save();\n /*Wallet Log*/\n $wallet_log = new WalletLog();\n $wallet_log->wallet_id = $wallet->id;\n $wallet_log->status = \"Top-up through Refund\";\n $wallet_log->amount = $order->cost_to_pay;\n $wallet_log->message = 'A Top-up of Amount '.number_format($order->cost_to_pay,2).' USD On Behalf on Refund '.$order->name.' Against Wallet ' . $wallet->wallet_token . ' At ' . now()->format('d M, Y h:i a');\n $wallet_log->save();\n\n /*Refund Order*/\n $order->status = 'cancelled';\n $order->paid = 2;\n $order->save();\n /*Order Log*/\n $order_log = new OrderLog();\n $order_log->message = \"An amount of \".$order->cost_to_pay.\" USD refunded to Wallet on \".now()->format('d M, Y h:i a');\n $order_log->status = \"refunded\";\n $order_log->retailer_order_id = $order->id;\n $order_log->save();\n\n $refund->status_id = 4;\n $refund->status = 'Closed';\n $refund->save();\n\n $tl = new RefundLog();\n $tl->message = 'A Refund Generated \"'.$refund->title.'\" against \"'.$order->name.'\" at '.now()->format('d M, Y h:i a');\n $tl->status = \"Generated\";\n $tl->refund_id = $refund->id;\n $tl->save();\n\n $this->notify->generate('Refund','Order Refund',$order->name.' Refund Approved',$refund);\n $this->inventory->OrderQuantityUpdate($order,'refund');\n return redirect()->back()->with('success','Order Refunded Successfully!');\n\n\n }", "function tep_calculate_tax($price, $tax) {\n global $currencies;\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }", "protected function addTotals($invoice, $request, $taxes, $sub_total, $discount_total, $tax_total)\n {\n if (!empty($request['totals'])) {\n $sort_order = 1;\n\n foreach ($request['totals'] as $total) {\n $total['invoice_id'] = $invoice->id;\n\n if (empty($total['sort_order'])) {\n $total['sort_order'] = $sort_order;\n }\n\n InvoiceTotal::create($total);\n\n $sort_order++;\n }\n\n return;\n }\n\n $sort_order = 1;\n\n // Added invoice sub total\n InvoiceTotal::create([\n 'company_id' => $request['company_id'],\n 'invoice_id' => $invoice->id,\n 'code' => 'sub_total',\n 'name' => 'invoices.sub_total',\n 'amount' => $sub_total,\n 'sort_order' => $sort_order,\n ]);\n\n $sort_order++;\n\n // Added invoice discount\n if ($discount_total) {\n InvoiceTotal::create([\n 'company_id' => $request['company_id'],\n 'invoice_id' => $invoice->id,\n 'code' => 'discount',\n 'name' => 'invoices.discount',\n 'amount' => $discount_total,\n 'sort_order' => $sort_order,\n ]);\n\n // This is for total\n $sub_total = $sub_total - $discount_total;\n\n $sort_order++;\n }\n\n // Added invoice taxes\n if (isset($taxes)) {\n foreach ($taxes as $tax) {\n InvoiceTotal::create([\n 'company_id' => $request['company_id'],\n 'invoice_id' => $invoice->id,\n 'code' => 'tax',\n 'name' => $tax['name'],\n 'amount' => $tax['amount'],\n 'sort_order' => $sort_order,\n ]);\n\n $sort_order++;\n }\n }\n\n // Added invoice total\n InvoiceTotal::create([\n 'company_id' => $request['company_id'],\n 'invoice_id' => $invoice->id,\n 'code' => 'total',\n 'name' => 'invoices.total',\n 'amount' => $sub_total + $tax_total,\n 'sort_order' => $sort_order,\n ]);\n }", "protected function get_merged_taxes( $in_cents = false, $types = array( 'items', 'fees', 'shipping' ) ) {\n\t\t$items = array();\n\t\t$taxes = array();\n\n\t\tif ( is_string( $types ) ) {\n\t\t\t$types = array( $types );\n\t\t}\n\n\t\tforeach ( $types as $type ) {\n\t\t\tif ( isset( $this->$type ) ) {\n\t\t\t\t$items = array_merge( $items, $this->$type );\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $items as $item ) {\n\t\t\tforeach ( $item->taxes as $rate_id => $rate ) {\n\t\t\t\tif ( ! isset( $taxes[ $rate_id ] ) ) {\n\t\t\t\t\t$taxes[ $rate_id ] = 0;\n\t\t\t\t}\n\t\t\t\t$taxes[ $rate_id ] += $this->round_line_tax( $rate );\n\t\t\t}\n\t\t}\n\n\t\treturn $in_cents ? $taxes : wc_remove_number_precision_deep( $taxes );\n\t}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "public function getBaseShippingTaxRefunded();", "public function getTaxcharges()\n {\n return $this->taxcharges;\n }", "public function getflatInvoice() {\r\n $result = $this->clients->flatInvoice();\r\n\r\n foreach ($result as $key => $value) {\r\n $clientId = $this->clients->getClientId($value->CustomerCompanyID);\r\n $result[$key]->ClientId = $clientId;\r\n }\r\n\r\n foreach ($result as $key => $value) {\r\n $getTaxdetails = $this->clients->getVatfaltType($value->ClientId);\r\n $PercentRateAfterEndDate = $getTaxdetails->PercentRateAfterEndDate;\r\n $StartDate = $getTaxdetails->StartDate;\r\n $EndDate = $getTaxdetails->EndDate;\r\n $PercentRate = $getTaxdetails->PercentRate;\r\n\r\n $result[$key]->Type = $Type;\r\n $result[$key]->PercentRateAfterEndDate = $PercentRateAfterEndDate;\r\n $result[$key]->StartDate = $StartDate;\r\n $result[$key]->EndDate = $EndDate;\r\n $result[$key]->PercentRate = $PercentRate;\r\n }\r\n foreach ($result as $key => $vat_listing) {\r\n $FlatRate = '';\r\n $NetSales = '';\r\n if (empty($vat_listing->Type) && empty($vat_listing->PercentRateAfterEndDate) && empty($vat_listing->PercentRate)) {\r\n $var = array('FlatRate' => 0, 'NetSales' => $vat_listing->InvoiceTotal);\r\n } else {\r\n if ($vat_listing->InvoiceTotal != 0 && $vat_listing->PaidOn != '') {\r\n if (strtotime($vat_listing->PaidOn) <= strtotime($vat_listing->EndDate)) {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRateAfterEndDate) / 100;\r\n } else {\r\n $flateRate = ($vat_listing->InvoiceTotal * $vat_listing->PercentRate) / 100;\r\n }\r\n $FlatRate = $flateRate;\r\n } else {\r\n $FlatRate = '0.00';\r\n }\r\n if ($vat_listing->InvoiceTotal != 0) {\r\n $NetSales = (($vat_listing->InvoiceTotal - $FlatRate));\r\n } else {\r\n $NetSales = '0.00';\r\n }\r\n $var = array('FlatRate' => trim($FlatRate), 'NetSales' => trim($NetSales));\r\n }\r\n $response = $this->clients->updateFlatandnetsales($vat_listing->InvoiceID, $var);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "protected function calculateTaxAmount()\n {\n\n //TAX ratio\n $tax_ratio = config('paths.tax') / 100;\n //Total amount as per current currency\n $total = Session::get('total') + Session::get('shipping_cost');\n //base currency total amount\n $bc_total = Session::get('bc_currency_total') + Session::get('bc_shipping_cost');\n //Tax amount for current currency\n $total_tax = round(($tax_ratio * $total), 2);\n //Tax amount for base currency\n $bc_total_tax = round(($tax_ratio * $bc_total), 2);\n Session::put('tax_amount', $total_tax);\n Session::put('bc_tax_amount', $bc_total_tax);\n return $total_tax;\n }", "public function calculate_taxes() {\n\n\t\t$this->calculate_taxes = ( wc_tax_enabled() && 'yes' === get_option( 'wc_avatax_enable_tax_calculation' ) );\n\n\t\t/**\n\t\t * Filter whether AvaTax calculation is enabled.\n\t\t *\n\t\t * @since 1.0.0\n\t\t * @param bool $calculate_taxes Whether AvaTax calculation is enabled.\n\t\t */\n\t\treturn (bool) apply_filters( 'wc_avatax_calculate_taxes', $this->calculate_taxes );\n\t}", "function calculate_totals() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$this->reset_totals();\n\t\t\t\n\t\t\t// Get count of all items + weights + subtotal (we may need this for discounts)\n\t\t\tif (sizeof($this->cart_contents)>0) foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\t\n\t\t\t\t$this->cart_contents_count \t= $this->cart_contents_count + $values['quantity'];\n\t\t\t\t\n\t\t\t\t// Base Price (inlusive of tax for now)\n\t\t\t\t$base_price \t\t\t= $_deals->get_sale();\n\t\t\t\t\t\n // Sub total is based on base prices (without discounts)\n $this->subtotal \t\t\t= $this->subtotal + ( $base_price * $values['quantity'] );\n\t\t\t\t\t\t\t\t\n\t\t\tendforeach;\n\t\t\t\n\t\t\t\n\t\t\t\tif (sizeof($this->cart_contents)>0) : foreach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t\n\t\t\t\t\t/** \n\t\t\t\t\t * Prices exclude tax\n\t\t\t\t\t *\n\t\t\t\t\t * This calculation is simpler - work with the base, untaxed price.\n\t\t\t\t\t */\n\t\t\t\t\t$_deals = $values['data'];\n\t\n\t\t\t\t\t// Base Price (i.e. no tax, regardless of region)\n\t\t\t\t\t$base_price \t\t\t\t= $_deals->get_sale();\n\t\t\n\t\t\t\t\t// Discounted Price (base price with any pre-tax discounts applied\n\t\t\t\t\t$discounted_price \t\t\t= $this->get_discounted_price( $values, $base_price, true );\t\t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Total item price (price, discount and quantity)\n\t\t\t\t\t$total_item_price \t\t\t= $discounted_price * $values['quantity'];\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// Cart contents total is based on discounted prices and is used for the final total calculation\n\t\t\t\t\t$this->cart_contents_total = $this->cart_contents_total \t\t+ $total_item_price;\n\t\t\t\t\n\t\t\t\tendforeach; endif;\n\t\t\t\n\t\t\t// Only go beyond this point if on the cart/checkout\n\t\t\tif (!is_checkout() && !defined('WPDEALS_CHECKOUT') && !is_ajax()) return;\n\t\t\t\n\t\t\t// VAT exemption done at this point - so all totals are correct before exemption\n\t\t\tif ($cmdeals->customer->is_vat_exempt()) :\n\t\t\t\t$this->shipping_tax_total = $this->tax_total = 0;\n\t\t\tendif;\n\t\t\t\n\t\t\t// Allow plugins to hook and alter totals before final total is calculated\n\t\t\tdo_action('cmdeals_calculate_totals', $this);\n\t\t\t\t\t\n\t\t\t/** \n\t\t\t * Grand Total\n\t\t\t *\n\t\t\t * Based on discounted deals prices, discounted tax, shipping cost + tax, and any discounts to be added after tax (e.g. store credit)\n\t\t\t */\n\t\t\t$this->total = $this->cart_contents_total + $this->discount_total;\n\t\t\t\n\t\t\tif ($this->total < 0) $this->total = 0;\n\t\t}", "public static function refund_vat_number( $refund_id ) {\n\t\tupdate_post_meta( $refund_id, '_billing_vat_number', get_post_meta( wp_get_post_parent_id( $refund_id ), '_billing_vat_number', true ) );\n\t\tupdate_post_meta( $refund_id, '_billing_country', get_post_meta( wp_get_post_parent_id( $refund_id ), '_billing_country', true ) );\n\t\tupdate_post_meta( $refund_id, '_order_currency', get_post_meta( wp_get_post_parent_id( $refund_id ), '_order_currency', true ) );\n\t}", "public function getBaseTaxAmount();", "public function get_tax_totals() {\n\t\t$taxes = $this->get_taxes();\n\t\t$tax_totals = array();\n\n\t\tforeach ( $taxes as $key => $tax ) {\n\t\t\t$code = WC_Tax::get_rate_code( $key );\n\n\t\t\tif ( $code || apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) === $key ) {\n\t\t\t\tif ( ! isset( $tax_totals[ $code ] ) ) {\n\t\t\t\t\t$tax_totals[ $code ] = new stdClass();\n\t\t\t\t\t$tax_totals[ $code ]->amount = 0;\n\t\t\t\t}\n\t\t\t\t$tax_totals[ $code ]->tax_rate_id = $key;\n\t\t\t\t$tax_totals[ $code ]->is_compound = WC_Tax::is_compound( $key );\n\t\t\t\t$tax_totals[ $code ]->label = WC_Tax::get_rate_label( $key );\n\t\t\t\t$tax_totals[ $code ]->amount += wc_round_tax_total( $tax );\n\t\t\t\t$tax_totals[ $code ]->formatted_amount = wc_price( wc_round_tax_total( $tax_totals[ $code ]->amount ) );\n\t\t\t}\n\t\t}\n\n\t\tif ( apply_filters( 'woocommerce_cart_hide_zero_taxes', true ) ) {\n\t\t\t$amounts = array_filter( wp_list_pluck( $tax_totals, 'amount' ) );\n\t\t\t$tax_totals = array_intersect_key( $tax_totals, $amounts );\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_tax_totals', $tax_totals, $this );\n\t}", "function ProcessRefundAmountNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Refund amount notifications inform you that a customer has been\n * refunded either the full amount or a partial amount of an order\n * total. A <refund-amount-notification> contains the order number\n * that Google assigned to the order, the value of the most recent\n * refund to the customer and the total amount that has been\n * refunded to the customer for the order. Google Checkout will send a\n * <refund-amount-notification> after refunding the customer.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <refund-amount-notification> to your internal systems that\n * process this order data.\n */\n SendNotificationAcknowledgment();\n}", "public function applyRefund(Order $order, array $parsedData);", "public function getTaxRate();" ]
[ "0.5693004", "0.5692877", "0.554982", "0.546903", "0.5352703", "0.5338464", "0.5334925", "0.5285087", "0.5282155", "0.52621937", "0.52201235", "0.5208214", "0.51671404", "0.5167089", "0.51505005", "0.51315975", "0.51246125", "0.5105885", "0.5089826", "0.50880015", "0.5087403", "0.5082731", "0.50746435", "0.5072978", "0.5068985", "0.5062987", "0.5061439", "0.50519", "0.5047958", "0.50471896", "0.5045218", "0.5022486", "0.5013529", "0.5009155", "0.5000558", "0.49999556", "0.49989384", "0.49841696", "0.49799362", "0.49784395", "0.49593526", "0.49582693", "0.49571702", "0.49507415", "0.49499494", "0.49465936", "0.49422023", "0.4934932", "0.49251738", "0.49248105", "0.49214613", "0.49076495", "0.48963544", "0.48819277", "0.487692", "0.4867953", "0.48672423", "0.48671702", "0.48619562", "0.4858681", "0.48578566", "0.4855423", "0.4855293", "0.48541862", "0.48481488", "0.4839273", "0.48321998", "0.482754", "0.48183727", "0.4815849", "0.48101848", "0.48094204", "0.48024777", "0.4800348", "0.47971195", "0.47837234", "0.47796148", "0.47744653", "0.47736126", "0.47695503", "0.47665155", "0.47561264", "0.47542384", "0.47521177", "0.4746254", "0.47436944", "0.47375444", "0.47257698", "0.47127816", "0.47036457", "0.47027463", "0.47004896", "0.4696713", "0.46936604", "0.46917212", "0.4688042", "0.468308", "0.4683075", "0.46812662", "0.46782044" ]
0.7674831
0
Run the database seeds.
public function run() { Admin::create([ 'username' => 'admin', 'password' => bcrypt('admin'), 'level' => 'admin', ]); // Dokter::create([ // 'id' => 'DK001', // 'username' => 'dokter', // 'password' => bcrypt('dokter'), // 'level' => 'dokter', // 'nama' => 'dokter adam', // 'alamat' => 'mojokerto', // 'tgl_lahir' => '1998-10-03', // 'spesialis' => 'bedah', // 'photo' => ' ', // ]); // Apoteker::create([ // 'id' => 'AP001', // 'username' => 'apoteker', // 'password' => bcrypt('apoteker'), // 'level' => 'apoteker', // 'nama' => 'apoteker hendrik', // 'alamat' => 'mojokerto', // 'tgl_lahir' => '1998-10-03', // 'photo' => ' ', // ]); // Resepsionist::create([ // 'id' => 'RS001', // 'username' => 'resepsionist', // 'password' => bcrypt('resepsionist'), // 'level' => 'resepsionist', // 'nama' => 'resepsionist syarif', // 'alamat' => 'mojokerto', // 'tgl_lahir' => '1998-10-03', // 'photo' => ' ', // ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // 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 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 Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // \\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\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\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(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 $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([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // 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(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 $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\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 $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 {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n //\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 // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n // $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 \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 $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 // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\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 // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n // 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 $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(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n $this->call(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 $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 // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n \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 }", "public function run()\n {\n \t$roles = DB::table('roles')->pluck('id');\n \t$sexes = DB::table('sexes')->pluck('id');\n \t$faker = \\Faker\\Factory::create();\n\n \tforeach (range(1,20) as $item) {\n \t\tDB::table('users')->insert([\n \t\t\t'role_id' => $faker->randomElement($roles),\n \t\t\t'sex_id' => $faker->randomElement($sexes),\n \t\t\t'name' => $faker->firstName . ' ' . $faker->lastName,\n \t\t\t'dob' => $faker->date,\n \t\t\t'bio' => $faker->text,\n \t\t\t'created_at' => now(),\n \t\t\t'updated_at' => now()\n \t\t]);\n \t} \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }" ]
[ "0.80138505", "0.79804975", "0.7977927", "0.7954003", "0.7951511", "0.79507065", "0.79449123", "0.794312", "0.7938865", "0.79372203", "0.79340154", "0.7892169", "0.7881411", "0.7879766", "0.78787434", "0.7875771", "0.7870809", "0.7870481", "0.7852045", "0.7851101", "0.784159", "0.78346395", "0.7827439", "0.7818506", "0.78085804", "0.7803168", "0.7803112", "0.7800874", "0.78000623", "0.77964896", "0.7790986", "0.77893186", "0.7786942", "0.7779508", "0.77773196", "0.7766297", "0.7762858", "0.77619725", "0.7761802", "0.77617735", "0.7760563", "0.77588934", "0.7757106", "0.77538526", "0.7750399", "0.7749764", "0.77460176", "0.7729847", "0.77295387", "0.77283424", "0.7717115", "0.7715115", "0.77147174", "0.77134794", "0.7713354", "0.7712908", "0.77113235", "0.7711319", "0.77109134", "0.7710318", "0.77056116", "0.770521", "0.77040505", "0.7704028", "0.7702745", "0.7702163", "0.77015257", "0.7699154", "0.76988846", "0.7698059", "0.76972497", "0.76941127", "0.7692912", "0.76910675", "0.7690705", "0.7687825", "0.7687763", "0.76870334", "0.76862305", "0.7684728", "0.76843387", "0.7680029", "0.76790416", "0.7678002", "0.76777124", "0.76734155", "0.7670605", "0.7669205", "0.7668748", "0.766868", "0.7666607", "0.76631796", "0.7662515", "0.7661419", "0.76591927", "0.7656439", "0.7654022", "0.76532", "0.76526594", "0.7652528", "0.765247" ]
0.0
-1
At least a height OR a width must be specified if there is no watermark selected
public function validateDimension($key, $value, $params, $rule) { if (empty($this->width) && empty($this->height) && empty($this->watermark_id)) { $rule->stop(); return lang('image_manip_dimension_required'); } return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWatermark($width, $height){\n if (is_null($width) && is_null($height)) {\n return public_path(\"/frontend/images/watermark.png\");\n }\n\n //if thumbnail exist returns it\n if (File::exists(public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}/watermark.png\"))) {\n return public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}/watermark.png\");\n }\n\n// //If original image doesn't exists returns a default image which shows that original image doesn't exist.\n// if (!File::exists(public_path(\"{$images_path}/\" . $path))) {\n//\n// /*\n// * 2 ways\n// */\n//\n// //1. recursive call for the default image\n// //return $this->getImageThumbnail(\"error/no-image.png\", $width, $height, $type);\n//\n// //2. returns an image placeholder generated from placehold.it\n// return \"http://placehold.it/{$width}x{$height}\";\n// }\n\n// $allowedMimeTypes = ['image/jpeg', 'image/gif', 'image/png'];\n// $contentType = mime_content_type(public_path(\"{$images_path}/\" . $path));\n//\n// if (in_array($contentType, $allowedMimeTypes)) { //Checks if is an image\n\n $image = Image::make(public_path(\"/frontend/images/watermark.png\"));\n\n// switch ($type) {\n// case \"fit\": {\n $image->fit($width, $height, function ($constraint) {\n $constraint->upsize();\n });\n// break;\n// }\n// case \"resize\": {\n// //stretched\n// $image->resize($width, $height);\n// }\n// case \"background\": {\n// $image->resize($width, $height, function ($constraint) {\n// //keeps aspect ratio and sets black background\n// $constraint->aspectRatio();\n// $constraint->upsize();\n// });\n// }\n// case \"resizeCanvas\": {\n// $image->resizeCanvas($width, $height, 'center', false, 'rgba(0, 0, 0, 0)'); //gets the center part\n// }\n// }\n\n //relative directory path starting from main directory of images\n// $dir_path = (dirname($path) == '.') ? \"\" : dirname($path);\n\n //Create the directory if it doesn't exist\n if (!File::exists(public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}\"))) {\n File::makeDirectory(public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}\"), 0775, true);\n }\n\n //Save the thumbnail\n $image->save(public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}/watermark.png\"));\n\n //return the url of the thumbnail\n return public_path(\"/frontend/images/thumbs/\" . \"{$width}x{$height}/watermark.png\");\n }", "function someImage($width, $height, $options = []);", "public function watermarkAction()\n {\n $watermarkPath = __DIR__ . '/../../../data/media/watermark.png';\n $image = __DIR__ . '/../../../data/media/test.jpg';\n\n $watermarkThumb = $this->thumbnailer->create($watermarkPath);\n $watermarkThumb->resize(100, 100);\n\n $watermark = $this->thumbnailer->createWatermark($watermarkThumb, [-1, -1], .3);\n $thumb = $this->thumbnailer->create($image, [], [$watermark]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/watermark_test.jpg');\n\n return false;\n }", "public function watermark($watermark, $offset_x=null, $offset_y=null, $opacity=null);", "function _watermarkImageGD($file, $desfile, $wm_file, $position, $imgobj) {\r\n global $zoom;\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $image = @imagecreatefromjpeg($file);\r\n } else if ($imgobj->_type == \"png\") {\r\n $image = @imagecreatefrompng($file);\r\n } else {\r\n \t$image = @imagecreatefromgif($file);\r\n }\r\n if (!$image) { return false; }\r\n \r\n $imginfo_wm = getimagesize($wm_file);\r\n $imgtype_wm = ereg_replace(\".*\\.([^\\.]*)$\", \"\\\\1\", $wm_file);\r\n if ($imgtype_wm == \"jpg\" || $imgtype_wm == \"jpeg\") {\r\n $watermark = @imagecreatefromjpeg($wm_file);\r\n } else {\r\n $watermark = @imagecreatefrompng($wm_file);\r\n }\r\n if (!$watermark) { return false; }\r\n \r\n $imagewidth = imagesx($image);\r\n $imageheight = imagesy($image);\r\n $watermarkwidth = $imginfo_wm[0];\r\n $watermarkheight = $imginfo_wm[1];\t\t\r\n $width_left = $imagewidth - $watermarkwidth;\r\n $height_left = $imageheight - $watermarkheight;\r\n switch ($position) {\r\n case \"TL\": // Top Left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TM\": // Top middle \r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TR\": // Top right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"CL\": // Center left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n default:\r\n case \"C\": // Center (the default)\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"CR\": // Center right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"BL\": // Bottom left\r\n $startwidth = $width_left >= 5 ? 5 : $width_left;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BM\": // Bottom middle\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BR\": // Bottom right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n }\r\n imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);\r\n @$zoom->platform->unlink($desfile);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($image, $desfile, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($image, $desfile);\r\n } else {\r\n \timagegif($image, $desfile);\r\n }\r\n imagedestroy($image);\r\n imagedestroy($watermark);\r\n return true;\r\n }", "protected function addWatermarkFilterIfExists(&$set, $width, $height)\n {\n if( isset($set['watermark']) )\n {\n if( ! empty($set['watermark'][1])) \n {\n $set['filters'][] = ['target', [$set['watermark'][1]]];\n }\n\n if( ! empty($set['watermark'][2])) \n {\n $set['filters'][] = ['margin', [$set['watermark'][2]]]; // @codeCoverageIgnore\n }\n\n $set['filters'][] = ['mix', [$set['watermark'][0]]];\n } \n }", "function create_watermark($source_file_path, $output_file_path)\r\n\t{\r\n\t\t$photo \t\t= imagecreatefromjpeg($source_file_path);\r\n\t\t$watermark \t= imagecreatefrompng($this->watermark_file);\r\n\t\t\r\n\t\t/* untuk mengatasi image dengan type png-24*/\r\n\t\timagealphablending($photo, true);\r\n\t\t\r\n\t\t$photo_x \t\t= imagesx($photo);\r\n\t\t$watermark_x \t= imagesx($watermark);\r\n\t\t$photo_y\t\t= imagesy($photo); \r\n\t\t$watermark_y\t= imagesy($watermark);\r\n\t\t\r\n\t\timagecopy($photo, $watermark, (($photo_x/2) - ($watermark_x/2)), (($photo_y/2) - ($watermark_y/2)), 0, 0, $watermark_x, $watermark_y);\r\n\t\timagejpeg($photo, $output_file_path, 100);\r\n\t}", "public static function watermark(){\n\n}", "function _watermarkImageIM($file, $desfile, $wm_file, $position, $imgobj) {\r\n $imginfo_wm = getimagesize($wm_file);\r\n\r\n $imagewidth = $imgobj->_size[0];\r\n $imageheight = $imgobj->_size[1];\r\n $watermarkwidth = $imginfo_wm[0];\r\n $watermarkheight = $imginfo_wm[1];\t\t\r\n $width_left = $imagewidth - $watermarkwidth;\r\n $height_left = $imageheight - $watermarkheight;\r\n switch ($position) {\r\n case \"TL\": // Top Left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TM\": // Top middle \r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"TR\": // Top right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $height_left >= 5 ? 5 : $height_left;\r\n break;\r\n case \"CL\": // Center left\r\n $startwidth = $width_left >= 5 ? 4 : $width_left;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n default:\r\n case \"C\": // Center (the default)\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"CR\": // Center right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = intval(($imageheight - $watermarkheight) / 2);\r\n break;\r\n case \"BL\": // Bottom left\r\n $startwidth = $width_left >= 5 ? 5 : $width_left;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BM\": // Bottom middle\r\n $startwidth = intval(($imagewidth - $watermarkwidth) / 2);\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n case \"BR\": // Bottom right\r\n $startwidth = $imagewidth - $watermarkwidth-4;\r\n $startheight = $imageheight - $watermarkheight-5;\r\n break;\r\n }\r\n\r\n\t\t$cmd = $this->_IM_path.\"convert -draw \\\"image over $startwidth,$startheight 0,0 '$wm_file'\\\" \\\"$file\\\" \\\"$desfile\\\"\";\r\n\t\t$output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n \r\n if($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "static function resize (\n $src,\n $dest,\n $width = 85,\n $height = 55,\n $exact = true,\n $watermark = false,\n $mode = 1,\n $watermark_position = [4]\n ) {\n $quality = 100;\n\n if (! file_exists($src)) {\n return false;\n }\n\n $size = getimagesize($src);\n if ($size === false) {\n return false;\n }\n\n if (!is_array($watermark_position)) {\n $watermark_position = [$watermark_position];\n }\n\n $format = strtolower(substr($size ['mime'], strpos($size ['mime'], '/')+ 1));\n\n switch($size['mime']) {\n case 'image/jpeg' :\n $isrc = imagecreatefromjpeg($src);\n break;\n case 'image/gif' :\n $isrc = imagecreatefromgif ($src);\n break;\n case 'image/png' :\n $isrc = imagecreatefrompng($src);\n break;\n case 'image/bmp' :\n $isrc = imagecreatefrombmp($src);\n break;\n default :\n return false;\n break;\n }\n $ow = $size [0]; //original width\n $oh = $size [1]; //original height\n\n if ($width === false) $width = $size [0];\n if ($height === false) $height = $size [1];\n\n $zero = false;\n $w = $width;\n $h = $height;\n if ($w <= 0) {\n $zero = true;\n $w = $ow;\n }\n if ($h <= 0) {\n $zero = true;\n $h = $oh;\n }\n $rw = $ow / $w;\n $rh = $oh / $h;\n if ($mode == 0)\n $r = $rw < $rh ? $rw : $rh;\n else\n $r = $rw > $rh ? $rw : $rh;\n\n //если исходное изображение меньше по размера нового, то новые размеры приравниваем к исходным\n if ($r < 1) $r = 1;\n $res_w = $ow / $r;\n $res_h = $oh / $r;\n if ($r == 1) {\n $w = $ow;\n $h = $oh;\n }\n if ($exact && ! $zero) {\n $idest = imagecreatetruecolor($w, $h);\n $bgcolor = imagecolorallocate($idest, 255, 255, 255);\n imagefill($idest, 0, 0, $bgcolor);\n imagecopyresampled($idest, $isrc,($w - $res_w) / 2,($h - $res_h) / 2, 0, 0, $res_w, $res_h, $ow, $oh);\n } else {\n $idest = imagecreatetruecolor($res_w, $res_h);\n imagecopyresampled($idest, $isrc, 0, 0, 0, 0, $res_w, $res_h, $ow, $oh);\n }\n if ($watermark) {\n if (file_exists($watermark)) {\n $wm_image = imagecreatefrompng($watermark);\n $wsize = getimagesize($watermark);\n $wrw = $width / $wsize[0];\n $wrh = $height / $wsize[1];\n\n $ww = $res_w / $wrw;\n $wh = $res_h / $wrh;\n\n if ($exact && ! $zero) {\n /*\tdstX, dstY - Точка на изображении назначения, которая определяет левый верхний угол прямоугольника в который будет вставляться копируемая область.\n dstW, dstH - ширина и высота прямоугольника в который будет вписана копируемая область.\n srcX, srcY - Точка на изображении-источнике, которая определяет левый верхний угол прямоугольника, содержащего копируемую.\n srcW, srcH - ширина и высота копируемой области на изображении-источнике.\n */\n if (in_array(1,$watermark_position)) { //left,top\n $dstX = 0; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(2,$watermark_position)) { //right,top\n $dstX = $w - $ww -(($w - $res_w) / 2); $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(3,$watermark_position)) { //left,bottom\n $dstX = 0; $dstY = $h - $wh -(($h - $res_h) / 2); $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(4,$watermark_position)) { //right,bottom\n $dstX = $w - $ww -(($w - $res_w) / 2); $dstY = $h - $wh -(($h - $res_h) / 2); $srcX = 0; $srcY = 0;\n $dstW = $ww; $dstH = $wh; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n\n } else {\n if (in_array(1,$watermark_position)) { //left,top\n $dstX = 0; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(2,$watermark_position)) { //right,top\n $dstX = $res_w - $wsize[0]; $dstY = 0; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(3,$watermark_position)) { //left,bottom\n $dstX = 0; $dstY = $res_h - $wsize[1]; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n if (in_array(4,$watermark_position)) { //right,bottom\n $dstX = $res_w - $wsize[0]; $dstY = $res_h - $wsize[1]; $srcX = 0; $srcY = 0;\n $dstW = $wsize[0]; $dstH = $wsize[1]; $srcW = $wsize[0]; $srcH = $wsize[1];\n imagecopyresampled($idest, $wm_image, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);\n }\n\n }\n } else {\n $wm_image = imagecreatefrompng($watermark);\n var_dump(__FILE__);\n }\n }\n imagejpeg($idest, $dest, $quality);\n /*switch($size ['mime'])\n {\n case 'image/jpeg':\n imagejpeg( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/gif':\n imagegif ($idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/png':\n imagepng( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n case 'image/bmp':\n imagebmp( $idest, $dest, $quality); //100 is the quality settings, values range from 0-100.\n break;\n }*/\n imagedestroy($isrc);\n imagedestroy($idest);\n\n return true;\n }", "public function watermark()\n\t{\n\t\treturn ($this->wm_type === 'overlay') ? $this->overlay_watermark() : $this->text_watermark();\n\t}", "public function applyWaterMark($sourceFileName, $waterMarkFileName, $horizontalPosition, $verticalPosition, $horizontalMargin, $verticalMargin, $opacity, $shrinkToFit, $stretchToFit) \n {\n $sourceImage = $this->loadImage($sourceFileName);\n \n if ($sourceImage) {\n $waterMarkImage = $this->loadImage($waterMarkFileName);\n\n if ($waterMarkImage) {\n //get image properties\n $sourceWidth = imagesx($sourceImage);\n $sourceHeight = imagesy($sourceImage);\n $waterMarkWidth = imagesx($waterMarkImage);\n $waterMarkHeight = imagesy($waterMarkImage);\n\n if (($shrinkToFit && ($waterMarkWidth > $sourceWidth || $waterMarkHeight > $sourceHeight)) || \n (($stretchToFit && $waterMarkWidth < $sourceWidth && $waterMarkHeight < $sourceHeight))) {\n $maxHeight = $sourceHeight;\n\n $maxWidth = $sourceWidth;\n\n if ($horizontalPosition === 'left' || $horizontalPosition === 'right') { \n $maxWidth -= $horizontalMargin;\n }\n\n if ($verticalPosition === 'top' || $verticalPosition === 'bottom') { \n $maxHeight -= $verticalMargin;\n }\n\n if ($maxWidth > 0 && $maxHeight > 0) {\n $waterMarkImageTemp = $waterMarkImage;\n \n $waterMarkImage = null;\n \n $this->resizeVirtualImage($waterMarkImageTemp, $waterMarkImage, $maxHeight, $maxWidth, false, null);\n \n $waterMarkWidth = imagesx($waterMarkImage);\n \n $waterMarkHeight = imagesy($waterMarkImage);\n \n imagedestroy($waterMarkImageTemp);\n }\n }\n\n //calculate stamp position\n $destX = 0;\n if ($horizontalPosition === 'left') {\n $destX = $horizontalMargin;\n }\n elseif ($horizontalPosition === 'right') {\n $destX = $sourceWidth - $waterMarkWidth - $horizontalMargin;\n }\n else { //center\n $destX = ($sourceWidth - $waterMarkWidth) / 2;\n }\n\n $destY = 0;\n if ($verticalPosition === 'top') {\n $destY = $verticalMargin;\n }\n elseif ($verticalPosition === 'bottom') {\n $destY = $sourceHeight - $waterMarkHeight - $verticalMargin;\n }\n else { //middle\n $destY = ($sourceHeight - $waterMarkHeight) / 2;\n }\n \n //stamp the watermark\n if ($opacity === 100) {\n imagecopy($sourceImage, $waterMarkImage, $destX, $destY, 0, 0, $waterMarkWidth, $waterMarkHeight);\n }\n else if ($opacity !== 0) {\n imagecopymerge($sourceImage, $waterMarkImage, $destX, $destY, 0, 0, $waterMarkWidth, $waterMarkHeight, $opacity);\n } \n\n //delete original image\n unlink($sourceFileName);\n\n //save the resulted image\n $this->saveImage($sourceImage, $sourceFileName);\n\n //free memory resource\n imagedestroy($waterMarkImage);\n }\n\n //free memory resource\n imagedestroy($sourceImage);\n }\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}", "function watermark($anchor,$markImgFile,$padding=5,$alpha=50,&$autosave=null) \n { \n if(empty($anchor) || empty($markImgFile) || !file_exists($markImgFile)) \n { \n return $this; \n } \n \n $anchor=strtolower(trim($anchor)); \n if(!in_array($anchor,array('lt','rt','lb','rb','center'))) \n { \n $anchor='rb'; \n } \n \n if($padding<0) \n { \n $padding=0; \n } \n if($padding>10) \n { \n $padding=10; \n } \n \n $_tmpImage=null; \n \n //mark image info \n list($_mw,$_mh,$_mt)=getimagesize($markImgFile); \n switch($_mt) \n { \n case IMAGETYPE_GIF: \n $_tmpImage = imagecreatefromgif($markImgFile); \n break; \n case IMAGETYPE_JPEG: \n $_tmpImage = imagecreatefromjpeg($markImgFile); \n break; \n case IMAGETYPE_PNG: \n $_tmpImage = imagecreatefrompng($markImgFile); \n break; \n default: \n $_tmpImage = null; \n break; \n } \n \n if(!is_resource($_tmpImage)) \n { \n return $this; \n } \n \n $pos=array(); \n switch($anchor) \n { \n case 'lt': \n $pos[0]=$padding; \n $pos[1]=$padding; \n break; \n case 'rt': \n $pos[0]=$this->_width-$_mw-$padding; \n $pos[1]=$padding; \n break; \n case 'lb': \n $pos[0]=$padding; \n $pos[1]=$this->_height-$_mh-$padding; \n break; \n case 'rb': \n $pos[0]=$this->_width-$_mw-$padding; \n $pos[1]=$this->_height-$_mh-$padding; \n break; \n case 'center': \n $pos[0]=($this->_width-$_mw-$padding)*0.5; \n $pos[1]=($this->_height-$_mh-$padding)*0.5; \n break; \n } \n \n imagecopymerge($this->_image,$_tmpImage,$pos[0],$pos[1],0,0,$_mw,$_mh,50); \n imagedestroy($_tmpImage); \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n 'wm', \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n \n }", "function escort_watermark_image( $filename, $upload_dir, $watermark_image ) {\n\n $original_image_path = trailingslashit( $upload_dir['basedir'] ) . $filename;\n \n $image_resource = new Imagick( $original_image_path );\n \n //$image_resource->blurImage( 20, 10 );\n\n $watermark_resource = new Imagick($watermark_image);\n\n // tamaños\n $iWidth = $image_resource->getImageWidth();\n $iHeight = $image_resource->getImageHeight();\n\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n\n if ($iHeight < $wHeight || $iWidth < $wWidth) {\n // resize the watermark\n $watermark_resource->scaleImage($iWidth, $iHeight);\n \n // get new size\n $wWidth = $watermark_resource->getImageWidth();\n $wHeight = $watermark_resource->getImageHeight();\n }\n\n\n // calculate the position\n $x = ($iWidth - $wWidth) / 2;\n $y = ($iHeight - $wHeight) / 2;\n\n $image_resource->compositeImage( $watermark_resource, Imagick::COMPOSITE_OVER, $x, $y );\n \n return save_watermarked_image( $image_resource, $original_image_path, $upload_dir );\n \n}", "public function validate()\n {\n if ($this->crop || $this->width || $this->height) {\n return;\n }\n\n throw new \\Exception(\n 'Slideshow expects a width or a height to be provided if crop is set to false.'\n );\n }", "function add_image_size($name, $width = 0, $height = 0, $crop = \\false)\n {\n }", "public function testImageCandidateFactoryWithWidthDescriptor()\n {\n $widthImageCandidate = ImageCandidateFactory::createImageCandidateFromFileAndDescriptor(\n 'image.jpg',\n '1000w'\n );\n $this->assertInstanceOf(WidthImageCandidate::class, $widthImageCandidate);\n }", "function someImageUrl($width, $height, $options = []);", "function create_watermark($image_path, $data)\n\t{\n\t\tee()->image_lib->clear();\n\n\t\t$config = $this->set_image_config($data, 'watermark');\n\t\t$config['source_image'] = $image_path;\n\n\t\tee()->image_lib->initialize($config);\n\n\t\t// watermark it!\n\n\t\tif ( ! ee()->image_lib->watermark())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tee()->image_lib->clear();\n\n\t\treturn TRUE;\n\t}", "private function _addOmittedCanvasDimension() {\n\t\t$sourceWidth = $this->params['sourceWidth'];\n\t\t$sourceHeight = $this->params['sourceHeight'];\n\t\t$sourceRatio = $sourceWidth / $sourceHeight;\n\n\t\tif (\n\t\t\tempty($this->params['w']) &&\n\t\t\tempty($this->params['h'])\n\t\t) {\n\t\t\t$this->params['w'] = $sourceWidth;\n\t\t\t$this->params['h'] = $sourceHeight;\n\t\t} elseif (empty($this->params['h'])) {\n\t\t\tif (\n\t\t\t\t!$this->params['grow'] &&\n\t\t\t\t$this->params['w'] > $sourceWidth\n\t\t\t) {\n\t\t\t\t$this->params['h'] = $sourceHeight;\n\t\t\t} else {\n\t\t\t\t$this->params['h'] = $this->params['w'] / $sourceRatio;\n\t\t\t}\n\t\t} elseif (empty($this->params['w'])) {\n\t\t\tif (\n\t\t\t\t!$this->params['grow'] &&\n\t\t\t\t$this->params['h'] > $sourceHeight\n\t\t\t) {\n\t\t\t\t$this->params['w'] = $sourceWidth;\n\t\t\t} else {\n\t\t\t\t$this->params['w'] = $this->params['h'] * $sourceRatio;\n\t\t\t}\n\t\t}\n\t}", "public function add_watermark_to_( $image ) {\n\n\t\t// TODO Select graphics library from plugin settings (this is GD, add Imagick)\n\n\t\t$watermark_file = get_attached_file( $this->settings['watermark']['image'] );\n\n\t\t$watermark = imagecreatefrompng( $watermark_file );\n\t\t$new_image = imagecreatefromjpeg( $image );\n\n\t\t$margin = ( $this->settings['watermark']['position'] ) ? $this->settings['watermark']['position'] : 50;\n\n\t\t$watermark_width = imagesx( $watermark );\n\t\t$watermark_height = imagesy( $watermark );\n\t\t$new_image_width = imagesx( $new_image );\n\t\t$new_image_height = imagesy( $new_image );\n\n\t\tif ( $this->settings['watermark']['position'] == 'topleft' ) {\n\t\t\t$x_pos = $margin;\n\t\t\t$y_pos = $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'topright' ) {\n\t\t\t$x_pos = $new_image_width - $watermark_width - $margin;\n\t\t\t$y_pos = $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'bottomleft' ) {\n\t\t\t$x_pos = $margin;\n\t\t\t$y_pos = $new_image_height - $watermark_height - $margin;\n\t\t} elseif ( $this->settings['watermark']['position'] == 'bottomright' ) {\n\t\t\t$x_pos = $new_image_width - $watermark_width - $margin;\n\t\t\t$y_pos = $new_image_height - $watermark_height - $margin;\n\t\t} else {\n\t\t\t$x_pos = ( $new_image_width / 2 ) - ( $watermark_width / 2 );\n\t\t\t$y_pos = ( $new_image_height / 2 ) - ( $watermark_height / 2 );\n\t\t}\n\n\t\tif ( $this->settings['watermark']['position'] == 'repeat' ) {\n\t\t\timagesettile( $new_image, $watermark );\n\t\t\timagefilledrectangle( $new_image, 0, 0, $new_image_width, $new_image_height, IMG_COLOR_TILED );\n\t\t} else {\n\t\t\timagecopy( $new_image, $watermark, $x_pos, $y_pos, 0, 0, $watermark_width, $watermark_height );\t\t\t\t\n\t\t}\n\n\t\t$success = imagejpeg( $new_image, $image, 100 );\n\t\timagedestroy( $new_image );\n\t}", "protected static function pick_video_size(&$width, &$height) {\n global $CFG;\n if (!$width) {\n $width = $CFG->media_default_width;\n $height = $CFG->media_default_height;\n }\n }", "public function setDimensions($width, $height) {}", "public function watermark()\n {\n $bMargin = $this->getBreakMargin();\n\n // Get current auto-page-break mode\n $auto_page_break = $this->AutoPageBreak;\n\n // Disable auto-page-break\n $this->SetAutoPageBreak(true, 1);\n\n // Define the path to the image that you want to use as watermark.\n\n $fontName = \"Helvetica\";\n $fontSize = 135;\n $fontStyle = \"B\";\n\n // Calcular ancho de la cadena\n $widthCadena = $this->GetStringWidth(trim(\"MY TEXT\"), $fontName, $fontStyle);\n $factorCentrado = round(($widthCadena * sin(deg2rad(45))) / 2, 0);\n\n // Get the page width/height\n $myPageWidth = $this->getPageWidth();\n $myPageHeight = $this->getPageHeight();\n\n // Find the middle of the page and adjust.\n $myX = ($myPageWidth / 2) - $factorCentrado - 10;\n $myY = ($myPageHeight / 2) - $factorCentrado + 5;\n\n // Set the transparency of the text to really light\n $this->SetAlpha(0.09);\n\n // Rotate 45 degrees and write the watermarking text\n $this->StartTransform();\n $this->Rotate(45, $myX, $myY);\n $this->SetFont($fontName, $fontStyle, $fontSize);\n $this->Text($myX, $myY, trim($this->watermark_text));\n $this->StopTransform();\n\n // Reset the transparency to default\n $this->SetAlpha(1);\n // Restore the auto-page-break status\n // $this->SetAutoPageBreak($auto_page_break, $bMargin);\n\n // Set the starting point for the page content\n $this->setPageMark();\n }", "function wp_img_tag_add_width_and_height_attr($image, $context, $attachment_id)\n {\n }", "function _image_get_preview_ratio($w, $h)\n {\n }", "function has_image_size($name)\n {\n }", "public function testImageCandidateFactoryWithWidthString()\n {\n $widthImageCandidate = ImageCandidateFactory::createImageCandidateFromString('image.jpg 1000w');\n $this->assertInstanceOf(WidthImageCandidate::class, $widthImageCandidate);\n }", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "public function getHeight($width = null) {}", "public function getHeight($width = null) {}", "protected function isValidConfiguration(/**\n * Checks to perform:\n * - width and/or height given, integer values?\n */\narray $configuration) {}", "private static function VerifyWidthMinAndMax()\n {\n global $wgEmbedVideoMinWidth, $wgEmbedVideoMaxWidth;\n if (!is_numeric($wgEmbedVideoMinWidth) || $wgEmbedVideoMinWidth < 100)\n $wgEmbedVideoMinWidth = 100;\n if (!is_numeric($wgEmbedVideoMaxWidth) || $wgEmbedVideoMaxWidth > 1024)\n $wgEmbedVideoMaxWidth = 1024;\n }", "function genesis_sample_validate_logo_width( $validity, $width ) {\n\n\tif ( empty( $width ) || ! is_numeric( $width ) ) {\n\t\t$validity->add( 'required', __( 'You must supply a valid number.', 'genesis-sample' ) );\n\t} elseif ( $width < 100 ) {\n\t\t$validity->add( 'logo_too_small', __( 'The logo width cannot be less than 100.', 'genesis-sample' ) );\n\t}\n\n\treturn $validity;\n\n}", "public function fit(IImageInformation $src, $width, $height, $backgroundcolor = 0xFFFFFF);", "public static function setMinSize(int $width, int $height) {}", "function set_post_thumbnail_size($width = 0, $height = 0, $crop = \\false)\n {\n }", "protected function update_size($width = \\null, $height = \\null)\n {\n }", "public function __construct($height, $width){\n $this->height = $height;\n $this->width = $width; \n}", "public function getWidth($height = null) {}", "public function getWidth($height = null) {}", "function watermarkText2Image ($imageUrl,$imgName,$WaterMarkText, $thb = true) {\n header(\"Content-type: image/jpg\");\n\n //amire kerul a watermark\n if ($thb) {\n $SourceFile = $imageUrl . 'tn_' . $imgName;\n } else {\n $SourceFile = $imageUrl . $imgName;\n }\n list($originalWidth, $originalHeight, $original_type, $original_attr) = getimagesize($SourceFile);\n $sourceImage = imagecreatefromjpeg($SourceFile);\n \n //watermark eloallitasa\n $new_w = (int)($originalWidth);\n $new_h = (int)($originalWidth)*0.15;\n $font = $_SERVER['DOCUMENT_ROOT'].'/include/captcha/fonts/walk_rounded.ttf';\n $fontSize = $new_h/2;\n $angel = 0;\n $the_box = calculateTextBox($WaterMarkText, $font, $fontSize, $angel);\n \n $watermark = imagecreatetruecolor($new_w,$new_h);\n \n \n $white = imagecolorallocate($watermark, 255, 255, 255);\n // Add some shadow to the text\n //$WaterMarkText = 'ww='.$the_box[\"width\"].' nw='.$new_w;\n //imagettftext($watermark, $new_h/2, 0, ($new_w - $the_box[\"width\"])/6, 2*$new_h/3, $white, $font, $WaterMarkText);\n imagettftext($watermark, \n $fontSize,\n $angel,\n $the_box[\"left\"] + ($new_w / 2) - ($the_box[\"width\"] / 2), \n $the_box[\"top\"] + ($new_h / 2) - ($the_box[\"height\"] / 2), \n $white, \n $font, \n $WaterMarkText); \n \n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n \n imagecopymerge($sourceImage, \n $watermark,\n 0,//imagesx($original_image)/2 , //dest x - $sx/2\n imagesy($sourceImage)/2- $sy/2, //dest y \n 0, //source origo x\n 0, //source origo y\n imagesx($watermark), \n imagesy($watermark),\n 30\n );\n \n // megjelenitem a thumbnailt a watermark szoveggel\n imagejpeg($sourceImage, null, 100); //$SourceFile\n imagedestroy($sourceImage);\n\n}", "public function getWatermark($text = false, $maximumWidth = NULL, $maximumHeight = NULL, $ratioMode = ImageInterface::RATIOMODE_INSET) {\n\n\t\t$processingInstructions = array(\n\t\t\tarray(\n\t\t\t\t'command' => 'thumbnail',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'size' => array(\n\t\t\t\t\t\t'width' => intval($maximumWidth ?: $this->width),\n\t\t\t\t\t\t'height' => intval($maximumHeight ?: $this->height)\n\t\t\t\t\t),\n\t\t\t\t\t'mode' => $ratioMode\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\treturn new ImageVariant($this, $processingInstructions);\n\n\t}", "public function setOptimalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n if (empty($this->__requestedHeight) || empty($this->__requestedWidth)) {\n $this->setError(__d('cloggy','Empty requested width and height.'));\n } else {\n\n /*\n * get optimal size width and height\n */\n switch ($this->__option) {\n\n case 'exact':\n $this->__optimalWidth = $this->__requestedWidth;\n $this->__optimalHeight = $this->__requestedHeight;\n break;\n\n case 'portrait':\n $this->__setOptimalSizeByPortrait();\n break;\n\n case 'landscape':\n $this->__setOptimalSizeByLandscape();\n break;\n\n case 'crop':\n $this->__setOptimalSizeByCrop();\n break;\n\n default:\n $this->__setOptimalSizeByAuto();\n break;\n }\n }\n \n }\n \n }", "function gallery_watermark($path){\n $image = new Imagick();\n $image->readImage(getcwd(). $path);\n\n // Open the watermark image\n // Important: the image should be obviously transparent with .png format\n $watermark = new Imagick();\n $watermark->readImage(getcwd(). \"/asset/images/watermark.png\");\n\n // Retrieve size of the Images to verify how to print the watermark on the image\n $img_Width = $image->getImageWidth();\n $img_Height = $image->getImageHeight();\n $watermark_Width = $watermark->getImageWidth();\n $watermark_Height = $watermark->getImageHeight();\n\n // // Check if the dimensions of the image are less than the dimensions of the watermark\n // // In case it is, then proceed to \n // if ($img_Height < $watermark_Height || $img_Width < $watermark_Width) {\n // // Resize the watermark to be of the same size of the image\n // $watermark->scaleImage($img_Width, $img_Height);\n\n // // Update size of the watermark\n // $watermark_Width = $watermark->getImageWidth();\n // $watermark_Height = $watermark->getImageHeight();\n // }\n\n // Calculate the position\n $x = ($img_Width - $watermark_Width) / 2;\n $y = ($img_Height - $watermark_Height) / 2;\n\n // Draw the watermark on your image\n $image->compositeImage($watermark, Imagick::COMPOSITE_OVER, $x, $y);\n\n\n // From now on depends on you what you want to do with the image\n // for example save it in some directory etc.\n // In this example we'll Send the img data to the browser as response\n // with Plain PHP\n // $image->writeImage(\"/test_watermark/<kambing class=\"\"></kambing>\" . $image->getImageFormat()); \n // header(\"Content-Type: image/\" . $image->getImageFormat());\n // echo $image;\n\n // Or if you prefer to save the image on some directory\n // Take care of the extension and the path !\n $image->writeImage(getcwd(). $path); \n }", "function _needPreview ($imageToolkit) {\n if ($this->getSize() < MIN_SIZE_FOR_PREVIEW * 1024) {\n return false;\n }\n\n // Si image de départ plus petite, on ne redimentione pas la photo\n if ($imageToolkit->destBiggerThanFrom()) {\n return false;\n }\n\n return true;\n }", "public function setResolution()\n\t{\n\t\t$args=func_get_args();\n\n\t\tif(count($args)==0 or count($args)>2) return;\n\n\t\t$this->resizeFlag=true;\n\n\t\t$this->width=$args[0];\n\t\t$this->height=$args[1];\n\n\t}", "function print_water_marked_image($path){\n $image = new Imagick();\n $image->readImage(_LOCAL_.$path);\n\n $height = $image->getImageHeight();\n $width = $image->getImageWidth();\n\n $watermark = new Imagick();\n $watermark->readImage($_SERVER[DOCUMENT_ROOT].__WATER_MARK_PATH__);\n $watermark = $watermark->flattenImages();\n $watermark->setImageOpacity(0.3);\n $watermark->setImageOrientation(Imagick::COLOR_ALPHA);\n\n $water_height = $watermark->getImageHeight();\n $water_width = $watermark->getImageWidth();\n\n $canvas = new Imagick();\n $canvas->newImage($width,$height,new ImagickPixel('white'));\n $canvas->setImageFormat('png');\n $canvas->compositeImage($image,imagick::COMPOSITE_OVER, 0, 0);\n\n $cal_margin_width = ($water_width-($width%$water_width))/2;\n $cal_margin_height = ($water_height-($height%$water_height))/2;\n $count_x = ($width-$width%$water_width)/$water_width;\n $count_y = ($height-$height%$water_height)/$water_height;\n for($i=0; $i<=$count_x;$i++){\n for ($j=0; $j <=$count_y; $j++) {\n $j+=2;\n if(!($i%2)){\n $canvas->compositeImage($watermark,imagick::COMPOSITE_OVER, $i*$water_width-$cal_margin_width, $j*$water_height-$cal_margin_height);\n }\n }\n }\n\n header('Content-type: image/png');\n echo $canvas;\n $image->destroy();\n $watermark->destroy();\n $canvas->destroy();\n}", "public function _set_new_size_auto()\n {\n if (empty($this->source_width) || empty($this->source_height)) {\n if ( ! $this->SILENT_MODE) {\n trigger_error('Missing source image sizes!', E_USER_WARNING);\n }\n return false;\n }\n $k1 = $this->source_width / $this->limit_x;\n $k2 = $this->source_height / $this->limit_y;\n $k = $k1 >= $k2 ? $k1 : $k2;\n if ($this->reduce_only && $k1 <= 1 && $k2 <= 1) {\n $this->output_width = $this->source_width;\n $this->output_height = $this->source_height;\n } else {\n $this->output_width = round($this->source_width / $k, 0);\n $this->output_height = round($this->source_height / $k, 0);\n }\n return true;\n }", "function watermark( $img, $cpr, $font, $font_size, $rgbtext, $rgbtsdw, $hotspot, $txp, $typ, $sxp, $syp )\n\t{\n\t\tstrtolower( substr( $img, strlen( $img ) - 4, 4 ) ) == \"jpeg\" ? $suffx = \"jpeg\" : $suffx = strtolower( substr( $img, strlen( $img ) - 3, 3 ) );\n\t\tswitch( $suffx )\n\t\t{\n\t\t\tcase \"jpg\":\n\t\t\t\t$image = imageCreateFromJpeg( $img );\n\t\t\t\tbreak;\n\t\t\tcase \"jpeg\":\n\t\t\t\t$image = imageCreateFromJpeg( $img );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"gif\":\n\t\t\t\t$image = imageCreateFromGif( $img );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"png\":\n\t\t\t\t$image = imageCreateFromPng( $img );\n\t\t\t\tbreak;\n\t\t}\n \tif( $hotspot != 0 )\n \t{\n \t\t$ix = imagesx( $image );\n \t\t$iy = imagesy( $image );\n \t\t$tsw = strlen( $text ) * $font_size / imagefontwidth( $font ) * 3;\n \t\t$tsh = $font_size / imagefontheight( $font );\n \t\tswitch ( $hotspot )\n \t\t{\n \t\tcase 1:\n \t\t\t$txp = $txp; $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 2:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 3:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = $tsh * $tsh + imagefontheight( $font ) * 2 + $typ;\n \t\t\tbreak;\n \t\tcase 4:\n \t\t\t$txp = $txp; $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 5:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 6:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = floor( ( $iy - $tsh ) / 2 );\n \t\t\tbreak;\n \t\tcase 7:\n \t\t\t$txp = $txp; $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\tcase 8:\n \t\t\t$txp = floor( ( $ix - $tsw ) / 2 ); $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\tcase 9:\n \t\t\t$txp = $ix - $tsw - $txp; $typ = $iy - $tsh - $typ;\n \t\t\tbreak;\n \t\t}\n \t}\n \t\tImageTTFText( $image, $font_size, 0, $txp + $sxp, $typ + $syp, imagecolorallocate( $image, HexDec( $rgbtsdw ) & 0xff, ( HexDec( $rgbtsdw ) >> 8 ) & 0xff, ( HexDec( $rgbtsdw ) >> 16 ) & 0xff ), $font, $cpr );\n \t\tImageTTFText( $image, $font_size, 0, $txp, $typ, imagecolorallocate( $image, HexDec( $rgbtext ) & 0xff, ( HexDec( $rgbtext ) >> 8 ) & 0xff, ( HexDec( $rgbtext ) >> 16 ) & 0xff ), $font, $cpr );\n\t\tswitch( $suffx )\n\t\t{\n\t\t\tcase \"jpg\":\n \t\t\t\theader( \"Content-type: image/jpg\" );\n \t\t\t\timageJpeg( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tcase \"jpeg\":\n \t\t\t\theader( \"Content-type: image/jpg\" );\n \t\t\t\timageJpeg( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"gif\":\n \t\t\t\theader( \"Content-type: image/gif\" );\n \t\t\t\timageGif( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t\tbreak;\n\t\t\tcase \"png\":\n \t\t\t\theader( \"Content-type: image/png\" );\n \t\t\t\timagePng( $image );\n \t\t\t\timageDestroy( $image );\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function update_size($width = \\false, $height = \\false)\n {\n }", "function fit($width, $height, $bgColor=array(255, 0, 0))\n\t\t{\n\t\t\t//TODO: set background color\n\t\t\tif (!$this->image) return;\n\t\t\t$ratio = $this->width / $this->height;\n\t\t \n\t\t\tif ($width / $height < $ratio) {\n\t\t\t\t $new_height = $width / $ratio;\n\t\t\t\t $new_width = $width;\n\t\t\t} else {\n\t\t\t\t $new_width = $height * $ratio;\n\t\t\t\t $new_height = $height;\n\t\t\t}\n\t\t \n\t\t\t$x_mid = $new_width / 2; //horizontal middle\n\t\t\t$y_mid = $new_height / 2; //vertical middle\n\t\t \n\t\t\t$process = imagecreatetruecolor(round($new_width), round($new_height));\n\t\t \n\t\t\timagecopyresampled($process, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height);\n\t\t\t$fit = imagecreatetruecolor($width, $height);\n\t\t\timagecopyresampled($fit, $process, 0, 0, ($x_mid-($width/2)), ($y_mid-($height/2)), $width, $height, $width, $height);\n\t\t\t\n\t\t\timagedestroy($process);\n\t\t\treturn $this->image = $fit;\n\t\t}", "public function validate_parameters() {\n\t\t// phpcs:disable WordPress.Security.NonceVerification.Recommended\n\n\t\tif ( empty( $_REQUEST['id'] ) ) {\n\t\t\t/* translators: 1: parameter markup */\n\t\t\twp_die( sprintf( esc_html__( 'Invalid %s parameter.', 'wpcom-thumbnail-editor' ), '<code>id</code>' ) );\n\t\t}\n\n\t\t$attachment = get_post( intval( $_REQUEST['id'] ) );\n\t\tif ( ! $attachment ) {\n\t\t\t/* translators: 1: parameter markup */\n\t\t\twp_die( sprintf( esc_html__( 'Invalid %s parameter.', 'wpcom-thumbnail-editor' ), '<code>id</code>' ) );\n\t\t}\n\n\t\tif ( 'attachment' != $attachment->post_type || ! wp_attachment_is_image( $attachment->ID ) ) {\n\t\t\twp_die( esc_html__( 'That is not a valid image attachment.', 'wpcom-thumbnail-editor' ) );\n\t\t}\n\n\t\tif ( ! current_user_can( get_post_type_object( $attachment->post_type )->cap->edit_post, $attachment->ID ) ) {\n\t\t\twp_die( esc_html__( 'You are not allowed to edit this attachment.', 'wpcom-thumbnail-editor' ) );\n\t\t}\n\n\t\tif ( $this->use_ratio_map ) {\n\t\t\tif ( empty( $_REQUEST['size'] ) || ! in_array( $_REQUEST['size'], $this->get_image_sizes_by_ratio(), true ) ) {\n\t\t\t\t/* translators: 1: parameter markup */\n\t\t\t\twp_die( sprintf( esc_html__( 'Invalid %s parameter.', 'wpcom-thumbnail-editor' ), '<code>size</code>' ) );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( empty( $_REQUEST['size'] ) || ! in_array( $_REQUEST['size'], $this->get_intermediate_image_sizes(), true ) ) {\n\t\t\t\t/* translators: 1: parameter markup */\n\t\t\t\twp_die( sprintf( esc_html__( 'Invalid %s parameter.', 'wpcom-thumbnail-editor' ), '<code>size</code>' ) );\n\t\t\t}\n\t\t}\n\n\t\t// phpcs:enable\n\n\t\treturn $attachment;\n\t}", "public function setWidth($width) {}", "public function setWidth($width) {}", "public function setWidth($width) {}", "protected function failsBasicDimensionChecks($parameters, $width, $height)\n {\n return (isset($parameters['width']) && $parameters['width'] != $width) ||\n (isset($parameters['min_width']) && $parameters['min_width'] > $width) ||\n (isset($parameters['max_width']) && $parameters['max_width'] < $width) ||\n (isset($parameters['height']) && $parameters['height'] != $height) ||\n (isset($parameters['min_height']) && $parameters['min_height'] > $height) ||\n (isset($parameters['max_height']) && $parameters['max_height'] < $height);\n }", "function imageCheck($target,$width=1,$height=1){\n if($width==1&&$height==1){\n return is_array(getimagesize($target));\n }else{\n $rvalue = false;\n if(is_array(getimagesize($target))){\n try {\n $img = new Imagick($target);\n if(strtoupper($img->getImageFormat())=='GIF'){\n $img = $img->coalesceImages();\n $img = $img->coalesceImages();\n do {\n if($width==0||$height==0)\n $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1);\n else $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1,true);\n } while ($img->nextImage());\n $img = $img->deconstructImages();\n $img->writeImages($target,true);\n }else{\n if($width==0||$height==0)\n $img->thumbnailImage($width, $height);\n else $img->thumbnailImage($width, $height,true);\n $img->writeImage($target);\n }\n $img->destroy();\n $rvalue = true;\n } catch (Exception $e) {\n }\n }\n return $rvalue;\n }\n}", "function image_size_input_fields($post, $check = '')\n {\n }", "function WallpaperPreview($id, $dimensions, $dimensions_43, $filename, $name, $crop_align, $ext, $orignal_width, $orignal_height) {\n\t\n\t$dimensions_ar = explode('x', $dimensions);\n\t$gcd = AspectRatio($orignal_width, $orignal_height);\n\t$a = $orignal_width/$gcd; \n\t$b = $orignal_height/$gcd; \n\t$ratio = $a . \":\" . $b; \n\t\n\tif ($ratio == '4:3') {\n\t\t$dimensions = $dimensions_43;\n\t}\n\n\tglobal $setting;\n\tif ($setting['seo_on'] != 0) {\n\t\t$url = '/file/'.$id.'/'.$dimensions.'/16:9/'.$name.'_'.$filename.'.'.$ext;\n\t}\n\telse {\n\t\t$dimensions_ar = explode('x', $dimensions);\n\t\t$url = '/image.php?id='.$id.'&width='.$dimensions_ar[0].'&height='.$dimensions_ar[1].'&cropratio=16:9&cropposition='.$crop_align.'&filename='.$filename;\n\t}\n\treturn $setting['site_url'].$url;\n}", "public function checkWidthHeigth()\r\n\t{\r\n\t\t$referenceImageSize = getimagesize($this->referenceFile);\r\n\t\t$targetImageSize = getimagesize($this->targetFile);\r\n\t\treturn ((abs($targetImageSize[0] - $referenceImageSize[0])) < $this->pixelTol &&\r\n\t\t\tabs(($targetImageSize[1] - $referenceImageSize[1])) < $this->pixelTol);\r\n\t}", "function resize_fit_or_smaller($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)>$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}", "public static function init(int $width, int $height, string $title) {}", "function image_hwstring($width, $height)\n {\n }", "function resizeUpload($field,$pic_dir,$name_dir,$cropratio=NULL,$watermark=NULL,$max_width,$max_height,$add_to_filename=NULL, $quality=90){\r\n\t\tglobal $font_path, $font_size, $water_mark_text_1, $water_mark_text;\r\n\t\t$maxwidth = $max_width; // Max new width or height, can not exceed this value.\r\n\t\t$maxheight = $max_height;\r\n\t\t$dir = $pic_dir; // Directory to save resized image. (Include a trailing slash - /)\r\n\t\t// Collect the post variables.\r\n\t\t$postvars = array(\r\n\t\t\t\"image\" => trim($_FILES[\"$field\"][\"name\"]),\r\n\t\t\t\"image_tmp\" => $_FILES[\"$field\"][\"tmp_name\"],\r\n\t\t\t\"image_size\" => (int)$_FILES[\"$field\"][\"size\"],\r\n\t\t\t);\r\n\t\t\t// Array of valid extensions.\r\n\t\t\t$valid_exts = array(\"jpg\",\"jpeg\",\"gif\",\"png\");\r\n\t\t\t$mod_exts = array(\"gif\",\"png\");\r\n\t\t\t// Select the extension from the file.\r\n\t\t\t$ext = end(explode(\".\",strtolower(trim($_FILES[\"$field\"][\"name\"]))));\r\n\t\t\t//echo (\"Image size: \" . $postvars[\"image_size\"] . \"<br> Ext: \" . $ext . \"<br>\");\r\n\t\t\t// Check is valid extension.\r\n\t\t\tif(in_array($ext,$valid_exts)){\r\n\t\t\t\tif($ext == \"jpg\" || $ext == \"jpeg\"){\r\n\t\t\t\t\t$image = imagecreatefromjpeg($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"gif\"){\r\n\t\t\t\t\t$image = imagecreatefromgif($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\telse if($ext == \"png\"){\r\n\t\t\t\t\t$image = imagecreatefrompng($postvars[\"image_tmp\"]);\r\n\t\t\t\t}\r\n\t\t\t\t// Grab the width and height of the image.\r\n\t\t\t\tlist($width,$height) = getimagesize($postvars[\"image_tmp\"]);\r\n\t\t\t\t// Ratio cropping\r\n\t\t\t\t$offsetX\t= 0;\r\n\t\t\t\t$offsetY\t= 0;\r\n\t\t\t\tif ($cropratio) {\r\n\t\t\t\t\t\t$cropRatio = explode(':', (string) $cropratio);\r\n\t\t\t\t\t\t$ratioComputed\t\t= $width / $height;\r\n\t\t\t\t\t\t$cropRatioComputed\t= (float) $cropRatio[0] / (float) $cropRatio[1];\r\n\t\t\t\t\t\tif ($ratioComputed < $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t\t\t$height\t\t= $width / $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $width;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if ($ratioComputed > $cropRatioComputed)\r\n\t\t\t\t\t\t{ // Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t\t\t$width\t\t= $height * $cropRatioComputed;\r\n\t\t\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t\t\t\t$smallestSide = $height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We get the other dimension by multiplying the quotient of the new width or height divided by\r\n\t\t\t\t// the old width or height.\r\n\t\t\t $w_adjust = ($maxwidth / $width);\r\n\t\t\t $h_adjust = ($maxheight / $height);\r\n\t\t\t if (($width >= $maxwidth)||($height >= $maxheight)) {\r\n\t\t\t\t if($w_adjust <= $h_adjust)\r\n\t\t\t\t {\r\n\t\t\t\t\t $newwidth=floor($width*$w_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$w_adjust);\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $newwidth=floor($width*$h_adjust);\r\n\t\t\t\t\t $newheight=floor($height*$h_adjust);\r\n\t\t\t\t }\r\n\t\t\t } else {\r\n\t\t\t\t \t$newwidth=$width;\r\n\t\t\t\t\t$newheight=$height;\r\n\t\t\t }\r\n\t\t\t\t// Create temporary image file.\r\n\t\t\t\t$tmp = imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\t\r\n\t\t\t\t// Copy the image to one with the new width and height.\r\n\t\t\t\t\timagecopyresampled($tmp,$image,0,0,$offsetX,$offsetY,$newwidth,$newheight,$width,$height);\r\n\t\t\t\t\t// Create random 5 digit number for filename. Add to current timestamp.\r\n\t\t\t\t\t$rand = rand(10000,99999);\r\n\t\t\t\t\t$rand .= time();\r\n\t\t\t\t\t$origfilename = $name_dir.$rand ;\r\n if ($add_to_filename){ $origfilename .= \"_\".$add_to_filename; }\r\n $origfilename .= \".jpg\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t$filename = $dir.$rand;\r\n if ($add_to_filename){ $filename .= \"_\".$add_to_filename; }\r\n $filename .= \".jpg\";\r\n\r\n\t\t\t\tif ($watermark) {\r\n\t\t\t\t\t//Apply watermark here\t\t\t\t\t\r\n\t\t\t\t\t$maroon = imagecolorallocate($tmp, 134, 22, 0);\r\n\t\t\t\t\t$white = imagecolorallocate($tmp, 255, 255, 255);\r\n\t\t\t\t\t/*$base_height = $newheight-20;\r\n\t\t\t\t\t$base_width = $newwidth/5;*/\r\n\t\t\t\t\t//$borderOffset = 4;\r\n\t\t\t\t\t$dimensions = imagettfbbox($font_size, 0, $font_path, $water_mark_text);\r\n\t\t\t\t\t$lineWidth = ($dimensions[2] - $dimensions[0]);\r\n\t\t\t\t\t$textX = (ImageSx($tmp) - $lineWidth) / 2;\r\n\t\t\t\t\t$textY = ($newheight/10)*9;\t\t\t\t\t\r\n\t\t\t\t // Add some shadow to the text\t\t\t\t\t\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX+1,$textY+1, $white, $font_path, $water_mark_text);\r\n\t\t\t\t\timagettftext($tmp, $font_size, 0, $textX, $textY, $maroon, $font_path, $water_mark_text);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t// Create image file with specified quality in % (low quality image in less image sharpness)\r\n\t\t\t\timagejpeg($tmp,$filename,$quality);\r\n\t\t\t\treturn $origfilename;\r\n\r\n\t\t\t\timagedestroy($image);\r\n\t\t\t\timagedestroy($tmp);\t\r\n\r\n\t\t\t}\r\n\r\n\t\r\n\r\n\t}", "abstract protected function getWidthOptions();", "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 }", "function thyme_validate_logo_width( $validity, $width ) {\n\n\tif ( empty( $width ) || ! is_numeric( $width ) ) {\n\t\t$validity->add( 'required', __( 'You must supply a valid number.', 'thyme-theme' ) );\n\t} elseif ( $width < 100 ) {\n\t\t$validity->add( 'logo_too_small', __( 'The logo width cannot be less than 100.', 'thyme-theme' ) );\n\t}\n\n\treturn $validity;\n\n}", "public function setSize($width, $height) {\r\nif (null === $width && null === $height) {\r\n$this->new_width = $this->width;\r\n$this->new_height = $this->height;\r\n}\r\nelseif (isset($width) && isset($height)) {\r\n$this->new_width = $width;\r\n$this->new_height = $height;\r\n}\r\nelseif(isset($width) && !isset($height)) {\r\n$this->new_width = $width;\r\n$this->new_height = round($this->new_width * $this->height / $this->width);\r\n}\r\nelseif(!isset($width) && isset($height)) {\r\n$this->new_height = $height;\r\n$this->new_width = round($this->new_height * $this->width / $this->height);\r\n}\r\nif($this->new_height != (int)$this->new_height || $this->new_width != (int)$this->new_width)\r\nthrow new Exception('<b>Error:</b> Parameters 3 and 4 expect to be type of integer');\r\n}", "function setWaterMark($filePath, $doc) {\r\n $docType = DocTypes::model()->getDocumentByDocTypeDesc($doc);\r\n $this->filePath = $filePath;\r\n $path = $this->getValidFile();\r\n $im = new Imagick($path);\r\n try {\r\n $outputtype = $im->getFormat();\r\n $size = $im->getImageLength();\r\n if ($docType->water_mark_text != null) {\r\n $draw = new ImagickDraw();\r\n $draw->setFontSize($docType->water_mark_font_size);\r\n $draw->setFillOpacity($docType->water_mark_opacity);\r\n $draw->setGravity(Imagick::GRAVITY_CENTER);\r\n $im->annotateImage($draw, 0, 0, $docType->water_mark_angle, $docType->water_mark_text);\r\n }\r\n return $im;\r\n } catch (Exception $e) {\r\n $message = $e->getMessage();\r\n }\r\n }", "function setSize($w=0,$h=0){\r\n $this->width = $w;\r\n $this->heigth=$h;\r\n }", "function watermarkText21Image ($SourceFile,$WaterMarkText) {\n header(\"Content-type: image/jpg\");\n //Using imagecopymerge() to create a translucent watermark\n \n // Load the image on which watermark is to be applied\n $original_image = imagecreatefromjpeg($SourceFile);\n // Get original parameters\n list($original_width, $original_height, $original_type, $original_attr) = getimagesize($original_image); \n \n // create watermark with orig size\n $watermark = imagecreatetruecolor(200, 60);\n \n $original_image = imagecreatefromjpeg($SourceFile);\n \n // Define text\n $font = $_SERVER['DOCUMENT_ROOT'].'/include/captcha/fonts/moloto.otf';\n $white = imagecolorallocate($watermark, 255, 255, 255);\n // Add some shadow to the text\n imagettftext($watermark, 18, 0, 30, 35, $white, $font, $WaterMarkText);\n \n // Set the margins for the watermark and get the height/width of the watermark image\n $marge_right = 10;\n $marge_bottom = 10;\n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n \n // Merge the watermark onto our photo with an opacity (transparency) of 50%\n imagecopymerge($original_image, \n $watermark,\n imagesx($original_image)/2 - $sx/2 , \n imagesy($original_image) /2 - $sy/2,\n 0, \n 0, \n imagesx($watermark), \n imagesy($watermark),\n 20\n );\n \n // Save the image to file and free memory\n imagejpeg($original_image, null, 100); //$SourceFile\n imagedestroy($original_image);\n}", "public function setWidth($width);", "public function setWidth($width);", "function wp_imagecreatetruecolor($width, $height)\n {\n }", "public function hasImageWidth()\n {\n return $this->image_width !== null;\n }", "public function setWatermark(int $events, int $lowmark, int $highmark): void {}", "public function testDimensionsInsetFillWhite()\n {\n $dimensions = Dimensions::create(\n 400,\n 400,\n 300,\n 150,\n ElcodiMediaImageResizeTypes::INSET_FILL_WHITE\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(0, $dimensions->getSrcY());\n $this->assertEquals(400, $dimensions->getSrcWidth());\n $this->assertEquals(400, $dimensions->getSrcHeight());\n\n $this->assertEquals(75, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(150, $dimensions->getDstWidth());\n $this->assertEquals(150, $dimensions->getDstHeight());\n $this->assertEquals(300, $dimensions->getDstFrameX());\n $this->assertEquals(150, $dimensions->getDstFrameY());\n }", "function wp_shrink_dimensions($width, $height, $wmax = 128, $hmax = 96)\n {\n }", "public function __construct($width = null, $height = null)\n {\n $this->width = is_numeric($width) ? (int) $width : $this->width;\n $this->height = is_numeric($height) ? (int) $height : $this->height;\n }", "public function testResizeIfNeededNotNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/small-image.jpg', true);\n $this->assertFalse($resized);\n\n // wide image to be resized\n $resized = Processor::resizeIfNeeded('/app/tests/wide-image.jpg', true);\n $this->assertTrue($resized);\n }", "public function sizeImg($width, $height, $crop = true);", "private function watermark_imagick($name, $ext, $logo, $w_logo, $h_logo, $div_photo)\n {\n #Not just me babe, All the places mises you ..\n $im = new \\Imagick($name);\n\n $watermark = new \\Imagick($logo);\n //$watermark->readImage($);\n\n #how big are the images?\n $iWidth = $im->getImageWidth();\n $iHeight = $im->getImageHeight();\n $wWidth = $watermark->getImageWidth();\n $wHeight = $watermark->getImageHeight();\n\n if ($iHeight < $wHeight || $iWidth < $wWidth) {\n #resize the watermark\n $watermark->scaleImage($iWidth, $iHeight);\n\n #get new size\n $wWidth = $watermark->getImageWidth();\n $wHeight = $watermark->getImageHeight();\n }\n\n #calculate the position\n $x = (($iWidth - ($wWidth - 5)) / $div_photo) * $w_logo;\n $y = (($iHeight - ($wHeight - 5)) / $div_photo) * $h_logo;\n\n #an exception for gif image\n #generating thumb with 10 frames only, big gif is a devil\n $composite_over = \\imagick::COMPOSITE_OVER;\n\n if ($ext == 'gif') {\n $i = 0;\n //$gif_new = new Imagick();\n foreach ($im as $frame) {\n $frame->compositeImage($watermark, $composite_over, $x, $y);\n\n //\t$gif_new->addImage($frame->getImage());\n if ($i >= 10) {\n # more than 10 frames, quit it\n break;\n }\n $i++;\n }\n $im->writeImages($name, true);\n return;\n }\n\n $im->compositeImage($watermark, $composite_over, $x, $y);\n\n $im->writeImages($name, false);\n }", "function Watermarker($stampPath, //chemin du logo\r\n\t\t\t\t $vAlign=POSITION_TOP, // alignement vertical du logo\r\n\t\t\t\t $hAlign=POSITION_LEFT, // alignement horizontal du logo\r\n\t\t\t\t $vMargin = 5, //marge verticale du logo\r\n\t\t\t\t $hMargin = 5, // marge horizontale du logo\r\n\t\t\t\t $transparence=100) {\r\n\t\t$this->stampPath = $stampPath;\r\n\t\t$this->vAlign = $vAlign;\r\n\t\t$this->hAlign = $hAlign;\r\n\t\t$this->alpha = $transparence/100;\r\n\t}", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function __checkDimensions($filePath) {\n\t\t$size = getimagesize($filePath);\n\t\t\t\t\n\t\tif(!$size) {\n\t\t\t$this->Session->setFlash('We could not check that image\\'s size, so we can\\'t upload it.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\n\t\tif($size[0] > 800 || $size[1] > 800) {\n\t\t\t$this->Session->setFlash('Images cannot be any larger than 800 by 800 pixels.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t\t\n\t}", "function yz_attachments_get_cover_image_dimensions( $wh ) {\n return array( 'width' => 1350, 'height' => 350 );\n}", "function resize_fit_or_bigger($width, $height) {\n\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\t$ratio = $width / $w;\n\t\tif (($h*$ratio)<$height)\n\t\t\t$ratio = $height / $h;\n\t\t\n\t\t$h *= $ratio;\n\t\t$w *= $ratio;\n\n\t\t$this->resize($w, $h);\n\t}", "public function testDimensionsOutboundsFillWhite()\n {\n $dimensions = Dimensions::create(\n 400,\n 400,\n 300,\n 150,\n ElcodiMediaImageResizeTypes::OUTBOUNDS_FILL_WHITE\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(0, $dimensions->getSrcY());\n $this->assertEquals(400, $dimensions->getSrcWidth());\n $this->assertEquals(400, $dimensions->getSrcHeight());\n\n $this->assertEquals(0, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(300, $dimensions->getDstWidth());\n $this->assertEquals(300, $dimensions->getDstHeight());\n $this->assertEquals(300, $dimensions->getDstFrameX());\n $this->assertEquals(300, $dimensions->getDstFrameY());\n }", "protected static function ImageMagickWatermark($in_file, $out_file, $wm_file)\n {\n $command_composite =\n \"composite -gravity SouthWest \".\n escapeshellarg($wm_file).\n \" \".\n escapeshellarg($in_file).\n \" -strip \".\n escapeshellarg($out_file);\n\n shell_exec($command_composite);\n }", "protected abstract function createGoogleVisualization($width, $height);", "public function testSetMaxDimensionsNotNumericWidth() {\n $this->assertFalse($this->up->setMaxDimensions(\"Hello\", 480));\n }", "public function watermark(Image $watermark, $offset_x = NULL, $offset_y = NULL, $opacity = 100)\n {\n if ($offset_x === NULL)\n {\n // Center the X offset\n $offset_x = round(($this->width - $watermark->width) / 2);\n }\n elseif ($offset_x === TRUE)\n {\n // Bottom the X offset\n $offset_x = $this->width - $watermark->width;\n }\n elseif ($offset_x < 0)\n {\n // Set the X offset from the right\n $offset_x = $this->width - $watermark->width + $offset_x;\n }\n\n if ($offset_y === NULL)\n {\n // Center the Y offset\n $offset_y = round(($this->height - $watermark->height) / 2);\n }\n elseif ($offset_y === TRUE)\n {\n // Bottom the Y offset\n $offset_y = $this->height - $watermark->height;\n }\n elseif ($offset_y < 0)\n {\n // Set the Y offset from the bottom\n $offset_y = $this->height - $watermark->height + $offset_y;\n }\n\n // The opacity must be in the range of 1 to 100\n $opacity = min(max($opacity, 1), 100);\n\n $this->_do_watermark($watermark, $offset_x, $offset_y, $opacity);\n\n return $this;\n }", "private static function addWatermark($image, $watermark, $padding = 0)\n {\n // Check if the watermark is bigger than the image\n $image_width = $image->getImageWidth();\n $image_height = $image->getImageHeight();\n $watermark_width = $watermark->getImageWidth();\n $watermark_height = $watermark->getImageHeight();\n\n if ($image_width < $watermark_width + $padding || $image_height < $watermark_height + $padding)\n {\n return false;\n }\n\n // Calculate each position\n $positions = array();\n $positions[] = array($image_width - $watermark_width - $padding, $image_height - $watermark_height - $padding);\n $positions[] = array(0 + $padding, $image_height - $watermark_height - $padding);\n\n // Initialization\n $min = null;\n $min_colors = 0;\n\n // Calculate the number of colors inside each region and retrieve the minimum\n foreach($positions as $position)\n {\n $colors = $image->getImageRegion($watermark_width, $watermark_height, $position[0], $position[1])->getImageColors();\n\n if ($min === null || $colors <= $min_colors)\n {\n $min = $position;\n $min_colors = $colors;\n }\n }\n\n // Draw the watermark\n $image->compositeImage($watermark, Imagick::COMPOSITE_OVER, $min[0], $min[1]);\n\n return true;\n }", "private function applyWatermark(ImageInterface $image, ImageInterface $watermark)\n {\n $size = $image->getSize();\n $wSize = $watermark->getSize();\n\n $bottomRight = new Point($size->getWidth() - $wSize->getWidth(), $size->getHeight() - $wSize->getHeight());\n\n $image->paste($watermark, $bottomRight);\n\n return $image;\n }", "public function testSetMaxDimensionsNotNumericHeight() {\n $this->assertFalse($this->up->setMaxDimensions(640, \"world\"));\n }", "public function resize($width, $height = null);", "public function create($src, $width = null, $height = null, $no_crop = null, $keep_canvas_size = null, $public = null, $dynamic_output = null) {\n\n if (is_array($src)) {\n\n $src = array_only($src, array('src', 'width', 'w', 'height', 'h', 'no_crop', 'keep_canvas_size', 'dynamic_output'));\n\n if (isset($src['width'])) {\n $width = $src['width'];\n } elseif (isset($src['w'])) {\n $width = $src['w'];\n } else {\n $width = $width;\n }\n\n if (isset($src['height'])) {\n $height = $src['height'];\n } elseif (isset($src['h'])) {\n $height = $src['h'];\n } else {\n $height = $height;\n }\n\n $no_crop = isset($src['no_crop']) ? $src['no_crop'] : $no_crop;\n $keep_canvas_size = isset($src['keep_canvas_size']) ? $src['keep_canvas_size'] : $keep_canvas_size;\n $public = isset($src['public']) ? $src['public'] : $public;\n $dynamic_output = isset($src['dynamic_output']) ? $src['dynamic_output'] : $dynamic_output;\n\n // The following assignment is to be at the last place within this block.\n $src = isset($src['src']) ? $src['src'] : null;\n }\n\n $public = !empty($public);\n $dynamic_output = !empty($dynamic_output);\n\n // Sanitaze the source URL.\n if ($this->_check_path($src) === false) {\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n // Calcualate the image path from the provided source URL.\n\n $src_path = $this->image_base_path.str_replace($this->image_base_url, '', $src);\n\n if (!is_file($src_path)) {\n\n if ($dynamic_output) {\n $this->_display_error(404);\n }\n\n return false;\n }\n\n $src_path = $this->_get_absolute_filename($src_path);\n\n if ($src_path === false || !is_file($src_path)) {\n\n if ($dynamic_output) {\n $this->_display_error(404);\n }\n\n return false;\n }\n\n // Get the name of a subdirectory that should contain the image's thumbnails.\n $image_cache_subdirectory = $this->_create_path_hash($src_path);\n $image_cache_path = ($public ? $this->image_public_cache_path : $this->image_cache_path).$image_cache_subdirectory.'/';\n\n // Get the image base name and file extension.\n $src_name_parts = $this->ci->image_lib->explode_name($src_path);\n $name = pathinfo($src_name_parts['name'], PATHINFO_BASENAME);\n $ext = $src_name_parts['ext'];\n\n // Expose the image default parameters.\n extract($this->_get_image_defaults());\n\n // Prepare the input parameters.\n\n $w = (string) $width;\n $h = (string) $height;\n\n $no_crop = !empty($no_crop);\n $no_crop_saved = $no_crop;\n\n if ($force_crop) {\n $no_crop = false;\n }\n\n $keep_canvas_size = !empty($keep_canvas_size);\n\n // Determine whether dynamic input is enabled.\n\n if ($dynamic_output) {\n\n $dynamic_output_enabled = false;\n\n foreach ($this->enable_dynamic_output as & $d_location) {\n\n if (strpos($src_path, $d_location) === 0) {\n $dynamic_output_enabled = true;\n }\n }\n\n unset($d_location);\n\n if (!$dynamic_output_enabled) {\n $this->_display_error(403);\n }\n }\n\n // Check whether the image is valid one.\n\n $prop = $this->ci->image_lib->get_image_properties($src_path, true);\n\n if ($prop === false) {\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n $mime_type = $prop['mime_type'];\n $image_type = $prop['image_type'];\n $src_size = filesize($src_path);\n\n // The image seems to be valid, so create the corresponding\n // subdirectory that should contain the image's thumbnails.\n file_exists($image_cache_path) OR @mkdir($image_cache_path, DIR_WRITE_MODE, TRUE);\n\n // Determine whether a watermark should be put.\n\n $has_watermark = false;\n\n foreach ($this->enable_watermark as & $wm_location) {\n\n if (strpos($src_path, $wm_location) === 0) {\n $has_watermark = true;\n }\n }\n\n unset($wm_location);\n\n // Determine kind of Image_lib's resizing operation is to be executed.\n\n $resize_operation = null;\n\n if ($w > 0) {\n\n $resize_operation = 'fit_width';\n $w = (int) $w;\n\n } else {\n\n $w = '';\n }\n\n if ($h > 0) {\n\n $resize_operation = $resize_operation == 'fit_width'\n ? ($no_crop ? ($keep_canvas_size ? 'fit_canvas' : 'fit_inner') : 'fit')\n : 'fit_height';\n\n $h = (int) $h;\n\n } else {\n\n $h = '';\n }\n\n if ($resize_operation == '') {\n\n $w = (int) $prop['width'];\n $h = (int) $prop['height'];\n\n $resize_operation = $keep_canvas_size ? 'fit_canvas' : 'fit_inner';\n }\n\n // Based on the real file name and the relevant parameters the thumbnail's\n // filename (a hash) is to be created. Let us determine these parameters.\n\n $parameters = compact(\n 'src_path',\n 'src_size',\n 'resize_operation',\n 'w',\n 'h',\n 'no_crop',\n 'force_crop',\n 'keep_canvas_size',\n 'has_watermark'\n );\n\n if ($keep_canvas_size) {\n\n $parameters = array_merge($parameters, compact(\n 'bg_r',\n 'bg_g',\n 'bg_b',\n 'bg_alpha'\n ));\n }\n\n if ($has_watermark) {\n\n $wm_parameters = compact(\n 'wm_enabled_min_w',\n 'wm_enabled_min_h',\n 'wm_type',\n 'wm_padding',\n 'wm_vrt_alignment',\n 'wm_hor_alignment',\n 'wm_hor_offset',\n 'wm_vrt_offset'\n );\n\n if ($wm_type == 'text') {\n\n $wm_parameters = array_merge($wm_parameters, compact(\n 'wm_text',\n 'wm_font_path',\n 'wm_font_size',\n 'wm_font_color',\n 'wm_shadow_color',\n 'wm_shadow_distance'\n ));\n\n } elseif ($wm_type == 'overlay') {\n\n $wm_parameters = array_merge($wm_parameters, compact(\n 'wm_overlay_path',\n 'wm_opacity',\n 'wm_x_transp',\n 'wm_y_transp'\n ));\n }\n\n $parameters = array_merge($parameters, $wm_parameters);\n }\n\n // Determine the destination file.\n //$cached_image_name = sha1(serialize($parameters)).$ext;\n $cached_image_name = sha1(serialize($parameters)).'-'.url_title($name, '-', true, true, $this->ci->config->default_language()).$ext; // SEO-friendly, hopefully.\n $cached_image_file = $image_cache_path.$cached_image_name;\n\n // If the destination file does not exist - create it.\n\n if (!is_file($cached_image_file)) {\n\n // Resize the image and write it to destination file.\n\n $config = array();\n $config['source_image'] = $src_path;\n $config['dynamic_output'] = false;\n $config['new_image'] = $cached_image_file;\n $config['maintain_ratio'] = true;\n $config['create_thumb'] = false;\n $config['width'] = $w;\n $config['height'] = $h;\n $config['quality'] = 100;\n\n if (!$this->ci->image_lib->initialize($config)) {\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n if ($resize_operation == 'fit_inner' || $resize_operation == 'fit_canvas') {\n $this->ci->image_lib->resize();\n } else {\n $this->ci->image_lib->fit();\n }\n\n $this->ci->image_lib->clear();\n\n // If the canvas size is to be preserved - add background with the\n // given width and height and place the image at the center.\n\n if ($resize_operation == 'fit_canvas') {\n\n $backgrund_image = @ tempnam(sys_get_temp_dir(), 'imp');\n\n if ($backgrund_image === false) {\n\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n $img = imagecreatetruecolor($w, $h);\n imagesavealpha($img, true);\n $bg = imagecolorallocatealpha($img, $bg_r, $bg_g, $bg_b, $bg_alpha);\n imagefill($img, 0, 0, $bg);\n\n $this->ci->image_lib->image_type = $image_type;\n $this->ci->image_lib->full_dst_path = $backgrund_image;\n $this->ci->image_lib->quality = 100;\n\n if (!$this->ci->image_lib->image_save_gd($img)) {\n\n @ unlink($backgrund_image);\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n $this->ci->image_lib->clear();\n\n $config = array();\n $config['source_image'] = $backgrund_image;\n $config['wm_type'] = 'overlay';\n $config['wm_overlay_path'] = $cached_image_file;\n $config['wm_opacity'] = 100;\n $config['wm_hor_alignment'] = 'center';\n $config['wm_vrt_alignment'] = 'middle';\n $config['wm_x_transp'] = false;\n $config['wm_y_transp'] = false;\n $config['dynamic_output'] = false;\n $config['new_image'] = $cached_image_file;\n $config['quality'] = 100;\n\n if (!$this->ci->image_lib->initialize($config)) {\n\n @ unlink($backgrund_image);\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n if (!$this->ci->image_lib->watermark()) {\n\n @ unlink($backgrund_image);\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n @ unlink($backgrund_image);\n $this->ci->image_lib->clear();\n }\n\n // If a watermark is needed, place it.\n\n if ($has_watermark) {\n\n $prop_resized = $this->ci->image_lib->get_image_properties($cached_image_file, true);\n\n if ($prop_resized === false) {\n\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n if ($prop_resized['width'] < $wm_enabled_min_w || $prop_resized['height'] < $wm_enabled_min_h) {\n $has_watermark = false;\n }\n\n if ($has_watermark) {\n\n $config = array();\n $config['source_image'] = $cached_image_file;\n $config['dynamic_output'] = false;\n $config['new_image'] = $cached_image_file;\n $config['quality'] = 100;\n $config = array_merge($config, $wm_parameters);\n\n if (!$this->ci->image_lib->initialize($config)) {\n\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n if (!$this->ci->image_lib->watermark()) {\n\n @ unlink($cached_image_file);\n\n if ($dynamic_output) {\n $this->_display_error(500);\n }\n\n return false;\n }\n\n $this->ci->image_lib->clear();\n }\n }\n }\n\n // Output or return the result.\n\n if ($dynamic_output) {\n $this->_display_graphic_file($cached_image_file, $mime_type, $cached_image_name);\n }\n\n if ($public) {\n\n return array(\n 'path' => $cached_image_file,\n 'url' => $this->image_public_cache_url.$image_cache_subdirectory.'/'.pathinfo($cached_image_file, PATHINFO_BASENAME),\n );\n }\n\n $uri = 'thumbnail';\n\n $url = http_build_url(default_base_url($uri), array(\n 'query' => http_build_query(array(\n 'src' => $src,\n 'w' => $width,\n 'h' => $height,\n 'no_crop' => $no_crop_saved ? 0 : 1,\n 'keep_canvas_size' => $keep_canvas_size ? 0 : 1\n )\n )\n ), HTTP_URL_JOIN_QUERY);\n\n return array(\n 'path' => $cached_image_file,\n 'url' => $url,\n );\n }", "function validateFileDimensions(&$model, $fieldData, $fieldName, $dimensions) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n if (!empty($dimensions)) {\n $info = array();\n \n if (list($info['w'], $info['h'], $info['t']) = getimagesize($fieldData[$fieldName]['tmp_name'])) {\n $tmpGeometry = $dimensions;\n $tmpGeometry = str_replace('<', '', $tmpGeometry);\n $tmpGeometry = str_replace('>', '', $tmpGeometry);\n \n list($geometry['w'], $geometry['h']) = explode('x', $tmpGeometry);\n \n foreach ($geometry as $k => $v) {\n $geometry[$k] = str_replace('*', '', $geometry[$k]);\n if ($geometry[$k] == '') unset($geometry[$k]);\n }\n \n $geometry['gtlt'] = 'equal';\n \n if (strpos($dimensions, '>') > 0) {\n $geometry['gtlt'] = 'greater';\n } elseif (strpos($dimensions, '<') > 0) {\n $geometry['gtlt'] = 'less';\n }\n \n if (!empty($geometry['w']) && !assetCheckDimensions($info['w'], $geometry['w'], $geometry['gtlt'])) return false;\n if (!empty($geometry['h']) && !assetCheckDimensions($info['h'], $geometry['h'], $geometry['gtlt'])) return false;\n } else {\n return false;\n }\n }\n \n return true;\n }" ]
[ "0.6050402", "0.60050774", "0.5986196", "0.59629184", "0.59626067", "0.591524", "0.58761567", "0.5835559", "0.57863086", "0.57771903", "0.57351786", "0.5701685", "0.5680601", "0.5679656", "0.56523865", "0.561612", "0.56131077", "0.56046635", "0.5579537", "0.55602986", "0.55113995", "0.5490557", "0.5479126", "0.54734147", "0.54463124", "0.5436595", "0.54154086", "0.5407572", "0.540757", "0.539823", "0.5396263", "0.5396263", "0.5385649", "0.5376883", "0.53484994", "0.53459805", "0.5339994", "0.53241503", "0.5305947", "0.5297916", "0.5246495", "0.5246495", "0.5238429", "0.5231504", "0.5214639", "0.5214274", "0.52027386", "0.5201117", "0.5196986", "0.5175117", "0.5171345", "0.51661587", "0.51625395", "0.5158963", "0.5157544", "0.5157544", "0.5156131", "0.51531696", "0.5149879", "0.5142528", "0.51388747", "0.5132004", "0.5128559", "0.5126731", "0.5120026", "0.5110958", "0.5104099", "0.51028216", "0.5102743", "0.5071477", "0.5065474", "0.5050496", "0.5047874", "0.5040755", "0.5040755", "0.5039641", "0.5029186", "0.50284207", "0.5024369", "0.5023831", "0.5019348", "0.50077575", "0.5006903", "0.5000857", "0.49923232", "0.4989896", "0.4981252", "0.49786898", "0.4975979", "0.49738294", "0.49706307", "0.49617922", "0.4951589", "0.49400994", "0.49397084", "0.4937201", "0.49302503", "0.49242896", "0.49194175", "0.49139607" ]
0.50184214
81
Calcuates the dimensions of a given file based on the constraints of this modification
public function getNewDimensionsOfFile(File $file) { if ( ! $file->isImage()) { return FALSE; } ee()->load->library('image_lib'); ee()->image_lib->clear(); $original_dimensions = explode(" ", $file->file_hw_original); // We do math on these values, so we'll coerce them into integers // now. Empty strings ('') turn into 0. $original_dimensions[0] = (int) $original_dimensions[0]; $original_dimensions[1] = (int) $original_dimensions[1]; // If we have 0 or negative numbers for the original height/width // this is not an image if ($original_dimensions[0] < 1 || $original_dimensions[1] < 1) { return FALSE; } $width = $this->width; $height = $this->height; $force_master_dim = FALSE; // If either h/w unspecified, calculate the other here if ($this->width == '' OR $this->width == 0) { $width = ($original_dimensions[1]/$original_dimensions[0])*$this->height; $force_master_dim = 'height'; } elseif ($this->height == '' OR $this->height == 0) { // Old h/old w * new width $height = ($original_dimensions[0]/$original_dimensions[1])*$this->width; $force_master_dim = 'width'; } // If the original is smaller than the thumb hxw, we'll make a copy rather than upsize if (($force_master_dim == 'height' && $original_dimensions[0] < $height) OR ($force_master_dim == 'width' && $original_dimensions[1] < $width) OR ($force_master_dim == FALSE && ($original_dimensions[1] < $width && $original_dimensions[0] < $height) )) { return array( 'height' => $original_dimensions[0], 'width' => $original_dimensions[1], ); } $config = array( 'source_image' => $file->getAbsolutePath(), 'image_library' => ee()->config->item('image_resize_protocol'), 'library_path' => ee()->config->item('image_library_path'), 'maintain_ratio' => TRUE, 'width' => $width, 'height' => $height, 'master_dim' => $force_master_dim ); if (isset($this->resize_type) && $this->resize_type == 'crop') { // Scale the larger dimension up so only one dimension of our // image fits within the desired dimension if ($original_dimensions[1] > $original_dimensions[0]) { $config['width'] = round($original_dimensions[1] * $height / $original_dimensions[0]); // If the new width ends up being smaller than the // resized width if ($config['width'] < $width) { $config['width'] = $width; $config['master_dim'] = 'width'; } } elseif ($original_dimensions[0] > $original_dimensions[1]) { $config['height'] = round($original_dimensions[0] * $width / $original_dimensions[1]); // If the new height ends up being smaller than the // desired resized height if ($config['height'] < $height) { $config['height'] = $height; $config['master_dim'] = 'height'; } } // If we're dealing with a perfect square image elseif ($original_dimensions[0] == $original_dimensions[1]) { // And the desired image is landscape, edit the // square image's width to fit if ($width > $height || $width == $height) { $config['width'] = $width; $config['master_dim'] = 'width'; } // If the desired image is portrait, edit the // square image's height to fit elseif ($width < $height) { $config['height'] = $height; $config['master_dim'] = 'height'; } } ee()->image_lib->initialize($config); $config['x_axis'] = ((ee()->image_lib->width / 2) - ($width / 2)); $config['y_axis'] = ((ee()->image_lib->height / 2) - ($height / 2)); $config['maintain_ratio'] = FALSE; $config['width'] = $width; $config['height'] = $height; } ee()->image_lib->initialize($config); $dimensions = array( 'height' => round(ee()->image_lib->height), 'width' => round(ee()->image_lib->width), ); return $dimensions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calc_size()\n\t{\n\t\t\t$size = getimagesize(ROOT_PATH . $this->file);\n\t\t\t$this->width = $size[0];\n\t\t\t$this->height = $size[1];\n\t}", "abstract public function file_bounds($inputfile);", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function getSize($file);", "function calc_size()\n\t{\n\t}", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function getnewdimensions($maxwidth,$maxheight,$file_tmp)\n{\n\tlist($width, $height) = getimagesize($file_tmp);\n\t\n\t/*CALCULATE THE IMAGE RATIO*/\n\tif($width>$height)\n\t{\n\t\t$imgratio=$width/$height;\n\t\t$newwidth = ($imgratio>1)?$maxwidth:$maxwidth*$imgratio;\n\t\t$newheight = ($imgratio>1)?$maxwidth/$imgratio:$maxwidth;\n\t}\n\telse\n\t{\n\t\t$imgratio=$height/$width;\n\t\t$newwidth = ($imgratio>1)?$maxwidth:$maxwidth/$imgratio;\n\t\t$newheight = ($imgratio>1)?$maxwidth*$imgratio:$maxwidth;\n\t}\n\t\n\t\n\t/*SIZE DOWN AGAIN TO KEEP WITHIN HEIGHT CONTRAINT*/\n\tif($newheight>$maxheight)\n\t{\n\t\tif($newwidth>$newheight)\n\t\t{\n\t\t\t$imgratio=$newwidth/$newheight;\n\t\t\t$newheight = ($imgratio>1)?$maxheight:$maxheight/$imgratio;\n\t\t\t$newwidth = ($imgratio>1)?$maxheight*$imgratio:$maxheight;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$imgratio=$newheight/$newwidth;\n\t\t\t$newheight = ($imgratio>1)?$maxheight:$maxheight*$imgratio;\n\t\t\t$newwidth = ($imgratio>1)?$maxheight/$imgratio:$maxheight;\n\t\t}\n\t}\n\t$newheight=round($newheight);\n\t$newwidth=round($newwidth);\n\treturn array($newwidth,$newheight);\n}", "public function getImageDimensions()\n {\n $dimension = $this->_getSetting('dimension');\n if ($this->getRow()->use_crop) {\n $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();\n $dimension['crop'] = $parentDimension['crop'];\n }\n $data = $this->getImageData();\n return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);\n }", "abstract public function calculateCropBoxSize();", "public function getWidth() {\n return Image::make($this->file)->width();\n }", "function __checkDimensions($filePath) {\n\t\t$size = getimagesize($filePath);\n\t\t\t\t\n\t\tif(!$size) {\n\t\t\t$this->Session->setFlash('We could not check that image\\'s size, so we can\\'t upload it.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\n\t\tif($size[0] > 800 || $size[1] > 800) {\n\t\t\t$this->Session->setFlash('Images cannot be any larger than 800 by 800 pixels.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t\t\n\t}", "function getSize() ;", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "public function getSize();", "function guy_imagedims($src) {\n\tif (substr($src,0,1)=='/') $src = \nsubstr_replace($src,$_SERVER['DOCUMENT_ROOT'].'/',0,1);\n\tif (is_file($src)) {\n\t\t$wh = @GetImageSize($src);\n\t\treturn $wh[3];\n\t}\n\treturn '';\n}", "function get_pdf_dimensions($path, $box=\"TrimBox\") {\n\n $stream = new SplFileObject($path); \n \n $result = false;\n\n while (!$stream->eof()) {\n \n if (preg_match(\"/\".$box.\"\\[[0-9]{1,}.[0-9]{1,} [0-9]{1,}.[0-9]{1,} ([0-9]{1,}.[0-9]{1,}) ([0-9]{1,}.[0-9]{1,})\\]/\", $stream->fgets(), $matches)) {\n $result[\"width\"] = $matches[1];\n $result[\"height\"] = $matches[2]; \n break;\n }\n }\n\n $stream = null;\n\n return $result;\n}", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function size($file)\n {\n }", "public function image_reproportion()\n\t{\n\t\tif (($this->width === 0 && $this->height === 0) OR $this->orig_width === 0 OR $this->orig_height === 0\n\t\t\tOR ( ! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height))\n\t\t\tOR ! ctype_digit((string) $this->orig_width) OR ! ctype_digit((string) $this->orig_height))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize\n\t\t$this->width = (int) $this->width;\n\t\t$this->height = (int) $this->height;\n\n\t\tif ($this->master_dim !== 'width' && $this->master_dim !== 'height')\n\t\t{\n\t\t\tif ($this->width > 0 && $this->height > 0)\n\t\t\t{\n\t\t\t\t$this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)\n\t\t\t\t\t\t\t? 'width' : 'height';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->master_dim = ($this->height === 0) ? 'width' : 'height';\n\t\t\t}\n\t\t}\n\t\telseif (($this->master_dim === 'width' && $this->width === 0)\n\t\t\tOR ($this->master_dim === 'height' && $this->height === 0))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->master_dim === 'width')\n\t\t{\n\t\t\t$this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);\n\t\t}\n\t}", "function validateFileDimensions(&$model, $fieldData, $fieldName, $dimensions) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n if (!empty($dimensions)) {\n $info = array();\n \n if (list($info['w'], $info['h'], $info['t']) = getimagesize($fieldData[$fieldName]['tmp_name'])) {\n $tmpGeometry = $dimensions;\n $tmpGeometry = str_replace('<', '', $tmpGeometry);\n $tmpGeometry = str_replace('>', '', $tmpGeometry);\n \n list($geometry['w'], $geometry['h']) = explode('x', $tmpGeometry);\n \n foreach ($geometry as $k => $v) {\n $geometry[$k] = str_replace('*', '', $geometry[$k]);\n if ($geometry[$k] == '') unset($geometry[$k]);\n }\n \n $geometry['gtlt'] = 'equal';\n \n if (strpos($dimensions, '>') > 0) {\n $geometry['gtlt'] = 'greater';\n } elseif (strpos($dimensions, '<') > 0) {\n $geometry['gtlt'] = 'less';\n }\n \n if (!empty($geometry['w']) && !assetCheckDimensions($info['w'], $geometry['w'], $geometry['gtlt'])) return false;\n if (!empty($geometry['h']) && !assetCheckDimensions($info['h'], $geometry['h'], $geometry['gtlt'])) return false;\n } else {\n return false;\n }\n }\n \n return true;\n }", "static function ImageCalSize($w,$h,$limitw,$limith)\r\n\t{\r\n\t\tif($w>$limitw){\r\n\t\t\t$per = $limitw/$w;\r\n\t\t\t$w = $w * $per ;\r\n\t\t\t$h = $h * $per ;\r\n\t\t}\r\n\t\tif($h >$limith){\r\n\t\t\t$per = $limith/$h;\r\n\t\t\t$w = $w * $per ;\r\n\t\t\t$h = $h * $per ;\r\n\t\t}\r\n\t\t$newSize = array($w,$h);\r\n\t\treturn $newSize;\r\n\t}", "public static function getSize($path) {\n \n }", "public function width() {\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$width = 0;\n\n\t\t\tif ($dims = $file->dimensions()) {\n\t\t\t\t$width = $dims['width'];\n\t\t\t}\n\n\t\t\treturn $width;\n\t\t});\n\t}", "protected function setDensities()\n\t{\n\t\t$size = $this->imagine->open($this->imagePath)->getSize();\n $width = $size->getWidth();\t\t\n $height = $size->getHeight();\t\t\n $ratio = $width/$height;\n \n\t if ($this->referenceWidth == self::REFERENCE_WIDTH_UNDEFINED && self::REFERENCE_HEIGHT_UNDEFINED == $this->referenceHeight) {\n\t\t\t$this->referenceWidth = $width;\t\t\t\n\t\t\t$this->referenceHeight = $height;\n\t\t} elseif (self::REFERENCE_WIDTH_UNDEFINED == $this->referenceWidth) {\n\t\t $this->referenceWidth = $this->referenceHeight*$ratio;\n\t\t} elseif (self::REFERENCE_HEIGHT_UNDEFINED == $this->referenceHeight) {\n\t\t $this->referenceHeight = $this->referenceWidth/$ratio;\n }\t\t\n\t\t\n\t\tif (self::BITMAP_TYPE_REGULAR == $this->bitmapType) {\t\t\n\t\t $this->densities[self::DENSITY_MDPI] = array($this->referenceWidth/3, $this->referenceHeight/3);\n\t\t $this->densities[self::DENSITY_HDPI] = array($this->referenceWidth/2, $this->referenceHeight/2);\n\t\t $this->densities[self::DENSITY_XHDPI] = array($this->referenceWidth*2/3, $this->referenceHeight*2/3);\n\t\t $this->densities[self::DENSITY_XXHDPI] = array($this->referenceWidth, $this->referenceHeight);\n\t\t} else {\n\t\t $this->densities[self::DENSITY_MDPI] = array($this->referenceWidth/4, $this->referenceHeight/4);\n\t\t $this->densities[self::DENSITY_HDPI] = array($this->referenceWidth*3/8, $this->referenceHeight*3/8);\n\t\t $this->densities[self::DENSITY_XHDPI] = array($this->referenceWidth/2, $this->referenceHeight/2);\n\t\t $this->densities[self::DENSITY_XXHDPI] = array($this->referenceWidth*3/4, $this->referenceHeight*3/4);\n\t\t $this->densities[self::DENSITY_XXXHDPI] = array($this->referenceWidth, $this->referenceHeight);\n\t\t}\n\t}", "static function size($file){\r\n\t\t$file = new File\\Instance($file);\r\n\t\treturn $file->Size();\r\n\t}", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "public function getDimensions() {}", "public function refreshDimensions()\n {\n if ('\\\\' === DIRECTORY_SEPARATOR) {\n if (preg_match('/^(\\d+)x(\\d+)(?: \\((\\d+)x(\\d+)\\))?$/', trim(getenv('ANSICON')), $matches)) {\n // extract [w, H] from \"wxh (WxH)\"\n // or [w, h] from \"wxh\"\n $this->width = (int) $matches[1];\n $this->height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];\n } elseif (null !== $dimensions = $this->getConsoleMode()) {\n // extract [w, h] from \"wxh\"\n $this->width = (int) $dimensions[0];\n $this->height = (int) $dimensions[1];\n }\n } elseif ($sttyString = $this->getSttyColumns()) {\n if (preg_match('/rows.(\\d+);.columns.(\\d+);/i', $sttyString, $matches)) {\n // extract [w, h] from \"rows h; columns w;\"\n $this->width = (int) $matches[2];\n $this->height = (int) $matches[1];\n } elseif (preg_match('/;.(\\d+).rows;.(\\d+).columns/i', $sttyString, $matches)) {\n // extract [w, h] from \"; h rows; w columns\"\n $this->width = (int) $matches[2];\n $this->height = (int) $matches[1];\n }\n }\n $this->initialised = true;\n }", "public function getHeight() {\n return Image::make($this->file)->height();\n }", "public function CalcWidthHeight()\n {\n list($this->width, $this->height) = $this->imgInfo;\n\n $aspectRatio = $this->width / $this->height;\n\n if($this->cropToFit && $this->newWidth && $this->newHeight) {\n $targetRatio = $this->newWidth / $this->newHeight;\n $this->cropWidth = $targetRatio > $aspectRatio ? $this->width : round($this->height * $targetRatio);\n $this->cropHeight = $targetRatio > $aspectRatio ? round($this->width / $targetRatio) : $this->height;\n if($this->verbose) { self::verbose(\"Crop to fit into box of {$this->newWidth}x{$this->newHeight}. Cropping dimensions: {$this->cropWidth}x{$this->cropHeight}.\"); }\n }\n else if($this->newWidth && !$this->newHeight) {\n $this->newHeight = round($this->newWidth / $aspectRatio);\n if($this->verbose) { self::verbose(\"New width is known {$this->newWidth}, height is calculated to {$this->newHeight}.\"); }\n }\n else if(!$this->newWidth && $this->newHeight) {\n $this->newWidth = round($this->newHeight * $aspectRatio);\n if($this->verbose) { self::verbose(\"New height is known {$this->newHeight}, width is calculated to {$this->newWidth}.\"); }\n }\n else if($this->newWidth && $this->newHeight) {\n $ratioWidth = $this->width / $this->newWidth;\n $ratioHeight = $this->height / $this->newHeight;\n $ratio = ($ratioWidth > $ratioHeight) ? $ratioWidth : $ratioHeight;\n $this->newWidth = round($this->width / $ratio);\n $this->newHeight = round($this->height / $ratio);\n if($this->verbose) { self::verbose(\"New width & height is requested, keeping aspect ratio results in {$this->newWidth}x{$this->newHeight}.\"); }\n }\n else {\n $this->newWidth = $this->width;\n $this->newHeight = $this->height;\n if($this->verbose) { self::verbose(\"Keeping original width & heigth.\"); }\n }\n }", "function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "function wp_create_image_subsizes($file, $attachment_id)\n {\n }", "public function getSize($path);", "protected function calculateMediaWidthsAndHeights() {}", "public function dimensions(): int\n {\n return -1;\n }", "public function getDimensions();", "public function getDimensions();", "public function get_size()\n\t{\n\t\treturn $this->area->get_size($this->path);\n\t}", "function getimagesize($filename){\n\t\treturn ($this->isSvg() ? $this->getSvgSize($filename) : we_thumbnail::getimagesize($filename));\n\t}", "public function addImageDimensionsData($file)\n\t{\n\t\tif ($file->isImage)\n\t\t{\n\t\t\t$filePath = $this->getFilePath($file->path, $file->newFilename);\n\n\t\t\tif (File::exists($filePath))\n\t\t\t{\n\t\t\t\t$size = getimagesize($filePath);\n\n\t\t\t\tif (!empty($size))\n\t\t\t\t{\n\t\t\t\t\t$file->imageDimensions->w = $size[0];\n\t\t\t\t\t$file->imageDimensions->h = $size[1];\n\n\t\t\t\t\t$thumbnailFilePath = $this->getThumbnailFilePath($filePath);\n\n\t\t\t\t\tif (File::exists($thumbnailFilePath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$thumbnailSize = getimagesize($thumbnailFilePath);\n\n\t\t\t\t\t\tif (!empty($thumbnailSize))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file->imageDimensions->tw = $thumbnailSize[0];\n\t\t\t\t\t\t\t$file->imageDimensions->th = $thumbnailSize[1];\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\treturn $file;\n\t}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize() {}", "public function getSize($path)\n {\n }", "public function testDimensionsValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"avatar\", function (Field $field): void {\n $field->dimensions(function(Dimensions $dimensions): void {\n $dimensions->ratio(3/2)->width(100);\n });\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"dimensions:ratio=1.5,width=100\"], $rules[\"avatar\"]);\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}", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "function size_calculator($vals)\n\t{\n\t\tif ( ! is_array($vals))\n\t\t\treturn;\n\t\t\t\n\t\t$allowed = array('new_width', 'new_height', 'width', 'height');\n\n\t\tforeach ($allowed as $item)\n\t\t{\n\t\t\tif ( ! isset($vals[$item]) OR $vals[$item] == '')\n\t\t\t\t$vals[$item] = 0;\n\t\t}\n\t\t\n\t\tif ($vals['width'] == 0 OR $vals['height'] == 0)\n\t\t{\n\t\t\treturn $vals;\n\t\t}\n\t\t\t\n\t\tif ($vals['new_width'] == 0)\n\t\t{\n\t\t\t$vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']);\n\t\t}\n\t\telseif ($vals['new_height'] == 0)\n\t\t{\n\t\t\t$vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']);\n\t\t}\n\t\n\t\treturn $vals;\n\t}", "function gttn_tpps_file_width($fid) {\n $file = file_load($fid);\n $location = drupal_realpath($file->uri);\n $extension = gttn_tpps_get_path_extension($location);\n switch ($extension) {\n case 'xlsx':\n return gttn_tpps_xlsx_width($location);\n break;\n\n case 'txt':\n case 'csv':\n return gttn_tpps_flat_width($location);\n break;\n\n default:\n throw new Exception('Unrecognized file type');\n }\n}", "private function _getResizeSize() {\n\t\t$width = $height = 0;\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.0')) {\n\t\t\t$width = Configure::read('GalleryOptions.Pictures.resize_to.0');\n\t\t}\n\n\t\tif (Configure::check('GalleryOptions.Pictures.resize_to.1')) {\n\t\t\t$height = Configure::read('GalleryOptions.Pictures.resize_to.1');\n\t\t}\n\n\t\t$crop = Configure::read('GalleryOptions.Pictures.resize_to.2');\n\t\t$action = $crop ? \"crop\" : \"\";\n\n\t\treturn array(\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'action' => $action\n\t\t);\n\t}", "public function image_width($image_file) {\r\n\t\t$image_size = getimagesize(self::real_path($image_file));\r\n\t\treturn new SassNumber($image_size[0].'px');\r\n\t}", "public function getDimensions()\n {\n $imageDimension = getimagesize($this->image);\n\n $width = $imageDimension[0];\n $height = $imageDimension[1];\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $modified = $effect->getNewDimensions($width, $height);\n\n $width = $modified['w'];\n $height = $modified['h'];\n }\n }\n\n return array(\n 'w' => $width,\n 'h' => $height,\n );\n }", "private function _addOmittedCanvasDimension() {\n\t\t$sourceWidth = $this->params['sourceWidth'];\n\t\t$sourceHeight = $this->params['sourceHeight'];\n\t\t$sourceRatio = $sourceWidth / $sourceHeight;\n\n\t\tif (\n\t\t\tempty($this->params['w']) &&\n\t\t\tempty($this->params['h'])\n\t\t) {\n\t\t\t$this->params['w'] = $sourceWidth;\n\t\t\t$this->params['h'] = $sourceHeight;\n\t\t} elseif (empty($this->params['h'])) {\n\t\t\tif (\n\t\t\t\t!$this->params['grow'] &&\n\t\t\t\t$this->params['w'] > $sourceWidth\n\t\t\t) {\n\t\t\t\t$this->params['h'] = $sourceHeight;\n\t\t\t} else {\n\t\t\t\t$this->params['h'] = $this->params['w'] / $sourceRatio;\n\t\t\t}\n\t\t} elseif (empty($this->params['w'])) {\n\t\t\tif (\n\t\t\t\t!$this->params['grow'] &&\n\t\t\t\t$this->params['h'] > $sourceHeight\n\t\t\t) {\n\t\t\t\t$this->params['w'] = $sourceWidth;\n\t\t\t} else {\n\t\t\t\t$this->params['w'] = $this->params['h'] * $sourceRatio;\n\t\t\t}\n\t\t}\n\t}", "function get_image_dimensions($file_path)\n\t{\n\n\t\tif( ! file_exists($file_path)) {\n\n\t\t\treturn FALSE;\n\n\t\t}\n\n\t\t// PHP7.4 does not come with GD JPEG processing by default\n\t\t// So, we need to run this check.\n\t\tif (function_exists('getimagesize'))\n\t\t{\n\t\t\t$imageSize = @getimagesize($file_path);\n\n\t\t\tif($imageSize && is_array($imageSize)) {\n\n\t\t\t\t$imageSizeParsed = [\n\t\t\t\t\t'height'\t=> $imageSize['1'],\n\t\t\t\t\t'width'\t=> $imageSize['0']\n\t\t\t\t];\n\n\t\t\t\treturn $imageSizeParsed;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// The file is either not an image, or there was an error.\n\t\treturn FALSE;\n\t}", "function afterImport(){\n\n\t\t$f=$this->getPath();\n\t\t\n\t\t$gd_info=getimagesize($f);\n\t}", "public function filesize()\n\t{\n\t\treturn (int)$this->_parent->{$this->_name.'_file_size'};\n\t}", "abstract protected function getSize(): int;", "function build_image_size_rule($mod_name, $device=null) {\n\t\t\t$element = json_decode($this->get_cached_mod($mod_name),true);\n\t\t\t$element_props = '';\n\t\t\tif ($device && isset($element[$device])) {\n\t\t\t\t$element = $element[$device];\n\t\t\t}\n\t\t\t// if (isset($element->mode) && $element->mode == 'image') {\n\t\t\t\tif (!empty($element['imgwidth'])) {\n\t\t\t\t\t$element_props = \"\\twidth: {$element['imgwidth']}px;\";\n\t\t\t\t}\n\t\t\t\tif (!empty($element['imgheight'])) {\n\t\t\t\t\t$element_props .= \"\\n\\theight: {$element['imgheight']}px;\";\n\t\t\t\t}\n\t\t\t// }\n\t\t\treturn $element_props;\n\t\t}", "function imgResizeHeight($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0) {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\t\n\t\tif ($handle->uploaded) {\n\t\t\t//$handle->image_x = $imgx;\n\t\t\t$handle->image_y = $imgy;\n\t\t\t$handle->image_resize = true;\n\t\t\t$handle->image_ratio_x = true;\n\t\t}\n\t\t$handle->process($UploadPath);\n\t\tif ($handle->processed) {\n\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\tif($clean==1)\n\t\t\t\t$handle->clean();\n\t\t} else\n\t\t\t$dest_filename='';\n\t\treturn $dest_filename;\n\t}", "static function resize($filename , $width, $height, $disk='local' ){\n\n $pathinfo = pathinfo( $filename );\n $resized = $pathinfo['filename'] . '-' . $width . 'x' . $height . '.' . $pathinfo['extension'];\n\n if( !Storage::disk( $disk )->exists( $resized ) ){\n\n Image::make( self::path( $filename , $disk ) )->resize( $width , $height , function($constraint){\n\n $constraint->aspectRatio();\n\n })->save( self::path( $resized , $disk ) );\n\n }\n\n return $resized;\n\n }", "function getimagesize($filename){\n\t\t$arr = @getimagesize($filename);\n\n\t\tif(isset($arr) && is_array($arr) && (count($arr) >= 4) && $arr[0] && $arr[1]){\n\t\t\treturn $arr;\n\t\t} else {\n\t\t\tif(we_base_imageEdit::gd_version()){\n\t\t\t\treturn we_base_imageEdit::getimagesize($filename);\n\t\t\t}\n\t\t\treturn $arr;\n\t\t}\n\t}", "public function fileNeedsProcessing()\n {\n // @todo Implement fileNeedsProcessing() method.\n\n /**\n * Checks to perform:\n * - width/height smaller than image, keeping aspect ratio?\n */\n }", "public function getDimensions(){\n\t\treturn array('width' => $this->_width, 'height' => $this->_height);\n\t}", "function getimagesize($filename){\n\t\treturn we_thumbnail::getimagesize($filename);\n\t}", "public function getResize($size, $dir, $filename) {\t\n\t\t$parts = explode(\".\", $filename);\n\t\tif(count($parts > 1)) {\n\t\t\t$filename = $parts[0];\n\t\t\t$extension = $parts[1]; \n\t\t}\t\n\n\t\tif($size === \"original\") {\n\t\t\t$size = $dir . $filename .\".\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minOriginal);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxOriginal);\n\t\t\t}\n\t\t} elseif($size === \"large\") {\n\t\t\t$size = $dir . $filename .\"_l.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minLarge);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxLarge);\n\t\t\t}\n\t\t} elseif($size === \"medium\") {\t\t\t\n\t\t\t$size = $dir . $filename .\"_m.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxMedium, _minMedium);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMedium);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMedium);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"small\") {\n\t\t\t$size = $dir . $filename .\"_s.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\t$this->resize(_maxSmall, _minSmall);\n\t\t\t\n\t\t\t/*\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minSmall);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxSmall);\n\t\t\t}\n\t\t\t*/\n\t\t} elseif($size === \"miniature\") {\n\t\t\t$size = $dir . $filename . \"_min.\". $extension;\n\t\t\t\n\t\t\t$this->load($dir . $filename .\".\". $extension);\n\t\t\t\n\t\t\tif($this->getWidth() < $this->getHeight()) {\n\t\t\t\t$this->resizeToHeight(_minMini);\n\t\t\t} else {\n\t\t\t\t$this->resizeToWidth(_maxMini);\n\t\t\t}\n\t\t}\n\n\t\t$this->save($size);\n\t\t\n\t\treturn $size;\n \t}", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "function get_image_size($name) {\n\t\t$file['site_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['email_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['site_favicon'] = array('width' => '50', 'height' => '50');\n\t\t$file['store_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['footer_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['app_logo'] = array('width' => '140', 'height' => '140');\n\t\t$file['driver_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['driver_white_logo'] = array('width' => '130', 'height' => '65');\n\t\t$file['home_slider'] = array('width' => '1300', 'height' => '500');\n\t\t$file['dietary_icon_size'] = array('width' => '256', 'height' => '256');\n\t\t$file['item_image_sizes'] = [\n\t\t\tarray('width' => '120', 'height' => '120'),\n\t\t\tarray('width' => '600', 'height' => '350'),\n\t\t\tarray('width' => '520', 'height' => '320'),\n\t\t];\n\t\t$file['cuisine_image_size'] = array('width' => '260', 'height' => '200');\n\t\t$file['store_image_sizes'] = [\n\t\t\tarray('width' => '520', 'height' => '280'),\n\t\t\tarray('width' => '480', 'height' => '320'),\n\t\t\tarray('width' => '215', 'height' => '215'),\n\t\t\tarray('width' => '100', 'height' => '100'),\n\t\t\tarray('width' => '320', 'height' => '129'),\n\t\t];\n\t\treturn $file[$name];\n\t}", "function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = \\false)\n {\n }", "public function get_svg_dimensions( $file ) {\n\t\t$width = $height = 1;\n\n\t\t// Get attached file\n\t\tif ( is_numeric( $file ) ) {\n\t\t\t$file = get_attached_file( $file );\n\t\t}\n\n\t\tif ( function_exists( 'simplexml_load_file' ) ) {\n\t\t\t$svg = simplexml_load_file( $file );\n\n\t\t\tif ( isset( $svg->attributes()->viewBox ) ) {\n\t\t\t\t$view_box = explode( ' ', (string) $svg->attributes()->viewBox );\n\t\t\t\t$view_box = array_values( array_filter( array_map( 'absint', $view_box ) ) );\n\n\t\t\t\tif ( count( $view_box ) > 1 ) {\n\t\t\t\t\treturn [ $view_box[0], $view_box[1] ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn [ $width, $height ];\n\t}", "public function getSize()\n {\n }", "public function sizeImg($width, $height, $crop = true);", "abstract public static function process(File $file, int $imageType, int $width, int $height): string;", "public function getSize() {\r\n\t\treturn $this->app->filesystem->formatFilesize($this->get('size', 0));\r\n\t}", "protected function calcImageSizeStrict($width, $height)\n {\n // first, we need to determine what the longest resize dimension is..\n if ($this->maxWidth >= $this->maxHeight) {\n // and determine the longest original dimension\n if ($width > $height) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n elseif ($height >= $width) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n }\n elseif ($this->maxHeight > $this->maxWidth) {\n if ($width >= $height) {\n $newDimensions = $this->calcWidth($width, $height);\n\n if ($newDimensions['height'] < $this->maxHeight) {\n $newDimensions = $this->calcHeight($width, $height);\n }\n }\n elseif ($height > $width) {\n $newDimensions = $this->calcHeight($width, $height);\n\n if ($newDimensions['width'] < $this->maxWidth) {\n $newDimensions = $this->calcWidth($width, $height);\n }\n }\n }\n\n if (isset($newDimensions)) {\n $this->newDimensions = $newDimensions;\n }\n }", "function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}", "public function getSizeDetails();", "public function size()\n {\n return $this->getPackage('FileStation')->size($this->path);\n }", "function loadSize()\n\t{\n\t\t$this->size = filesize($this->filename);\n\t}", "function tdc_get_filesize($filenode){\n $file_path = tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n $full_path = TDC_DOC_ROOT . $file_path . \"/\" .$file_name;\n $size = filesize($full_path);\n return human_filesize($size);\n}", "protected function getWidthAndHeight(string $filepath): array\n {\n // An internet path.\n if (strpos($filepath, 'https://') === 0 || strpos($filepath, 'http://') === 0) {\n return $this->getWidthAndHeightUrl($filepath);\n }\n // A normal path.\n if (file_exists($filepath) && is_file($filepath) && is_readable($filepath) && filesize($filepath)) {\n return $this->getWidthAndHeightLocal($filepath);\n }\n return $this->emptySize;\n }", "function fileSize($filePath) { \n\t\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t\t$size = Storage::size($filePath);\n\t \tfor ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024; \n\n\t \treturn round($size, 2).$units[$i]; \n\t}", "public function getOriginalSize(): int;", "function legion_get_dimensions( $svg ) {\n\t// If that happens, we will just go back to not knowing the dimensions,\n\t// rather than breaking the site.\n\t$fail = (object) array( 'width' => 0, 'height' => 0 );\n\n\t// Welp, nothing we can do here...\n\tif ( ! function_exists( 'simplexml_load_file' ) ) {\n\t\treturn $fail;\n\t}\n\n\t$svg = simplexml_load_file( $svg );\n\t$attributes = $svg ? $svg->attributes() : false;\n\n\t// Probably an invalid XML file?\n\tif( ! $attributes ) {\n\t\treturn $fail;\n\t}\n\n\t$width = (string) $attributes->width;\n\t$height = (string) $attributes->height;\n\n\treturn (object) array( 'width' => $width, 'height' => $height );\n}", "public function filesizeValid()\n\t{\n\t\tif ($this->files['size'] > $this->max_filesize) {\n\t\t\tthrow new Exception(\"File is too big\",7);\n\t\t}\n\n\t\t//Check that the file is not too less\n\t\tif ($this->files['size'] < $this->min_filesize) {\n\t\t throw new Exception(\"File is too less than\",8);\n\t\t}\n\t\n\t}", "function max_hw_check($file_path, $prefs)\n\t{\n\t\t$force_master_dim = FALSE;\n\n\t\t// Make sure height and width are set\n\t\tif ( ! isset($prefs['height']) OR ! isset($prefs['width']))\n\t\t{\n\t\t\t$dim = $this->get_image_dimensions($file_path);\n\n\t\t\tif ($dim == FALSE)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$prefs['height'] = $dim['height'];\n\t\t\t$prefs['width'] = $dim['width'];\n\t\t\t$prefs['file_height'] = $prefs['height'];\n\t\t\t$prefs['file_width'] = $prefs['width'];\n\t\t}\n\n\t\tif ($prefs['max_width'] == 0 && $prefs['max_height'] == 0)\n\t\t{\n\t\t\treturn $prefs;\n\t\t}\n\n\n\t\t$config['width']\t\t\t= $prefs['max_width'];\n\t\t$config['height']\t\t\t= $prefs['max_height'];\n\n\t\tee()->load->library('image_lib');\n\n\t\tee()->image_lib->clear();\n\n\t\t// If either h/w unspecified, calculate the other here\n\t\tif ($prefs['max_width'] == 0)\n\t\t{\n\t\t\t$config['width'] = ($prefs['width']/$prefs['height'])*$prefs['max_height'];\n\t\t\t$force_master_dim = 'height';\n\t\t}\n\t\telseif ($prefs['max_height'] == 0)\n\t\t{\n\t\t\t// Old h/old w * new width\n\t\t\t$config['height'] = ($prefs['height']/$prefs['width'])*$prefs['max_width'];\n\t\t\t$force_master_dim = 'width';\n\t\t}\n\n\t\t// If the original is smaller than the thumb hxw, we'll make a copy rather than upsize\n\t\tif (($force_master_dim == 'height' && $prefs['height'] <= $prefs['max_height']) OR\n\t\t\t\t($force_master_dim == 'width' && $prefs['width'] <= $prefs['max_width']) OR\n\t\t\t\t($force_master_dim == FALSE && $prefs['width'] <= $prefs['max_width']) OR\n\t\t\t\t($force_master_dim == FALSE && $prefs['height'] <= $prefs['max_height']))\n\t\t{\n\t\t\treturn $prefs;\n\t\t}\n\n\n\t\tunset($prefs['width']);\n\t\tunset($prefs['height']);\n\n\t\t// Set required memory\n\t\ttry\n\t\t{\n\t\t\tee('Memory')->setMemoryForImageManipulation($file_path);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\tlog_message('error', $e->getMessage().': '.$file_path);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Resize\n\n\t\t$config['source_image']\t\t= $file_path;\n\t\t$config['maintain_ratio']\t= TRUE;\n\t\t$config['image_library']\t= ee()->config->item('image_resize_protocol');\n\t\t$config['library_path']\t\t= ee()->config->item('image_library_path');\n\n\t\tee()->image_lib->initialize($config);\n\n\t\tif ( ! ee()->image_lib->resize())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$new_image = ee()->image_lib->get_image_properties('', TRUE);\n\n\t\t// We need to reset some prefs\n\t\tif ($new_image)\n\t\t{\n\t\t\tee()->load->helper('number');\n\t\t\t$f_size = get_file_info($file_path);\n\n\t\t\t$prefs['file_size'] = ($f_size) ? $f_size['size'] : 0;\n\n\t\t\t$prefs['file_height'] = $new_image['height'];\n\t\t\t$prefs['file_width'] = $new_image['width'];\n\t\t\t$prefs['file_hw_original'] = $new_image['height'].' '.$new_image['width'];\n\t\t\t$prefs['height'] = $new_image['height'];\n\t\t\t$prefs['width'] = $new_image['width'];\n\t\t}\n\n\t\treturn $prefs;\n\t}", "public function testDimensionsForceMesasures()\n {\n $dimensions = Dimensions::create(\n 400,\n 400,\n 200,\n 200,\n ElcodiMediaImageResizeTypes::FORCE_MEASURES\n );\n\n $this->assertEquals(0, $dimensions->getSrcX());\n $this->assertEquals(0, $dimensions->getSrcY());\n $this->assertEquals(400, $dimensions->getSrcWidth());\n $this->assertEquals(400, $dimensions->getSrcHeight());\n\n $this->assertEquals(0, $dimensions->getDstX());\n $this->assertEquals(0, $dimensions->getDstY());\n $this->assertEquals(200, $dimensions->getDstWidth());\n $this->assertEquals(200, $dimensions->getDstHeight());\n $this->assertEquals(200, $dimensions->getDstFrameX());\n $this->assertEquals(200, $dimensions->getDstFrameY());\n }" ]
[ "0.67889464", "0.6596037", "0.61705405", "0.60403454", "0.5989588", "0.5818235", "0.5760433", "0.57114255", "0.5675711", "0.56400424", "0.55905366", "0.55261517", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.54571575", "0.5454513", "0.5430502", "0.53798807", "0.53796923", "0.5378918", "0.5378918", "0.5378918", "0.5378728", "0.5354847", "0.5343843", "0.5288611", "0.5284229", "0.5283656", "0.52753407", "0.52728504", "0.5253312", "0.5238402", "0.5234154", "0.52202606", "0.52159446", "0.5210226", "0.51981497", "0.5195176", "0.5191047", "0.51806825", "0.5179119", "0.5179119", "0.51685655", "0.51607746", "0.51413256", "0.51400596", "0.5137261", "0.5137257", "0.5137257", "0.5137257", "0.5137257", "0.51281", "0.5116342", "0.5103065", "0.5100474", "0.50701386", "0.5043944", "0.5020571", "0.50006753", "0.49819303", "0.4977783", "0.49732322", "0.49710217", "0.49665898", "0.49588555", "0.49587768", "0.4950624", "0.49497372", "0.49450064", "0.49348736", "0.49336046", "0.49277988", "0.4921996", "0.4915185", "0.49124324", "0.49063382", "0.48978895", "0.48978063", "0.48906133", "0.4879462", "0.48782915", "0.48769486", "0.48747692", "0.4871365", "0.48687094", "0.48664355", "0.48621437", "0.4861549", "0.48597813", "0.4844733", "0.48424608", "0.48384452", "0.48369", "0.48361582" ]
0.6011698
4
Uses the upload destination's server path to compute the absolute path of the dirctory
public function getAbsolutePath() { return rtrim($this->UploadDestination->server_path, '/') . '/_' . $this->short_name . '/'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function destinationUploadDir()\n {\n return public_path(env('UPLOAD_DIR_GALLERY', 'media/images/galleries'));\n }", "public function getRelativeUploadPath(): string;", "protected function getUploadDir()\n {\n return 'uploads/org' . $this->id;\n }", "private function getUploadRootDir(){\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "protected function getUploadDir()\n {\n return __DIR__ . '/../../../../web' . $this->getFilesPath();\n }", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "protected function getUploadRootDir()\n {\n //$racine = sudo chmod ;\n return __DIR__.'/../../../web/ressources/uploads/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../web/' . self::UPLOAD_ROOT;\n }", "protected function getUploadRootDir() {\n // guardar los archivos cargados\n return __DIR__ . '/../../../../web/uploads/portafolios/' . $this->getId();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../'.$this->getUploadDir();\n }", "protected function getUploadDir() {\n return '/uploads';\n }", "public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "public function getAbsolutePath()\r\n {\r\n return null === $this->getPath() ? null : $this->getUploadRootDir().'/'.$this->getPath();\r\n }", "private function getUploadRootDir()\n {\n return __DIR__ . \"/../../../../web\" . $this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/ads/images';\n }", "protected function getUploadRootDir()\n {\n return dirname(__DIR__).'/../public/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/w2share';\n }", "protected function getUploadRootDir() {\r\n return __DIR__ . '/../../../../web/' . $this->getUploadDir()\r\n\r\n ;\r\n }", "protected function getUploadDir()\n {\n return 'uploads';\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../public/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "public function getUploadRootDir() {\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\r\n\t{\r\n\t\treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n\t}", "protected function getUploadDir()\n\t{\n\t\t// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image\n\t\t// in the view.\n\t\treturn 'uploads/mybudget';\n\t}", "public function getAbsolutePath()\n {\n return $this->getUploadRootDir().'/'.$this->name;\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../web/' . $this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../www/' . $this->getUploadImageDir();\n }", "public function getAbsolutePath()\n {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/';\n }", "protected function getAbsolutePath()\n {\n return '/var/www/html/ColdkitchenSymfony/web/'.$this->getUploadPath();\n }", "public function uploadPath();", "protected function _getUploadDir()\n {\n return $this->_mediaDirectory->getAbsolutePath($this->_appendScopeInfo(self::UPLOAD_DIR));\n }", "protected function getUploadRootDir()\r\n {\r\n // the absolute directory path where uploaded documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "protected function getUploadRootDir()\n {\n // guardar los archivos cargados\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // guardar los archivos cargados\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // guardar los archivos cargados\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // guardar los archivos cargados\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir() {\n // guardar los archivos cargados\n return __DIR__ . '/../../../../web/' . $this->getUploadDir();\n }", "public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "protected function getUploadDir()\n {\n return 'upload/files';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadRootDir() {\n return __DIR__ . '/../../../../web/' . $this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadRootDir()\r\n {\r\n // documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "public static function uploadPath(): string {\n\t\treturn config('filesystems.upload_folder_name') . DIRECTORY_SEPARATOR . self::UPLOAD_FOLDER_NAME;\n\t}", "public function getUploadDir(){\n return dirname(_FILE_). \"/img/\";\n }", "public function getUploadRootDir() {\n return __DIR__ . '/../../../../web/' . $this->getUploadDir();\n }", "abstract protected function getUploadDir(): string;", "public function getUploadPath()\n {\n return Yii::$app->params['upload_dir'] . DIRECTORY_SEPARATOR . $this->path;\n }", "public function getUploadedPath()\n {\n return $this->getUploadsFolder() . '/' . $this->getRootUploadedPath();\n }", "protected function getUploadRootDir()\n\t{\n\t\treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n\t}", "protected function getUploadRootDir()\n {\n return $_SERVER['DOCUMENT_ROOT'] . '/' . $this->getUploadDir();\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }", "public function getTemporaryUploadRootDir()\n {\n return __DIR__.'/../../../../web/uploads/temporary';\n }", "protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }", "public function getUploadDir()\n\t{\n\t\treturn 'uploads/ressources';\n\t}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "protected function getUploadRootDir()\n {\n \t// documents should be saved\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "public function getUploadRootDir()\n {\n\n return '/home/jimmy/html/TDB/web/'.$this->getUploadDir();\n\n }", "protected function getUploadRootDir() {\n // documents should be saved\n return __DIR__ . '/../../../../web/' . $this -> getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/subtitles';\n }", "public function getAbsolutePath() {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "protected function getUploadDir()\n {\n return 'uploads/serie';\n }", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "protected function getUploadRootDir(): string\n {\n // documents should be saved\n return __DIR__.'/../../public/'.$this->getUploadDir();\n }", "public static function get_media_base_dir_path() {\n return self::make_path('cm_root_upload');\n }", "protected function getUploadRootDir()\n {\n // le chemin absolu du répertoire où les documents uploadés doivent être sauvegardés\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function getAbsolutePath()\n {\n return null === $this->image\n ? null\n : $this->getUploadRootDir() . '/' . $this->image;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }" ]
[ "0.7529544", "0.74377644", "0.72891146", "0.72154385", "0.7196516", "0.719315", "0.7160784", "0.7146222", "0.71442014", "0.7128431", "0.7127373", "0.71254337", "0.7107554", "0.7096031", "0.70955247", "0.70924145", "0.7078154", "0.7067088", "0.70635915", "0.7062307", "0.70620215", "0.70538944", "0.70538944", "0.70508426", "0.70482135", "0.70480794", "0.70413417", "0.70387125", "0.7036583", "0.7036583", "0.7036583", "0.7036583", "0.7036583", "0.7032345", "0.7032184", "0.70146006", "0.70144445", "0.7011458", "0.70081246", "0.7004378", "0.6997461", "0.699432", "0.69894856", "0.69894856", "0.69894856", "0.69894856", "0.69881654", "0.6982087", "0.69804746", "0.6976087", "0.69711155", "0.69700176", "0.69626045", "0.69615465", "0.69589263", "0.69586945", "0.6953227", "0.69472164", "0.69468504", "0.694192", "0.694093", "0.6940902", "0.69389063", "0.69308776", "0.6924038", "0.6920063", "0.6920063", "0.69121855", "0.6911528", "0.69111806", "0.68965757", "0.6891878", "0.68918073", "0.6890747", "0.6889395", "0.68865544", "0.68846387", "0.6883894", "0.6874414", "0.6872459", "0.68703854", "0.68677944", "0.68673176", "0.6864873", "0.68619317", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279", "0.6861279" ]
0.7137758
9
Uses the upload destination's url to compute the absolute URL of the directory
public function getAbsoluteURL() { return rtrim($this->UploadDestination->url, '/') . '/_' . rawurlencode($this->short_name) . '/'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_upload_url() {\n\t\t$upload = wp_upload_dir();\n\n\t\treturn $upload['baseurl'] . '/' . static::SUB_DIR . '/';\n\t}", "protected function destinationUploadDir()\n {\n return public_path(env('UPLOAD_DIR_GALLERY', 'media/images/galleries'));\n }", "public function get_uploaded_file_url()\n {\n return App::getBaseURL() . $this->uploaded_file_path;\n }", "public function getRelativeUploadPath(): string;", "function upload_dir($url = '')\n{\n return UPLOAD_F . $url;\n}", "protected function getUploadDir()\n {\n return 'uploads/org' . $this->id;\n }", "function upload_url(string $url = null)\n { \n return Storage::disk('armin.public')->url( \n trim_url(config('armin.path.file', 'files').\"/{$url}\")\n ); \n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/ads/images';\n }", "protected function getUploadDir() {\n return '/uploads';\n }", "private function getFileUrl() {\n return Storage::disk('public')->url('/uploads/' . $this->file_name);\n }", "public function getAbsolutePath()\n\t{\n\t\treturn rtrim($this->UploadDestination->server_path, '/') . '/_' . $this->short_name . '/';\n\t}", "abstract protected function getUploadDir(): string;", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "public function getAbsolutePath()\n {\n return null === $this->image\n ? null\n : $this->getUploadRootDir() . '/' . $this->image;\n }", "protected function getUploadDir()\n\t{\n\t\t// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image\n\t\t// in the view.\n\t\treturn 'uploads/mybudget';\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/photos';\n }", "protected function _getUploadDir()\n {\n return $this->_mediaDirectory->getAbsolutePath($this->_appendScopeInfo(self::UPLOAD_DIR));\n }", "protected function getUploadDir()\n {\n return 'uploads';\n }", "function uploads_dir() {\n\techo esc_url(home_url()) . \"/wp-content/uploads/\";\n}", "public function getAbsolutePath()\n {\n return $this->getUploadRootDir().'/'.$this->name;\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'web/images';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "private function getDestinationUrl()\n {\n if (!empty($this->options->cloneHostname)) {\n return $this->options->cloneHostname;\n }\n\n return trailingslashit(get_site_url()) . $this->options->cloneDirectoryName;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/w2share';\n }", "public function getUploadDir()\n\t{\n\t\treturn 'uploads/ressources';\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/images/agancy';\n }", "protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }", "public function getUploadDir()\n {\n return storage_path($this->getUploadUri());\n }", "public function getUrl(): string\n {\n $url = $this->getBaseMediaDirectoryUrl().'/'.$this->getPathRelativeToRoot();\n $url = $this->makeCompatibleForNonUnixHosts($url);\n $url = $this->rawUrlEncodeFilename($url);\n\n return $url;\n }", "public function uploadPath();", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }", "public function getUploadDir(){\n return dirname(_FILE_). \"/img/\";\n }", "public function getRelativePath() {\n $str = str_replace(Storage::disk('public')->url(''), '', $this->url);\n $str = str_replace($this->file_name, '', $str);\n return $str;\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/contact/contactlist/images';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/products';\n }", "public function getUploadedFileUrl()\n {\n return !empty($this->fileurl) ? $this->fileurl : \n (!empty($this->filename) ? $this->uploadUrl . $this->filename : null);\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'images/about_us';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/articles';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "function get_dir_url() {\n\n\t\treturn $this->dir_url;\n\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/images/profile';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }", "public function getAbsolutePath()\r\n {\r\n return null === $this->getPath() ? null : $this->getUploadRootDir().'/'.$this->getPath();\r\n }", "public function getAbsolutePath()\n {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "protected function getUploadDir()\n {\n return 'uploads/images';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }", "protected function getUploadDir()\n {\n return __DIR__ . '/../../../../web' . $this->getFilesPath();\n }", "protected function getUploadFotoDir() {\n return 'uploads/produtos/produto/';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'upload/documents';\n }", "protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }", "public function getAbsolutePath()\n {\n return null === $this->avatar ? null : $this->getUploadRootDir().'/'.$this->avatar;\n }", "public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }", "protected function getUploadDir()\n {\n // al mostrar el documento/imagen cargada en la vista.\n return 'usuarios/fotos_perfil';\n }", "protected function getUploadDir(): string\n {\n // when displaying uploaded doc/image in the view.\n return 'image_room_directory';\n }", "protected function getUploadDir()\n {\n return 'upload/files';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/devis';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/warranty_images';\n }", "public function getAbsolutePath()\n\t{\n\t\treturn ($this->filename === null) ? null : ($this->getUploadRootDir() . '/' . $this->filename);\n\t}", "public static function getTargetUploadDir()\n {\n $dir = basename(Env::getVideoUploadDir());\n return $dir;\n }", "public function getUploadUrl()\n {\n \treturn $this->getForm()->getUploadUrl();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/produtos';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'results';\n }", "function fn_get_http_files_dir_path()\n{\n $path = fn_get_rel_dir(fn_get_files_dir_path());\n $path = Registry::get('config.http_location') . '/' . $path;\n\n return $path;\n}", "public static function getTrackUploadURL(): string {\n return Helper::getUploadDirectoryURL(self::TRACK_UPLOAD_PATH);\n }", "public function baseUrl() : string\n {\n return $this->urlGenerator->to('mezzo/upload/');\n }", "public function getUploadDir()\n {\n return 'uploads/images';\n }", "public function getUploadDir()\n {\n return 'uploads/fanart';\n }", "public static function get_uploaded_image_folder() {\n if (!isset(self::$final_image_folder) || self::$final_image_folder === 'warehouse') {\n return self::getProxiedBaseUrl() . (isset(self::$indicia_upload_path) ? self::$indicia_upload_path : 'upload/');\n }\n else {\n return self::getRootFolder() . self::client_helper_path() . self::$final_image_folder;\n }\n }", "protected function getUploadDir()\r\n\t{\r\n\t\treturn 'uploads/documents';\r\n\t}", "public function getAbsolutePath() {\n return null === $this->path ? null : $this->getUploadRootDir() . '/' . $this->path;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/subtitles';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/guide';\n }", "protected function getUploadPath()\n {\n return 'uploads/achtergrondfotos';\n }", "private function uploadFolder()\n {\n return \"instagram/{$this->InstagramUserID}\";\n }", "public function getAbsolutePath()\n {\n return null === $this->photoId\n ? null\n : $this->getUploadRootDir().'/'.$this->photoId;\n }", "public function get_uploadBaseUrl()\n {\n return $this->_uploadBaseUrl;\n }", "public static function getDestination()\n {\n return public_path() . '/img/profile_photos/';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'images/page/'.$this->page->getId();\n }", "protected function generateUploadDir()\n\t{\n\t\treturn self::EXPORT_PATH;\n\t}", "protected function getUploadRootDir()\n {\n return dirname(__DIR__).'/../public/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return static::UPLOAD_DIRECTORY;\n }", "public function getUploadDir() {\n \treturn 'uploads/img';\n }", "public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }" ]
[ "0.7364734", "0.71367615", "0.70683354", "0.6965075", "0.69373906", "0.6840406", "0.67348766", "0.66836274", "0.6666377", "0.6624", "0.6612367", "0.658223", "0.65783095", "0.65695125", "0.65677816", "0.6565654", "0.6557096", "0.65484935", "0.6538917", "0.65365607", "0.6532108", "0.65300226", "0.6523273", "0.6516734", "0.65151113", "0.6511456", "0.6500583", "0.64901984", "0.6489028", "0.6489028", "0.6483475", "0.64830774", "0.64811885", "0.6467944", "0.6464958", "0.64501584", "0.64346933", "0.64241356", "0.6410076", "0.64091647", "0.6407497", "0.6405827", "0.6405827", "0.6405827", "0.6405827", "0.6405827", "0.6405827", "0.6405827", "0.6405827", "0.64044803", "0.63912845", "0.6389527", "0.63831145", "0.6380144", "0.63775915", "0.6374871", "0.63705707", "0.6370449", "0.6361743", "0.6358142", "0.63569814", "0.63424426", "0.63387", "0.63346297", "0.6322596", "0.6316219", "0.63132733", "0.6311931", "0.63111806", "0.6305672", "0.6294218", "0.6286462", "0.6286047", "0.62825775", "0.62791294", "0.6274256", "0.62736696", "0.626845", "0.6263038", "0.62612015", "0.6259185", "0.6259166", "0.62573814", "0.62569684", "0.6256947", "0.6256744", "0.6251695", "0.62355334", "0.6223563", "0.62189764", "0.621853", "0.62156045", "0.62129205", "0.6211083", "0.6209236", "0.6202636", "0.6191457", "0.61910903", "0.6187491", "0.6186961" ]
0.7270278
1