query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Get the Primary Key Name for the User Model | public function getUserPrimaryKeyName() {
$forcedPkName = Configure::read('acl.aro.user.primary_key');
if (! empty($forcedPkName)) {
return $forcedPkName;
} else {
/* Return the primary key's name that follows the CakePHP
* conventions */
return 'id';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function primaryKey() {\n return (new static)->getKeyName();\n }",
"public function getPrimaryKeyName()\n {\n return self::$primary_key_name;\n }",
"private function userKeyName()\n {\n $userModel = config('follow.user');\n\n return (new $userModel)->getKeyName();\n }",
"public function getPrimaryKeyName()\n {\n return $this->primaryKeyName;\n }",
"protected function getPrimaryKeyName(): string\n {\n return $this->query->getModel()->getKeyName();\n }",
"public function getAuthIdentifierName()\n {\n return $this->primaryKey;\n }",
"public function getRolePrimaryKeyName() {\n\n $forcedPkName = Configure::read('acl.aro.role.primary_key');\n if (! empty($forcedPkName)) {\n return $forcedPkName;\n } else {\n /* Return the primary key's name that follows the CakePHP\n * conventions */\n return 'id';\n }\n }",
"protected function getPrimaryKeyName() {\n return \"UserID\";\n }",
"public function getAuthIdentifierName() {\n return $this->primaryKey;\n }",
"protected function userKeyName()\n {\n $userModel = config('blockable.user');\n\n return (new $userModel)->getKeyName();\n }",
"public function getModelKeyName()\n {\n // Create an instance of the model to get primary key name\n // I couldn't find a better solution \n $model = $this->getModel();\n $model = new $model;\n return $model->getKeyName();\n }",
"public function getKeyName()\n {\n return isset($this->primaryKey) ? $this->primaryKey : static::$defaultPrimaryKey;\n }",
"public function getKeyName()\n {\n if (!$this->primaryKey) {\n if ($key = $this->getPrimaryFromFields()) {\n $this->primaryKey = $key;\n } else {\n $this->primaryKey = 'id';\n }\n }\n\n return $this->primaryKey;\n }",
"public function getPrimaryKeyFieldName(){\n\t\treturn $this->primaryKey;\n\t}",
"protected function getModelPrimaryKey(): string\n {\n $model = $this->option('model');\n $model = new $model;\n\n return $model->getRouteKeyName();\n }",
"public function getKeyName()\n {\n return $this->primaryKey;\n }",
"public function getKeyName()\n {\n return $this->primaryKey;\n }",
"public function getPrimaryKey() {\n\t\treturn $this->_key_primary->name;\n\t}",
"public function getPrimaryKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public static function getPkFieldName()\n {\n $modelClass = self::getClass();\n\n return implode('__', $modelClass::getScheme()->getPkFieldNames());\n }",
"protected abstract function getPrimaryKeyName();",
"protected function getPrimaryKeyMemberName()\n {\n return MemberNames::ENTITY_ID;\n }",
"public function getPrimaryKey()\n\t{\n\t\treturn $this->name;\n\t}",
"public function getPrimaryKeyName()\n\t{\n\t\treturn 'id';\n\t}",
"protected function _getPrimaryKey(): string\n {\n if (!$this->_primaryKey) {\n $primaryKey = (array)$this->_table->getPrimaryKey();\n $this->_primaryKey = $primaryKey[0];\n }\n\n return $this->_primaryKey;\n }",
"public function getPrimaryKey()\n\t{\n\t\treturn $this->getCoUsuario();\n\t}",
"public function pkName()\r\n {\r\n $schema = $this->schema();\r\n foreach($schema as $col){\r\n if( $col['PRIMARY'] === true )\r\n return $col['FIELD'];\r\n }\r\n throw new \\Exception( __CLASS__ .\" Error: could not find Primary Key for table: \" . $this->table->name() ); \r\n }",
"public function getCustomEntityPrimaryKeyColumnName()\n {\n return self::CUSTOM_TABLE_PRIMARY_KEY_COLUMN;\n }",
"function primary_key()\r\n\t{\r\n\t\treturn 'key';\r\n\t}",
"public function primaryKey()\n\t{\n\t\treturn 'userID';\n\t}"
]
| [
"0.81207246",
"0.80537635",
"0.80530363",
"0.8032713",
"0.803236",
"0.79726744",
"0.79648507",
"0.7948807",
"0.79371184",
"0.7924475",
"0.7910404",
"0.78667253",
"0.78244376",
"0.77758414",
"0.77562934",
"0.77033526",
"0.77033526",
"0.76473117",
"0.75378853",
"0.75027096",
"0.7470409",
"0.745425",
"0.74480754",
"0.73909897",
"0.72982806",
"0.7203248",
"0.7185287",
"0.71779084",
"0.7152796",
"0.7107944"
]
| 0.8695527 | 0 |
Get the Foreign Key Name for the Role Model | protected function _getRoleForeignKeyName() {
$forcedFkName = Configure::read('acl.aro.role.foreign_key');
if (! empty($forcedFkName)) {
return $forcedFkName;
} else {
/* Return the foreign key's name that follows the CakePHP
* conventions */
return Inflector::underscore(Configure::read('acl.aro.role.model')) . '_id';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getForeignKeyName() {\n return $this->foreignKeyName;\n }",
"public function getForeignKey()\n {\n return $this->getTableSingular().'_'.$this->getKeyName();\n }",
"public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }",
"public function getForeignKey()\n {\n $keyName = $this->getKeyName();\n\n if ($keyName[0] != '_') {\n $keyName = '_' . $keyName;\n }\n\n return Str::snake(class_basename($this)) . $keyName;\n }",
"public function getForeignKey()\n {\n return str_singular($this->getTable()).'_id';\n }",
"public function getForeignKey(): string\n {\n return $this->foreignKey;\n }",
"public function getQualifiedForeignKeyName(): string\n {\n return $this->related->getQualifiedKeyName();\n }",
"public function getForeignKey()\n {\n return $this->table . '.' . $this->foreignKey;\n }",
"public function getForeignKeyName(Model $model = null): string\n {\n $table = explode(' AS ', ($model ?? $this->parent)->getTable())[0];\n\n return $this->foreign_ley_lookup->get($table, sprintf('%s_id', Str::singular($table)));\n }",
"public function getQualifiedFarKeyName()\n {\n return $this->getQualifiedForeignKeyName();\n }",
"public function getForeignKey()\n {\n if (is_null($this->_foreignKey)) {\n $this->_foreignKey = strtolower($this->_entity->getAlias()) .\n \"_id\";\n }\n return $this->_foreignKey;\n }",
"public function getForeignKeyName()\n {\n $segments = explode('.', $this->getQualifiedForeignKeyName());\n\n return end($segments);\n }",
"public function getForeignKey();",
"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 getRoleName()\n {\n $item = $this->belongsTo(Role::class, 'role_id', 'id');\n return $item->first()->name;\n }",
"public function getTranslationForeignKey(): string\n {\n return $this->translationForeignKey ?? $this->getForeignKey();\n }",
"protected function associated_key()\n {\n return $this->model->table() . '.' . $this->model->key();\n }",
"public function getQualifiedForeignKeyName()\n {\n return $this->farChild->qualifyColumn($this->secondKey);\n }",
"public function getRolePrimaryKeyName() {\n\n $forcedPkName = Configure::read('acl.aro.role.primary_key');\n if (! empty($forcedPkName)) {\n return $forcedPkName;\n } else {\n /* Return the primary key's name that follows the CakePHP\n * conventions */\n return 'id';\n }\n }",
"public function getRouteKeyName()\n\t\t{\n\t\t return 'fk_usuario';\n\t\t}",
"public function getForeignKey()\n {\n return $this->foreignKey;\n }",
"public function getForeignKey()\n {\n return $this->foreignKey;\n }",
"public function getForeignKey()\n {\n return $this->foreignKey;\n }",
"public function getForeignKey()\n {\n return 'nonmember_id';\n }",
"public function getQualifiedKeyName()\n {\n return $this->getTable().'.'.$this->getKeyName();\n }",
"public function getForeignKey()\n {\n return $this->primaryKey;\n }",
"public function getForeignKey($name);",
"public function getForeignPartitionKeyName()\n {\n return $this->foreignKey[0];\n }",
"public function getForeignSortKeyName()\n {\n return $this->foreignKey[1];\n }",
"public function getRoleIdFk()\n {\n return $this->roleIdFk;\n }"
]
| [
"0.7569259",
"0.75360084",
"0.7419114",
"0.73863214",
"0.73412377",
"0.7316087",
"0.7259885",
"0.71900666",
"0.7155617",
"0.7107631",
"0.70518327",
"0.6753322",
"0.66961634",
"0.66732",
"0.66642493",
"0.66597706",
"0.6655589",
"0.6647459",
"0.6642061",
"0.6631837",
"0.6591524",
"0.6591524",
"0.6591524",
"0.6537429",
"0.64417523",
"0.643056",
"0.64187264",
"0.63999254",
"0.6389851",
"0.6382083"
]
| 0.85481507 | 0 |
redirect to the referring page or the admin_index action. | protected function _returnToReferer() {
return $this->redirect(
$this->referer(
array(
'action' => 'admin_index'
)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redirect() {\n\t\theader('Location: admin.php');\n\t\texit();\n\t}",
"public static function redirect() {\n\t\tunset( $_GET['action'] );\n\n\t\twp_safe_redirect( admin_url( 'admin.php?page=' . WPFC_QS_Setup::get_template_name() . '-setup' ) );\n\n\t\texit();\n\t}",
"public function index()\n {\n redirect(site_url('admin'));\n }",
"public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }",
"protected function redirectToCurrentPage() {}",
"public function actionIndex() {\n \n $this->redirect('admin');\n \n\t}",
"private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}",
"public function referredAction()\n {\n $this->_logger->debug(__('Calling referredAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to referred page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_logger->error($e->getMessage());\n $this->_getCheckoutSession()->addError($this->__('An error occurred during redirecting to referred page.'));\n }\n }",
"function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }",
"public function redirect_to_referrer()\n\t\t{\n\t\t\tif ( isset($_SERVER['HTTP_REFERER']) )\n\t\t\t\theader(\"Location: \" . $_SERVER[\"HTTP_REFERER\"]);\n\t\t\telse\n\t\t\t\theader(\"Location: \" . root_url('', true));\n\t\t}",
"public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}",
"public function redirect();",
"public function redirect();",
"public function redirect();",
"public function showAdminAction()\n {\n header (\"location: admin.php?route=adminAccueil\");\n }",
"public function redirectAction()\n {\n $this->getResponse()->setBody($this->getLayout()->createBlock('paymentsensegateway/redirect')->toHtml());\n }",
"public function index() {\n redirect(site_url('admin/dashboard'), 'refresh');\n }",
"function wpmu_admin_do_redirect($url = '')\n {\n }",
"public function redirectAction()\n {\n\t\t\n $session = Mage::getSingleton('checkout/session');\n $session->setHdfcStandardQuoteId($session->getQuoteId());\n\t\t$order = $this->getOrder();\n\t\t\n \n if (!$order->getId()) {\n\t\t\n\t\t\t$this->_forward('failurerefresh');\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('hdfc')->__('Customer was redirected to hdfc')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('hdfc/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }",
"protected function expulsaVisitante()\n {\n header( \"Location: \".self::index );\n }",
"public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }",
"public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}",
"abstract protected function redirect();",
"abstract protected function redirectTo();",
"public function index() {\n if ($this->session->userdata('adminLogged') != 'yes') {\n redirect(SITE_ADMIN_URL.'index_admin/index');\n } else {\n redirect(SITE_ADMIN_URL.'index_admin/index');\n }\n }",
"function ahr_handle_redirections() {\r\n \r\n ahr_redirect( get_option( 'ahr-redirect-admin-default' ) );\r\n \r\n}",
"public static function display_in_redirect() {\n\t\n\t\t\t\tif ( is_home() ) { return; }\n\t\t\t\t\n\t\t\t\tglobal $wp_query;\n\t\t\n\t\t\t\t$opt = self::get_current_options();\n\t\t\t\t\n\t\t\t\tif($opt[3] == \"redirect\"){\n\t\t\t\t\tif((is_single($opt[0]) && $opt[2] == \"post\") || (is_page($opt[0]) && $opt[2] == \"page\")){\n\t\t\t\t\t\t\t$file = get_bloginfo('wpurl').'/menu/';\n\t\t\t\t\t\t\theader(\"Location:\".$file);\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t }",
"public function redirect(){\r\n\t}",
"protected function _redirectBack()\n {\n $this->_helper->redirector->gotoUrl($this->_request->getServer('HTTP_REFERER'));\n }",
"public function redirect() : void\n {\n $controller = $this->getNamespace() . $this->params['controller'];\n $action = $this->capitalizeAction($this->params['action']);\n\n if (class_exists($controller)) \n {\n $controller = new $controller;\n unset($this->params['controller']);\n\n if (is_callable([$controller, $action])) \n {\n unset($this->params['action']);\n unset($this->params['namespace']);\n }\n else\n {\n die('Page not found.');\n }\n }\n else \n {\n header('location: ' . URLROOT);\n }\n\n call_user_func_array([$controller, $action], [$this->params]);\n }"
]
| [
"0.7361207",
"0.7289132",
"0.72034097",
"0.7177263",
"0.7059238",
"0.7026167",
"0.6996214",
"0.69860095",
"0.6976114",
"0.69076633",
"0.6881888",
"0.6802216",
"0.6802216",
"0.6802216",
"0.67744046",
"0.67598134",
"0.67345256",
"0.67100114",
"0.6705284",
"0.6701056",
"0.6682446",
"0.66810423",
"0.6653851",
"0.6649124",
"0.66442126",
"0.66233927",
"0.66231954",
"0.6598072",
"0.65962416",
"0.6585722"
]
| 0.77819353 | 0 |
$sql is a string which contains $1 to $n parameters and $param_array must supply the correct amount of string parameters in the correct order. Zero parameters are also allowed | function execute_params($sql, $param_array)
{
// Using an empty string as stmtname here overwrites any
// previous prepared statement making multiple prepares
// easily doable
$q = pg_prepare($this->connection, '', $sql);
$q = pg_execute($this->connection, '', $param_array);
$rows = array();
while($r = pg_fetch_array($q, null, PGSQL_ASSOC))
{
array_push($rows, $r);
}
pg_free_result($q);
return $rows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setParams($sql, $params)\n{\n\t$has_params = false;\n\t\n\t$pat = $this->SQL_PARAM_PATTERN;\n\tif (strpos($sql, '{')) $has_params = true;\n\tif ($this->config['pclib.compatibility']['sql_syntax'] and strpos($sql, '[')) {\n\t\t$has_params = true;\n\t\t$pat = \"/\\[([#\\?\\!]?)([a-z0-9_]+)\\]/i\";\n\t}\n\tif (!$has_params) return $sql;\n\t\n\tpreg_match_all($pat, $sql, $found);\n\tif (!$found[0]) return $sql;\n\t$from = $to = array();\n\t$empty = false;\n\tforeach($found[2] as $i => $key) {\n\t\t$from[] = $found[0][$i];\n\t\tif (strlen(array_get($params, $key)) == 0) {\n\t\t\t$empty = true;\n\t\t\tif ($found[1][$i] == '#') $to[] = '__PCL_EMPTY0__';\n\t\t\telse $to[] = '__PCL_EMPTYS__';\n\t\t}\n\t\telseif ($found[1][$i] == '#')\n\t\t\t$to[] = (int)$params[$key];\n\t\telseif($found[1][$i] == '?')\n\t\t\t$to[] = '';\n\t\telseif($found[1][$i] == '!')\n\t\t\t$to[] = $params[$key];\n\t\telse\n\t\t\t$to[] = $this->escape($params[$key]);\n\t}\n\t\n\t$sql = str_replace($from, $to, $sql);\n\tif (!strpos($sql, \"\\n\") and !$empty) return $sql;\n\t\n\t$from = array(\"/^\\s*~ .+__PCL_EMPTY.__.*$/m\", \"/^\\s*~ /m\", \"/__PCL_EMPTYS__/\", \"/__PCL_EMPTY0__/\");\n\t$to = array('',' ','', '0');\n\treturn preg_replace($from, $to, $sql);\n}",
"public function safeExecution($sql,array $param){\n $conn = $this->connect();\n if(empty($param)){\n $nrOfVar = 0;\n }\n else{\n $stmt = $conn->prepare($sql);\n $nrOfVar = count($param);\n }\n switch($nrOfVar){\n case 0:\n break;\n case 1:\n $stmt->bind_param('s',$param[0]);\n break;\n case 2:\n $stmt->bind_param('ss',$param[0],$param[1]);\n break;\n case 3:\n $stmt->bind_param('sss',$param[0],$param[1],$param[2]);\n break;\n case 4:\n $stmt->bind_param('ssss',$param[0],$param[1],$param[2],$param[3]);\n break;\n case 5:\n $stmt->bind_param('ssss',$param[0],$param[1],$param[2],$param[3],$param[4]);\n break;\n }\n if($nrOfVar == 0){\n $result = mysqli_query($conn,$sql);\n }else {\n $stmt->execute();\n $result = $stmt->get_result();\n }\n return $result;\n }",
"function _query($sql,$inputarr=false)\n\t{\n\t\t$this->_pnum = 0;\n\t\t$this->_errorMsg = false;\n\t\tif ($inputarr) {\n\t\t/*\n\t\t\tIt appears that PREPARE/EXECUTE is slower for many queries.\n\n\t\t\tFor query executed 1000 times:\n\t\t\t\"select id,firstname,lastname from adoxyz\n\t\t\t\twhere firstname not like ? and lastname not like ? and id = ?\"\n\n\t\t\twith plan = 1.51861286163 secs\n\t\t\tno plan = 1.26903700829 secs\n\t\t*/\n\t\t\t$plan = 'P'.md5($sql);\n\n\t\t\t$execp = '';\n\t\t\tforeach($inputarr as $v) {\n\t\t\t\tif ($execp) $execp .= ',';\n\t\t\t\tif (is_string($v)) {\n\t\t\t\t\tif (strncmp($v,\"'\",1) !== 0) $execp .= $this->qstr($v);\n\t\t\t\t} else {\n\t\t\t\t\t$execp .= $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($execp) $exsql = \"EXECUTE $plan ($execp)\";\n\t\t\telse $exsql = \"EXECUTE $plan\";\n\n\n\t\t\t$rez = @pg_execute($this->_connectionID,$exsql);\n\t\t\tif (!$rez) {\n\t\t\t# Perhaps plan does not exist? Prepare/compile plan.\n\t\t\t\t$params = '';\n\t\t\t\tforeach($inputarr as $v) {\n\t\t\t\t\tif ($params) $params .= ',';\n\t\t\t\t\tif (is_string($v)) {\n\t\t\t\t\t\t$params .= 'VARCHAR';\n\t\t\t\t\t} else if (is_integer($v)) {\n\t\t\t\t\t\t$params .= 'INTEGER';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params .= \"REAL\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sqlarr = explode('?',$sql);\n\t\t\t\t//print_r($sqlarr);\n\t\t\t\t$sql = '';\n\t\t\t\t$i = 1;\n\t\t\t\tforeach($sqlarr as $v) {\n\t\t\t\t\t$sql .= $v.' $'.$i;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$s = \"PREPARE $plan ($params) AS \".substr($sql,0,strlen($sql)-2);\n\t\t\t\t//adodb_pr($s);\n\t\t\t\t$rez = pg_execute($this->_connectionID,$s);\n\t\t\t\t//echo $this->ErrorMsg();\n\t\t\t}\n\t\t\tif ($rez)\n\t\t\t\t$rez = pg_execute($this->_connectionID,$exsql);\n\t\t} else {\n\t\t\t//adodb_backtrace();\n\t\t\t$rez = pg_query($this->_connectionID,$sql);\n\t\t}\n\t\t// check if no data returned, then no need to create real recordset\n\t\tif ($rez && pg_num_fields($rez) <= 0) {\n\t\t\tif (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {\n\t\t\t\tpg_free_result($this->_resultid);\n\t\t\t}\n\t\t\t$this->_resultid = $rez;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $rez;\n\t}",
"public function prepareQuery($sql){\n \t//parse out the tokens\n \t$tokens = preg_split('/((?<!\\\\\\)[&?!])/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\n \t//maintain a count of the actual tokens for quick reference in execute\n \t$count = 0;\n \t\n \t$sqlStr = '';\n\t foreach ($tokens as $key => $val) {\n\t switch ($val) {\n\t case '?' :\n\t case '!' :\n\t case '&' :\t\n\t \t$count++;\n\t \t$sqlStr .= '?';\n\t \tbreak;\n\t \t\n\t default :\n\t \t//escape any special characters\n\t $tokens[$key] = preg_replace('/\\\\\\([&?!])/', \"\\\\1\", $val);\n\t $sqlStr .= $tokens[$key];\n\t break;\n\t } // switch\n\t } // foreach\n\n\t $this->preparedTokens[] = array('tokens' => $tokens, 'tokenCount' => $count, 'sqlString' => $sqlStr);\n\t end($this->preparedTokens);\n\t return key($this->preparedTokens);\t\n }",
"public static function query($sql) {\n\t\t\tif (!is_string($sql)) return false;\n\t\t\t\n\t\t\t$valuei = 1;\n\t\t\t$value = null;\n\t\t\t$pos = 0;\n\t\t\t$length = strlen($sql);\n\t\t\t$posTo = strpos($sql, '%', $pos);\n\t\t\t$resultSQL = '';\n\t\t\twhile ($posTo !== false) {\n\t\t\t\t$resultSQL .= substr($sql, $pos, $posTo-$pos);\n\t\t\t\tswitch($sql[$posTo+1]) {\n\t\t\t\t\tcase 'i':\n\t\t\t\t\t\t$valueRaw = func_get_arg($valuei);\n\t\t\t\t\t\t$value = self::sqlInt($valueRaw);\n\t\t\t\t\t\t$valuei++;\n\t\t\t\t\t\t$pos = $posTo+2;\n\t\t\t\t\t\t$resultSQL .= $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\t$valueRaw = func_get_arg($valuei);\n\t\t\t\t\t\t$value = self::sqlString($valueRaw);\n\t\t\t\t\t\t$valuei++;\n\t\t\t\t\t\t$pos = $posTo+2;\n\t\t\t\t\t\t$resultSQL .= $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'v':\n\t\t\t\t\t\t$valueRaw = func_get_arg($valuei);\n\t\t\t\t\t\t$value = self::sqlValueName($valueRaw);\n\t\t\t\t\t\t$valuei++;\n\t\t\t\t\t\t$pos = $posTo+2;\n\t\t\t\t\t\t$resultSQL .= $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'b':\n\t\t\t\t\t\t$valueRaw = func_get_arg($valuei);\n\t\t\t\t\t\t$value = self::sqlBool($valueRaw);\n\t\t\t\t\t\t$valuei++;\n\t\t\t\t\t\t$pos = $posTo+2;\n\t\t\t\t\t\t$resultSQL .= $value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tif (($posTo+3) > $length) return false;\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\t$arrayType = $sql[$posTo+2];\n\t\t\t\t\t\t$arrayRaw = func_get_arg($valuei);\n\t\t\t\t\t\tif (!is_array($arrayRaw)) $arrayRaw = [];\n\t\t\t\t\t\tif ($arrayType==='i') {\n\t\t\t\t\t\t\tforeach($arrayRaw as $arrayKey=>$arrayValue) {\n\t\t\t\t\t\t\t\t$resultSQL .= self::sqlInt($arrayValue).',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if ($arrayType==='b') {\n\t\t\t\t\t\t\tforeach($arrayRaw as $arrayKey=>$arrayValue) {\n\t\t\t\t\t\t\t\t$resultSQL .= self::sqlBool($arrayValue).',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if ($arrayType==='s') {\n\t\t\t\t\t\t\tforeach($arrayRaw as $arrayKey=>$arrayValue) {\n\t\t\t\t\t\t\t\t$resultSQL .= self::sqlString($arrayValue).',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if ($arrayType==='v') {\n\t\t\t\t\t\t\tforeach($arrayRaw as $arrayKey=>$arrayValue) {\n\t\t\t\t\t\t\t\t$resultSQL .= self::sqlValueName($arrayValue).',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$resultSQL = substr($resultSQL, 0, \\strlen($resultSQL)-1);\n\t\t\t\t\t\t$valuei++;\n\t\t\t\t\t\t$pos = $posTo+3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$resultSQL .= '%';\n\t\t\t\t\t\t$pos = $posTo+1;\n\t\t\t\t}\n\t\t\t\t$posTo = strpos($sql, '%', $pos);\n\t\t\t}\n\t\t\t$resultSQL .= substr($sql, $pos);\n\t\t\t\n\t\t\t$res = self::$link->query($resultSQL);\n\t\t\tLog::info($resultSQL);\n\t\t\tif (self::$link->errno) Log::error('DB_ERROR '.self::$link->error.' '.$sql);\n\t\t\tif ( \\is_bool($res) ) {\n\t\t\t\tif ($res===false) return false;\n\t\t\t\treturn self::$link->insert_id;\n\t\t\t}\n\t\t\t$arr = [];\n\t\t\twhile ($row = $res->fetch_object()) {\n\t\t\t\t$arr[] = $row;\n\t\t\t}\n\t\t\t//$res->free_result();\n\t\t\treturn $arr;\n\t\t}",
"function normalize_sql($sql, $params = null, $detectErrors = false) {\n\n // TODO: move to a tests.php file that is only included w/ tests?\n // TODO: actually watch out for whitespace in fields\n\n $sql = preg_replace('/\\s+/m', ' ', trim($sql));\n if (empty($params)) return $sql;\n\n //TODO: be smarter about ? characters in\n $pos = 0;\n while(count($params) && ($pos = strpos($sql, '?', $pos)) !== false) {\n\n $p = array_shift($params);\n $p = \"'\" . str_replace(\"'\", \"\\\\'\", $p) . \"'\";\n\n $sql = substr($sql,0,$pos) . $p . substr($sql,$pos + 1);\n $pos += strlen($p);\n }\n\n if ($detectErrors && count($params)) {\n throw new Octopus_Exception(count($params) . \" parameter(s) left in params array: \" . implode(',', $params));\n }\n\n return $sql;\n }",
"public function execute($sql, $params = array());",
"private function interpolateQuery($sql, $params = array())\n {\n $keys = array();\n if(!is_array($params)) return $sql;\n\n // build regular expression for each parameter\n foreach($params as $key => $value){\n if (is_string($key)) {\n $keys[] = '/:'.$key.'/';\n }else{\n $keys[] = '/[?]/';\n }\n }\n\n return preg_replace($keys, $params, $sql, 1, $count);\n }",
"abstract public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR);",
"public function queryArray($sql, $params = array());",
"function exeSql($sql, $pars, $isLimit = 1){ \n $ini = parse_ini_file('config.ini');\n $servername = $ini['db_name'];\n $username = $ini['db_user'];\n $password = $ini['db_password'];\n\n // Create connection\n $conn = new mysqli($servername, $username, $password);\n \n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n \n for ($i=0; $i < count($pars); $i++)\n $sql = str_replace(\"{\".$i.\"}\", $pars[$i], $sql); \n\n if($isLimit)\n $sql .= \" LIMIT 30 \";\n\n \n\n $data = mysqli_query($conn, $sql); \n\n return $data; \n }",
"public function query (string $sql, array $params = [])\n {\n /**\n * Prepared Statement initialisieren\n */\n $this->stmt = $this->link->prepare($sql);\n\n if (count($params) >= 1) {\n /**\n * Variablen vorbereiten\n */\n $paramTypes = [];\n $paramValues = [];\n\n /**\n * Funktionsparameter $params durchgehen und die obenstehenden Variablen befüllen.\n */\n foreach ($params as $key => $value) {\n $paramTypes[] = explode(':', $key)[0];\n\n /**\n * $stmt->bind_param() erwartet eine Referenz als Werte und nicht eine normale Variable, daher müssen\n * wir in unseren $paramValues Array Referenzen pushen. Das ist eine seltsame aber begründete Eigenheit\n * von bind_param().\n */\n unset($_value);\n $_value = $value;\n $paramValues[] = &$_value;\n /**\n * $paramTypes: ['i', 'i']\n * $paramValues: [&1, &0]\n */\n }\n /**\n * $stmt->bind_param() verlangt als ersten Parameter einen String mit den Typen aller folgenden Parameter.\n * Wir müssen also aus dem Array $paramTypes einen String erstellen.\n */\n $paramString = implode('', $paramTypes); // ii\n\n /**\n * Gemeinsames Array aus $paramString und $paramValues erstellen, weil $stmt->bind_param() als ersten\n * Parameter einen String aller Typen und als folgende Parameter die einzelnen Werte erwartet.\n *\n * s. https://www.php.net/manual/en/mysqli-stmt.bind-param.php\n */\n array_unshift($paramValues, $paramString);\n\n /**\n * Query fertig \"preparen\": $stmt->bind_param() mit den entsprechenden Werten ausführen; aber nur, wenn es\n * sich um einen MySQL Query mit Parametern handelt (s. if-Statement).\n */\n @call_user_func_array([$this->stmt, 'bind_param'], $paramValues);\n }\n\n /**\n * Query an den MySQL Server schicken.\n */\n $this->stmt->execute();\n\n /**\n * Ergebnis aus dem Query holen.\n */\n $result = $this->stmt->get_result();\n\n /**\n * Das Ergebnis ist idR. nur dann ein bool'scher Wert, wenn ein Fehler auftritt oder ein Query ohne Ergebnis\n * ausgeführt wird.\n */\n if (is_bool($result)) {\n return $result;\n }\n\n /**\n * Tritt kein Fehler auf, erstellen wir ein assoziatives Array und geben es zurück.\n */\n return $result->fetch_all(MYSQLI_ASSOC);\n }",
"abstract public function arrQuery($sql);",
"function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }",
"public function query($sqlstr,$paramarray){\n \n $st = $this->exec($sqlstr, $paramarray);\n \n return $st->fetchAll();\n }",
"public function rawExecute(array $param = array('query'=>'','arrData'=>[])) {\n $qry = isset($param['query']) ? $param['query'] : '';\n $arrData = isset($param['arrData']) ? $param['arrData'] : [];\n\n if( empty( $qry ) ) {\n echo \"missing query\";\n die;\n }\n \n $insert_values = [];\n\n if( !empty( $qry ) ) {\n $countQuestionMarks = 0;\n\n foreach( $qry AS $char ) {\n if( $char == \"?\" )\n $countQuestionMarks++;\n }\n\n if( count($arrData) == $countQuestionMarks ) {\n echo \"data count doesn't match with column count.\";\n die;\n }\n\n if( count( $arrData ) ) {\n $insert_values = $arrData;\n }\n }\n\n $strQry = $qry;\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n\n if( count( $insert_values ) ) {\n $executed = $this->stmt->execute($insert_values);\n } else {\n $executed = $this->stmt->execute();\n }\n \n if( $executed ) {\n echo 'query executed successfully.';\n } else {\n echo 'fails to truncate table';\n }\n \n $this->stmt = null;\n die;\n }",
"public static function read_SqlParams($param);",
"public function query($sql, $param = array(), $insert_multi = FALSE) {\n\n $this->startTime = microtime(TRUE);\n $results = FALSE;\n $this->sql = $sql;\n $this->param = $param;\n\n if (!is_string($sql) || empty($sql) || !is_array($param)) {\n\n $msg = '%s Expects parameter 1 to be not empty string and parameter 2 to be array. %s, %s given.';\n return $this->queryFail(sprintf($msg, __METHOD__, gettype($sql), gettype($param)));\n }\n\n if (!$stmt = $this->queryPrepare($sql)) {\n\n return $this->queryFail(sprintf('%s Prepare fail: %s', __METHOD__, $this->msgBox));\n }\n\n $this->param_count = $stmt->param_count;\n $bindfail = '%s Bind param fail. The number of parameter doesn\\\"t match the placeholders in the statement. Placeholders count: %d, Parameter count: %d, Parameter type count: %d.';\n\n if ($stmt->param_count <= 0) {\n\n $results = $this->queryExecute($stmt, $sql);\n }\n else {\n\n $pinfo = $this->qparamSpliter($param);\n\n if ($pinfo['param_count'] <= 0) {\n\n $msg = sprintf($bindfail, __METHOD__, $stmt->param_count, (int) $pinfo['param_count'], $pinfo['format_count']);\n return $this->queryFail($msg);\n }\n\n if ($insert_multi && ($sqltype = $this->getSqlType($sql)) == 'insert') {\n\n if ($pinfo['format_count'] != ($row1count = count(current(current($pinfo['param_arr']))))) {\n\n $msg = sprintf($bindfail, __METHOD__, $stmt->param_count, $row1count, $pinfo['format_count']);\n return $this->queryFail($msg);\n }\n\n $results = array();\n $param_arr = current($pinfo['param_arr']);\n\n foreach ($param_arr as $v) {\n\n if ($row1count != count($v)) {\n\n $msg = '%s Expects all array from parameter 2\\'s element 2 have the same count.';\n return $this->queryFail(sprintf($msg, __METHOD__));\n }\n\n if (!($stmt = $this->queryBindParam($stmt, $pinfo['format_chars'], $pinfo['format_str'], $v))) {\n\n break;\n }\n\n $results[] = $this->queryExecute($stmt, $sql);\n }\n }\n else {\n\n if ($pinfo['format_count'] != $pinfo['param_count']) {\n\n $msg = sprintf($bindfail, __METHOD__, $stmt->param_count, (int) $pinfo['param_count'], $pinfo['format_count']);\n return $this->queryFail($msg);\n }\n\n $stmt = $this->queryBindParam($stmt, $pinfo['format_chars'], $pinfo['format_str'], $pinfo['param_arr']);\n $results = ($stmt) ? $this->queryExecute($stmt, $sql) : FALSE;\n }\n }\n\n $this->durationLap();\n $stmt->close();\n $this->close();\n return $results;\n }",
"protected function query($sql, array $params)\n {\n }",
"public function prepare($sql, $params);",
"static function callSQL($sql, $paramArray = NULL, $datatypeArray = NULL)\n {\n self::init();\n \n $sth = self::$_dbh->prepare($sql);\n \n if( isset( $paramArray ) )\n self::bind_params($sth, $paramArray, $datatypeArray);\n \n $sth->execute();\n if( self::$_dbh->errorCode() <> '00000' ){\n self::$_mysqlErrorInfo = self::$_dbh->errorInfo();\n throw new PDOException(\"Database::callSQL() error: \" . self::$_mysqlErrorInto[2]);\n }\n \n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function SqlQuery($sql, $parameters)\n {\n \n }",
"function build_sql(string $sql, array $bindings = []): string\n{\n if (! Arr::isAssoc($bindings)) {\n $position = 0;\n foreach ($bindings as $value) {\n $position = strpos($sql, '?', $position);\n if ($position === false) {\n break;\n }\n\n $value = (string) match (gettype($value)) {\n 'integer', 'double' => $value,\n 'boolean' => (int) $value,\n default => sprintf(\"'%s'\", $value),\n };\n $sql = substr_replace($sql, $value, $position, 1);\n $position += strlen($value);\n }\n }\n\n return $sql;\n}",
"function _execQ($query, $param_strs, $params){\n $db = MySQLConnect::get_instance();\n $res = $db->prepare($query);\n \t array_unshift($params, $param_strs);\n call_user_func_array(array($res, 'bind_param'), $params);\n $bool = $res->execute();\n $sonuclar = $res->get_result();\n $rows = $sonuclar->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }",
"private function generateSql($sql, $params, $types)\n {\n if (!count($params)) {\n return $sql;\n }\n\n $converted = $this->getConvertedParams($params, $types);\n\n if (is_int(key($params))) {\n $index = key($converted);\n $sql = preg_replace_callback('@\\?@sm', function ($match) use (&$index, $converted) {\n return $converted[$index++];\n }, $sql);\n } else {\n foreach ($converted as $key => $value) {\n $sql = str_replace(':' . $key, $value, $sql);\n }\n }\n\n return $sql;\n }",
"abstract protected function executeSql($sql);",
"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}",
"function _create_add_sql($params) {\n\t\t$tables_shorts\t= array_flip($this->_user_tables);\n\t\t$add_sql = \" \";\n\t\tif (empty($params)) {\n\t\t\treturn \"\";\n\t\t}\n\t\tforeach ((array)$params as $mod => $val) {\n\t\t\t$mod = strtoupper($mod);\n\t\t\tif (!in_array($mod, $this->_allowed_sql_params)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (in_array($mod, array(\"LIMIT\", \"OFFSET\"))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($mod == \"WHERE\") {\n\t\t\t\t$add_sql .= \"AND \";\n\t\t\t} else {\n\t\t\t\t$add_sql .= $mod.\" \";\n\t\t\t}\n\t\t\tif ($this->MODE != \"SIMPLE\") {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$table_names = $this->_arrange_fields(array_keys($val), $this->_user_tables);\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\t\tif (in_array($fld, $fields)) {\n\t\t\t\t\t\t\t\t$table = $_table_name;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$table_names = $this->_arrange_fields($val, $this->_user_tables);\n\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\tif (in_array($val, $fields)) {\n\t\t\t\t\t\t\t$table = $_table_name;\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\t$add_sql .= \" \".$tables_shorts[$table].\".\".$val.\" \";\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$add_sql .= \" \".$val.\" \";\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $add_sql;\n\t}",
"abstract public function executeS($query, $array = true);",
"public function quoteInto($sql) {\n\t\t$args = func_get_args();\n\n\t\tif (count($args) < 2 || (count($args) == 2 && !is_array($args[1]))) {\n\t\t\t// Nothing special happening here, pass it through to the default method.\n\t\t\t// We do this instead of calling $this->_zendDb->quoteInto($sql, $args[1])\n\t\t\t// because we're not sure if args[1] is there or not.\n\t\t\treturn call_user_func_array(array($this->_db, 'quoteInto'), $args);\n\t\t}\n\n\t\t// We are going to run our own replacement method.\n\t\t$replacements = $args;\n\t\tarray_shift($replacements);\n\n\t\tif (is_array($replacements[0])) {\n\t\t\t// Here, we are passed an array of replacements with key/value combos\n\t\t\t// that correspond to \":key\" => \"sqlValueToBeEscaped\".\n\t\t\t$replacements = $replacements[0];\n\t\t}\n\n\t\t// If we are using \"?\" placeholders, we need to change them over to indexed-placeholders.\n\t\t$pieces = explode('?', $sql);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $i => $piece) {\n\t\t\t$sql .= $piece;\n\n\t\t\tif ($i == count($pieces) -1) {\n\t\t\t\t// We are on the last one, skip.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sql .= ':'.$i;\n\t\t}\n\n\t\t// At this point, we are using \":key\" placeholders.\n\t\t$pieces = preg_split('/:(\\w+)\\b/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $key => $piece) {\n\t\t\tif ($key % 2 == 0) {\n\t\t\t\t// We are on a piece of the query.\n\t\t\t\t$sql .= $piece;\n\t\t\t} else {\n\t\t\t\t// We are on a placeholder.\n\t\t\t\t$sql .= $this->_db->quote($replacements[$piece]);\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}"
]
| [
"0.7089347",
"0.7055418",
"0.69063294",
"0.6806215",
"0.6777838",
"0.66843504",
"0.6653871",
"0.66308755",
"0.65509635",
"0.65400493",
"0.64663815",
"0.6454364",
"0.6415091",
"0.6411967",
"0.6393609",
"0.6391266",
"0.635393",
"0.6343606",
"0.6310819",
"0.6306672",
"0.62978935",
"0.6249079",
"0.6240007",
"0.62334716",
"0.6220002",
"0.6210015",
"0.61900485",
"0.6180522",
"0.6176638",
"0.6175468"
]
| 0.7140548 | 0 |
This method check whether the supplied primary key $dsh_id exists or not | public function exists(){
try {
global $ks_db;
global $ks_log;
$bReturn = false;
if (! isset ( $this->id )) {
echo "Fatal Error: Id is not set for the object! Please do \$objA->setId(\$dsh_id); in: " . __METHOD__;
exit ();
}
$sql = "SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE dsh_id = ?";
//count how many rows found
$totalRow = $ks_db->fetchOne ( $sql, $this->id );
if ($totalRow > 0) {
$bReturn = true;
}else {
$bReturn = false;
}
return $bReturn;
} catch(Exception $e) {
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql);
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function KeyExists($id, $key)\n {\n global $SESSDB;\n \n $q = $SESSDB->prepare(\"SELECT COUNT(id) FROM `sdat` WHERE id=:id AND pkey=:key\");\n $q->bindParam(':id', $id, PDO::PARAM_INT);\n $q->bindParam(':key', $key);\n $q->execute();\n\n $result = $q->fetch();\n return $result[0] > 0;\n }",
"private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }",
"public function existsInDb($dh) {\n $info = $this->getDbInfo($dh);\n return isset($info[\"user\"]);\n }",
"public static function isExistingId($id, PDO $dbh=null);",
"function isSkIDExists($SkID) {\n\t$db = connectDB();\n\t$sql = \"SELECT SkID FROM infoTable WHERE SkID = ?\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->bind_param(\"i\",$SkID);\n\t$stmt->execute();\n\t$stmt->store_result();\n\t$num_rows = $stmt->num_rows;\n\t$stmt->close();\n\treturn $num_rows > 0;\n}",
"private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }",
"function isDataExists($tableName, $id, $key) {\n $ci = & get_instance();\n $ci->load->database();\n if ($tableName && $id && $key) {\n $query = $ci->db->get_where($tableName, array($key => $id));\n return ($query->num_rows()) ? true : false;\n }\n return false;\n}",
"function isDishExist($dish,$x){\n\n \t$catId \t\t= $this->input->post('category_id');\n \t$productId \t= $this->input->post('product_id');\n\n\t\t$data \t= $this->Dishes_model->getDuplicateDish($dish,$catId,$productId);\n\n\t\tif(sizeof($data)>0){\n\t\t\t$this->form_validation->set_message('isDishExist', 'This Dish is already exist');\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}",
"public function validateSchoolNameExistenceMapToId($schoolName,$id){\n $handle = $this->con->prepare(\"SELECT * FROM school WHERE schoolName = ? AND id != ?\");\n $handle->execute([$schoolName,$id]); \n \n if($handle->rowCount()>0){\n return SCHOOL_NAME_AREADY_EXIST;\n }else{\n return SCHOOL_NAME_DOES_NOT_EXIT;\n }\n }",
"public function checkExistence($intaskid)\n\t{\n\t\t$retval; \n\t\t\n\t\t$dbhandle = db_connect();\n\t\t$stmt = $dbhandle->stmt_init();\n\t\t\n\t\t$stmt->prepare(\"SELECT TaskID FROM Tasks WHERE TaskID=?\");\n\t\t$stmt->bind_param(\"i\", $intaskid);\n\t\t$stmt->execute();\n\t\t\n\t\t$stmt->store_result();\n\t\t\n\t\tif ($stmt->num_rows == 0)\n\t\t\t$retval = false;\n\t\telse\n\t\t\t$retval = true;\n\t\t\n\t\t$stmt->close();\n\t\t$dbhandle->close();\n\t\t\n\t\treturn $retval;\n\t}",
"public function checkIDexists($car_id){\n $this->db->query('SELECT `id` FROM ' . CARS_TABLE . ' WHERE `id` = ' .$car_id);\n $this->db->getSingle();\n\n if( $this->db->rowCount() >= 1){\n return true;\n }else{\n return false;\n }\n }",
"function is_rowid_exist($rowid,$db_table='') {\r\n $db_table = $db_table == '' ? $this->db_table : $GLOBALS['dbpre'].$db_table;\r\n $sql = 'select 1 from '.$db_table.' where rowid='.intval($rowid);\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n return mysql_num_rows($res);\r\n }",
"function exists($id);",
"function isPrimaryKey(): bool;",
"public function isPrimaryKeyNull()\n {\n return (null === $this->getShnttype()) && (null === $this->getShntseq()) && (null === $this->getShntkey2()) && (null === $this->getShntform());\n }",
"function exists() {\n\t return !empty($this->id);\n\t}",
"function check_pk($key_id)\n\t{\n\t\t$pubkey = false;\n\t\t$subkey = false;\n\n\t\tif (false == $list = $this->get_list($key_id))\n\t\t{\n\t\t\t// no key found\n\t\t\treturn 3;\n\t\t}\n\t\telse foreach ($list as $row)\n\t\t{\n\t\t\t// check for base key usability\n\t\t\tif ($row[0] == 'pub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$pubkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check for subkey presence and usability\n\t\t\telse if ($row[0] == 'sub')\n\t\t\t{\n\t\t\t\tif ( ($row[1] != 'r' && $row[1] != 'e') &&\t\t\t\t\t// check for revocation/expiry status\n\t\t\t\t(str_contains($row[11], 'e')) &&\t\t\t\t\t\t// check that subkey is intended for encryption\n\t\t\t\t($row[5] < time() && ($row[6] == '' || $row[6] > time())) )\t// check creation and expiration dates\n\t\t\t\t{\n\t\t\t\t\t$subkey = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// return codes\n\t\tif ($pubkey === false) return 2;\t// public key is unusable\n\t\tif ($subkey === false) return 1;\t// key is not suitable for encryption\n\t\t// key is okay\n\t\treturn 0;\n\t}",
"private function _exists($wherePk=''){\n\t\tif($this->_forceExists===false){\n\t\t\tif($this->_schema){\n\t\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t\t} else {\n\t\t\t\t$table = $this->_source;\n\t\t\t}\n\t\t\tif($wherePk===''){\n\t\t\t\t$wherePk = array();\n\t\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\t\tif(count($primaryKeys)>0){\n\t\t\t\t\tforeach($primaryKeys as $key){\n\t\t\t\t\t\tif($this->$key!==null&&$this->$key!==''){\n\t\t\t\t\t\t\t$wherePk[] = ' '.$key.' = \\''.$this->$key.'\\'';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(count($wherePk)){\n\t\t\t\t\t\t$this->_wherePk = join(' AND ', $wherePk);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE '.$this->_wherePk;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(is_numeric($wherePk)){\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE id = \\''.$wherePk.'\\'';\n\t\t\t\t} else {\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE '.$wherePk;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$num = $this->_db->fetchOne($query);\n\t\t\treturn (bool) $num['rowcount'];\n\t\t} else {\n\t\t\t$wherePk = array();\n\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\tif(count($primaryKeys)>0){\n\t\t\t\tforeach($primaryKeys as $key){\n\t\t\t\t\tif($this->$key!==null&&$this->$key!==''){\n\t\t\t\t\t\t$wherePk[] = ' '.$key.' = \\''.$this->$key.'\\'';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count($wherePk)){\n\t\t\t\t\t$this->_wherePk = join(' AND ', $wherePk);\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}",
"private function isIdExist($id) {\n\t\tif(!$id){\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$stmt = $this->dbh->prepare(\"SELECT * FROM candidates WHERE id=:id \");\n\t\t$stmt->setFetchMode(PDO::FETCH_ASSOC);\n\t\t$stmt->execute(array(\":id\"=>$id));\n\t\t$row = $stmt->fetch();\n\t\n\t\treturn !empty($row);\n\t}",
"public function exists($id);",
"public function exists($id);",
"public function returnExists($id);",
"function is_exists($id) {\n $query = \"SELECT\n id\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n return ($stmt->rowCount() > 0);\n }",
"private function checkPrimaryKey($load) {\n\t\t$TableConfig = $this->config_crud;\n\t\tif ($TableConfig):\n\t\t\tforeach ($TableConfig->fields as $name=>$field):\n\t\t\t\tif (@$field->key== \"PRI\"):\n\t\t\t\t\tif (!($this->input->get($name))):\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse:\n\t\t\t\t\t\t$this->data[\"x_\".$name] = $this->input->get($name);\n\t\t\t\t\t\t$this->primaryKey[$name] = $this->input->get($name);\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\tendif;\n\t\t\n\t\treturn true;\n\t}",
"public function hasEntry($idEntry);",
"public function exist( $data, $id ) {\n\t\t$query = $this->db->select( '*' )\n\t\t ->from( $this->_table )\n\t\t ->where( $this->name, $data )\n\t\t ->where_not_in( $this->primary_key, $id )\n\t\t ->get();\n\t\t$num = $query->num_rows();\n\t\tif ( $num == 0 ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function checkExists($input_data, $sql) {\n $stmt = $this->connection->prepare($sql);\n if(!$stmt) {\n $this->error(0);\n }\n\n foreach($input_data as $key => $data) {\n $stmt->bindParam(':' . $key, $data['data']);\n }\n\n try{\n $stmt->execute();\n } catch(PDOException $e) {\n $this->error(1, $e->getMessage());\n }\n\n if($stmt->rowCount() > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function isPk($pk) {\n\t\treturn filter_var($pk, FILTER_VALIDATE_INT) !== false;\n }",
"function _existsInDatabase($id)\n {\n $conn = getConn();\n $sql = \"SELECT RubriekID FROM Rubriek WHERE RubriekID = ?\";\n $stmt = sqlsrv_prepare($conn, $sql, array($id));\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n $row = sqlsrv_has_rows( $stmt );\n if ($row === true){\n return true;\n }\n }\n return false;\n }",
"public static function exists(int $id): bool;"
]
| [
"0.6575605",
"0.64779884",
"0.63994676",
"0.6291113",
"0.62721914",
"0.6246964",
"0.6206025",
"0.61375153",
"0.60984004",
"0.6077715",
"0.60469276",
"0.5994472",
"0.5990669",
"0.5954009",
"0.59210426",
"0.59045076",
"0.5898235",
"0.5895467",
"0.58408785",
"0.5837751",
"0.5837751",
"0.5820213",
"0.58186203",
"0.5799429",
"0.57862353",
"0.5765463",
"0.5744586",
"0.5721144",
"0.57160157",
"0.5710634"
]
| 0.65306145 | 1 |
Show the form for creating a new Medication. | public function create()
{
$med_categories = MedCategory::with('children')->whereNull('parent_id')->get();
$med_names = MedName::get();
$packs = MedPack::get();
$templateMeds = TemplateMed::get();
return view('medication.create')
->withMedCategories($med_categories)
->withMedNames($med_names)
->withMedPacks($packs)
->withTemplateMeds($templateMeds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return view('backend.admin.medicine.create');\n }",
"public function create()\n {\n return view('Medicines.create');\n }",
"public function create()\n {\n $mobil = new Mobil();\n return view('mobil.form', compact('mobil'));\n }",
"public function create()\n {\n return view('medicalRequest.create');\n }",
"public function create()\n {\n return view('medics.create');\n }",
"public function create()\n {\n return view('medicamentos.create');\n }",
"public function create()\n {\n return view('materiales.materialForm');\n }",
"public function create()\n {\n return view('medicamento.create');\n\n }",
"public function create()\n {\n return view('medico.create');\n }",
"public function create()\n {\n return view('mediasocial.create');\n }",
"public function create()\n {\n $mobils = Mobil::all();\n return view('merk.create',compact('mobils'));\n }",
"public function create()\n {\n $medicamentos = $this->medicamentos->listar();\n $header = \"Registar Entrada de Medicamento\";\n return view('entrada.nova', compact('header', 'medicamentos'));\n }",
"public function create()\n\t{\n\t\treturn View::make('medis.create');\n\t}",
"public function create()\n {\n return view('musics.create');\n }",
"public function create()\n {\n return view('admin.medicalfacility.create');\n }",
"public function create()\n {\n return view('share.form');\n }",
"public function create()\n {\n //\n return view('Admin.Meals.add');\n }",
"public function create(Medicine $medicine)\n {//\n\n $user = Auth::user();\n return view('backend.medicines.create',compact('user','medicine'));\n }",
"public function create()\n {\n return view('medicos/cadastrar');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create()\n {\n $mobil = Mobil::all();\n return view('detail.create',compact('mobil'));\n }",
"public function create()\n {\n return view('organization.material.material.create');\n }",
"public function create()\n {\n\n return view('material.create');\n\n //\n }",
"public function create()\n {\n return view('adminpages.mealsAdd');\n }",
"public function create()\n {\n return view('admin.addfilm');\n }",
"public function create()\n {\n return view('panel.materiales.new');\n }",
"public function create()\n {\n return view('admin.pages.forms.pengirim');\n }",
"public function create()\n {\n return view('medecin.create');\n }",
"public function create()\n {\n return view('admis.create');\n }",
"public function create()\n {\n return view('material.create');\n }"
]
| [
"0.7291153",
"0.7144382",
"0.71082056",
"0.7085397",
"0.7032347",
"0.701842",
"0.6983736",
"0.69143116",
"0.68464106",
"0.6737258",
"0.670481",
"0.6640224",
"0.6628402",
"0.6621706",
"0.65985733",
"0.6594298",
"0.65936834",
"0.6550819",
"0.65471536",
"0.65314263",
"0.6517359",
"0.650323",
"0.64992183",
"0.6480819",
"0.6479",
"0.6471606",
"0.6463683",
"0.64569795",
"0.64542514",
"0.64538455"
]
| 0.7407342 | 0 |
Distributor Address for presentation | public function printDistributorAddress()
{
$str = '<address class="vcard">';
$str .= '<p>';
$str .= '<strong class="org">' . $this->name . '</strong>';
if ( ! empty($this->address)) {
$str .= '<br><span class="adr">';
$str .= '<span class="street-address">' . $this->address . '</span>';
if ( ! empty($this->city)) {
$str .= '<br><span class="locality">' . $this->city . '</span>';
}
if ( ! empty($this->region)) {
$str .= ', <span class="region">' . $this->region . '</span>';
}
if ( ! empty($this->postCode)) {
$str .= ' <span class="postal-code">' . $this->postCode . '</span>';
}
if ( ! empty($this->country)) {
$str .= ', <span class="country-name">' . $this->country . '</span>';
}
$str .= '</span>';
}
if ( ! empty($this->website)) {
$str .= '<br><a href="' . $this->website . '" class="url">' . $this->website . '</a>';
}
if ( ! empty($this->contact)) {
$str .= '<br>Contact: <span class="fn">' . $this->contact . '</span>';
}
if ( ! empty($this->email)) {
$str .= '<br>Email: <a href="mailto:' . $this->email . '" class="email">' . $this->email . '</a>';
}
if ( ! empty($this->phone)) {
$str .= '<br>Phone: <span class="tel">' . $this->phone . '</span>';
}
$str .= '</p>';
$str .= '</address>';
return $str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function address() { return ($this->address); }",
"public function address(): string\n {\n return $this->address;\n }",
"function viewAddress(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewAddress();\r\n }",
"public function renderAddress()\n {\n echo $this->getAddressStringSingleLine();\n }",
"public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }",
"public function toString()\n\t{\n\t\treturn \"Customer on checkout page - Shipping address popup - created address is shown on [Shipping address] and [Billing address] section\";\n\t}",
"public function toString() : string\n {\n return $this->address;\n }",
"public function getOrganizationAddress1() :string {\n\t\treturn($this->organizationAddress1);\n\t}",
"public function getDistributorCode()\n {\n return $this->distributorCode;\n }",
"public function getAddress(): string\n {\n return $this->address;\n }",
"public function __toString()\r\n {\r\n return $this['address'];\r\n }",
"function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }",
"public function getAddress() {}",
"public function property_address() {\n\n\t\t\t$out = '<h6>Business Name:</strong></h6>';\n\t\t\t$out .= '<p>' . get_field( 'practice_name' ) . '</p>';\n\t\t\t$out .= '<h6>Address:</h6>';\n\t\t\t$out .= '<p>' . get_field( 'address_street' ) . '<br/>';\n\t\t\t$out .= get_field( 'address_city' ) . ', ' . get_field( 'address_state' ) . ' ' . get_field( 'address_postcode' ) . '</p>';\n\n\t\t\treturn $out;\n\t\t}",
"public function key() {\n\t\treturn \"Address\";\n\t}",
"public function getFullAddressAttribute(){\n\n \treturn \"{$this->street} {$this->number}. {$this->dept}{$this->floor} - ({$this->postal_code}). {$this->city} - {$this->country}\";\n }",
"public function getAddress(){\n\t\treturn $this->sourceAddress;\n\t}",
"public function getAddress();",
"public function getAddress();",
"private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}",
"public function getAddress() {\n if($this->isCash) {\n return $this->getPdfUrl(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n } else {\n return $this->getBankPage(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n }\n }",
"function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}",
"public function getAddress(){\r\n\t\treturn $this->address;\r\n\t}",
"public function getAddress()\n {\n \treturn $this->address;\n }",
"public function getAddress()\n {\n return $this->address;\n }",
"function stringify() {\n return $this->Name.' '.$this->Addressln1;\n }",
"public function getAddress()\r\n {\r\n return $this->address;\r\n }",
"public function getAdress()\n {\n return $this->adress;\n }",
"public function getAdress()\n {\n return $this->adress;\n }",
"public function getAddress1()\n {\n return $this->getValue('nb_icontact_prospect_address_1');\n }"
]
| [
"0.64839643",
"0.6309607",
"0.62910753",
"0.62617326",
"0.6122346",
"0.6106823",
"0.60907793",
"0.6065269",
"0.60634726",
"0.60541743",
"0.60255396",
"0.59778386",
"0.59553933",
"0.59094447",
"0.59061325",
"0.58745325",
"0.58720684",
"0.5855768",
"0.5855768",
"0.584866",
"0.5833721",
"0.58151305",
"0.5799154",
"0.5793558",
"0.57734495",
"0.57579434",
"0.5755581",
"0.57245064",
"0.57245064",
"0.5724027"
]
| 0.80096704 | 0 |
$sql = "SELECT m.id AS mid, m.display_label AS m_name, f.id AS fid, f.code, f.menu_name AS f_name, r.id AS rid, r.right_name AS r_name FROM | public function getAllRight(){
// admin_module m LEFT JOIN admin_menu f ON f.module_id = m.id
// LEFT JOIN admin_right r ON r.menu_id = f.id";
$sql = "SELECT
m.id AS mid,
m.display_label AS m_name,
f.id AS fid,
f. CODE,
f.menu_name AS f_name,
r.id AS rid,
r.right_name AS r_name
FROM
admin_module m,
admin_menu f ,
admin_right r
WHERE f.module_id = m.id
AND r.menu_id = f.id";
//$connection = Yii::$app->db;
$connection = $this->getDb();
$command=$connection->createCommand($sql);
$rows=$command->queryAll();
// $rows=$dataReader->readAll();
return $rows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select_modification_data($mid)\n\t{\n\t\tglobal $db;\n\t\n\t\t$sql = \"SELECT mods.*, g.made_year, g.id, images.*, user.username, user.user_avatar_type, user.user_allowavatar, user.user_avatar, images.attach_ext, images.attach_id, images.attach_file, cats.title as category_title, makes.make, models.model, bus.title as business_name, ins.title as install_business_name, ins.id as install_business_id, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \t\t\tFROM ( \" . GARAGE_MODS_TABLE . \" AS mods, \" . GARAGE_TABLE . \" AS g )\n\t\t\t\tLEFT JOIN \" . USERS_TABLE .\" AS user ON g.member_id = user.user_id\n\t\t\t\tLEFT JOIN \" . GARAGE_CATEGORIES_TABLE . \" AS cats ON cats.id = mods.category_id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = mods.image_id \n \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \tLEFT JOIN \" . GARAGE_BUSINESS_TABLE . \" AS bus ON mods.business_id = bus.id\n \tLEFT JOIN \" . GARAGE_BUSINESS_TABLE . \" AS ins ON mods.install_business_id = ins.id\n \t\tWHERE mods.id = $mid AND g.id = mods.garage_id\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Modification Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}",
"function enquery_view_sql()\n\t{\n\t\t$view_enquery=mysqli_query($this->con,\"SELECT enquery.*,categories.c_name FROM enquery,categories where enquery.c_id=categories.c_id order by enquery.id desc\");\n\t\treturn $view_enquery;\n\t}",
"function select_quartermile_data($qmid)\n\t{\n\t\tglobal $db;\n\t\n\t \t$sql = \"SELECT qm.*, rr.id, rr.bhp, rr.bhp_unit, images.*, g.made_year, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \tFROM \" . GARAGE_QUARTERMILE_TABLE . \" AS qm\n\t\t \tLEFT JOIN \" . GARAGE_TABLE . \" AS g ON qm.garage_id = g.id\n\t\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = qm.image_id \n\t \t\tLEFT JOIN \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr ON rr.id = qm.rr_id \n \tWHERE qm.id = $qmid\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Quartermile Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}",
"protected function getDetailedSelect() { \n return \"SELECT PostID, Posts.UserID, MainPostImage, Posts.Title, Message, PostTime, ImageDetails.ImageID, Path, FirstName, LastName\n FROM Posts\";\n }",
"function gallery_view_sql()\n\t{\n\t\t$view_gallery=mysqli_query($this->con,\"SELECT * FROM gallery where status=1 order by id desc\");\n\t\treturn $view_gallery;\n\t}",
"function gallery_view_sql()\n\t{\n\t\t$view_gallery=mysqli_query($this->con,\"SELECT * FROM gallery order by id desc\");\n\t\treturn $view_gallery;\n\t}",
"function getRSO($rso_id, $db){\n\n\t$temp = $db->query(\"SELECT rso.name AS name, rso.description as description, rso_type.type as type, rso.joinable as joinable\n\t\tFROM rso, rso_type\n\t\tWHERE (rso.rid) = '\" . $rso_id . \"' \n\t\t\t&& (rso_type.rtid) = (rso.rtid)\");\n\t//echo '<pre>', var_dump($temp), '</pre>';\n\t$rso = $temp->fetch_assoc();\n\treturn $rso;\n}",
"function select_idxmenu(){\n $query = $this->db->query(\"\n select title, file_path\n from sys_menu \n where is_parent = 0 order by id\n \");\n return $query;\n }",
"function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}",
"function FeaturesDetails() \n {\n \n $FeaturesDetails= \"SELECT f.*,fd.*,st.*,fs.name as fname,pi.pi_title as ptitle,tp.name as tname\n FROM features AS f\n LEFT JOIN feature_statuses AS fs ON fs.id = f.f_status_id\n LEFT JOIN productincrements AS pi ON pi.pi_id = f.f_PI\n LEFT JOIN topics AS tp ON tp.id = f.f_topic_id\n LEFT JOIN feature_details AS fd ON fd.f_id = f.f_id\n LEFT JOIN staff AS st ON st.staff_id = fd.f_SME\"; \n $FeaturesDetailsresult = $this->ds->select($FeaturesDetails);\n //print '<pre>';print_r($FeaturesDetailsresult);\n return $FeaturesDetailsresult;\n }",
"function get_item_details_for_mgoref($mgo_file_ref) {\n $query = \"\n SELECT\n\t\t\t\ttbl_items_list.item_id,\n\t\t\t\ttbl_items_list.item_name,\n\t\t\t\ttbl_items_list.item_code\n\t\t\tFROM\n\t\t\t\ttbl_items_list\n\t\t\t\tINNER JOIN tbl_tender_basic_details ON tbl_items_list.item_id = tbl_tender_basic_details.item_id\n\t\t\t\tINNER JOIN tbl_tec_appointed_details ON tbl_tec_appointed_details.tec_mgo_ref = tbl_tender_basic_details.mgo_file_ref\n\t\t\tWHERE\n\t\t\t\ttbl_tender_basic_details.mgo_file_ref ='$mgo_file_ref'\n \";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n\t}",
"function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }",
"public function getQuerySelect() {\n $R = 'R_'. $this->id;\n return \"$R.value_id AS `\". $this->name.\"`\";\n }",
"function show_all()\n\t{\n\t\t$orderBy=\"\";\n\t\t$sql = \"SELECT * \n\t\tFROM umgroup INNER JOIN umsystem \n\t\tON umgroup.GpStID = umsystem.StID\n\t\t$orderBy\";\n\t\t$query = $this->ums->query($sql);\n\t\treturn $query;\n\t}",
"function rel_medico_ag ($cod_med){\r\n\t\t$db = banco();\r\n\t\tif($cod_med == '*')\r\n\t\t$query = \"SELECT DISTINCT user.cod, user.name, especialidade.cod_espec, especialidade.nom_espec, medico_agenda.data_disponivel, medico_agenda.vagas\r\n\t\t\t\t FROM user, medico, medico_agenda, medico_especialidade, especialidade\r\n\t\t\t\t WHERE user.cod = medico.cod_medic AND\r\n\t\t\t\t \t \tmedico.cod_medic = medico_especialidade.cod_medic AND\r\n\t\t\t\t \t \tmedico_agenda.cd_med = medico_especialidade.cod_medic AND\r\n\t\t\t\t \t \tmedico_agenda.cd_esp = medico_especialidade.cod_espec AND\r\n\t\t\t\t \t \tespecialidade.cod_espec = medico_especialidade.cod_espec\r\n\t\t\t\t \";\r\n\t\telse{\r\n\t\t\t$query = \"SELECT DISTINCT user.cod, user.name, especialidade.cod_espec, especialidade.nom_espec, medico_agenda.data_disponivel, medico_agenda.vagas\r\n\t\t\t\t FROM user, medico, medico_agenda, medico_especialidade, especialidade\r\n\t\t\t\t WHERE user.cod = medico.cod_medic AND\r\n\t\t\t\t \t \tmedico.cod_medic = medico_especialidade.cod_medic AND\r\n\t\t\t\t \t \tmedico_agenda.cd_med = medico_especialidade.cod_medic AND\r\n\t\t\t\t \t \tmedico_agenda.cd_esp = medico_especialidade.cod_espec AND\r\n\t\t\t\t \t \tespecialidade.cod_espec = medico_especialidade.cod_espec AND\r\n\t\t\t\t \t \tuser.cod = $cod_med\r\n\t\t\t\t \";\r\n\t\r\n\t\t}\r\n\t\t\r\n\t\t$row = $db->query($query);\t\t\r\n\t\t$db->close();\r\n\t\t\r\n\t\treturn $row;\t\t\r\n\t}",
"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 }",
"function listQueryHitLembur($r_periode) {\n $sql = \"select g.*,p.nip,\" . static::schema . \".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as namapegawai,\n\t\t\t\t\tu.namaunit,pd.namapendidikan,t.tipepeg||' - '||j.jenispegawai as namajenispegawai \n\t\t\t\t\tfrom \" . static::table('ga_upahlembur') . \" g\n\t\t\t\t\tleft join \" . static::table('ga_historydatagaji') . \" h on h.idpeg = g.idpegawai and h.gajiperiode = g.periodegaji\n\t\t\t\t\tleft join \" . static::table('ms_pegawai') . \" p on p.idpegawai = h.idpeg\n\t\t\t\t\tleft join \" . static::table('ms_tipepeg') . \" t on t.idtipepeg = h.idtipepeg\n\t\t\t\t\tleft join \" . static::table('ms_jenispeg') . \" j on j.idjenispegawai = h.idjenispegawai\n\t\t\t\t\tleft join \" . static::table('ms_unit') . \" u on u.idunit = h.idunit\n\t\t\t\t\tleft join \" . static::table('lv_jenjangpendidikan') . \" pd on pd.idpendidikan = h.pendidikan\";\n\n return $sql;\n }",
"function select_query( $tablepre = \"euconnect_\" ) {\n\t$select_sql = \" \" ;\n\t$sort_sql = \" ORDER BY fullname ASC\" ;\n\t$sql = \"SELECT euid , RTRIM( CONCAT( lastname,\\\", \\\", firstname) ) AS fullname , username FROM \" . $tablepre . \"members WHERE active = 1 \" ;\n\treturn $sql . $select_sql . $sort_sql ;\n}",
"public function select_umenu(){\n// ORDER BY pathid ASC\";\n $sql = \"SELECT info FROM \".$this ->db ->dbprefix('wx_umenu');\n $data = $this ->db ->query($sql)->result_array();\n return $data[0]['info'];\n }",
"function select_rollingroad_data($rrid)\n\t{\n\t\tglobal $db;\n\n\t \t$sql = \"SELECT rr.*, images.* , g.made_year, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \tFROM \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr\n\t\t \tLEFT JOIN \" . GARAGE_TABLE . \" AS g ON rr.garage_id = g.id\n\t\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = rr.image_id \n \tWHERE rr.id = $rrid\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Quartermile Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}",
"public function get_menu($r_id){\n $dbs = new DatabaseControls();\n $qry = \"select * from \".$this->table_name.\" where r_id = \".$r_id.\" order by item_id\";\n $result = $dbs->run_multi_data_select_qry($qry);\n return $result;\n }",
"public function query(){\n // $this->db->select('idk,id_kain,nm_kain')\n $this->db->select('*')\n ->from($this->table);\n }",
"function fill_modules_table($db){\n $query=\"SELECT m.*, u.usi from Modulo m join usi_moduli u on m.nome=u.modulo;\";\n $result = mysqli_query($db,$query);\n while($row=mysqli_fetch_assoc($result)){\n ?>\n <tr>\n <td><b class=\"text-primary\"><?php echo $row['nome']; ?></b></td>\n <td><?php echo $row['funzionalita']; ?></td>\n <td><?php echo $row['costo']; ?></td>\n <td><?php echo $row['usi'];?> </td>\n </tr>\n<?php\n }\n}",
"public function selectvillagemaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM villagemaster LEFT JOIN mandalmaster ON villagemaster.mandalid=mandalmaster.mandalid\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function get_family_data($will_id){\n $query = $this->db->select('*')\n ->from('tbl_family_info')\n ->where('will_id',$will_id)\n ->order_by(\"FIELD(relationship,'Spouse','Son','Daughter')\",'',FALSE)\n ->get();\n $result = $query->result();\n return $result;\n }",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"function SelectMedicoReferente($db_conx, $query = NULL) {\r\n\r\n if ($query == NULL) {\r\n $sql = \"SELECT * FROM tmedicoreferente LIMIT 20\";\r\n $query = mysqli_query($db_conx, $sql);\r\n }\r\n $n_columnas = $query->field_count;\r\n $n_filas = $query->num_rows;\r\n $data = '<tr class=\"row_header\">\r\n <td>COD</td> \r\n <td>Nombre</td>\r\n <td>CodMed</td> \r\n <td>Especialidad</td>\r\n <td>Unidad(es)</td>\r\n <td>Estado</td>\r\n <td>Observacion</td>\r\n <td id=\"custom-action\"></td>\r\n </tr>';\r\n $c = 0;\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<tr class=\"row_data\">';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_0\">' . $row[0] . '</span></td>';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_7\">' . $row[7] . '</span> ';\r\n $data .= '<span id=\"td_' . $row[0] . '_8\">' . $row[8] . '</span> ';\r\n $data .= '<span id=\"td_' . $row[0] . '_5\">' . $row[5] . '</span> ';\r\n $data .= '<span id=\"td_' . $row[0] . '_6\">' . $row[6] . '</span></td>';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_1\">' . $row[1] . '</span></td>';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_2\">' . $row[2] . '</span></td>';\r\n\r\n $cod = \"\";\r\n $uni = \"\";\r\n $unimedarray = SelectValuesUnidadMedicoArray($db_conx, $row[0]);\r\n for ($i = 0; $i < count($unimedarray); $i++) {\r\n $tem = explode(\"*\", $unimedarray[$i]);\r\n $cod .= $tem[0];\r\n $uni .= $tem[1];\r\n if ($i + 1 != count($unimedarray)) {\r\n $cod .= \",\";\r\n $uni .= \",<br>\";\r\n }\r\n }\r\n $data .= '<td><span style=\"display:none;\" id=\"uni_' . $row[0] . '\">' . $cod . '</span>\r\n <span >' . $uni . '</span>\r\n </td>';\r\n\r\n $data .= '<td><span id=\"td_' . $row[0] . '_4\">' . $row[4] . '</span></td>';\r\n $data .= '<td><span id=\"td_' . $row[0] . '_3\">' . $row[3] . '</span></td>';\r\n\r\n $data .= '<td id=\"custom-action\"><button id=\"editar\" onclick=\"editMedicoReferente(' . $row[0] . ')\">Editar</button></td></tr>';\r\n }\r\n echo $data;\r\n}",
"static public function mdlMostrarUnidadMedidaxInventario(){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\n\t\t\tSELECT X.* FROM \n\t\t\t(\n\t\t\tSELECT inventario.id , 0 as unidad_medida , UPPER(inventario.nombre) as nombre FROM inventario \n\t\t\tUNION ALL \n\t\t\tSELECT inventario_x_unidad_medida_salida.id_inventario ,inventario_x_unidad_medida_salida.id, CONCAT( UPPER(inventario.nombre ), '-' , LOWER(inventario_x_unidad_medida_salida.unidad_medida_salida ) ) FROM inventario \n\t\t\tINNER JOIN inventario_x_unidad_medida_salida WHERE inventario.id = inventario_x_unidad_medida_salida.id_inventario ) AS X\n\t\t\tORDER BY 1 DESC ,2 \n\n\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n \n\t\t$stmt-> close();\n\n\t\t$stmt = null;\n\n\t}",
"function getMenu(){\n\t\t$sql = \"SELECT tl.TenTL, tl.TenKhongDauTL, GROUP_CONCAT(gd.MaGD,':', gd.TenGD,':', gd.TenKhongDauGD) AS GiaiDoan FROM theloai tl INNER JOIN giaidoan gd ON tl.MaTL = gd.MaTL GROUP BY tl.MaTL\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows();\n\t}",
"static function list($q=\"\",$f=\"\"){\n \t$query = \"select \n\t\t\t\t\tcloto_id.id,\n\t\t\t\t\tcloto_id.tipo,\n\t\t\t\t\tcloto_type.nome AS tipo_nome,\n\t\t\t\t\t\n\t\t\t\t\tif(cloto_id.tipo = '1',cloto_label.value,\n\t\t\t\t\t\tif(cloto_id.tipo = '2',cloto_number.value,\n\t\t\t\t\t\t\tif(cloto_id.tipo = '3',cloto_text.value,'[object]')\n\t\t\t\t\t\t)\n\t\t\t\t\t) as value\n\t\t\t\tfrom cloto_id\n\t\t\t\t\n\t\t\t\tleft join cloto_label on cloto_id.id = cloto_label.id\n\t\t\t\tleft join cloto_number on cloto_id.id = cloto_number.id\n\t\t\t\tleft join cloto_text on cloto_id.id = cloto_text.id\n\t\t\t\tleft join cloto_object on cloto_id.id = cloto_object.id\n\t\t\t\t\n\t\t\t\tINNER JOIN cloto_type ON cloto_id.tipo = cloto_type.id\n\t\t\t;\";\n \t$retorno = dbQuery($query);\n\n \treturn $retorno;\n\n }"
]
| [
"0.60787094",
"0.5895437",
"0.58847654",
"0.57737136",
"0.5765146",
"0.5760141",
"0.57255864",
"0.5681123",
"0.5676963",
"0.5662733",
"0.5618395",
"0.55416584",
"0.55343884",
"0.55205977",
"0.5516878",
"0.55072755",
"0.55049944",
"0.5474555",
"0.54688287",
"0.54658234",
"0.54528916",
"0.54391134",
"0.5433934",
"0.54175127",
"0.5408913",
"0.5405453",
"0.53794175",
"0.53712183",
"0.5363162",
"0.53562176"
]
| 0.5903446 | 1 |
Returns the Query Builder to select all nodes ordered as tree. | public function getNodeTreeQueryBuilder()
{
$qb = $this->repository
->createQueryBuilder('c')
->select('c, p')
->leftJoin('c.parent', 'p')
->orderBy('c.lft');
return $qb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodesQueryBuilder($parentId=null)\n {\n // Get class metadata\n $metadata = $this->getClassMetadata();\n\n // Create the query builder\n $queryBuilder = $this->_em->createQueryBuilder();\n\n $queryBuilder\n ->select('node')\n ->from($metadata->name, 'node');\n\n // Get the name of the parent field\n $parentColumn = $metadata->closureTree['parent']['fieldName'];\n\n if (!$parentId) {\n $queryBuilder->where('node.'. $parentColumn .' IS NULL');\n } else {\n $queryBuilder->where('node.'. $parentColumn .' = :parentId')->setParameter('parentId', $parentId);\n }\n\n return $queryBuilder;\n }",
"public function getNodes():ActiveQuery\n {\n return $this\n ->hasMany(Node::class, ['id' => 'nodeId'])\n ->viaTable(NodeBloc::tableName(), ['blocId' => 'id']);\n }",
"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 }",
"protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_ancestry', 'oga');\n // only load JUST the type of nodes we need\n $query->join('node', 'n', 'oga.nid = n.nid AND n.type = :type', array(':type' => $this->sourceType));\n $query->condition('group_nid', 0, '>') // handle 0 values\n ->fields('oga', array('nid', 'group_nid'));\n return $query;\n }",
"private function GetAllNodes(){\n $tree = array();\n try {\n $db = new SQLite3('mysqlitedb.db', SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);\n $result = $db->query('SELECT * FROM tree WHERE DELETE_AT IS NULL AND PARENT_ID=0');\n if (!is_bool($result)) {\n while ($row = $result->fetchArray()) {\n $nodes = $this->GetNodesByParentId($db, $row[\"ID\"]);\n $tree[] = array(\"ID\" => $row[\"ID\"], \"NAME\" => $row[\"NAME\"], \"NODES\" => $nodes);\n }\n }\n $db->close();\n } catch (Exception $ex) {\n echo \"Exception in Tree->GetAllNodes: \" . $ex->getMessage() . \"<br/>\";\n $db->close();\n }\n return $tree;\n }",
"static public function getCategoryTree() {\n $rows = self::find()\n ->where(['!=', 'id', 1]) // exclude root category\n ->andWhere(['=', 'status', self::STATUS_SHOW]) // exclude hidden\n ->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC])\n ->all();\n \n // build tree\n $result = [];\n $last_parent_id = null;\n foreach($rows as $row) {\n if($row['depth'] == 1) { // parent\n $last_parent_id = $row['id'];\n $result[$last_parent_id] = [\n 'parent' => $row,\n 'childs' => []\n ];\n\n continue;\n }\n\n // childs\n $result[$last_parent_id]['childs'][$row->id] = $row;\n }\n return $result;\n }",
"public function scopeDepthFirst(Builder $query): Builder\n {\n $sql = $query->getExpressionGrammar()->compileOrderByPath();\n\n return $query->orderByRaw($sql);\n }",
"public function roots() {\n $db = $this->getDbConnection();\n $this->getDbCriteria()->addCondition($db->quoteColumnName($this->getTableAlias()) . '.' . $db->quoteColumnName($this->leftAttribute) . '=1');\n\n return $this;\n }",
"public function renderTree()\n {\n $structure = $this->_module->treeStructure + $this->_module->dataStructure;\n extract($structure);\n $nodeDepth = $currDepth = $counter = 0;\n $jsSelect = '$('.$this->id.').treeview(\"collapseAll\");';\n $out = Html::beginTag('ul', ['class' => 'kv-tree']) . \"\\n\";\n foreach ($this->_nodes as $node) {\n /**\n * @var Tree $node\n */\n if (!$this->isAdmin && !$node->isVisible() || !$this->showInactive && !$node->isActive()) {\n continue;\n }\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeDepth = $node->$depthAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeLeft = $node->$leftAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeRight = $node->$rightAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeKey = $node->$keyAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeName = $node->$nameAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIcon = $node->$iconAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIconType = $node->$iconTypeAttribute;\n\n $isChild = ($nodeRight == $nodeLeft + 1);\n $indicators = '';\n\n if (isset($this->nodeLabel)) {\n $label = $this->nodeLabel;\n $nodeName = is_callable($label) ? $label($node) :\n (is_array($label) ? ArrayHelper::getValue($label, $nodeKey, $nodeName) : $nodeName);\n }\n if ($nodeDepth == $currDepth) {\n if ($counter > 0) {\n $out .= \"</li>\\n\";\n }\n } elseif ($nodeDepth > $currDepth) {\n $out .= Html::beginTag('ul') . \"\\n\";\n $currDepth = $currDepth + ($nodeDepth - $currDepth);\n } elseif ($nodeDepth < $currDepth) {\n $out .= str_repeat(\"</li>\\n</ul>\", $currDepth - $nodeDepth) . \"</li>\\n\";\n $currDepth = $currDepth - ($currDepth - $nodeDepth);\n }\n if (trim($indicators) == null) {\n $indicators = ' ';\n }\n $nodeOptions = [\n 'data-key' => $nodeKey,\n 'data-lft' => $nodeLeft,\n 'data-rgt' => $nodeRight,\n 'data-lvl' => $nodeDepth,\n 'data-readonly' => static::parseBool($node->isReadonly()),\n 'data-movable-u' => static::parseBool($node->isMovable('u')),\n 'data-movable-d' => static::parseBool($node->isMovable('d')),\n 'data-movable-l' => static::parseBool($node->isMovable('l')),\n 'data-movable-r' => static::parseBool($node->isMovable('r')),\n 'data-removable' => static::parseBool($node->isRemovable()),\n 'data-removable-all' => static::parseBool($node->isRemovableAll()),\n ];\n\n $css = [];\n if (!$isChild) {\n $css[] = 'kv-parent ';\n }\n if (!$node->isVisible() && $this->isAdmin) {\n $css[] = 'kv-invisible';\n }\n if ($this->showCheckbox && in_array($node->id, $this->selected)) {\n $css[] = 'kv-selected ';\n $jsSelect .= '$('.$this->id.').treeview(\"checkNode\", \"'.$node->id.'\");';\n }\n if ($node->isCollapsed()) {\n $css[] = 'kv-collapsed ';\n }\n if ($node->isDisabled()) {\n $css[] = 'kv-disabled ';\n }\n if (!$node->isActive()) {\n $css[] = 'kv-inactive ';\n }\n $indicators .= $this->renderToggleIconContainer(false) . \"\\n\";\n $indicators .= $this->showCheckbox ? $this->renderCheckboxIconContainer(false) . \"\\n\" : '';\n if (!empty($css)) {\n Html::addCssClass($nodeOptions, $css);\n }\n $out .= Html::beginTag('li', $nodeOptions) . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-tree-list']) . \"\\n\" .\n Html::beginTag('div', ['class' => 'kv-node-indicators']) . \"\\n\" .\n $indicators . \"\\n\" .\n '</div>' . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-node-detail']) . \"\\n\" .\n $this->renderNodeIcon($nodeIcon, $nodeIconType, $isChild) . \"\\n\" .\n Html::tag('span', $nodeName, ['class' => 'kv-node-label']) . \"\\n\" .\n '</div>' . \"\\n\" .\n '</div>' . \"\\n\";\n ++$counter;\n }\n if (isset($jsSelect)) {\n $this->view->registerJs(\n $jsSelect,\n View::POS_READY,\n 'treeviewinput-selected'\n );\n }\n $out .= str_repeat(\"</li>\\n</ul>\", $nodeDepth) . \"</li>\\n\";\n $out .= \"</ul>\\n\";\n return Html::tag('div', $this->renderRoot() . $out, $this->treeOptions);\n }",
"private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}",
"public function getNodeAscendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft <= :lft AND c.rgt >= :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"function & get_root_nodes($add_sql = array())\r\n\t{\r\n\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.id=%s.root_id %s ORDER BY %s.%s ASC',\r\n\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(),\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this->_secondary_sort);\r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn $node_set;\r\n\t}",
"function & get_all_nodes($add_sql = array())\r\n\t{\r\n\t\tif ($this->_sort_mode == NESE_SORT_LEVEL)\r\n\t\t{\r\n\t\t\t$sql = sprintf('SELECT %s %s FROM %s %s %s ORDER BY %s.level, %s.%s ASC',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append'),\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, $this->_secondary_sort);\r\n\t\t} \n\t\telseif ($this->_sort_mode == NESE_SORT_PREORDER)\r\n\t\t{\r\n\t\t\t$node_set = array();\r\n\t\t\t$rootnodes = $this->get_root_nodes(true);\r\n\t\t\tforeach($rootnodes AS $rid => $rootnode)\r\n\t\t\t{\r\n\t\t\t\t$node_set = $node_set + $this->get_branch($rid, true);\r\n\t\t\t} \r\n\t\t\treturn $node_set;\r\n\t\t} \r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn $node_set;\r\n\t}",
"protected function toQuery() {\n\t\t$query = $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder());\n\t\t$query->snapshot();\n\t\treturn $query;\n\t}",
"function BuildTree($items)\r\n\t{\r\n\t\tif (!empty($items))\r\n\t\t{\r\n\t\t\t# Columns\r\n\t\t\t# * Gather all columns required for display and relation.\r\n\t\t\t# Children\r\n\t\t\t# * Map child names to child index.\r\n\r\n\t\t\t$cols[$this->ds->table] = array($this->ds->id => 1);\r\n\t\t\tif (!empty($this->ds->DisplayColumns))\r\n\t\t\tforeach (array_keys($this->ds->DisplayColumns) as $col)\r\n\t\t\t\t$cols[$this->ds->table][$col] = $this->ds->id == $col;\r\n\r\n\t\t\tif (!empty($this->ds->children))\r\n\t\t\tforeach ($this->ds->children as $ix => $child)\r\n\t\t\t{\r\n\t\t\t\t$children[$child->ds->table] = $ix;\r\n\t\t\t\t$cols[$child->ds->table][$child->parent_key] = 1;\r\n\t\t\t\t$cols[$child->ds->table][$child->child_key] = 0;\r\n\t\t\t\tif (!empty($child->ds->DisplayColumns))\r\n\t\t\t\tforeach (array_keys($child->ds->DisplayColumns) as $col)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cols[$child->ds->table][$col] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t# Flats\r\n\t\t\t# * Convert each item into separated TreeNodes\r\n\t\t\t# * Associate all indexes by table, then id\r\n\r\n\t\t\t$flats = array();\r\n\r\n\t\t\t# Iterate all the resulting database rows.\r\n\t\t\tforeach ($items as $ix => $item)\r\n\t\t\t{\r\n\r\n\t\t\t\t# Iterate the columns that were created in step 1.\r\n\t\t\t\tforeach ($cols as $table => $columns)\r\n\t\t\t\t{\r\n\t\t\t\t\t# This will store all the associated data in the treenode\r\n\t\t\t\t\t# for the editor to reference while processing the tree.\r\n\t\t\t\t\t$data = array();\r\n\t\t\t\t\t$skip = false;\r\n\r\n\t\t\t\t\t# Now we're iterating the display columns.\r\n\t\t\t\t\tforeach ($columns as $column => $id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t# This column is not associated with a database row.\r\n\t\t\t\t\t\tif (is_numeric($column)) continue;\r\n\r\n\t\t\t\t\t\t# Table names are included to avoid ambiguity.\r\n\t\t\t\t\t\t$colname = $table.'_'.$column;\r\n\r\n\t\t\t\t\t\t# ID would be specified if this is specified as a keyed\r\n\t\t\t\t\t\t# value.\r\n\t\t\t\t\t\tif ($id)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (empty($item[$colname]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$skip = 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\t$idcol = $colname;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[$this->ds->StripTable($colname)] = $item[$this->ds->StripTable($colname)];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$skip)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$tn = new TreeNode($data);\r\n\t\t\t\t\t\t$tn->id = $item[$idcol];\r\n\t\t\t\t\t\t$flats[$table][$item[$idcol]] = $tn;\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# Tree\r\n\t\t\t# * Construct tree out of all items and children.\r\n\r\n\t\t\t$tree = new TreeNode('Root');\r\n\r\n\t\t\tforeach ($flats as $table => $items)\r\n\t\t\t{\r\n\t\t\t\tforeach ($items as $ix => $node)\r\n\t\t\t\t{\r\n\t\t\t\t\t$child_id = isset($children[$table]) ? $children[$table] : null;\r\n\r\n\t\t\t\t\tif (isset($children[$table]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$ckeycol = $this->ds->children[$child_id]->child_key;\r\n\t\t\t\t\t\t$pid = $node->data[\"{$table}_{$ckeycol}\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse $pid = 0;\r\n\r\n\t\t\t\t\t$node->data['_child'] = $child_id;\r\n\r\n\t\t\t\t\tif ($pid != 0)\r\n\t\t\t\t\t\t$flats[$this->ds->table][$pid]->children[] = $node;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$tree->children[] = $node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t# Put child table children above related children, helps to\r\n\t\t\t# understand the display.\r\n\t\t\tif (count($this->ds->children) > 0) $this->FixTree($tree);\r\n\t\t\treturn $tree;\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}",
"public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\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 }",
"public function roots()\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->left_column = 1\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n $result = $this->_db->query($sql);\n return $this->factory_set($result);\n }",
"private function _getTree()\r\n {\r\n $items = $this->setArray($this->getItems());\r\n $tree = $this->_buildTree($items);\r\n return $tree;\r\n }",
"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}",
"function reorder_nodes()\n\t{\n\t\t\n\t\t// @todo introduce some tests here to make sure data is a valid nested set etc.\n\t\t// completely reliant on clean outut from js here\n\t\t\n\t\t$tree_id = $this->EE->input->get_post('tree_id');\n\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id);\n\t\t\n\t\t$tree_settings = $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t$sent_last_updated = $this->EE->input->get_post('last_updated');\n\n\t\tif($sent_last_updated != $tree_settings['last_updated'])\n\t\t{\n\t\t\t$resp['data'] = 'last_update_mismatch';\t\n\t\t\t$this->EE->output->send_ajax_response($resp);\n\t\t}\n\n\t\t$node_id = '';\n\t\t$lft = '';\n\t\t$rgt = '';\n\n\t\t$taxonomy_order = $this->EE->input->get_post('taxonomy_order');\n\t\t$taxonomy_order = rtrim($taxonomy_order, '|');\n\n\t\tif($taxonomy_order)\n\t\t{\n\t\t\t$m = explode(\"|\", $taxonomy_order);\n\t\t\t\n\t\t\t$lq = \"LOCK TABLE exp_taxonomy_tree_\".$tree_id.\" WRITE\";\n\t\t\t$res = $this->EE->db->query($lq);\n\n\t\t\tforeach($m as $items)\n\t\t\t{\n\n\t\t\t\t$item = explode(',', $items);\n\t\t\t\t\n\t\t\t\tif(isset($item[0]) && $item[0] != '')\n\t\t\t\t{\n\t\t\t\t\t$node_id \t= str_replace(\"id:\", \"\", $item[0]);\n\t\t\t\t\t$lft\t\t= str_replace(\"lft:\", \"\", $item[1]);\n\t\t\t\t\t$rgt \t\t= str_replace(\"rgt:\", \"\", $item[2]);\n\t\t\t\t}\n\n \tif($node_id != 'root')\n \t{\n\t \t $data = array(\n\t\t 'node_id' \t=> $node_id,\n\t\t 'lft' \t\t=> $lft,\n\t\t 'rgt' \t\t=> $rgt\n\t \t);\n\t \t\n\t \t$this->EE->db->where('node_id', $node_id);\n\t\t\t\t\t$this->EE->db->update('exp_taxonomy_tree_'.$tree_id, $data);\n\t \t\n\t }\n\t \n\t if($node_id == 'root')\n \t{\n\t \t $data = array(\n\t\t 'lft' \t\t=> $lft,\n\t\t 'rgt' \t\t=> $rgt\n\t \t);\n\t \t\n\t \t$this->EE->db->where('lft', $lft);\n\t\t\t\t\t$this->EE->db->update('exp_taxonomy_tree_'.$tree_id, $data);\n\t \t\n\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$ulq = \"UNLOCK TABLES\";\n\t\t\t$res = $this->EE->db->query($ulq);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// update the last_updated timestamp\n\t\t$this->EE->ttree->set_last_update_timestamp($tree_id);\n\t\t\n\t\t// last_updated timestamp has been updated, so fetch again.\n\t\tunset($this->EE->session->cache['taxonomy']['tree'][$tree_id]['settings']);\n\t\t$tree_settings = $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t$resp['data'] = 'Node order updated';\n\t\t$resp['last_updated'] = $tree_settings['last_updated'];\n\t\t\n\t\tunset($data);\n\t\t\n\t\t// update our stashed tree array\n\t\t$this->EE->ttree->rebuild_tree_array($tree_id);\n\t\t$this->EE->output->send_ajax_response($resp);\t\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 }",
"protected function initTree()\n {\n Table9Peer::doDeleteAll();\n $ret = array();\n // shuffling the results so the db order is not the natural one\n $fixtures = array(\n 't2' => array(2, 3, 1),\n 't5' => array(7, 12, 2),\n 't4' => array(5, 6, 2),\n 't7' => array(10, 11, 3),\n 't1' => array(1, 14, 0),\n 't6' => array(8, 9, 3),\n 't3' => array(4, 13, 1),\n );\n /* in correct order, this is:\n 't1' => array(1, 14, 0),\n 't2' => array(2, 3, 1),\n 't3' => array(4, 13, 1),\n 't4' => array(5, 6, 2),\n 't5' => array(7, 12, 2),\n 't6' => array(8, 9, 3),\n 't7' => array(10, 11, 3),\n */\n foreach ($fixtures as $key => $data) {\n $t = new PublicTable9();\n $t->setTitle($key);\n $t->setLeftValue($data[0]);\n $t->setRightValue($data[1]);\n $t->setLevel($data[2]);\n $t->save();\n $ret[$key]= $t;\n }\n // reordering the results in the fixtures\n ksort($ret);\n\n return array_values($ret);\n }",
"public function getRootNodes()\n {\n return $this->getNodes($this->qbFactory\n ->getRootNodeQueryBuilder()\n ->getQuery()\n ->getResult());\n }",
"public function buildMenuTree()\n {\n $menu = new Menu\\Menu('menuTree');\n\n // Top level.\n $this->p1 = $menu->addItem(new Menu\\Item('p.1'));\n $this->p2 = $menu->addItem(new Menu\\Item('p.2'));\n\n // First level (p1).\n $this->c11 = $this->p1->addChild(new Menu\\Item('c.1.1'));\n $this->c12 = $this->p1->addChild(new Menu\\Item('c.1.2'));\n\n // First level (p2).\n $this->c21 = $this->p2->addChild(new Menu\\Item('c.2.1'));\n $this->c22 = $this->p2->addChild(new Menu\\Item('c.2.2'));\n $this->c23 = $this->p2->addChild(new Menu\\Item('c.2.3'));\n\n // Second level (c.1.1).\n $this->c111 = $this->c11->addChild(new Menu\\Item('c.1.1'));\n }",
"public function dropdown_tree() {\n $args = func_get_args();\n list($key, $value, $parent) = $args;\n\n $result = $this->db->select(array($key, $value, $parent))->get($this->_table())->result();\n\n $options = array();\n foreach ($result as $row) {\n $options[] = array(\n 'id'=>$row->{$key},\n 'name'=>$row->{$value},\n 'parent'=>$row->{$parent},\n );\n }\n return $options;\n }",
"public function getTree() {\n\n $servers = Hash::extract($this->find('all', array(\n 'fields' => array(\n 'server_id', 'name', 'short_name', 'parent_id'\n )\n )), '{n}.Server');\n\n $tree = array();\n\n foreach ($servers as $server) {\n\n $parent_id = $server['parent_id'];\n\n if (empty($parent_id)) {\n\n $server_id = $server['server_id'];\n\n if (empty($tree[$server_id])) {\n $tree[$server_id] = $server;\n } else {\n $tree[$server_id] = array_merge($tree[$server_id], $server);\n }\n\n } else {\n\n if (empty($tree[$parent_id])) {\n $tree[$parent_id] = array(\n 'children' => array($server)\n );\n } else if (empty($tree[$parent_id]['children'])) {\n $tree[$parent_id]['children'] = array($server);\n } else {\n $tree[$parent_id]['children'][] = $server;\n }\n }\n }\n\n return $tree;\n }",
"public function getNodeDescendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft > :lft AND c.rgt < :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"protected function createAddEmptyNodeQuery()\n {\n $db = $this->dbh;\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', $q->bindValue( null ) );\n\n return $q;\n }"
]
| [
"0.6490567",
"0.6306455",
"0.62454224",
"0.59238976",
"0.5892231",
"0.58225065",
"0.5818849",
"0.57435685",
"0.5618105",
"0.55940264",
"0.55886483",
"0.55865026",
"0.5550731",
"0.5530019",
"0.5510987",
"0.5493688",
"0.54929763",
"0.5484383",
"0.54810077",
"0.5479525",
"0.5448418",
"0.54390806",
"0.54385126",
"0.54243594",
"0.54158586",
"0.5385204",
"0.5382851",
"0.5366873",
"0.53592753",
"0.53579015"
]
| 0.74920726 | 0 |
Returns ascendants of a given node filtered by published status. | public function findNodeAscendantsFilteredByPublished(NodeInterface $node, $published)
{
$qb = $this->getNodeAscendantsQueryBuilder($node);
$qb->andWhere('c.published = :pub')
->setParameter('pub', $published);
return $qb->getQuery()->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findNodePublishedDescendantsFilteredByDepth(NodeInterface $node, $depth = 1)\n {\n $qb = $this->getNodeDescendantsQueryBuilder($node);\n $qb->andWhere('c.published = true')\n ->andWhere('c.lvl - ' . $node->getLevel() . ' <= :d')\n ->setParameter('d', $depth);\n\n return $qb->getQuery()->getResult();\n }",
"public function getAllPublished()\n {\n $result = $this->getManyBy('status', 'publish');\n\n return $result;\n }",
"public function getDescendants();",
"public function getAllPublished();",
"public function countUnpublishedNodes() {\n // Count migrated, unpublished nodes.\n $map_table = $this->map->getMapTable();\n $query = db_query(\"SELECT COUNT(n.nid) FROM {node} n RIGHT JOIN {$map_table} m ON m.destid1 = n.nid WHERE n.status = 0\");\n\n return $query->fetchField();\n }",
"public static function published()\n {\n return self::where('published', '=', true)->orderBy('published_at', 'DESC')->get();\n }",
"public static function published()\n {\n // return self::where('published',1)->get();\n return self::where('published',true);\n }",
"function getFilteredChilds($a_filter,$a_node,$a_order = \"\",$a_direction = \"ASC\")\n\t{\n\t\t$childs = $this->getChilds($a_node,$a_order,$a_direction);\n\n\t\tforeach($childs as $child)\n\t\t{\n\t\t\tif(!in_array($child[\"type\"],$a_filter))\n\t\t\t{\n\t\t\t\t$filtered[] = $child;\n\t\t\t}\n\t\t}\n\t\treturn $filtered ? $filtered : array();\n\t}",
"public function getDescendants(NodeInterface $node)\r\n {\r\n $params = compact('node');\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, $params);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getDescendants($node);\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }",
"function getPublished()\n {\n return $this->published()->orderBy('sort')->get();\n }",
"public function getDescendants(BaseObject $node, $peer_method = 'doSelect', Criteria $c = null)\n {\n $descendants = array();\n\n if (!$node->isLeaf())\n {\n if(!$c)\n {\n $c = new Criteria();\n }\n $c->addAnd(self::getColumnConstant(get_class($node), 'left'), $node->getLeftValue(), Criteria::GREATER_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'right'), $node->getRightValue(), Criteria::LESS_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n $c->addAscendingOrderByColumn(self::getColumnConstant(get_class($node), 'left'));\n\n $descendants = call_user_func(array(get_class($node->getPeer()), $peer_method), $c);\n }\n\n /*\n * Set node levels to prevent further queries to database\n */\n $prev = array($node->getRightValue());\n $i = 0;\n if (count($descendants))\n {\n $initial_level = $descendants[0]->getLevel() - 1;\n }\n\n foreach ($descendants as $cur)\n {\n // get back to the parent\n while ($cur->getRightValue() > $prev[$i])\n {\n $i--;\n }\n\n $cur->setLevel(++$i + $initial_level);\n $prev[$i] = $cur->getRightValue();\n }\n\n return $descendants;\n }",
"public function getChilds($unpublished = false) {\n\n if ($this->childs === null) {\n $list = new Document\\Listing();\n $list->setUnpublished($unpublished);\n $list->setCondition(\"parentId = ?\", $this->getId());\n $list->setOrderKey(\"index\");\n $list->setOrder(\"asc\");\n $this->childs = $list->load();\n }\n return $this->childs;\n }",
"public function getAllPublishedPosts() \n\t{\n $q = \"SELECT * FROM in_posts WHERE publish_flag = 1 ORDER BY publish_time DESC\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }",
"function &get_pages_with_status($args = '') {\n\tglobal $wpdb;\n\n\t$defaults = array(\n\t\t'child_of' => 0, 'sort_order' => 'ASC',\n\t\t'sort_column' => 'post_title', 'hierarchical' => 1,\n\t\t'exclude' => '', 'include' => '',\n\t\t'meta_key' => '', 'meta_value' => '',\n\t\t'authors' => '', 'parent' => -1, 'exclude_tree' => '',\n\t\t'number' => '', 'offset' => 0, 'status' => 'publish'\n\t);\n\n\t$r = wp_parse_args( $args, $defaults );\n\textract( $r, EXTR_SKIP );\n\t$number = (int) $number;\n\t$offset = (int) $offset;\n\n\tif ($status == 'all' || $status == 'All' || $status == 'ALL') $statusquery = '';\n\telse $statusquery = $wpdb->prepare(\" AND post_status = '\". $status .\"'\");\n\n\n\t$cache = array();\n\t$key = md5( serialize( compact(array_keys($defaults)) ) );\n\tif ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {\n\t\tif ( is_array($cache) && isset( $cache[ $key ] ) ) {\n\t\t\t$pages = apply_filters('get_pages', $cache[ $key ], $r );\n\t\t\treturn $pages;\n\t\t}\n\t}\n\n\tif ( !is_array($cache) )\n\t\t$cache = array();\n\n\t$inclusions = '';\n\tif ( !empty($include) ) {\n\t\t$child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include\n\t\t$parent = -1;\n\t\t$exclude = '';\n\t\t$meta_key = '';\n\t\t$meta_value = '';\n\t\t$hierarchical = false;\n\t\t$incpages = preg_split('/[\\s,]+/',$include);\n\t\tif ( count($incpages) ) {\n\t\t\tforeach ( $incpages as $incpage ) {\n\t\t\t\tif (empty($inclusions))\n\t\t\t\t\t$inclusions = $wpdb->prepare(' AND ( ID = %d ', $incpage);\n\t\t\t\telse\n\t\t\t\t\t$inclusions .= $wpdb->prepare(' OR ID = %d ', $incpage);\n\t\t\t}\n\t\t}\n\t}\n\tif (!empty($inclusions))\n\t\t$inclusions .= ')';\n\n\t$exclusions = '';\n\tif ( !empty($exclude) ) {\n\t\t$expages = preg_split('/[\\s,]+/',$exclude);\n\t\tif ( count($expages) ) {\n\t\t\tforeach ( $expages as $expage ) {\n\t\t\t\tif (empty($exclusions))\n\t\t\t\t\t$exclusions = $wpdb->prepare(' AND ( ID <> %d ', $expage);\n\t\t\t\telse\n\t\t\t\t\t$exclusions .= $wpdb->prepare(' AND ID <> %d ', $expage);\n\t\t\t}\n\t\t}\n\t}\n\tif (!empty($exclusions))\n\t\t$exclusions .= ')';\n\n\t$author_query = '';\n\tif (!empty($authors)) {\n\t\t$post_authors = preg_split('/[\\s,]+/',$authors);\n\n\t\tif ( count($post_authors) ) {\n\t\t\tforeach ( $post_authors as $post_author ) {\n\t\t\t\t//Do we have an author id or an author login?\n\t\t\t\tif ( 0 == intval($post_author) ) {\n\t\t\t\t\t$post_author = get_userdatabylogin($post_author);\n\t\t\t\t\tif ( empty($post_author) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif ( empty($post_author->ID) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t$post_author = $post_author->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( '' == $author_query )\n\t\t\t\t\t$author_query = $wpdb->prepare(' post_author = %d ', $post_author);\n\t\t\t\telse\n\t\t\t\t\t$author_query .= $wpdb->prepare(' OR post_author = %d ', $post_author);\n\t\t\t}\n\t\t\tif ( '' != $author_query )\n\t\t\t\t$author_query = \" AND ($author_query)\";\n\t\t}\n\t}\n\n\t$join = '';\n\t$where = \"$exclusions $inclusions \";\n\tif ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {\n\t\t$join = \" LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )\";\n\n\t\t// meta_key and meta_value might be slashed\n\t\t$meta_key = stripslashes($meta_key);\n\t\t$meta_value = stripslashes($meta_value);\n\t\tif ( ! empty( $meta_key ) )\n\t\t\t$where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_key = %s\", $meta_key);\n\t\tif ( ! empty( $meta_value ) )\n\t\t\t$where .= $wpdb->prepare(\" AND $wpdb->postmeta.meta_value = %s\", $meta_value);\n\n\t}\n\n\tif ( $parent >= 0 )\n\t\t$where .= $wpdb->prepare(' AND post_parent = %d ', $parent);\n\n\t$query = \"SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page'$statusquery) $where \";\n\t$query .= $author_query;\n\t$query .= \" ORDER BY \" . $sort_column . \" \" . $sort_order ;\n\n\tif ( !empty($number) )\n\t\t$query .= ' LIMIT ' . $offset . ',' . $number;\n\n//\techo $query;\n\t\n\t$pages = $wpdb->get_results($query);\n\n\tif ( empty($pages) ) {\n\t\t$pages = apply_filters('get_pages', array(), $r);\n\t\treturn $pages;\n\t}\n\n\t// Update cache.\n\tupdate_page_cache($pages);\n\n\tif ( $child_of || $hierarchical )\n\t\t$pages = & get_page_children($child_of, $pages);\n\n\tif ( !empty($exclude_tree) ) {\n\t\t$exclude = array();\n\n\t\t$exclude = (int) $exclude_tree;\n\t\t$children = get_page_children($exclude, $pages);\n\t\t$excludes = array();\n\t\tforeach ( $children as $child )\n\t\t\t$excludes[] = $child->ID;\n\t\t$excludes[] = $exclude;\n\t\t$total = count($pages);\n\t\tfor ( $i = 0; $i < $total; $i++ ) {\n\t\t\tif ( in_array($pages[$i]->ID, $excludes) )\n\t\t\t\tunset($pages[$i]);\n\t\t}\n\t}\n\n\t$cache[ $key ] = $pages;\n\twp_cache_set( 'get_pages', $cache, 'posts' );\n\n\t$pages = apply_filters('get_pages', $pages, $r);\n\n\treturn $pages;\n}",
"public static function drafts()\n {\n return self::where('published', '=', false)->get();\n }",
"function get_unpublished_post_statuses() {\n $status = [ 'draft', 'pending', 'auto-draft'/*, 'future' */ ];\n\n /**\n * Filter the unpublished post statuses.\n *\n * @param array $status List of non-public post statuses.\n */\n return apply_filters( 'unpublished_post_statuses', $status );\n }",
"public function getSiblings($unpublished = false) {\n\t\tif ($this->siblings === null) {\n\t\t\t$list = new Document\\Listing();\n\t\t\t$list->setUnpublished($unpublished);\n\t\t\t// string conversion because parentId could be 0\n\t\t\t$list->addConditionParam(\"parentId = ?\", (string)$this->getParentId());\n\t\t\t$list->addConditionParam(\"id != ?\", $this->getId());\n\t\t\t$list->setOrderKey(\"index\");\n\t\t\t$list->setOrder(\"asc\");\n\t\t\t$this->siblings = $list->load();\n\t\t}\n\t\treturn $this->siblings;\n\t}",
"function descendants() {\n\t\t/*\n\t\tget all children of this article\n\t\tfor each child, run the same query..\n\t\t*/\n\t\t$childs = $this->children();\n\t\t$subChilds = array();\n\t\tforeach ($childs as $oneChild) {\n\t\t\t$subChilds = array_merge($subChilds, $oneChild->descendants());\n\t\t}\n\t\t$childs = array_merge($childs, $subChilds);\n\t\tpb_pqp_log_speed(\"article descendants()\");\n\t\treturn $childs;\n\t}",
"public function ancestorsGetDescendants($exclude_this=true)\r\n {\r\n $model = (new static)->setState('filter.path_begins_with', $this->path);\r\n if ($exclude_this) {\r\n \t$model->setState('filter.ids_excluded', array( $this->id ));\r\n } \r\n $items = $model->getItems();\r\n\r\n return $items;\r\n }",
"public function getNodeAscendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft <= :lft AND c.rgt >= :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"public function getDescendants()\n {\n if (!isset($this->_objects['Descendants'])) {\n $this->_objects['Descendants'] = $this->_getRepository()->fetchDescendantsByParent($this->id);\n }\n\n return $this->_objects['Descendants'];\n }",
"public function getArchivedEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 1')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }",
"function five_get_ancestors(){\n\t\t\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->get_results(\"SELECT ID, post_title, guid FROM $wpdb->posts WHERE post_type = 'page' AND post_parent = 0 AND post_status = 'publish'\");\n\t\treturn $result;\n\t\t}",
"function get_list_of_non_published_files() {\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 0 ORDER BY date DESC');\n return $result;\n }",
"public function published()\n {\n $published = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && $page->published()) {\n $published[$path] = $slug;\n }\n }\n $this->items = $published;\n\n return $this;\n }",
"public function getPublishedChoices()\n\t{\n\t\treturn array(1=>'Published',0=>'Unpublished');\n\t}",
"function mongo_node_filters($entity_type) {\n $filters = array(\n 'status' => array(\n 'any' => array(\n 'label' => 'Any',\n ),\n 'published' => array(\n 'label' => 'Published',\n 'filters' => array(\n array(\n '#type' => 'status',\n '#value' => 1,\n '#callback' => 'propertyCondition',\n ),\n ),\n ),\n 'not_published' => array(\n 'label' => 'Not published',\n 'filters' => array(\n array(\n '#type' => 'status',\n '#value' => 0,\n '#callback' => 'propertyCondition',\n ),\n ),\n ),\n ),\n 'type' => array(\n 'any' => array(\n 'label' => 'Any',\n ),\n ),\n );\n\n $set = mongo_node_settings();\n $bundles = $set[$entity_type]['bundles'];\n foreach ($bundles as $bundle_name => $bundle_settings) {\n $filters['type'][$bundle_name] = array(\n 'label' => $bundle_settings['label'],\n 'filters' => array(\n array(\n '#type' => 'bundle',\n '#value' => $bundle_name,\n '#callback' => 'entityCondition',\n ),\n ),\n );\n }\n return $filters;\n}",
"public function getDescendants($idEntry = 0);",
"public function getActivePages()\n {\n $qb = $this->getEntityManager()->createQueryBuilder();\n $qb->select(['p'])\n ->from('ArcmediaCmsBundle:ArcmediaPage', 'p')\n ->where('p.active = :state')\n ->orderBy('p.order', 'ASC')\n ->setParameter('state',true)\n ;\n\n return $qb->getQuery()->getResult();\n }",
"public function getChildrenForArbo()\n {\n $filtreEnfant = ' and 1=1 ';\n $oUtilisateur = Utilisateur::getConnected();\n if ($oUtilisateur && ! $oUtilisateur->isRoot()) {\n if ((sizeof(self::getForbiddenID($this->mode)) > 0)) {\n $filtreEnfant .= \" and ID_PAGE not in (\" . implode(',', self::getForbiddenID($this->mode)) . \")\";\n }\n }\n\n return $this->getChildren($filtreEnfant);\n }"
]
| [
"0.59303397",
"0.5769526",
"0.572744",
"0.5537261",
"0.5366998",
"0.5162558",
"0.5161066",
"0.51442534",
"0.5068894",
"0.5001943",
"0.49399307",
"0.49125707",
"0.4904975",
"0.49000794",
"0.48306423",
"0.48306128",
"0.4817847",
"0.48056942",
"0.48042446",
"0.4794809",
"0.4784965",
"0.47685516",
"0.4766103",
"0.47547013",
"0.47523734",
"0.47514403",
"0.47459882",
"0.4739644",
"0.47386235",
"0.47287157"
]
| 0.72250086 | 0 |
Returns the Query Builder to select node ascendants. | public function getNodeAscendantsQueryBuilder(NodeInterface $node)
{
$qb = $this->getNodeTreeQueryBuilder();
$qb->where('c.lft <= :lft AND c.rgt >= :rgt')
->setParameter('lft', $node->getLeft())
->setParameter('rgt', $node->getRight());
return $qb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodeTreeQueryBuilder()\n {\n $qb = $this->repository\n ->createQueryBuilder('c')\n ->select('c, p')\n ->leftJoin('c.parent', 'p')\n ->orderBy('c.lft');\n\n return $qb;\n }",
"public function scopeDepthFirst(Builder $query): Builder\n {\n $sql = $query->getExpressionGrammar()->compileOrderByPath();\n\n return $query->orderByRaw($sql);\n }",
"public function getNodeDescendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft > :lft AND c.rgt < :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"public function getSearchableEntitiesQuery(): \\Illuminate\\Database\\Eloquent\\Builder\n {\n return (new static())->orderBy($this->getKeyName());\n }",
"public function scopeBreadthFirst(Builder $query): Builder\n {\n return $query->orderBy($this->getDepthName());\n }",
"public function getQueryBuilder()\n {\n if (null === $this->queryBuilder) {\n\n $queryBuilder = $this->generator->list->query_builder;\n\n if ( null !== $this->generator->list->query_builder\n && false !== $this->generator->list->query_builder\n && method_exists($this->getRepository(), $queryBuilder)) {\n $this->queryBuilder = $this->getRepository()->$queryBuilder();\n } else {\n $this->queryBuilder = $this->getRepository()->createQueryBuilder('e');\n }\n\n foreach ($this->sort as $field => $order) {\n $this->queryBuilder->addOrderBy('e.' . $field, $order);\n }\n\n $this->processFilters();\n\n }\n return $this->queryBuilder;\n }",
"protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_ancestry', 'oga');\n // only load JUST the type of nodes we need\n $query->join('node', 'n', 'oga.nid = n.nid AND n.type = :type', array(':type' => $this->sourceType));\n $query->condition('group_nid', 0, '>') // handle 0 values\n ->fields('oga', array('nid', 'group_nid'));\n return $query;\n }",
"public function getNodes():ActiveQuery\n {\n return $this\n ->hasMany(Node::class, ['id' => 'nodeId'])\n ->viaTable(NodeBloc::tableName(), ['blocId' => 'id']);\n }",
"public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }",
"public function toBase() : QueryBuilder\n {\n return $this->applyScopes()->getQuery();\n }",
"protected function _getBrowseQuery()\n {\n if (!$this->_browseQuery) {\n $query = $this->_getTable()->select();\n \n $query = $this->_appendOrderByClause($query);\n \n $this->_browseQuery = $query;\n }\n \n return $this->_browseQuery; \n }",
"protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}",
"public function getDescendants();",
"public function getNodesQueryBuilder($parentId=null)\n {\n // Get class metadata\n $metadata = $this->getClassMetadata();\n\n // Create the query builder\n $queryBuilder = $this->_em->createQueryBuilder();\n\n $queryBuilder\n ->select('node')\n ->from($metadata->name, 'node');\n\n // Get the name of the parent field\n $parentColumn = $metadata->closureTree['parent']['fieldName'];\n\n if (!$parentId) {\n $queryBuilder->where('node.'. $parentColumn .' IS NULL');\n } else {\n $queryBuilder->where('node.'. $parentColumn .' = :parentId')->setParameter('parentId', $parentId);\n }\n\n return $queryBuilder;\n }",
"public function getCollectionQuery(): Builder;",
"protected function toQuery() {\n\t\t$query = $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder());\n\t\t$query->snapshot();\n\t\treturn $query;\n\t}",
"public function ancestorsGetDescendants($exclude_this=true)\r\n {\r\n $model = (new static)->setState('filter.path_begins_with', $this->path);\r\n if ($exclude_this) {\r\n \t$model->setState('filter.ids_excluded', array( $this->id ));\r\n } \r\n $items = $model->getItems();\r\n\r\n return $items;\r\n }",
"public function getQuery() : QueryBuilder\n {\n return $this->query;\n }",
"public function queryBuilder();",
"public function queryBuilder();",
"public function getChildrenQuery()\n {\n return null;\n }",
"public function buildSortQuery(): Builder\n {\n return static::query()->where('repository_id', $this->repository_id);\n }",
"public function getDescendants()\n {\n if (!isset($this->_objects['Descendants'])) {\n $this->_objects['Descendants'] = $this->_getRepository()->fetchDescendantsByParent($this->id);\n }\n\n return $this->_objects['Descendants'];\n }",
"public function getChildrenQuery();",
"public function getDescendants(BaseObject $node, $peer_method = 'doSelect', Criteria $c = null)\n {\n $descendants = array();\n\n if (!$node->isLeaf())\n {\n if(!$c)\n {\n $c = new Criteria();\n }\n $c->addAnd(self::getColumnConstant(get_class($node), 'left'), $node->getLeftValue(), Criteria::GREATER_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'right'), $node->getRightValue(), Criteria::LESS_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n $c->addAscendingOrderByColumn(self::getColumnConstant(get_class($node), 'left'));\n\n $descendants = call_user_func(array(get_class($node->getPeer()), $peer_method), $c);\n }\n\n /*\n * Set node levels to prevent further queries to database\n */\n $prev = array($node->getRightValue());\n $i = 0;\n if (count($descendants))\n {\n $initial_level = $descendants[0]->getLevel() - 1;\n }\n\n foreach ($descendants as $cur)\n {\n // get back to the parent\n while ($cur->getRightValue() > $prev[$i])\n {\n $i--;\n }\n\n $cur->setLevel(++$i + $initial_level);\n $prev[$i] = $cur->getRightValue();\n }\n\n return $descendants;\n }",
"public function getBuilder()\n {\n $builder = new Query\\Builder($this->getKeys());\n $builder->setVisitors([\n new Visitors\\EqVisitor($builder),\n new Visitors\\NotEqVisitor($builder),\n new Visitors\\GtVisitor($builder),\n new Visitors\\GteVisitor($builder),\n new Visitors\\LtVisitor($builder),\n new Visitors\\LteVisitor($builder),\n new Visitors\\CtVisitor($builder),\n new Visitors\\SwVisitor($builder),\n new Visitors\\EwVisitor($builder),\n new Visitors\\AndVisitor($builder),\n new Visitors\\OrVisitor($builder),\n new Visitors\\NotInVisitor($builder),\n new Visitors\\InVisitor($builder),\n new Visitors\\NullVisitor($builder),\n new Visitors\\NotNullVisitor($builder),\n ]);\n\n return $builder;\n }",
"public function query() {\n $query = parent::query();\n // Add in book parent child relationships.\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n return $query;\n }",
"private function getBlockSelectQuery(): QueryBuilder\n {\n $query = $this->connection->createQueryBuilder();\n $query->select('DISTINCT b.*, bt.*')\n ->from('ngbm_block', 'b')\n ->innerJoin(\n 'b',\n 'ngbm_block_translation',\n 'bt',\n $query->expr()->andX(\n $query->expr()->eq('bt.block_id', 'b.id'),\n $query->expr()->eq('bt.status', 'b.status')\n )\n );\n\n return $query;\n }",
"public function descendants($depth=null) {\n $db = $this->getDbConnection();\n $criteria = $this->getDbCriteria();\n $alias = $db->quoteColumnName($this->getTableAlias());\n\n $criteria->mergeWith(array(\n 'condition' => $alias . '.' . $db->quoteColumnName($this->leftAttribute) . '>' . $this->{$this->leftAttribute} .\n ' AND ' . $alias . '.' . $db->quoteColumnName($this->rightAttribute) . '<' . $this->{$this->rightAttribute},\n 'order' => $alias . '.' . $db->quoteColumnName($this->leftAttribute),\n ));\n\n if ($depth !== null)\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->levelAttribute) . '<=' . ($this->{$this->levelAttribute} + $depth));\n\n if ($this->hasManyRoots) {\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount);\n $criteria->params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n return $this;\n }",
"public function getDocumentBuilder()\n {\n return Document::query()\n ->where(function($query) {\n return $query->whereRaw($this->getExpandedQuery());\n });\n }"
]
| [
"0.6466017",
"0.628101",
"0.60708696",
"0.59080255",
"0.58498013",
"0.57561725",
"0.57357436",
"0.5719049",
"0.566345",
"0.56513584",
"0.560418",
"0.5572246",
"0.55671185",
"0.55293167",
"0.5477672",
"0.54699075",
"0.5465625",
"0.5457522",
"0.5435523",
"0.5435523",
"0.54200727",
"0.54179007",
"0.541235",
"0.5404996",
"0.5375872",
"0.5367954",
"0.5331227",
"0.5326713",
"0.53045547",
"0.5300307"
]
| 0.67854375 | 0 |
Returns the Query Builder to select node descendants. | public function getNodeDescendantsQueryBuilder(NodeInterface $node)
{
$qb = $this->getNodeTreeQueryBuilder();
$qb->where('c.lft > :lft AND c.rgt < :rgt')
->setParameter('lft', $node->getLeft())
->setParameter('rgt', $node->getRight());
return $qb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodeTreeQueryBuilder()\n {\n $qb = $this->repository\n ->createQueryBuilder('c')\n ->select('c, p')\n ->leftJoin('c.parent', 'p')\n ->orderBy('c.lft');\n\n return $qb;\n }",
"public function descendants($depth=null) {\n $db = $this->getDbConnection();\n $criteria = $this->getDbCriteria();\n $alias = $db->quoteColumnName($this->getTableAlias());\n\n $criteria->mergeWith(array(\n 'condition' => $alias . '.' . $db->quoteColumnName($this->leftAttribute) . '>' . $this->{$this->leftAttribute} .\n ' AND ' . $alias . '.' . $db->quoteColumnName($this->rightAttribute) . '<' . $this->{$this->rightAttribute},\n 'order' => $alias . '.' . $db->quoteColumnName($this->leftAttribute),\n ));\n\n if ($depth !== null)\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->levelAttribute) . '<=' . ($this->{$this->levelAttribute} + $depth));\n\n if ($this->hasManyRoots) {\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount);\n $criteria->params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n return $this;\n }",
"public function getNodeAscendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft <= :lft AND c.rgt >= :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"public function getNodesQueryBuilder($parentId=null)\n {\n // Get class metadata\n $metadata = $this->getClassMetadata();\n\n // Create the query builder\n $queryBuilder = $this->_em->createQueryBuilder();\n\n $queryBuilder\n ->select('node')\n ->from($metadata->name, 'node');\n\n // Get the name of the parent field\n $parentColumn = $metadata->closureTree['parent']['fieldName'];\n\n if (!$parentId) {\n $queryBuilder->where('node.'. $parentColumn .' IS NULL');\n } else {\n $queryBuilder->where('node.'. $parentColumn .' = :parentId')->setParameter('parentId', $parentId);\n }\n\n return $queryBuilder;\n }",
"private function getBlockSelectQuery(): QueryBuilder\n {\n $query = $this->connection->createQueryBuilder();\n $query->select('DISTINCT b.*, bt.*')\n ->from('ngbm_block', 'b')\n ->innerJoin(\n 'b',\n 'ngbm_block_translation',\n 'bt',\n $query->expr()->andX(\n $query->expr()->eq('bt.block_id', 'b.id'),\n $query->expr()->eq('bt.status', 'b.status')\n )\n );\n\n return $query;\n }",
"public function getQuery() : QueryBuilder\n {\n return $this->query;\n }",
"function descendants() {\n\t\t/*\n\t\tget all children of this article\n\t\tfor each child, run the same query..\n\t\t*/\n\t\t$childs = $this->children();\n\t\t$subChilds = array();\n\t\tforeach ($childs as $oneChild) {\n\t\t\t$subChilds = array_merge($subChilds, $oneChild->descendants());\n\t\t}\n\t\t$childs = array_merge($childs, $subChilds);\n\t\tpb_pqp_log_speed(\"article descendants()\");\n\t\treturn $childs;\n\t}",
"public function getBuilder()\n {\n $builder = new Query\\Builder($this->getKeys());\n $builder->setVisitors([\n new Visitors\\EqVisitor($builder),\n new Visitors\\NotEqVisitor($builder),\n new Visitors\\GtVisitor($builder),\n new Visitors\\GteVisitor($builder),\n new Visitors\\LtVisitor($builder),\n new Visitors\\LteVisitor($builder),\n new Visitors\\CtVisitor($builder),\n new Visitors\\SwVisitor($builder),\n new Visitors\\EwVisitor($builder),\n new Visitors\\AndVisitor($builder),\n new Visitors\\OrVisitor($builder),\n new Visitors\\NotInVisitor($builder),\n new Visitors\\InVisitor($builder),\n new Visitors\\NullVisitor($builder),\n new Visitors\\NotNullVisitor($builder),\n ]);\n\n return $builder;\n }",
"function descendants() {\n\t\t$out = array();\n\t\t$this->get_descendants($out);\n\t\treturn $out;\n\t}",
"public function toBase() : QueryBuilder\n {\n return $this->applyScopes()->getQuery();\n }",
"public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }",
"public function build()\n {\n $query = $this->qb;\n if ($this->getWhereExpression()) {\n $query->where($this->getWhereExpression());\n }\n foreach ($this->getWhereParameters() as $key => $param) {\n $query->setParameter($key, $param, is_array($param) ? Connection::PARAM_STR_ARRAY : null);\n }\n\n return $query;\n }",
"public function createQueryBuilder ()\r\n {\r\n return new QueryBuilder($this);\r\n }",
"public function getCollectionQuery(): Builder;",
"public function descendants($depth=null)\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\n\t\t$criteria->mergeWith(array(\n\t\t\t'condition'=>$alias.'.'.$db->quoteColumnName($this->leftAttribute).'>'.$owner->{$this->leftAttribute}.\n\t\t\t\t' AND '.$alias.'.'.$db->quoteColumnName($this->rightAttribute).'<'.$owner->{$this->rightAttribute},\n\t\t\t'order'=>$alias.'.'.$db->quoteColumnName($this->leftAttribute),\n\t\t));\n\n\t\tif($depth!==null)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->levelAttribute).'<='.($owner->{$this->levelAttribute}+$depth));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner;\n\t}",
"public function query() {\n $query = parent::query();\n // Add in book parent child relationships.\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n return $query;\n }",
"public function getDescendants(BaseObject $node, $peer_method = 'doSelect', Criteria $c = null)\n {\n $descendants = array();\n\n if (!$node->isLeaf())\n {\n if(!$c)\n {\n $c = new Criteria();\n }\n $c->addAnd(self::getColumnConstant(get_class($node), 'left'), $node->getLeftValue(), Criteria::GREATER_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'right'), $node->getRightValue(), Criteria::LESS_THAN);\n $c->addAnd(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n $c->addAscendingOrderByColumn(self::getColumnConstant(get_class($node), 'left'));\n\n $descendants = call_user_func(array(get_class($node->getPeer()), $peer_method), $c);\n }\n\n /*\n * Set node levels to prevent further queries to database\n */\n $prev = array($node->getRightValue());\n $i = 0;\n if (count($descendants))\n {\n $initial_level = $descendants[0]->getLevel() - 1;\n }\n\n foreach ($descendants as $cur)\n {\n // get back to the parent\n while ($cur->getRightValue() > $prev[$i])\n {\n $i--;\n }\n\n $cur->setLevel(++$i + $initial_level);\n $prev[$i] = $cur->getRightValue();\n }\n\n return $descendants;\n }",
"public function getQueryBuilder()\n {\n $qb = $this->repository->createQueryBuilder(self::ALIAS);\n\n $qb->leftJoin(self::ALIAS.'.networks', 'networks')\n ->addSelect('COUNT(networks.id) AS networksCount')\n ->groupBy(self::ALIAS.'.id');\n\n return $qb;\n }",
"public function createQueryBuilder()\n {\n return new QueryBuilder($this->db);\n }",
"public function getChildrenQuery();",
"public function getQuery(): Builder;",
"public function scopeBreadthFirst(Builder $query): Builder\n {\n return $query->orderBy($this->getDepthName());\n }",
"public function createQueryBuilder(): QueryBuilder\n {\n return new QueryBuilder($this->db, [\n 'separator' => \"\\n\"\n ]);\n }",
"public function getQueryBuilder()\n {\n if (null === $this->queryBuilder) {\n\n $queryBuilder = $this->generator->list->query_builder;\n\n if ( null !== $this->generator->list->query_builder\n && false !== $this->generator->list->query_builder\n && method_exists($this->getRepository(), $queryBuilder)) {\n $this->queryBuilder = $this->getRepository()->$queryBuilder();\n } else {\n $this->queryBuilder = $this->getRepository()->createQueryBuilder('e');\n }\n\n foreach ($this->sort as $field => $order) {\n $this->queryBuilder->addOrderBy('e.' . $field, $order);\n }\n\n $this->processFilters();\n\n }\n return $this->queryBuilder;\n }",
"public function newQuery(): Builder\n {\n return new static($this->connection);\n }",
"protected function createQueryBuilder()\n {\n $builder = new QueryBuilder();\n return $builder;\n }",
"public function query()\n {\n return new \\Rubberband\\Elastic\\Laravel\\Query\\Builder($this);\n }",
"public function queryBuilder();",
"public function queryBuilder();",
"public function getChildrenQuery()\n {\n return null;\n }"
]
| [
"0.6369904",
"0.6067729",
"0.60116416",
"0.59157914",
"0.5892921",
"0.57832295",
"0.5748616",
"0.57383394",
"0.5737618",
"0.57343405",
"0.5687902",
"0.5665829",
"0.56632423",
"0.5636539",
"0.5615965",
"0.561082",
"0.5604218",
"0.56036675",
"0.55853957",
"0.5583348",
"0.5578328",
"0.5569789",
"0.55670637",
"0.5559756",
"0.55413353",
"0.5535583",
"0.5525562",
"0.5523377",
"0.5523377",
"0.5522922"
]
| 0.67344344 | 0 |
Returns the Query Builder to select all nodes that are not descendants of a given node. | public function getNodeNotDescendantsQueryBuilder(NodeInterface $node)
{
$qb = $this->getNodeTreeQueryBuilder();
$qb->where('c.lft < :lft OR c.rgt > :rgt')
->setParameter('lft', $node->getLeft())
->setParameter('rgt', $node->getRight());
return $qb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newQueryWithoutRelationships();",
"private function findNotSoldQuery() : QueryBuilder\n {\n return $this\n ->createQueryBuilder('p')\n ->where('p.sold = false')\n ->orderBy('p.created_at', 'ASC');\n }",
"public function whereNotEq()\n {\n \n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOT][$field] = [self::OPERATORS['ne'] => $value];\n return $this;\n }",
"public function whereNotIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERENOTIN][$field] = [self::OPERATORS['nin'] => $value];\n return $this;\n }",
"protected function sourceQuery(){\n $query = parent::sourceQuery();\n $query->condition('i.field_name', array_keys($this->getFieldNameMappings()), 'NOT IN');\n return $query;\n }",
"public function newQueryWithoutScopes(): Builder\n {\n return $this->newModelQuery();\n }",
"public function createNot()\n {\n $o = new NotSelector();\n $this->appendSelector($o);\n\n return $o;\n }",
"public function newQueryWithoutScopes()\n {\n $builder = $this->newBuilder();\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n return $builder->setModel($this);\n }",
"public function whereNotBetween($column, $value, $boolean='and') : Query\n {\n return $this->whereBetween($column, $value, $boolean, true);\n }",
"public function notGroupStart(): QueryBuilderInterface\n\t{\n\t\t$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : ' AND ';\n\n\t\t$this->state->appendMap($conj, ' NOT (', 'group_start');\n\n\t\treturn $this;\n\t}",
"public function getNodeTreeQueryBuilder()\n {\n $qb = $this->repository\n ->createQueryBuilder('c')\n ->select('c, p')\n ->leftJoin('c.parent', 'p')\n ->orderBy('c.lft');\n\n return $qb;\n }",
"public function where_not($query, $params = array(), $boolean = 'and')\r\n {\r\n return $this->where($query, $params, $boolean, true);\r\n }",
"public function neq(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_NEQ;\n\n return $this;\n\n }",
"public function scopeNotEnabled($query): \\Illuminate\\Database\\Eloquent\\Builder\n {\n return $query->enabled(false);\n }",
"protected function _negateQuery($query) {\n $field = $query->options()['fields'][0];\n\n $negativeQuery = new AdvancedQuery($query->model(), 'all', [\n 'fields' => [\n $field\n ],\n 'conditions' => [\n QueryCondition::comparison($field, 'NOT IN', $query)\n ]\n ]);\n\n return $negativeQuery;\n }",
"public function getNodeDescendantsQueryBuilder(NodeInterface $node)\n {\n $qb = $this->getNodeTreeQueryBuilder();\n $qb->where('c.lft > :lft AND c.rgt < :rgt')\n ->setParameter('lft', $node->getLeft())\n ->setParameter('rgt', $node->getRight());\n\n return $qb;\n }",
"public function scopeNonSystem(Builder $query): Builder\n {\n return $query->whereIn('type', self::NonSystemTypes);\n }",
"public function notWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'and',\n\t\t\t'not' => true,\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}",
"public function not($selector = null) {\r\n\t\t\r\n\t\tif (!isset($selector)) return $this;\r\n\t\t\r\n\t\tif (is_string($selector)) {\r\n\t\t\t\r\n\t\t\tforeach ($this as $index => $node) \r\n\t\t\t\tforeach ($this->filter($selector) as $n)\r\n\t\t\t\t\tif ($node->isSameNode($n)) $this->removeFromList($index);\r\n\t\t} elseif (is_object($selector) AND get_class($selector) === 'DOMElement') {\r\n\t\t\t\r\n\t\t\tif (in_array($selector, $this->list)) $this->removeFromList($this->index($selector));\r\n\t\t} elseif (is_array($selector)) {\r\n\t\t\t\r\n\t\t\tforeach ($selector as $node) {\r\n\t\t\t\tif (is_object($node) == false) continue;\r\n\t\t\t\t\r\n\t\t\t\tif (in_array($node, $this->list)) $this->removeFromList($this->index($node));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"public function isNot(): WhereCondition\n {\n\n $this->_op = self::OP_TYPE_ISN;\n\n return $this;\n\n }",
"public function prunable(): Builder\n {\n return static::whereDoesntHave('bookings', function (Builder $query) {\n return $query->whereState('state', CheckedOut::class);\n })\n ->where(function ($query) {\n // User has never logged in and was created more than a year ago.\n $query->whereNull('last_logged_in_at')\n ->whereDate('created_at', '<=',\n now()->subDays(config('hydrofon.prune_models_after_days.users', 365)));\n })\n ->orWhere(function ($query) {\n // User has logged in but not been active for more than a year.\n $query->whereNotNull('last_logged_in_at')\n ->whereDate('last_logged_in_at', '<=',\n now()->subDays(config('hydrofon.prune_models_after_days.users', 365)));\n });\n }",
"private function getRemainingQueryBuilder()\n {\n $qb = $this->createQueryBuilder('o');\n $ex = $qb->expr();\n\n $qb\n ->select('o')\n ->where($ex->andX(\n $ex->eq('o.sample', ':sample'), // Not sample\n $ex->eq('o.state', ':state'), // Accepted\n $ex->lt('o.invoiceTotal', 'o.grandTotal') // invoice total lower than grand total\n ))\n ->addOrderBy('o.createdAt', 'ASC')\n ->setParameter('sample', false)\n ->setParameter('state', OrderStates::STATE_ACCEPTED);\n\n return $qb;\n }",
"public function whereNotIn($field, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_whereIn($field, $val, 'NOT IN');\n\t}",
"public function newQueryWithoutScopes()\n {\n $builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());\n\n\n // Once we have the query builders, we will set the model instances so the\n // builder can easily access any information it may need from the model\n // while it is constructing and executing various queries against it.\n\n return $builder->setModel($this)\n //->setfillableColumns($this->fillable)\n ->with($this->with)\n ->withCount($this->withCount);\n }",
"protected function createAddEmptyNodeQuery()\n {\n $db = $this->dbh;\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', $q->bindValue( null ) );\n\n return $q;\n }",
"public function getNodes():ActiveQuery\n {\n return $this\n ->hasMany(Node::class, ['id' => 'nodeId'])\n ->viaTable(NodeBloc::tableName(), ['blocId' => 'id']);\n }",
"protected function getTableQuery(): Builder\n {\n return parent::getTableQuery()->withoutDrafts();\n }",
"public function scopeNotProvider(Builder $query,\n MessengerProvider $provider,\n string $morph = 'owner'): Builder\n {\n return $this->scopeForProvider($query, $provider, $morph, true);\n }",
"public function orNotGroupStart(): QueryBuilderInterface\n\t{\n\t\t$this->state->appendMap('', ' OR NOT (', 'group_start');\n\n\t\treturn $this;\n\t}",
"public function forNestedWhere()\n {\n // ->from($this->from) is wrong, and ->from($this->type) is redundant in nested where\n return $this->newQuery()->from(null);\n }"
]
| [
"0.591824",
"0.5860476",
"0.5846658",
"0.57491595",
"0.5716643",
"0.5701002",
"0.5688973",
"0.56481946",
"0.5634945",
"0.5625262",
"0.55713594",
"0.5530799",
"0.548697",
"0.5470394",
"0.5470253",
"0.54560655",
"0.54117244",
"0.5397437",
"0.5389121",
"0.53789645",
"0.5346176",
"0.53042483",
"0.5286376",
"0.5249538",
"0.52473366",
"0.523717",
"0.5219204",
"0.52072644",
"0.5178219",
"0.51652235"
]
| 0.75435907 | 0 |
Fonction qui ajoute une biographie | function addBio($bio, $db) {
$query = $db->prepare("INSERT INTO Bio (Titre, Description) VALUES (?)");
$query->execute([$bio["Titre"], $bio["Description"]]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setBio($newBio){\n $this->bio = $newBio;\n }",
"public function biography();",
"public function add_information() \r\n {}",
"public function add_information() \r\n {}",
"function bio () {\n if (empty($this->bio_bio)) {\n if ( $this->page[\"Bio\"] == \"\" ) $this->openpage (\"Bio\",\"person\");\n if ( $this->page[\"Bio\"] == \"cannot open page\" ) return array(); // no such page\n if (@preg_match_all('|<h5>Mini Biography</h5>\\s*(.+)\\s+.+\\s+(.+)|',$this->page[\"Bio\"],$matches)) {\n for ($i=0;$i<count($matches[0]);++$i) {\n $bio_bio[\"desc\"] = str_replace(\"href=\\\"/name/nm\",\"href=\\\"http://\".$this->imdbsite.\"/name/nm\",\n str_replace(\"href=\\\"/title/tt\",\"href=\\\"http://\".$this->imdbsite.\"/title/tt\",\n str_replace('/SearchBios','http://'.$this->imdbsite.'/SearchBios',$matches[1][$i])));\n $author = 'Written by '.(str_replace('/SearchBios','http://'.$this->imdbsite.'/SearchBios',$matches[2][$i]));\n if (@preg_match(\"/href\\=\\\"(.*?)\\\">(.*?)<\\/a>/\",$author,$match)) {\n $bio_bio[\"author\"][\"url\"] = $match[1][$i];\n $bio_bio[\"author\"][\"name\"] = $match[2][$i];\n }\n $this->bio_bio[] = $bio_bio;\n unset($bio_bio,$author);\n }\n }\n }\n return $this->bio_bio;\n }",
"public function biographies() {\n\t\treturn $this->hasMany('App\\Biography');\n\t}",
"function setIdHistorialCambio($idHistorialCambio) {\r\n $this->idHistorialCambio = $idHistorialCambio;\r\n }",
"public static function onImopenlineCreate(\\Bitrix\\Main\\Event $event)\n\t{\n\t\t$parameters = $event->getParameters();\n\n\t\tself::addInfoConnectors($parameters['line']);\n\t}",
"public function __construct($bio) {\n\t\tparent::__construct($this->shortenIfTooLong($bio));\n\t}",
"public function setBiometricDefaults(){\r\n \t\r\n \tif($this->data['biometric_data']['height']==\"0\"){ \t\t\r\n \t\t$this->data['biometric_data']['height']=(intval($this->demographics['height_ft'])*12)+$this->demographics['height_in']; \t\t\r\n \t} \t\r\n \t\r\n \t//get last weight entered\r\n \tif($this->data['biometric_data']['weight']==\"0\"){\r\n \t\trequire_once(ROOT_DIR.\"classes/model/UserTrackWeightModel.php\");\r\n \t\t$w=new UserTrackWeightModel($this->id); \r\n \t\t$weight=$w->getLastEntry();\r\n \t\t$this->data['biometric_data']['weight']=($weight)?$weight['weight']:0;\r\n \t}\r\n \t\r\n \t\t//get last bp entered\r\n \tif($this->data['biometric_data']['bp_systolic']==\"0\"){\r\n \t\trequire_once(ROOT_DIR.\"classes/model/UserTrackBPModel.php\");\r\n \t\t$bp= new UserTrackBPModel($this->id);\r\n \t\t$data=$bp->getLastEntry(); \t\t\r\n \t\t$this->data['biometric_data']['bp_systolic']=($data)?$data['systolic']:0;\r\n \t\t$this->data['biometric_data']['bp_diastolic']=($data)?$data['diastolic']:0; \t\t\t \t\t\r\n \t}\r\n \t\r\n \t//calculate current BMI\r\n \tif($this->data['biometric_data']['bmi']==0){ \t\t\r\n \t\tif($this->data['biometric_data']['height']!=0){ \t\t\t\r\n \t \t\t$this->data['biometric_data']['bmi']=round($this->data['biometric_data']['weight']/pow($this->data['biometric_data']['height'],2)*703,2); \t\t\t\r\n \t\t}\r\n \t\trequire_once(ROOT_DIR.\"classes/model/UserTrackMeasurementsModel.php\");\r\n\t\t\t\t$mm = new UserTrackMeasurementsModel($this->id);\r\n\t\t\t\t$data = $mm->getLastEntry();\r\n \t\t$this->data['biometric_data']['waist'] = ($data['waist']) ? $data['waist'] : 0;\r\n \t}\r\n \t\r\n \t//get Last Entered Blood Glucose\r\n \tif($this->data['biometric_data']['blood_glucose']==0){\r\n \t\trequire_once(ROOT_DIR.\"classes/model/UserTrackBloodGlucoseModel.php\");\r\n \t\t$bg= new UserTrackBloodGlucoseModel($this->id);\r\n \t\t$data=$bg->getLastEntry();\r\n \t\tif ($data['random']['date_entered'] > $data['fasting']['date_entered']) {\r\n\t \t\t$this->data['biometric_data']['blood_glucose']=$data['random']['blood_glucose'];\r\n\t \t\t$this->data['glucose_test'] = 'random';\r\n\t \t}\r\n\t \telse {\r\n\t \t\t$this->data['biometric_data']['blood_glucose'] = $data['fasting']['blood_glucose'];\r\n\t \t\t$this->data['glucose_test'] = 'fasting';\r\n\t \t}\r\n\t\t\t\tif (!isset($this->data['biometric_data']['hemoglobin']))\r\n\t \t\t$this->data['biometric_data']['hemoglobin'] = 0;\r\n\t\t\t\tif (!isset($this->data['biometric_data']['cotinine']))\r\n\t \t\t$this->data['biometric_data']['cotinine'] = 0;\r\n \t}\r\n \t\r\n //get Last Entered Cholesterol\r\n \tif($this->data['biometric_data']['cholesterol']==0){\r\n \t\trequire_once(ROOT_DIR.\"classes/model/UserTrackCholesterolModel.php\");\r\n \t\t$c= new UserTrackCholesterolModel($this->id);\r\n \t\t$data=$c->getLastEntry(); \t\t\r\n \t\t$this->data['biometric_data']['cholesterol']=($data)?$data['total']:0;\r\n \t\t$this->data['biometric_data']['triglycerides']=($data)?$data['triglycerides']:0;\r\n \t\t$this->data['biometric_data']['hdl']=($data)?$data['hdl']:0;\r\n \t\t$this->data['biometric_data']['ldl']=($data)?$data['ldl']:0;\r\n \t}\r\n \t\t\r\n\t}",
"public function add_info($info)\r\n { \r\n }",
"function addArtist($informations)\n {\n\n $db = dbConnect();\n\n //Après traitement et upload, j'ai mon nom de fichier\n $query = $db->prepare('INSERT INTO artists (name, biography, label_id) VALUES(:name, :biography, :label_id)');\n $result = $query->execute([\n 'name' => $informations['name'],\n 'biography' => $informations['description'],\n 'label_id' => $informations['label_id']\n ]);\n\n $artistId = $db->lastInsertId(); //retourne l'id de la dernière ligne insérée\n\n insertArtistImage($artistId, $result); //Insertion de l'image\n\n return $result;\n }",
"public function show(Biologica $biologica)\n {\n //\n }",
"function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `svg_info` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}else{\n\t\t\t$sql = \"INSERT into `svg_info` values('\".addslashes($this->id).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->type).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->index).\"' , '\".addslashes($this->transform).\"' , '\".addslashes($this->value).\"' , '\".addslashes($this->fontsize).\"' , '\".addslashes($this->color).\"' , '\".addslashes($this->fill).\"' , '\".addslashes($this->stroke).\"' , '\".addslashes($this->points).\"' , '\".addslashes($this->txt).\"')\";\n\t\t}\n\t\t$this->connection->send_query($sql);\n\t}",
"public function updateBio($input) {\n\t\t// and should be implemented by you\n\n\n\t\t// Prepare SQL Values\n\t\t$sql_values = [\n\t\t\t'user_id' => $_SESSION['user_id'],\n\t\t\t'bio' => $input['bio-text']\n\t\t];\n\n\t\t// Ensure values are encompased with quote marks\n\t\t$sql_values = db::array_in_quotes($sql_values);\n\n\t\t// Insert\n\t\t$results = db::insert_duplicate_key_update('user', $sql_values, 'WHERE user_id =\\'{$this->user_id}\\'');\n\t\t\n\t\t// Return a new instance of this user as an object\n\t\treturn new User($this->user_id);\n\n\t}",
"public function edit(Biologica $biologica)\n {\n //\n }",
"function CHistorialCambiosBeneficiario($idHistorialCambio, $beneficiario1, $beneficiario2, $tipoCambioBeneficiario, $fecha, $soporte, $observaciones) {\r\n $this->idHistorialCambio = $idHistorialCambio;\r\n $this->beneficiario1 = $beneficiario1;\r\n $this->beneficiario2 = $beneficiario2;\r\n $this->tipoCambioBeneficiario = $tipoCambioBeneficiario;\r\n $this->fecha = $fecha;\r\n $this->soporte = $soporte;\r\n $this->observaciones = $observaciones;\r\n }",
"function getBio() {\n return $this->bio;\n }",
"public function setBio($bio)\n {\n $this->bio = $bio;\n\n return $this;\n }",
"public function setBio($bio)\n {\n $this->bio = $bio;\n\n return $this;\n }",
"public function addMetaboxes() {}",
"function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function agregar_adjunto($nombre, $path_archivo, $encoding = 'base64', $tipo = '')\n\t{\n\t\t$this->adjuntos[] = array(\n\t\t\t'nombre' => $nombre,\n\t\t\t'archivo' => file_get_contents($path_archivo),\n\t\t\t'encoding' => $encoding,\n\t\t\t'tipo' => $tipo\n\t\t);\n\t}",
"function inscription_jesa_link_add_child($form, &$form_state) {\n // Everything in $form_state is persistent, so we'll just use\n // $form_state['add_stagiaire']\n $form_state['num_stagiaires']++;\n\n // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.\n $form_state['rebuild'] = TRUE;\n}",
"public function aparecer() {\n // Referencia al objeto dentro de la clase\n echo '<img src=\"' . $this -> foto . '\">';\n\n }",
"public function getBio()\n {\n return $this->bio;\n }",
"function altaGrupo($nombre,$descripcion)\n\t\t{\t\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"INSERT INTO `grupo`(`NOMBRE_GRUPO`, `DESCRIPCION`) VALUES ('$nombre','$descripcion')\";\n\t\t\t$mysqli->query($query);\n\t\t\t$mysqli->close();\n\t\t\t\t\n\t\t}",
"public function __construct(felicitacionesRegistro $profile)\n {\n //\n $this->profile = $profile;\n }",
"function register_block_core_post_author_biography()\n {\n }",
"function NouveauProfil($prenom,$nom,$pseudonyme,$mdp,$date,$sexe,$orientation){\r\n\t\t$conn = mysqli_connect(\"localhost\", \"root\", \"\", \"bddfinale\");\r\n\t\t$requete = \"INSERT INTO allinformations VALUES ('$pseudonyme','$mdp','$nom','$prenom', '$date', '', '01', '$sexe', '$orientation', '1', '1', '0', '0', '0', '0', '', '', '', '', '', 'logo.jpg','logo2.png','logo3.jpg','0','1','0', NULL)\";\r\n\t\t//Les champs obligatoires sont remplis par défaut mais l'utilisateur peut directement les modifier dans ModifierMonProfil\r\n\t\t$ligne= mysqli_query($conn, $requete);\r\n\t\tmysqli_close($conn);\r\n\t\t}"
]
| [
"0.64594334",
"0.5830039",
"0.5721712",
"0.5721712",
"0.5541129",
"0.55054057",
"0.53822917",
"0.52820754",
"0.50951916",
"0.50745076",
"0.5067793",
"0.50589174",
"0.504512",
"0.5044792",
"0.5043552",
"0.49954015",
"0.49895394",
"0.4983016",
"0.49745274",
"0.49745274",
"0.4949655",
"0.49461788",
"0.49236205",
"0.48988655",
"0.4898513",
"0.4856147",
"0.48518348",
"0.4845455",
"0.48442975",
"0.48307556"
]
| 0.5992736 | 1 |
Amenities that belong to the property. | public function amenities()
{
return $this->belongsToMany('App\Models\Properties\Amenity');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function amenities()\n {\n return $this->belongsToMany(\n 'App\\Amenity', 'listing_amenities', 'listing_id', 'amenity_id'\n )->select(['id', 'title', 'icon']);\n }",
"public function abilities()\n {\n return $this->belongsToMany(config('rinvex.fort.models.ability'), config('rinvex.fort.tables.ability_user'))\n ->withTimestamps();\n }",
"public function abilities()\n {\n if (!$this->abilities) {\n $this->abilities = array();\n foreach (monsterToAbility::select('ability', 'description')->where('mid', '=', $this->id)->get() as $m) {\n $this->abilities[$m->ability] = $m->description;\n }\n }\n return $this->abilities;\n }",
"public function areasDetails()\n {\n return $this->hasManyThrough(FilterPracticeArea::class, CandidateSubSpecialism::class, 'candidate_id', 'id', 'id', 'area_id');\n }",
"public function availabilities()\n {\n return $this->hasMany('App\\Availability', 'location_id', 'location_id');\n }",
"public function getAnchorAllowableValues()\n {\n return [\n self::ANCHOR_ALLIANCE_MEMBER,\n self::ANCHOR_CONFIG_STARBASE_EQUIPMENT_ROLE,\n self::ANCHOR_CORPORATION_MEMBER,\n self::ANCHOR_STARBASE_FUEL_TECHNICIAN_ROLE,\n ];\n }",
"public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }",
"public function abilities(): HasMany\n {\n return $this->hasMany(PsAbility::class, 'champion_id', 'id');\n }",
"public function amenityIds()\n {\n $this->attributes['amenityIds'] = $this->amenities->pluck('id');\n }",
"public function getAssessors()\n {\n return $this->hasMany(Assessor::className(), ['projectId' => 'id']);\n }",
"public function get_Aksesmenu()\n {\n $queryAksesmenu = \"SELECT user_access_menu.*, user_menu.menu, user_role.role\n FROM user_access_menu \n JOIN user_menu\n ON user_access_menu.menu_id = user_menu.id\n JOIN user_role\n ON user_access_menu.role_id = user_role.id\";\n\n return $this->db->query($queryAksesmenu)->result_array();\n }",
"public function abilities()\n {\n return $this->belongsToMany(Ability::class, 'pokemon_abilities', 'pokemon_id', 'ability_id')->select(['ability_id', 'name']);\n }",
"public function absences()\n {\n return $this->hasMany('App\\Models\\Absence', 'personnel_no', 'personnel_no');\n }",
"public function enterprises(): HasMany\n {\n return $this->hasMany(Enterprise::class, 'categoria_id');\n }",
"public function applicants()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_APPLICANT)->get();\n }",
"public function achievements()\n {\n return $this->hasManyThrough(Achievement::class, Profile::class);\n }",
"public function getAvailabilities()\n {\n return $this->availabilities;\n }",
"public function getAvailabilities()\n {\n return $this->availabilities;\n }",
"public function managedProperties(){\n\n /*$manager =Auth::user()->whereHas('roles', function ($query) {\n $query->where('id',1);\n })->firstOrFail();*/\n\n $manager= Auth::user();\n //dd($manager);\n\n $managedProperties = Property::whereHas('information', function ($query) use ($manager){\n $query->where('manager_id',$manager->id)->where('isApprovedManager',1);\n })->verified()->latest()->paginate(10);\n\n $title = \"My Managed Properties\";\n\n return view('frontend.pages.view-property.managed-property.index',compact('title'))->with('properties',$managedProperties);\n }",
"public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }",
"public function getAuteurs()\n {\n return $this->hasMany(Auteurs::className(), ['types_id' => 'id']);\n }",
"private function organizations(){\n $presidents = $this->base_model->getEmployee('President');\n foreach ($presidents as $key => $president) {\n $unders = $presidents[$key]['employeeUnder'] = $this->base_model->getEmployeeUnder($president[\"employeeNumber\"]);\n if(!empty($unders)){\n foreach ($unders as $underkey => $under) {\n $undersUnder = $presidents[$key]['employeeUnder'][$underkey]['employeeUnder'] = $this->base_model->getEmployeeUnder($under[\"employeeNumber\"]);\n foreach ($undersUnder as $undersunderkey => $uu) {\n $presidents[$key]['employeeUnder'][$underkey]['employeeUnder'][$undersunderkey]['employeeUnder'] = $this->base_model->getEmployeeUnder($uu[\"employeeNumber\"]);\n }\n }\n }\n }\n\n $this->response($presidents, REST_Controller::HTTP_OK);\n }",
"public function antecedents(){\n return $this->hasMany(Antecedent::class);\n }",
"public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }",
"public function getAccessoires()\n {\n if ($this->_oAccessoires === null) {\n $this->_oAccessoires = false;\n if ($oProduct = $this->getProduct()) {\n $this->_oAccessoires = $oProduct->getAccessoires();\n }\n }\n\n return $this->_oAccessoires;\n }",
"public function getAdvisors()\n {\n return $this->hasMany(Advisor::className(), ['i_ID' => 'ID']);\n }",
"public function getAchievements() { return $this->Achievements; }",
"function dir_link_roles_entity_property_info() {\n $info = array();\n $entity_info = entity_get_info('dir_role');\n foreach ($entity_info['bundles'] as $bundle => $bundle_info) {\n $info[$bundle] = array(\n 'label' => $bundle_info['label'],\n 'description' => t('@role is a role of link.', array('@role' => $bundle_info['label'])),\n 'type' => 'dir_role',\n );\n }\n\n return $info;\n}",
"public function menuItems(){\n return $this->hasMany('App\\Models\\MasterRecords\\MenuItem');\n }",
"public function getAchievementCategories() { return $this->AchievementCategories; }"
]
| [
"0.68743193",
"0.5743877",
"0.57319707",
"0.5686096",
"0.56854695",
"0.5666088",
"0.55952317",
"0.5592784",
"0.55508274",
"0.5509109",
"0.5484758",
"0.5481894",
"0.54407275",
"0.54223764",
"0.5367487",
"0.53596133",
"0.5349716",
"0.5349716",
"0.53317046",
"0.5321251",
"0.5315208",
"0.52945477",
"0.5291473",
"0.52689034",
"0.5254253",
"0.52490443",
"0.5247833",
"0.52408826",
"0.52382565",
"0.52376145"
]
| 0.7736862 | 0 |
Always unserialize coordinates attribute on retrieval. | public function getCoordinatesAttribute($coordinates)
{
return $coordinates != null ? unserialize($coordinates) : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCoordinatesAttribute($coordinates)\n {\n $this->attributes['coordinates'] = serialize($coordinates);\n }",
"public function serialize() {\n return array( \n 'lat' => $this->getLat(),\n 'lon' => $this->getLong()\n );\n }",
"public function getInternalValueAttribute()\n {\n $value = $this->data->get($this->localKey);\n if (!$this->is_serialized) {\n return $value;\n }\n \n return (@unserialize($value) ?: []);\n }",
"public function getCoordinates(): array\n {\n return $this->coordinates;\n }",
"public function getCoordinates()\n {\n return $this->coordinates;\n }",
"public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}",
"public function toArray($serialize = true)\n {\n return $this->toSerializedArray(\n $serialize,\n [\n self::LATITUDE => $this->latitude,\n self::LONGITUDE => $this->longitude,\n self::ELEVATION => $this->elevation,\n ]\n );\n }",
"public function unserialize($serialized=null){ }",
"public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->usuario,\n $this->clave,\n ) = unserialize($serialized);\n }",
"abstract protected function unSerializeData();",
"public function unserialize($serialized)\n {\n list(\n $this->id,\n $this->active,\n $this->username,\n $this->password,\n $this->places,\n $this->roles,\n $this->sharedPlaces\n ) = \\json_decode($serialized);\n }",
"public function unserialize($serialized);",
"public function unserialize($serialized);",
"public function getAsArray($serializeNestedObjects=false) {\n\n\t\treturn [\"locationLabel\"=>$this->locationLabel, \"address\"=>$this->address, \"loc\"=>array(\"type\"=>\"Point\",\"coordinates\"=>[(float)$this->longitude,(float)$this->latitude]), \"isPrimary\"=>$this->isPrimary];\n\t}",
"public function unserialize($serialized)\n {\n // older data which does not include all properties.\n $data = array_merge(unserialize($serialized), array_fill(0, 2, null));\n\n list($this->email, $this->id) = $data;\n }",
"public function getCoordinates();",
"abstract public function unserialize($serialized);",
"public function getCitiesAttribute($value){\n return unserialize($value);\n }",
"public function unserialize($serialized)\n{\n list($this->username, $this->password, $this->salt,\n $this->user_roles, $this->id) = \\json_decode(\n $serialized);\n}",
"public function toArray()\n {\n return [\n 'latitude' => $this->latitude,\n 'longitude' => $this->longitude,\n ];\n }",
"public function unsetLongitude(): void\n {\n $this->longitude = [];\n }",
"public function unserialize($serialized)\n{\n list($this->username, $this->password,\n $this->id) = json_decode(\n $serialized);\n}",
"public function unserialize($data) {}",
"public function jsonSerialize(): mixed\n {\n $position = [$this->getLng(), $this->getLat()];\n if ($this->is3d()) $position[] = $this->getAlt();\n return new \\GeoJson\\Geometry\\Point($position);\n }",
"public function jsonSerialize()\n {\n return [\n 'x' => $this->x,\n 'y' => $this->y,\n ];\n }",
"function maybe_unserialize($data)\n {\n }",
"public function unserialize($serialized)\n {\n list($this->id, $this->username, $this->password,) = unserialize($serialized);\n }",
"public function getCoords()\n\t{\n\t\treturn $this->coords;\n\t}",
"public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n\n //TODO load references with id ?\n }",
"private function updateGeoCoords()\n\t{\n\t\t// $this->attributes contains payload of the session\n\t\t// $this->handler->get_table_row() contains extended Row's field like IP and Platform\n\t\t$row = $this->handler->get_table_row();\n\t\t$current_ip = PlatformDetector::getClientIp();\n\n\t\t// define the flag for new re-detection\n\t\t// if no coordinates is set\n\t\t$should_recheck_coords = !isset($this->attributes['geo_coords']);\n\t\t// or if IP address was changed\n\t\t$should_recheck_coords |= $row && $row['ip_address'] != $current_ip;\n\n\t\tif ($should_recheck_coords) {\n\t\t\t//Log::info('Recheck GEO coords for session');\n\t\t\t// we need to update geo coordinates\n\t\t\t$coords = GeoIPLib::get_lat_lon($current_ip);\n\t\t\t$this->attributes['geo_coords'] = [\n\t\t\t\t'latitude' => $coords[0],\n\t\t\t\t'longitude' => $coords[1],\n\t\t\t];\n\t\t}\n\n\t}"
]
| [
"0.6557048",
"0.5719965",
"0.56663734",
"0.56413805",
"0.5551172",
"0.55447596",
"0.54303646",
"0.5401764",
"0.5382625",
"0.5366854",
"0.52941746",
"0.5281055",
"0.5281055",
"0.5247889",
"0.52467364",
"0.5232397",
"0.51980674",
"0.5187305",
"0.51868856",
"0.5182701",
"0.51769245",
"0.51615065",
"0.5159861",
"0.5129012",
"0.5111181",
"0.5088973",
"0.5071026",
"0.5039224",
"0.50373554",
"0.50281113"
]
| 0.7251681 | 0 |
Always serialize coordinates attribute on storage. | public function setCoordinatesAttribute($coordinates)
{
$this->attributes['coordinates'] = serialize($coordinates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCoordinatesAttribute($coordinates)\n {\n return $coordinates != null ? unserialize($coordinates) : null;\n }",
"public function serialize() {\n return array( \n 'lat' => $this->getLat(),\n 'lon' => $this->getLong()\n );\n }",
"public function jsonSerialize(): mixed\n {\n $position = [$this->getLng(), $this->getLat()];\n if ($this->is3d()) $position[] = $this->getAlt();\n return new \\GeoJson\\Geometry\\Point($position);\n }",
"public function getCoordinates()\n {\n return $this->coordinates;\n }",
"public function jsonSerialize()\n {\n return [\n 'x' => $this->x,\n 'y' => $this->y,\n ];\n }",
"public function getCoordinates(): array\n {\n return $this->coordinates;\n }",
"public function getCoordinates();",
"public function set_chain_store_coordinates() \n {\n // get all chain stores\n $chain_stores = $this->admin_model->get_all(CHAIN_STORE_TABLE);\n \n foreach ($chain_stores as $store) \n {\n if($store->longitude == 0 && $store->latitude == 0)\n {\n $data = array(\"longitude\" => 0, \"latitude\" => 0, \"id\" => $store->id);\n $coordinates = $this->geo->get_coordinates($store->city, $store->address, $store->state, $store->country);\n if($coordinates)\n {\n $data[\"longitude\"] = $coordinates[\"long\"];\n $data[\"latitude\"] = $coordinates[\"lat\"];\n }\n\n $this->admin_model->create(CHAIN_STORE_TABLE, $data);\n }\n \n }\n }",
"function setCoords($a_coords)\n\t{\n\t\t$this->coords = $a_coords;\n\t}",
"public function jsonSerialize() {\n\t\treturn $this->store;\n\t}",
"public function serialize()\n\t{\n\t\treturn serialize(array(\n\t\t\t$this->gender,\n\t\t\t($this->sociotype ? $this->sociotype->getId() : 0),\n\t\t\t$this->ageFrom,\n\t\t\t$this->ageTo,\n\t\t\t$this->locationId,\n\t\t\t$this->locationType,\n\t\t\t$this->locationTitle,\n\t\t\t$this->hasPhoto,\n\t\t));\n\t}",
"public function save_coordinates( $attachment_id, $size, $coordinates ) {\n\t\t$sizes = (array) get_post_meta( $attachment_id, $this->post_meta, true );\n\n\t\t$sizes[ $size ] = $coordinates;\n\n\t\t// save meta for all the related sizes to if were using a ratio map.\n\t\tif ( $this->use_ratio_map ) {\n\t\t\t$related_sizes = $this->get_related_sizes( $size );\n\n\t\t\t// add the same meta value to the related sizes.\n\t\t\tif ( count( $related_sizes ) ) {\n\t\t\t\tforeach ( $related_sizes as $related_size ) {\n\t\t\t\t\t$sizes[ $related_size ] = $coordinates;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tupdate_post_meta( $attachment_id, $this->post_meta, $sizes );\n\t}",
"abstract public function coordinates();",
"function amap_ma_save_object_coords($location, $object, $pluginname, $lat_g = '', $lng_g = '') {\n if ($lat_g && $lng_g) {\n $lat = $lat_g;\n $lng = $lng_g;\n } else if ($location) {\n $prefix = elgg_get_config('dbprefix');\n $coords = amap_ma_geocode_location($location);\n\n if ($coords) {\n $lat = $coords['lat'];\n $lng = $coords['long'];\n }\n }\n\n if ($lat && $lng) {\n $prefix = elgg_get_config('dbprefix');\n $object->setLatLong($lat, $lng);\n $query = \"INSERT INTO {$prefix}entity_geometry (entity_guid, geometry)\n VALUES ({$object->guid}, GeomFromText('POINT({$lat} {$lng})'))\n ON DUPLICATE KEY UPDATE geometry=GeomFromText('POINT({$lat} {$lng})')\";\n\n insert_data($query);\n\n return true;\n }\n\n return false;\n}",
"public function getCoord(){\n return $this->coord;\n }",
"public function initializePositionSaving() {}",
"public function initializePositionSaving() {}",
"public function initializePositionSaving() {}",
"public function getCoords()\n\t{\n\t\treturn $this->coords;\n\t}",
"public function savePosition() {}",
"public function setLocationAttribute($value)\n {\n $value=empty($value)?'0,0':$value;\n $this->attributes['location'] = DB::raw(\"POINT($value)\") ;\n }",
"public function afterSave()\r\n\t{\r\n\t\tif(count($this->serialAttributes)) {\r\n\t\t\tforeach($this->serialAttributes as $attribute) {\r\n\t\t\t\t$_att = $this->owner->$attribute;\r\n\t\t\t\tif(!empty($_att)\r\n\t\t\t\t && is_scalar($_att)) {\r\n\t\t\t\t\t$a = @unserialize($_att);\r\n\t\t\t\t\tif($a !== false) {\r\n\t\t\t\t\t\t$this->owner->$attribute = $a;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->owner->$attribute = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t}",
"private function updateGeoCoords()\n\t{\n\t\t// $this->attributes contains payload of the session\n\t\t// $this->handler->get_table_row() contains extended Row's field like IP and Platform\n\t\t$row = $this->handler->get_table_row();\n\t\t$current_ip = PlatformDetector::getClientIp();\n\n\t\t// define the flag for new re-detection\n\t\t// if no coordinates is set\n\t\t$should_recheck_coords = !isset($this->attributes['geo_coords']);\n\t\t// or if IP address was changed\n\t\t$should_recheck_coords |= $row && $row['ip_address'] != $current_ip;\n\n\t\tif ($should_recheck_coords) {\n\t\t\t//Log::info('Recheck GEO coords for session');\n\t\t\t// we need to update geo coordinates\n\t\t\t$coords = GeoIPLib::get_lat_lon($current_ip);\n\t\t\t$this->attributes['geo_coords'] = [\n\t\t\t\t'latitude' => $coords[0],\n\t\t\t\t'longitude' => $coords[1],\n\t\t\t];\n\t\t}\n\n\t}",
"public function toArray($serialize = true)\n {\n return $this->toSerializedArray(\n $serialize,\n [\n self::LATITUDE => $this->latitude,\n self::LONGITUDE => $this->longitude,\n self::ELEVATION => $this->elevation,\n ]\n );\n }",
"#[ReturnTypeWillChange]\n public function __serialize()\n {\n return $this->toArray();\n }",
"public function toArray()\n {\n return [\n 'latitude' => $this->latitude,\n 'longitude' => $this->longitude,\n ];\n }",
"public function __serialize() { \n $serialized = [\n 'instance_name' => $this->instance_name,\n 'local_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getLocalColumns()),\n 'referenced_columns' => array_map(fn($column) => $this->serializeColumn($column), $this->getReferencedColumns()),\n 'is_reversed_relation' => $this->is_reverse_relation,\n 'target_relation' => $this->getTargetRelation(),\n 'type' => $this->type,\n ];\n\n return $serialized;\n\n }",
"public function serialize() {}",
"public function serialize() {}",
"public function serialize() {}"
]
| [
"0.66904724",
"0.6220539",
"0.60584307",
"0.5855384",
"0.57794446",
"0.5700593",
"0.5584386",
"0.5556558",
"0.53686976",
"0.53552014",
"0.5322808",
"0.5302561",
"0.52963424",
"0.52659845",
"0.52596784",
"0.5255756",
"0.52545744",
"0.52545744",
"0.52489614",
"0.52389276",
"0.523886",
"0.52348185",
"0.52064866",
"0.51982594",
"0.51945645",
"0.5194356",
"0.51754284",
"0.51531726",
"0.51531726",
"0.5151804"
]
| 0.69275486 | 0 |
Attach full city name to property. | public function location()
{
$city = $this->city;
if ($city) {
$subdivision = $city->subdivision;
$country = $subdivision->country;
$this->attributes['location'] = $city->name . ' ' . $subdivision->abbreviation . ', ' . $country->name;
} else {
$this->attributes['location'] = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function giveCity()\n {\n return \"Luanda minha CIDADE\";\n }",
"public function getCityNameAttribute()\n {\n return $this->city->city;\n }",
"public function getCityNameAttribute()\n {\n return $this->city->name;\n }",
"protected function giveCity()\n\t{\n\t\treturn \"Orland\";\n\t}",
"function setCity($city) {\r\r\n\t\t$this->city = $city;\r\r\n\t}",
"public function setCity($newCity){\n\t}",
"public function getCityNameAttribute()\n {\n return $this->city->getCityName();\n }",
"public function setCity($city = \"\");",
"public function setCity(string $city): void\n {\n $this->_city = $city;\n }",
"public function setFullName() {\n $this->fullname = $this->name . ' ' . $this->surname . ' ' . $this->phone;\n }",
"public function getLocationNameAttribute()\n {\n return $this->hasGeoip() ? $this->geoip->country.' '.$this->geoip->city : 'undefined';\n }",
"public function setCity($city)\r\n {\r\n $this->_city = $city;\r\n }",
"public function setCity($city)\n {\n $this->json()->city = $city;\n }",
"public function getCityName()\n {\n return $this->getValue('nb_icontact_prospect_city_name');\n }",
"public function testSetGetCityName()\n {\n $cityName = 'Cologne';\n\n $location = new Location();\n\n $this->assertSame($location, $location->setCityName($cityName));\n $this->assertEquals($cityName, $location->getCityName());\n }",
"public function setCity($city)\n {\n $this->city = $city;\n }",
"public function setCity($city)\n {\n $this->city = $city;\n }",
"public function setCity($city) {\n\t\t$this->city = $city;\n\t}",
"public function city(): string\n {\n return $this->getData('CityName');\n }",
"public function getCity()\n {\n return parent::getValue('city');\n }",
"public function setCity($value) {\n\t\tself::$_city = $value;\n\t}",
"public function addNewPersonToCity()\n {\n }",
"public function getCity() :string\n {\n return $this->city;\n }",
"public function setCityName(string $city_name = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_city_name', $city_name);\n \n return $this;\n }",
"public function getCountryNameAttribute()\n {\n return $this->city->country->country;\n }",
"public function getCity(): string\n {\n return $this->result->city_name;\n }",
"public function __construct($city)\n {\n $this->city = $city;\n }",
"public function setCity($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->city !== $v) {\n\t\t\t$this->city = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::CITY;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setRecipientCityName($value)\n {\n return $this->set('RecipientCityName', $value);\n }",
"public function getCity() \n {\n return $this->city;\n }"
]
| [
"0.63906837",
"0.6195338",
"0.6177446",
"0.61548555",
"0.6044146",
"0.5957114",
"0.5931086",
"0.59091157",
"0.588481",
"0.5863296",
"0.5848821",
"0.58161545",
"0.5746712",
"0.57146925",
"0.56994116",
"0.5654224",
"0.5654224",
"0.56534785",
"0.5640592",
"0.55993",
"0.5580893",
"0.55781114",
"0.5523883",
"0.5523137",
"0.5516688",
"0.5497825",
"0.5472579",
"0.5469405",
"0.5463752",
"0.5397921"
]
| 0.65257925 | 0 |
Attach ids of amenities that belong to the property. | public function amenityIds()
{
$this->attributes['amenityIds'] = $this->amenities->pluck('id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function amenities()\n {\n return $this->belongsToMany('App\\Models\\Properties\\Amenity');\n }",
"public function amenities()\n {\n return $this->belongsToMany(\n 'App\\Amenity', 'listing_amenities', 'listing_id', 'amenity_id'\n )->select(['id', 'title', 'icon']);\n }",
"public function setAgents() {\n foreach ($this->rAgents as $value) {\n $this->agent[$value->id] = $value->id;\n }\n }",
"protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}",
"public function store(StoreAidUsersRequest $request)\n {\n if(!auth()->user()->hasPermissionTo('assign_aid_create')) $this->deny();\n\n $user = User::findOrFail($request->user_id);\n\n foreach ($request->aid_id as $id)\n $user->aids()->attach($id);\n\n return redirect()->route('admin.assign_aids.index');\n }",
"function addAttendeesIDs($attendees) {\n foreach ($attendees as &$attendee){\n $attendee = addAttendeeID($attendee);\n }\n return $attendees;\n}",
"public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }",
"function cc_insert_agencies(){\n\t\n\t// 1. recupero elenco di tutti gli immobili\n\t$args = array(\n\t 'numberposts' => -1,\n\t 'post_type' => 'property'\n\t);\n\n\t$immobili = get_posts( $args );\t\n\t\n\t// 2. loop immobili trovati\n\tif($immobili){\n\t\tforeach($immobili as $immobile){\n\t\t\t$idimmobile = (int) $immobile->ID;\n\t\t\t$rif = (string) get_post_meta($idimmobile, \"fave_property_id\", true);\n\t\t\t\n\t\t\techo $idimmobile . \" => \" . $rif;\n\t\t\t\n\t\t\t// 3. richiamo cc_get_agency passando codice immobile, questo mi resistuisce agente, agenzia e user del record\n\t\t\t$aau = cc_get_agency($rif);\n\t\t\t\n\t\t\tif(!empty($aau['fave_property_agency'])) update_post_meta($idimmobile, 'fave_property_agency', $aau['fave_property_agency']);\n\t\t\tif(!empty($aau['fave_agents'])) update_post_meta($idimmobile, 'fave_agents', $aau['fave_agents']);\n\t\t\tif(!empty($aau['post_author'])){\n\t\t\t\t\n\t\t\t\t$arg = array(\n\t\t\t\t\t'ID' => $idimmobile,\n\t\t\t\t\t'post_author' => $aau['post_author'],\n\t\t\t\t);\n\t\t\t\twp_update_post( $arg );\t\t\t\t\n\t\t\t\t\n\t\t\t} // end if post_author\t\t\n\t\t\t\n\t\t\techo \" agenzia: \".$aau['fave_property_agency']. \" - agente: \" . $aau['fave_agents'] . \" - author: \" . $aau['post_author'] . \"<br>\\n\";\n\t\t\t\n\t\t} // end foreach\n\t\t$n = count($immobili);\n\t\techo \"Updated \".$n.\" properties.\";\n\t\tdie();\n\t} // end if immobili\t\t\n\t\n}",
"public function setIds($arrIds);",
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"public function setMultipleWishlistId($id);",
"public function updateRelation($roles,$id){\n $this->removeRoles();\n \n foreach($roles as $role) {\n switch($role)\n {\n // Admin\n case 1:\n $this->attachRole(Role::find(1));\n break;\n\n // Manager \n case 2:\n $manager = array('manager_id' => $id);\n DB::table('manager_user')->insert($manager);\n $this->attachRole(Role::find(2));\n break;\n\n // Member \n case 3:\n $member = array('member_id' => $id);\n DB::table('member_user')->insert($member);\n $this->attachRole(Role::find(3));\n break;\n\n default:\n break;\n } \n }\n \n }",
"public function save() {\n foreach($this->getMenuItems() as $item){\n $item->setMenu($this);\n $item->save();\n }\n parent::save();\n }",
"public function relatedIdItems()\n {\n $query = Menu::find();\n if ($this->menuRelatedType != self::ALL_MENU_TYPES) {\n $query->andWhere(['type' => $this->menuRelatedType]);\n }\n if ($this->menuRelatedLevel != self::ALL_MENU_LEVELS) {\n $query->andWhere(['level' => $this->menuRelatedLevel]);\n }\n\n $relatedIdnotin = [];\n\n if ($this->relatedType == ArticleType::RELATE_MENU_UNIQUE) {\n $relatedIdnotin = ArticleRelate::find()->select('related_id')->where(['type_id' => ArticleType::RELATE_MENU_UNIQUE])->column();\n }\n\n // exclude related id for edit themself\n if ($this->scenario == self::SCENARIO_EDIT && $this->relatedId) {\n unset($relatedIdnotin[array_search($this->relatedId, $relatedIdnotin)]);\n }\n\n if ($relatedIdnotin) {\n $query->andWhere(['not in', 'id', $relatedIdnotin]);\n }\n\n $items = ArrayHelper::map($query->asArray()->all(), 'id', 'title');\n return $items;\n }",
"public function setMenus(Request $request){\n\n $this->validate($request,[\n 'menus' => 'required|array',\n 'paciente_id' => 'required'\n ]);\n\n $paciente = $request->input('paciente_id');\n $menus = $request->input('menus');\n foreach ($menus as $menu ){\n DB::table('det_pac_men')->insert(\n ['menu_id' => $menu, 'paciente_id' => $paciente]\n );\n }\n return response()->json([\n 'status' => 'OK',\n 'code' => 200,\n 'result' => \"Se asigno menu\"\n ],200)\n ->header('Access-Control-Allow-Origin','*')\n ->header('Content-Type', 'application/json');\n\n }",
"protected static function addOrEditPropertiesToDB($properties)\n {\n\n if (is_array($properties) && !empty($properties)) {\n foreach ($properties['properties'] as $property) {\n $checkExistence = DB::select(\n \"SELECT `property_id` FROM `apimo_properties` WHERE property_id = ?\",\n [$property['id']]\n );\n if (empty($checkExistence)) {\n DB::insert(\n 'INSERT INTO `apimo_properties` ( `property_id`, `agency`, `reference`, `status`, `user`, `step`, `parent`, `category`, `subcategory`, `name`, `type`, `subtype`, `agreement`, `block_name`, `address`, `address_more`, `publish_address`, `country`, `city`, `district`, `longitude`, `latitude`, `radius`, `area_unit`, `area_surface`, `rooms`, `bedrooms`, `sleeps`, `price`, `price_max`, `price_period`, `price_currency`, `residence`, `view`, `landscape`, `floor`, `heating`, `water`, `condition`, `standing`, `style`, `construction_year`, `renovation_year`, `available_at`, `delivered_at`, `activities`, `orientations`, `services`, `proximities`, `tags`, `tags_customized`, `pictures`, `areas`, `regulations`, `created_at`, `updated_at`)\n VALUES ( :property_id, :agency, :reference, :status, :user, :step, :parent, :category, :subcategory, :name, :type, :subtype, :agreement, :block_name, :address, :address_more, :publish_address, :country, :city, :district, :longitude, :latitude, :radius, :area_unit, :area_surface, :rooms, :bedrooms, :sleeps, :price, :price_max, :price_period, :price_currency, :residence, :view, :landscape, :floor, :heating, :water, :condition, :standing, :style, :construction_year, :renovation_year, :available_at, :delivered_at, :activities, :orientations, :services, :proximities, :tags, :tags_customized, :pictures, :areas, :regulations, :created_at, :updated_at)',\n [\n 'property_id' => $property['id'],\n 'agency' => $property['user']['agency'],\n 'reference' => $property['reference'],\n 'status' => $property['status'],\n 'user' => $property['user']['id'],\n 'step' => $property['step'],\n 'parent' => $property['parent'],\n 'category' => $property['category'],\n 'subcategory' => $property['subcategory'],\n 'name' => $property['name'],\n 'type' => $property['type'],\n 'subtype' => $property['subtype'],\n 'agreement' => $property['agreement']['type'],\n 'block_name' => $property['block_name'],\n 'address' => $property['address'],\n 'address_more' => $property['address_more'],\n 'publish_address' => $property['publish_address'],\n 'country' => $property['country'],\n 'city' => self::addOrUpdateCity($property['city']),\n 'district' => self::addOrUpdateDistrict($property['district']),\n 'longitude' => $property['longitude'],\n 'latitude' => $property['latitude'],\n 'radius' => $property['radius'],\n 'area_unit' => $property['area']['unit'],\n 'area_surface' => ((!empty($property['area']['value']) || !empty($property['area']['total'])) ? (($property['area']['value'] < $property['area']['total']) ? $property['area']['total'] : $property['area']['value']) : 0),\n 'rooms' => $property['rooms'],\n 'bedrooms' => $property['bedrooms'],\n 'sleeps' => $property['sleeps'],\n 'price' => ((isset($property['price']['value']) && !empty($property['price']['value'])) ? $property['price']['value'] : 0),\n 'price_max' => ((isset($property['price']['max']) && !empty($property['price']['max'])) ? $property['price']['max'] : 0),\n 'price_period' => ((isset($property['price']['period']) && !empty($property['price']['period'])) ? $property['price']['period'] : ''),\n 'price_currency' => ((isset($property['price']['currency'])) ? $property['price']['currency'] : ''),\n 'residence' => self::addOrUpdateResidence($property['residence']),\n 'view' => self::addOrUpdateView($property['view'], $property['id']),\n 'landscape' => (!empty($property['view']['landscape']) ? implode(',', $property['view']['landscape']) : ''),\n 'floor' => self::addOrUpdateFloor($property['floor'], $property['id']),\n 'heating' => self::addOrUpdateHeating($property['heating'], $property['id']),\n 'water' => self::addOrUpdateWater($property['water'], $property['id']),\n 'condition' => $property['condition'],\n 'standing' => $property['standing'],\n 'style' => $property['style']['name'],\n 'construction_year' => $property['construction_year'],\n 'renovation_year' => $property['renovation_year'],\n 'available_at' => $property['available_at'],\n 'delivered_at' => $property['delivered_at'],\n 'activities' => (!empty($property['activities']) ? implode(\n ',',\n $property['activities']\n ) : ''),\n 'orientations' => (!empty($property['orientations']) ? implode(\n ',',\n $property['orientations']\n ) : ''),\n 'services' => (!empty($property['services']) ? implode(',', $property['services']) : ''),\n 'proximities' => (!is_null($property['proximities']) ? implode(\n ',',\n $property['proximities']\n ) : ''),\n 'tags' => (!empty($property['tags']) ? implode(',', $property['tags']) : ''),\n 'tags_customized' => (!empty($property['tags_customized']) ? implode(\n ',',\n $property['tags_customized']\n ) : ''),\n 'pictures' => self::addOrUpdatePictures($property['pictures']),\n 'areas' => self::addOrUpdateAreas($property['areas'], $property['id']),\n 'regulations' => self::addOrUpdateRegulations($property['regulations'], $property['id']),\n 'created_at' => $property['created_at'],\n 'updated_at' => $property['updated_at'],\n ]\n );\n self::addOrUpdateUser($property['user']);\n self::addOrUpdateComments($property['comments'], $property['id']);\n self::setPropertyHash($property);\n } else {\n if (self::checkPropertyUpdateByHash($property)) {\n DB::update(\n 'UPDATE `apimo_properties` SET \n `agency`= :agency, \n `reference`= :reference, \n `status`= :status, \n `user` = :user, \n `step` = :step, \n `parent` = :parent, \n `category` = :category, \n `subcategory` = :subcategory, \n `name` = :name, \n `type` = :type, \n `subtype` = :subtype,\n `agreement` = :agreement, \n `block_name` = :block_name, \n `address` = :address, \n `address_more` = :address_more, \n `publish_address` = :publish_address, \n `country` = :country, \n `city` = :city, \n `district` = :district, \n `longitude` = :longitude, \n `latitude` = :latitude, \n `radius` = :radius, \n `area_unit` = :area_unit, \n `area_surface` = :area_surface, \n `rooms` = :rooms, \n `bedrooms` = :bedrooms, \n `sleeps` = :sleeps, \n `price` = :price, \n `price_max` = :price_max, \n `price_period` = :price_period, \n `price_currency` = :price_currency, \n `residence` = :residence, \n `view` = :view, \n `landscape = :landscape, \n `floor` = :floor, \n `heating` = :heating, \n `water` = :water, \n `condition` = :condition, \n `standing` = :standing, \n `style` = :style, \n `construction_year` = :construction_year, \n `renovation_year` = :renovation_year, \n `available_at` = :available_at, \n `delivered_at` = :delivered_at, \n `activities` = :activities, \n `orientations` = :orientations, \n `services` = :services, \n `proximities` = :proximities, \n `tags` = :tags, \n `tags_customized` = :tags_customized, \n `pictures` = :pictures, \n `areas` = :areas, \n `regulations` =:regulations,\n `created_at` = :created_at, \n `updated_at` = :updated_at \n WHERE property_id = :property_id',\n [\n 'property_id' => $property['id'],\n 'agency' => $property['user']['agency'],\n 'reference' => $property['reference'],\n 'status' => $property['status'],\n 'user' => $property['user']['id'],\n 'step' => $property['step'],\n 'parent' => $property['parent'],\n 'category' => $property['category'],\n 'subcategory' => $property['subcategory'],\n 'name' => $property['name'],\n 'type' => $property['type'],\n 'subtype' => $property['subtype'],\n 'agreement' => $property['agreement']['type'],\n 'block_name' => $property['block_name'],\n 'address' => $property['address'],\n 'address_more' => $property['address_more'],\n 'publish_address' => $property['publish_address'],\n 'country' => $property['country'],\n 'city' => self::addOrUpdateCity($property['city']),\n 'district' => self::addOrUpdateDistrict($property['district']),\n 'longitude' => $property['longitude'],\n 'latitude' => $property['latitude'],\n 'radius' => $property['radius'],\n 'area_unit' => $property['area']['unit'],\n 'area_surface' => ((!empty($property['area']['value']) || !empty($property['area']['total'])) ? (($property['area']['value'] < $property['area']['total']) ? $property['area']['total'] : $property['area']['value']) : 0),\n 'rooms' => $property['rooms'],\n 'bedrooms' => $property['bedrooms'],\n 'sleeps' => $property['sleeps'],\n 'price' => ((isset($property['price']['value']) && !empty($property['price']['value'])) ? $property['price']['value'] : 0),\n 'price_max' => ((isset($property['price']['max']) && !empty($property['price']['max'])) ? $property['price']['max'] : 0),\n 'price_period' => ((isset($property['price']['period']) && !empty($property['price']['period'])) ? $property['price']['period'] : ''),\n 'price_currency' => ((isset($property['price']['currency'])) ? $property['price']['currency'] : ''),\n 'residence' => self::addOrUpdateResidence($property['residence']),\n 'view' => self::addOrUpdateView($property['view'], $property['id']),\n 'landscape' => (!empty($property['view']['landscape']) ? implode(',', $property['view']['landscape']) : ''),\n 'floor' => self::addOrUpdateFloor($property['floor'], $property['id']),\n 'heating' => self::addOrUpdateHeating($property['heating'], $property['id']),\n 'water' => self::addOrUpdateWater($property['water'], $property['id']),\n 'condition' => $property['condition'],\n 'standing' => $property['standing'],\n 'style' => $property['style']['name'],\n 'construction_year' => $property['construction_year'],\n 'renovation_year' => $property['renovation_year'],\n 'available_at' => $property['available_at'],\n 'delivered_at' => $property['delivered_at'],\n 'activities' => (!empty($property['activities']) ? implode(\n ',',\n $property['activities']\n ) : ''),\n 'orientations' => (!empty($property['orientations']) ? implode(\n ',',\n $property['orientations']\n ) : ''),\n 'services' => (!empty($property['services']) ? implode(\n ',',\n $property['services']\n ) : ''),\n 'proximities' => (!is_null($property['proximities']) ? implode(\n ',',\n $property['proximities']\n ) : ''),\n 'tags' => (!empty($property['tags']) ? implode(\n ',',\n $property['tags']\n ) : ''),\n 'tags_customized' => (!empty($property['tags_customized']) ? implode(\n ',',\n $property['tags_customized']\n ) : ''),\n 'pictures' => self::addOrUpdatePictures($property['pictures']),\n 'areas' => self::addOrUpdateAreas($property['areas'], $property['id']),\n 'regulations' => self::addOrUpdateRegulations($property['regulations'], $property['id']),\n 'created_at' => $property['created_at'],\n 'updated_at' => $property['updated_at'],\n ]\n );\n self::addOrUpdateUser($property['user']);\n self::addOrUpdateComments($property['comments'], $property['id']);\n }\n }\n }\n }\n self::setSyncLastTime();\n }",
"public function add_post(Request $request)\n {\n\n $propertylists = new PropertyList;\n $propertylists->user_id = 1; \n $propertylists->name =$request->property_title; \n $propertylists->category_id =$request->property_category; \n $propertylists->type_id =$request->property_type; \n $propertylists->prize =$request->property_prize; \n $propertylists->building_area =$request->building_area;\n $propertylists->building_unit_id=$request->building_unit; \n $propertylists->land_area =$request->land_area; \n $propertylists->land_unit_id=$request->land_unit; \n $propertylists->bedroom =$request->bedroom; \n $propertylists->bathroom =$request->bathroom; \n $propertylists->location =$request->location; \n $propertylists->status =1;\n $tableStatus = DB::select(\"SHOW TABLE STATUS LIKE '\".DB::getTablePrefix().\"propertys'\");\n if (empty($tableStatus)) {\n throw new \\Exception(\"Table not found\");\n }else\n {\n $nextId = $tableStatus[0]->Auto_increment; \n $propertylists->uid=(10000+$nextId);\n\n try{\n $propertylists->save();\n $id = $propertylists->id;\n if($request->input('amenities')){\n $propertylists->amineties()->attach($request->input('amenities'));\n }\n if($request->input('neighbourhood') && $request->input('km')){\n $kmvalue=array_filter($request->input('km'));\n $kmvalue=array_values($kmvalue);\n foreach (array_combine($request->input('neighbourhood') , $kmvalue) as $neighbourhood => $km){\n $propertylists->neighbourhoods()->attach($neighbourhood, ['kilometer' => $km]);\n } \n }\n if(Session::get('country_id')){\n // foreach (array_combine($request->hidlang , $request->description) as $language => $description){\n // $propertylists->countrylangs()->attach($language, ['country_id' => $request->countries,'description' => $description]);\n // }\n }\n if($request->file('images')){\n foreach ($request->file('images') as $gimage) {\n $extension = $gimage->getClientOriginalExtension();\n $imagename = time().'_' . rand(100, 999) .'.'.$extension;\n $destinationPath = public_path() . \"/images/properties/\";\n $gimage->move($destinationPath, $imagename);\n $propertylists->images4property()->attach($imagename, ['is_featured' => 0]);\n }\n }\n\n $request->session()->flash('val', 1);\n $request->session()->flash('msg', \"Property created successfully !\");\n return response()->json(['status'=>true,'url'=>URL('/property/post/'),'csrf' => csrf_token()]);\n }\n\n\n catch (Exception $ex) {\n $request->session()->flash('val', 0);\n $request->session()->flash('msg', \"Property not created successfully.\".$e->getMessage()); \n return response()->json(['status'=>false,'csrf' => csrf_token()]);\n }\n\n }\n \n \n\n }",
"protected function addAmenities($remote_id, $item)\n {\n if(!empty($item['amenities']))\n {\n $amenities = array_filter(explode(',', $item['amenities']));\n foreach($amenities as $amenity)\n {\n $body = trim($amenity);\n $this->amenities[$remote_id][] = [\n 'item' => $body,\n 'created_at' => $this->date,\n 'updated_at' => $this->date\n ];\n }\n }\n }",
"public function massOtherroomIdAction()\n {\n $equipmentIds = $this->getRequest()->getParam('equipment');\n if (!is_array($equipmentIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('Please select equipments.')\n );\n } else {\n try {\n foreach ($equipmentIds as $equipmentId) {\n $equipment = Mage::getSingleton('bs_logistics/equipment')->load($equipmentId)\n ->setOtherroomId($this->getRequest()->getParam('flag_otherroom_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d equipments were successfully updated.', count($equipmentIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('There was an error updating equipments.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }",
"private function setAdmins($ids,$log=false){\n \t$adminPermission = $this->getAdminPermission();\n \tforeach ($ids as $id)\n \t\tNewDao::getInstance()->insert('user_permissions',array('user_id'=>$id,'permission_id'=>$adminPermission),$log);\n }",
"public function update(PropertyAsigmentRequest $request, $id)\n {\n $property_assigment = Property_assigment::create($request, $id);\n\n\n flash('Elemento guardado');\n return redirect('/admin/seguimiento-asesores');\n }",
"public function setIdPROVEEDORES($idPROVEEDORES){\n $this->idPROVEEDORES = $idPROVEEDORES;\n }",
"public function attachMatkul(){\n return Mahasiswa::find(1)->mata_kuliah()->attach([3,4,6]);\n }",
"protected function populateInstanceActionIds()\n {\n populateActiveIds($this->instanceActiveIdHash, $this->instanceIdsIdentifier);\n\n // Same, for per-edah filter.\n if ($this->activeEdotFilterTable) {\n $multiColName = $this->activeEdotFilterTable;\n populateActiveIds($this->activeEdotHash, $multiColName);\n }\n }",
"public function initAssignedPrayersRelatedByAgentId($overrideExisting = true)\n {\n if (null !== $this->collAssignedPrayersRelatedByAgentId && !$overrideExisting) {\n return;\n }\n $this->collAssignedPrayersRelatedByAgentId = new ObjectCollection();\n $this->collAssignedPrayersRelatedByAgentId->setModel('\\AssignedPrayer');\n }",
"function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }",
"public function addFeatures(Request $request) {\n\n Log::info($request->all());\n\n //validate\n $validator = Validator::make($request->all(), [\n 'property_id' => \"required\",\n 'ids' => 'required'\n ], \n [\n \"property_id.required\" => \"Invalid Request, Incomplete Parameter\"\n ])->validate(); \n\n $property = Property::find($request->property_id);\n \n if(is_null($property)) {\n return redirect()->back()->with(\"error\", \"Property Not Found\");\n }\n\n $idsArray = preg_split(\"/[,]/\", $request->ids);\n array_pop($idsArray); //deletes the last'','\n Log::info(\"idsArray \");\n Log::info($idsArray);\n\n\n $superArray = [];\n\n foreach ($idsArray as $key => $value) {\n //create it when it's not there already for the property\n PropertyFeature::firstOrCreate([\n \"property_id\" => $property->id,\n \"feature_id\" => $value\n ]);\n }\n\n return redirect()->back()->with(\"success\", \"Property Features Updated Successfully\");\n }",
"public function attachRoles($roles);",
"public function set_id($ids) {\n $this->id = $ids; \n }",
"function setMenuItem(){\n\n $totalMenuItem=count($this->html->find('b')); // total number of menu items in the webpage\n $allMenuName=$this->html->find('b'); // array of objects of all b tag for item name\n $allMenuDetails=$this->html->find('span[itemprop=\"description\"]'); // array of objects of all span of itemproperty description\n $allMenuPrice=$this->html->find('span.price'); // array of objects of all span with class price\n $phone=$this->html->find('span[itemprop=\"telephone\"]')[0]->innertext; // string\n $address=$this->html->find('span[itemprop=\"streetAddress\"]')[0]->innertext.' , '\n .$this->html->find('span[itemprop=\"addressLocality\"]')[0]->innertext; // string concated restaurant address\n\n for ($i=0; $i<$totalMenuItem; $i++){\n \n $price=$this->stringModifier->modifyString($allMenuPrice[$i]->innertext); //remove currency sign from price\n $this->saveMenuItems($totalMenuItem,$allMenuName[$i]->innertext,$allMenuDetails[$i]->innertext,\n $price,NULL,webPageUrlThree,$phone,$address); // save data in the database\n \n } // loop ends\n \n }"
]
| [
"0.59695023",
"0.5592355",
"0.5519928",
"0.50788265",
"0.4984267",
"0.49646252",
"0.49623868",
"0.49561778",
"0.49453518",
"0.49078664",
"0.48412922",
"0.4839164",
"0.48146242",
"0.47847247",
"0.4768297",
"0.4761813",
"0.4747934",
"0.47055477",
"0.46936214",
"0.46753767",
"0.4638202",
"0.4610322",
"0.45928225",
"0.4589798",
"0.45742112",
"0.45679358",
"0.45463794",
"0.4545888",
"0.4529759",
"0.45160666"
]
| 0.71790624 | 0 |
Attach ids of utilities that belong to the property. | public function utilityIds()
{
$this->attributes['utilityIds'] = $this->utilities->pluck('id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function utilities()\n {\n return $this->belongsToMany('App\\Models\\Properties\\Utility');\n }",
"function set_properties_by_id () {\n\t\t$stm = DB::$pdo->prepare(\"select * from `generated_object` where `id`=:id\");\n\t\t$stm->bindParam(':id', $this->id);\n\t\t$stm->execute();\n\t\t$res = $stm->fetch();\n\n\t\t$this->set_properties_by_array($res);\n\t}",
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"public static function getIDProperties()\n {\n return static::$ids;\n }",
"public function amenityIds()\n {\n $this->attributes['amenityIds'] = $this->amenities->pluck('id');\n }",
"public function addUtility($adsUtility) {\n $this->adsUtilities[$adsUtility] = $adsUtility;\n }",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"function attach_repository_id(&$value, $key, $id){\n $value['repo_id'] = $id;\n}",
"protected function getUIDAsProperty()\n {\n $builder = self::builder('uid');\n return $builder->setValue($this->checkSetUID())->build();\n }",
"public function duplicate_tools($tools_id){\n\t\t$tools = $this->db->query(\"SELECT * FROM integration_tools WHERE id=\". (int)$tools_id)->row_array();\n\t\t// append duplicate keyword in name\n\t\t$tools['name'] = $tools['name'] .\" - Duplicate\";\n\n\t\t// update created date\n\t\t$tools['created_at'] = date(\"Y-m-d H:i:s\");\n\n\t\t// remove primary key value. bcoz can't duplicate\n\t\tunset($tools['id']);\n\n\t\t// create new records & get new created id (primary key)\n\t\t$this->db->insert(\"integration_tools\", $tools);\n\t\t$new_tool_id = $this->db->insert_id();\n\n\n\t\t// Tools record store in two table so we need to copy second table records also....\n\t\t// Find The Record from integration_tools_ads table by tools id Note Records can be more thana one\n\t\t$tools_ads = $this->db->query(\"SELECT * FROM integration_tools_ads WHERE tools_id=\". (int)$tools_id)->result_array();\n\t\t\n\t\tforeach ($tools_ads as $key => $ads) {\n\t\t\t// remove primary key value. bcoz can't duplicate\n\t\t\tunset($ads['id']);\n\n\t\t\t// add new tools id\n\t\t\t$ads['tools_id'] = $new_tool_id;\n\n\t\t\t// copy images if banner\n\t\t\tif($ads['ads_type'] == 'banner'){\n\t\t\t\t$base_path = \"assets/integration/uploads/{$tools_id}/\";\n\t\t\t\t$new_base_path = \"assets/integration/uploads/{$new_tool_id}/\";\n\t\t\t\tif (!file_exists($new_base_path)) { mkdir($new_base_path, 0777, true); }\n\n\t\t\t\t$base_path .= $ads['value'];\n\t\t\t\t$new_base_path .= $ads['value'];\n\t\t\t\tcopy($base_path, $new_base_path);\n\t\t\t}\n\n\t\t\t// create new records & get new created id (primary key)\n\t\t\t$this->db->insert(\"integration_tools_ads\", $ads);\n\t\t}\n\t}",
"private function buildIds(){\n\n\t\t$string = 'data-id=\"'.$this->fullId.'\" ';\n\t\t$string .= 'data-column_id=\"'.$this->id.'\" ';\n\t\t$string .= 'data-section_id=\"'.$this->section_id.'\" ';\n\t\t$string .= 'data-post_id=\"'.$this->post_id.'\" ';\n\n\t\treturn $string;\n\t}",
"public function attachMatkul(){\n return Mahasiswa::find(1)->mata_kuliah()->attach([3,4,6]);\n }",
"public function test_setupids() {\n $ratings = array();\n $ratings[1] = new \\stdClass();\n $ratings[1]->userid = 3;\n $ratings[1]->choiceid = 1;\n $ratings[1]->rating = 5;\n\n $ratings[2] = new \\stdClass();\n $ratings[2]->userid = 3;\n $ratings[2]->choiceid = 2;\n $ratings[2]->rating = 3;\n\n $ratings[3] = new \\stdClass();\n $ratings[3]->userid = 2;\n $ratings[3]->choiceid = 1;\n $ratings[3]->rating = 5;\n\n $ratings[4] = new \\stdClass();\n $ratings[4]->userid = 2;\n $ratings[4]->choiceid = 2;\n $ratings[4]->rating = 2;\n\n $usercount = 2;\n list($fromuserid, $touserid, $fromchoiceid, $tochoiceid) = \\solver_edmonds_karp::setup_id_conversions($usercount, $ratings);\n\n $this->assertEquals(array(3 => 1, 2 => 2), $fromuserid);\n $this->assertEquals(array(1 => 3, 2 => 2), $touserid);\n\n $this->assertEquals(array(1 => 3, 2 => 4), $fromchoiceid);\n $this->assertEquals(array(3 => 1, 4 => 2), $tochoiceid);\n }",
"public static function officeIds()\n {\n return collect([\n AdminOffice::all()->first()->office_id,\n Auth::user()->office_id,\n ])->unique();\n }",
"function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}",
"protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }",
"public function setNameAndId() {}",
"public function getIds()\n {\n\n }",
"function setUpTargets(){\r\n\t\t$pupils = $this->Query(\"SELECT id FROM pupils\");\r\n\t\t$sql = '';\r\n\t\tforeach($pupils as $k=>$v){\r\n\t\t\t$sql .= 'INSERT INTO pupils_targets VALUES(NULL,1,'.$v['pupils']['id'].');';\r\n\t\t}\r\n\t\t$this->Query($sql);\r\n\t}",
"private function addIdentityFieldsToUser()\n {\n\n /** @var CrudService $service */\n $service = $this->container->get('shopware_attribute.crud_service');\n\n foreach (self::PROVIDERS as $provider) {\n $service->update('s_user_attributes', strtolower($provider) . '_identity', 'string', [\n 'label' => 'Identity ' . $provider,\n\n //user has the opportunity to translate the attribute field for each shop\n 'translatable' => false,\n\n //attribute will be displayed in the backend module\n 'displayInBackend' => true,\n\n //in case of multi_selection or single_selection type, article entities can be selected,\n 'entity' => Customer::class,\n\n //numeric position for the backend view, sorted ascending\n 'position' => 100,\n\n //user can modify the attribute in the free text field module\n 'custom' => false,\n ]);\n }\n\n $models = $this->container->get('models');\n $metaDataCache = $models->getConfiguration()->getMetadataCacheImpl();\n $metaDataCache->deleteAll();\n $models->generateAttributeModels(['s_user_attributes']);\n }",
"function getArticleUids() \t{\n \t\treturn $this->articles_uids;\n \t}",
"public function idsDataProvider() {\n $data['ids'] = [\n 'configuration' => [\n 'ids' => [\n 'id',\n 'paragraph',\n ],\n ],\n 'expected' => [\n 'id' => [\n 'type' => 'string',\n ],\n 'paragraph' => [\n 'type' => 'string',\n ],\n ],\n ];\n return $data;\n }",
"protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}",
"protected function populateInstanceActionIds()\n {\n populateActiveIds($this->instanceActiveIdHash, $this->instanceIdsIdentifier);\n\n // Same, for per-edah filter.\n if ($this->activeEdotFilterTable) {\n $multiColName = $this->activeEdotFilterTable;\n populateActiveIds($this->activeEdotHash, $multiColName);\n }\n }",
"public function setGlobalUuids($uuids);",
"public function getUtilisateurs();",
"private function computeIdentifierAttribute(): void\n {\n $data = $this->content->jsonSerialize();\n $this->attributes['data-bb-identifier'] = str_replace('\\\\', '/', $data['type']) . '(' . $data['uid'] . ')';\n }",
"public static function bootUuids()\n {\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::creating(function ($model) {\n $model->{$model->getKeyName()} = (string)Uuid::generate();\n });\n\n /**\n * Attach to the 'creating' Model Event to provide a UUID\n * for the `id` field (provided by $model->getKeyName())\n */\n static::pivotAttaching(function ($model, $pivotRelation, $pivotIds, $pivotIdsAttributes) {\n $pivotRelation->attributes['id'] = (string)Uuid::generate();\n });\n\n }",
"protected function addAdditionalIdentityPropertiesIfNeeded() {}",
"function addAttendeesIDs($attendees) {\n foreach ($attendees as &$attendee){\n $attendee = addAttendeeID($attendee);\n }\n return $attendees;\n}"
]
| [
"0.5778601",
"0.5004662",
"0.49143374",
"0.47113052",
"0.46814117",
"0.46080622",
"0.4601683",
"0.45984155",
"0.45729363",
"0.45483688",
"0.45133397",
"0.45086017",
"0.4493528",
"0.44639462",
"0.4408339",
"0.4395268",
"0.4361364",
"0.43528295",
"0.4346339",
"0.4341085",
"0.43277693",
"0.43240348",
"0.43217227",
"0.43144715",
"0.4307458",
"0.43065324",
"0.43012437",
"0.4288181",
"0.42853534",
"0.4275024"
]
| 0.7843064 | 0 |
Attach a total count of reviews that belong to the property. | public function reviewCount()
{
$this->attributes['review_count'] = $this->reviews()->selectRaw('count(*) as count')->pluck('count')[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function reviewsCount()\n {\n return count($this->reviews);\n }",
"private function _addReviewsCount(& $collection, $reviews_count_alias=\"sm_reviews_count\", $rating_summary_alias=\"sm_rating_summary\" ){\r\n\t\t$review_summary_table = Mage::getSingleton('core/resource')->getTableName('review/review_aggregate');\r\n\t\t$collection->getSelect()->joinLeft(\r\n\t\t\tarray(\"rs_table\" => $review_summary_table),\r\n\t\t\t\"e.entity_id = rs_table.entity_pk_value AND rs_table.store_id=\" . $this->getStoreId(),\r\n\t\t\tarray(\r\n\t\t\t\t$reviews_count_alias => \"rs_table.reviews_count\",\r\n\t\t\t\t$rating_summary_alias => \"rs_table.rating_summary\"\r\n\t\t\t)\r\n\t\t);\r\n\t}",
"private function _addReviewsCount(& $collection, $reviews_count_alias = \"sm_reviews_count\", $rating_summary_alias = \"sm_rating_summary\")\r {\r\r $review_summary_table = Mage::getSingleton('core/resource')->getTableName('review/review_aggregate');\r\r $collection->getSelect()->joinLeft(\r\r array(\"rs_table\" => $review_summary_table),\r\r \"e.entity_id = rs_table.entity_pk_value AND rs_table.store_id=\" . $this->getStoreId(),\r\r array(\r\r $reviews_count_alias => \"rs_table.reviews_count\",\r\r $rating_summary_alias => \"rs_table.rating_summary\"\r\r )\r\r );\r\r }",
"private function _addReviewsCount(& $collection, $reviews_count_alias=\"sm_reviews_count\", $rating_summary_alias=\"sm_rating_summary\" ){\r\n\t\t$review_summary_table = Mage::getSingleton('core/resource')->getTableName('review/review_aggregate');\r\n\t\t$collection->getSelect()->joinLeft(\r\n\t\t\t\tarray(\"rs_table\" => $review_summary_table),\r\n\t\t\t\t\"e.entity_id = rs_table.entity_pk_value AND rs_table.store_id=\" . $this->getStoreId(),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t\t$reviews_count_alias => \"rs_table.reviews_count\",\r\n\t\t\t\t\t\t$rating_summary_alias => \"rs_table.rating_summary\"\r\n\t\t\t\t)\r\n\t\t);\r\n\t}",
"public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }",
"public function updateCommentCount()\n {\n $this->comment_count = $this->comments()->count();\n\n $this->save();\n }",
"public function getCountNewReviews(): int\n {\n return ShopFeedbackEntity::find()\n ->leftJoin('user', 'user.id = shop_feedback.created_by')\n ->where([\n 'shop_feedback.shop_id' => Yii::$app->user->identity->getId(),\n 'shop_feedback.status' => ShopFeedbackEntity::STATUS_UNREAD,\n 'user.status' => UserEntity::STATUS_VERIFIED,\n 'user.is_deleted' => 0\n ])\n ->count();\n }",
"public function getReviewInfoCount()\n {\n return $this->count(self::review_info);\n }",
"private function incrementFavoriteCount()\n {\n $counter = $this->favoriteCounter()->first();\n\n if ($counter) {\n $counter->count++;\n $counter->save();\n } else {\n $counter = new FavoriteCounter;\n $counter->count = 1;\n $this->favoriteCounter()->save($counter);\n }\n }",
"public function incrementVoteCount()\n {\n $this->setVotesCount( $this->getVotesCount() + 1 );\n }",
"static function addReview($bookingId, $hotelId, $rating, $comment)\n {\n $db = DB::getConnection();\n try {\n $st = $db->prepare('INSERT INTO projekt_reviews(id_booking, id_user, name_user, id_hotel, name_hotel, rating, comment) VALUES (:id_booking, :id_user, :name_user, :id_hotel, :name_hotel, :rating, :comment)');\n $st->execute(array('id_booking' => $bookingId, 'id_user' => $_SESSION['user']->getId(), 'name_user' => $_SESSION['user']->getName(), 'id_hotel' => $hotelId, 'name_hotel' => Hotel::find($hotelId)->getName(), 'rating' => $rating, 'comment' => $comment));\n } catch (PDOException $e) {\n exit(\"PDO error [insert projekt_users]: \" . $e->getMessage());\n }\n try {\n echo $rating;\n $st = $db->prepare('UPDATE projekt_hotels SET rating = (rating * number_of_comments + :rating)/(number_of_comments + 1), number_of_comments = number_of_comments + 1 WHERE id = :id_hotel');\n $st->execute(array('id_hotel' => $hotelId, 'rating' => $rating));\n } catch (PDOException $e) {\n exit(\"PDO error [UPDATE projekt_hotels]: \" . $e->getMessage());\n }\n }",
"private function incrementFavoriteCount()\n\t{\n\t\t$counter = $this->favoriteCounter()->first();\n\n\t\tif($counter) {\n\t\t\t$counter->count++;\n\t\t\t$counter->save();\n\t\t} else {\n\t\t\t$counter = new FavoriteCounter;\n\t\t\t$counter->count = 1;\n\t\t\t$this->favoriteCounter()->save($counter);\n\t\t}\n\t}",
"public function setTotalCount($totalCount);",
"public function incViewCount()\n {\n $incView = (int) $this->attribute( 'view_count' );\n $incView++;\n $this->setAttribute( 'view_count', $incView );\n $this->store();\n }",
"public function getTotalPeopleAttribute(): int\n {\n return PersonCertification::where('certification_id', $this->id)->count();\n }",
"public static function updateNumReviews(Destination $dest){\n\n $db = dbConnect::getInstance();\n //query\n $q = \"UPDATE destination SET num_reviews = '\" . $dest->getNumReviews()\n . \"' WHERE dest_id = \" . $dest->getDestId() . \"\";\n\n if(!$db->query($q)) return false;\n\n return true;\n }",
"public function totalreatingandreview($productid){\n\t\t$this->db->where('ProductId', $productid);\n\t\t$this->db->select('Id');\n\t\t$query=$this->db->get('tbl_review');\n\t\techo $query->num_rows();\n\t}",
"public function put_review($data)\n\t{\n\t\t$review_count = $this->count_reviews([\n\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t'author_id'\t\t=>\t$data['author_id']\n\t\t]);\n\t\tif ($review_count < 1)\n\t\t{\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->insert('reviews', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filter_results([\n\t\t\t\t'restaurant_id'\t=>\t$data['restaurant_id'],\n\t\t\t\t'author_id'\t=>\t$data['author_id']\n\t\t\t]);\n\t\t\tunset($data['javascript']);\n\t\t\t$this->db->update('reviews', $data);\n\t\t}\n\t}",
"public function updateQuantity()\n {\n $this->load('itemAddressFiles');\n $quantity = 0;\n foreach ($this->itemAddressFiles as $addressFileLink) {\n $quantity += $addressFileLink->count;\n }\n $quantity += $this->mail_to_me;\n $this->quantity = $quantity;\n $this->save();\n $this->_calculateTotal();\n }",
"public function testGetTotalRating()\n {\n $rating = new Rating($this->user->getId(), $this->video->getId(), 5);\n $rating->insert();\n\n $rating = new Rating($this->extraUser->getId(), $this->video->getId(), 2);\n $rating->insert();\n\n\n $totalRating = Rating::getTotalRating($this->video->getId());\n $this->assertEquals(7 / 2, $totalRating);\n }",
"public function increaseCommentCount()\n {\n \tif($this->comment_count != null)\n \t\t$this->comment_count++;\n \telse\n \t\t$this->comment_count = 1;\n \t$this->save();\n }",
"public function updateLikesCount()\n {\n $totals = Db::table('rainlab_forum_likes as r')\n ->select(Db::raw('sum(r.like) as likes, sum(r.unlike) as unlikes'))\n ->wherePostId($this->id)\n ->first();\n\n $this->count_likes = $totals->likes;\n $this->count_unlikes = $totals->unlikes;\n $this->save();\n }",
"public function testProfilePrototypeCountReviews()\n {\n\n }",
"public function recalculateRating($rating)\n {\n $reviews = $this->reviews();\n $avgRating = $reviews->avg('rating');\n $this->rating_cache = round($avgRating,1);\n $this->rating_count = $reviews->count();\n $this->save();\n }",
"public function addReview($review) {\n $this->reviews[] = $review;\n }",
"public function setReviews($reviews) {\n $this->properties['reviews'] = $reviews;\n\n return $this;\n }",
"public function countVotesOf(PersistentCollection $fields);",
"public function reviews() {\n return $this->hasMany('App\\Models\\ProductReview');\n }",
"public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }",
"private function countSearchResults(): void\n {\n $this->SearchResult->total_matches = count($this->SearchResult->matches);\n $this->SearchResult->total_indecisive_matches = count($this->SearchResult->indecisive_matches);\n $this->SearchResult->total_no_matches = count($this->SearchResult->no_matches);\n }"
]
| [
"0.6058389",
"0.60511565",
"0.6050394",
"0.60294324",
"0.59756404",
"0.5807854",
"0.57304347",
"0.5450064",
"0.5387524",
"0.53737265",
"0.53614694",
"0.53075135",
"0.5285351",
"0.52675587",
"0.5261194",
"0.5230221",
"0.52133733",
"0.5199933",
"0.5183468",
"0.51664454",
"0.5156514",
"0.51350516",
"0.50541914",
"0.50409484",
"0.50366855",
"0.50302345",
"0.5003062",
"0.50001335",
"0.4989575",
"0.4970692"
]
| 0.6973338 | 0 |
Attach image routes to property. | public function ImageRoutes()
{
$routes = [];
foreach ($this->images as $image) {
$routes[] = '/' . env('PROPERTY_IMAGE_DISK') . '/' . $image->filepath;
}
if (count($routes) == 0) {
$routes[] = '/imgs/default_image.png';
}
$this->image_routes = $routes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function images()\n {\n return $this->hasMany(PropertyImage::class,'property_id', 'id');\n }",
"public function add_rewrite_rule() {\n\t\t\tadd_rewrite_rule(\n\t\t\t\t'photo/([a-z0-9-_]+)/?', // ([^/]+)\n\t\t\t\t'index.php?attachment=$matches[1]',\n\t\t\t\t'top'\n\t\t\t);\n\t\t}",
"public function images()\n {\n return $this->HasMany('App\\Models\\Properties\\Image')->orderBy('index', 'asc');\n }",
"public function add_image() {\n\t $this->use_layout=false;\n\t $this->page = new $this->model_class(Request::get('id'));\n\t\t$this->join_name = \"images\";\n\t if(Request::post(\"id\")) {\n\t\t $this->image = new WildfireFile(Request::post('id'));\n\t\t $this->image->join_order = Request::post('order');\n\t\t $this->page->images = $this->image;\n\t }\n\t}",
"public function getPhotoRouteAttribute()\n\t{\n\t\t\n\t\tif($this->imagen)\n\t\t{\n\t\t\treturn 'data:image/jpg; base64 ,'.(base64_encode($this->imagen));\n\t\t}\n\t\t\t\n\t\t//dd('ima/users/male.jpg');\n\t\n\t\treturn (asset('img/users/default.bin'));\n\t\t\n\t}",
"public function __construct()\n {\n foreach ($this as $key => $property)\n if (is_array($property) && isset($property['path']))\n $this->{$key}['path'] = VPATH . $property['path'] . EXT;\n }",
"function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}",
"protected function assignImageProperties($properties) {\n foreach ( $properties as $property => $value ) {\n if (! isset($this->$property) || is_null($this->$property)) {\n $this->$property = $value;\n }\n }\n }",
"private function updatePaths(&$properties, $collection) {\r\n \r\n /*\r\n * Update dynamically metadata, quicklook and thumbnail path if required before the replaceInTemplate\r\n */\r\n if (method_exists($collection->model,'generateMetadataPath')) {\r\n $properties['metadata'] = $collection->model->generateMetadataPath($properties);\r\n }\r\n\r\n if (method_exists($collection->model,'generateQuicklookPath')) {\r\n $properties['quicklook'] = $collection->model->generateQuicklookPath($properties);\r\n }\r\n\r\n if (method_exists($collection->model,'generateThumbnailPath')) {\r\n $properties['thumbnail'] = $collection->model->generateThumbnailPath($properties);\r\n }\r\n \r\n if (method_exists($collection->model,'generateDownloadUrl')) {\r\n $properties['resource'] = $collection->model->generateDownloadUrl($properties);\r\n }\r\n \r\n if (method_exists($collection->model,'generateWMSUrl')) {\r\n $properties['wms'] = $collection->model->generateWMSUrl($properties);\r\n }\r\n \r\n /*\r\n * Modify properties as defined in collection propertiesMapping associative array\r\n */\r\n if (isset($collection->propertiesMapping)) {\r\n $_properties = $properties;\r\n foreach (array_keys($collection->propertiesMapping) as $key) {\r\n $properties[$key] = $this->replaceInTemplate($collection->propertiesMapping[$key], $_properties);\r\n }\r\n }\r\n \r\n }",
"public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}",
"public function setImage($image)\n{\n$this->image = $image;\n\nreturn $this;\n}",
"function _putimages() {\n parent::_putimages();\n $this->_putformxobjects();\n }",
"public function configure()\n {\n return $this->afterMaking(function (Product $product) {\n //\n })->afterCreating(function (Product $product) {\n if ($product->images()->count()) {\n $product->cover()->associate($product->images()->first());\n $product->save();\n }\n });\n }",
"public function registerMediaCollections() {\n $this->addMediaCollection('image')->singleFile();\n }",
"public function register_rest_episode_images() {\n\t\tregister_rest_field(\n\t\t\tssp_post_types(),\n\t\t\t'episode_featured_image',\n\t\t\tarray(\n\t\t\t\t'get_callback' => array( $this, 'get_rest_featured_image' ),\n\t\t\t\t'update_callback' => null,\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t}",
"function setImage($image) {\n\t\t$this->_image = $image;\n\t}",
"function setVakoImage($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the vako with $object->reference->ShopId */ \n}",
"public function registerMediaCollections()\n {\n $this->addMediaCollection('image')->singleFile();\n }",
"public function add_image( &$data ) {\n\t\tif ( $this->context->has_image ) {\n\t\t\t$data['primaryImageOfPage'] = [ '@id' => $this->context->canonical . WPSEO_Schema_IDs::PRIMARY_IMAGE_HASH ];\n\t\t}\n\t}",
"public function images(): AdminApi\n {\n return $this->setResource(Image::class);\n }",
"public function images()\n {\n return $this->hasMany('App\\Image', 'restaurant_id');\n }",
"function imageUrl($property, $size = null);",
"public function setImageResource($image)\n {\n $this->image = $image;\n }",
"function TS_VCSC_Add_Posts_Image_Lean() {\r\n\t\t\t\tvc_lean_map('TS_VCSC_Posts_Image_Grid_Standalone',\t\t\tarray($this, 'TS_VCSC_Add_Posts_Image_Elements'), null);\r\n\t\t\t}",
"function setArticleImage($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}",
"function add_rewrite_rules() {\n\n\tadd_rewrite_tag( '%image%', '([^/]*)');\n\n\tadd_rewrite_rule('^gallery/([^/]*)/([^/]*)/?$', 'index.php?gallery=$matches[1]&image=$matches[2]', 'top');\n}",
"public function image()\n {\n\n return $this->hasMany(ProductImage::class);\n \n }",
"public function images()\n {\n // Fetch all properties existing in the database\n $image = Image::all();\n\n // return list of properties;\n return $image;\n\n }",
"protected function bindImage($image, $post){\n\n $this->uploader->upload($image, config('image.postsDESTINATION'))->save(config('image.postsDESTINATION'));\n\n $picture = Picture::create(['path' => $this->uploader->getFilename()]);\n\n $post->picture()->attach($picture);\n }",
"private function _getPathsForUrl($image)\n {\n $convertedImageStr = StringHelper::asciiString(urldecode($image));\n $urlParts = parse_url($convertedImageStr);\n $pathParts = pathinfo($urlParts['path']);\n $hashRemoteUrl = craft()->imager->getSetting('hashRemoteUrl');\n $hashPath = craft()->imager->getSetting('hashPath');\n \n if ($hashPath) {\n $targetFolder = '/' . md5($pathParts['dirname']);\n } else {\n $targetFolder = $pathParts['dirname'];\n }\n\n if ($hashRemoteUrl) {\n if (is_string($hashRemoteUrl) && $hashRemoteUrl == 'host') {\n $parsedDirname = substr(md5($urlParts['host']), 0, 10) . $targetFolder;\n } else {\n $parsedDirname = md5($urlParts['host'] . $pathParts['dirname']);\n }\n } else {\n $parsedDirname = str_replace('.', '_', $urlParts['host']) . $targetFolder;\n }\n\n $runtimePath = IOHelper::getRealPath(craft()->path->getRuntimePath());\n $this->sourcePath = ImagerService::fixSlashes($runtimePath . 'imager/' . $parsedDirname . '/');\n $this->sourceUrl = $image;\n $this->targetPath = ImagerService::fixSlashes(craft()->imager->getSetting('imagerSystemPath') . $parsedDirname . '/');\n $this->targetUrl = craft()->imager->getSetting('imagerUrl') . $parsedDirname . '/';\n $this->sourceFilename = $this->targetFilename = str_replace(' ', '-', $pathParts['basename']);\n \n // check if the temp path for remote files exists or can be created.\n if (!IOHelper::getRealPath($this->sourcePath)) {\n IOHelper::createFolder($this->sourcePath, craft()->config->get('defaultFolderPermissions'), true);\n\n if (!IOHelper::getRealPath($this->sourcePath)) {\n $msg = Craft::t('Temp folder “{sourcePath}” does not exist and could not be created', array('sourcePath' => $this->sourcePath));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n }\n\n // check if the file is already downloaded\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename) ||\n ((craft()->imager->getSetting('cacheDurationRemoteFiles') !== false) && (IOHelper::getLastTimeModified($this->sourcePath . $this->sourceFilename)->format('U') + craft()->imager->getSetting('cacheDurationRemoteFiles') < time()))\n ) {\n $this->_downloadFile($this->sourcePath . $this->sourceFilename, $image);\n\n if (!IOHelper::fileExists($this->sourcePath . $this->sourceFilename)) {\n $msg = Craft::t('File could not be downloaded and saved to “{sourcePath}”', array('sourcePath' => $this->sourcePath));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n } else {\n throw new Exception($msg);\n }\n }\n }\n }"
]
| [
"0.5714889",
"0.5680359",
"0.559291",
"0.5586751",
"0.54304624",
"0.53598565",
"0.5314433",
"0.52572125",
"0.51980245",
"0.5182699",
"0.5173096",
"0.5112765",
"0.5106167",
"0.50788325",
"0.5054979",
"0.5043555",
"0.50340104",
"0.49982843",
"0.49979964",
"0.4987067",
"0.49858811",
"0.4984036",
"0.49731898",
"0.49707517",
"0.49445742",
"0.49445483",
"0.49380633",
"0.49372134",
"0.49358234",
"0.49346742"
]
| 0.70499086 | 0 |
Attach all necessary data to show property. | public function prepareShow()
{
$this->location();
$this->type;
$this->amenityIds();
$this->utilityIds();
$this->reviewCount();
$this->user->location();
$this->user->profilePicture();
$this->user->reviewCount();
$this->reviews = $this->reviews()->select('reviews.*')->withReviewer()->get();
$this->coordinates;
$this->imageRoutes();
$this->image_ids = $this->images->pluck('id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show()\n {\n // carrega os dados no datagrid\n $this->onReload();\n //chama o metodo show da super classe\n parent::show();\n\n }",
"protected function setDisplayData() {\n parent::setDisplayData();\n $this->template->setDisplayData( \"person_header\", $this->getTitle() );\n if ( !($form_link = $this->form_link)) {\n if ($this->module == 'I2CE') {\n $form_link = $this->page;\n } else {\n $form_link = $this->module .'/' . $this->page;\n }\n }\n $this->template->setDisplayData( \"person_form\", $form_link);\n }",
"protected function setupShowOperation(): void\n {\n $this->crud->addColumn([\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Наименование',\n ]);\n $this->crud->addColumn([\n 'name' => 'category_id',\n 'type' => 'select',\n 'label' => 'Категория',\n 'entity' => 'category',\n 'attribute' => \"name\",\n 'model' => Category::class,\n ]);\n $this->crud->addColumn([\n 'name' => 'photos',\n 'label' => 'Фотографии',\n 'type' => 'upload_multiple',\n 'disk' => 'public'\n ]);\n $this->crud->addColumn([\n 'name' => 'attributes',\n 'label' => 'Атрибуты',\n 'type' => 'attributes',\n 'entity_singular' => 'атрибут',\n 'columns' => [\n 'name' => 'Название атрибута',\n 'value' => 'Значение',\n ],\n 'min' => 0,\n ]);\n }",
"protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }",
"public function show()\n\t{\n\t\t// Set title\n\t\t$this->setTitle('K2_EXTRA_FIELDS');\n\n\t\t// Set user states\n\t\t$this->setUserStates();\n\n\t\t// Set pagination\n\t\t$this->setPagination();\n\n\t\t// Set rows\n\t\t$this->setRows();\n\n\t\t// Set filters\n\t\t$this->setFilters();\n\n\t\t// Set toolbar\n\t\t$this->setToolbar();\n\n\t\t// Set menu\n\t\t$this->setMenu();\n\n\t\t// Set Actions\n\t\t$this->setListActions();\n\n\t\t// Render\n\t\tparent::render();\n\t}",
"protected function setupShowOperation()\n {\n $this->crud->set('show.setFromDb', false);\n\n CRUD::addColumn([\n 'name' => 'description',\n 'label' => 'Description',\n 'type' => 'string'\n ]);\n\n $this->crud->addColumn([\n 'name' => 'items',\n 'label' => 'Code Items',\n 'type' => 'table',\n 'columns' => [\n 'description' => 'Description',\n 'show_is_visible' => 'Is Visible'\n ]\n ]);\n\n CRUD::addColumn([\n 'name' => 'is_visible',\n 'label' => 'Is Visible',\n 'type' => 'boolean'\n ]);\n }",
"public function showDetails(){\n $this->_showDetails = true;\n }",
"function fill_in_additional_detail_fields()\n {\n parent::fill_in_additional_detail_fields();\n $this->project_name = $this->_get_project_name($this->project_id);\n $this->resource_name = $this->getResourceName();\n }",
"protected function configureShowFields(ShowMapper $show): void\r\n {\r\n $show\r\n ->add('expediente')\r\n ->add('cotizacion')\r\n ->add('personaNif')\r\n ->add('oficina')\r\n ->add('horizontal')\r\n ->add('vertical')\r\n ->add('missatge')\r\n ->add('nivel')\r\n ->add('updatedAt')\r\n ->add('createdAt')\r\n ->add('active')\r\n ->add('deleted')\r\n ->add('deletedBy')\r\n ->add('deletedAt');\r\n }",
"public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }",
"public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }",
"public function buildShowFields()\n {\n $this->addField(\n SharpShowTextField::make('id')\n ->setLabel('Id:')\n )->addField(\n SharpShowTextField::make('name')\n ->setLabel('name:')\n )->addField(\n SharpShowTextField::make('url')\n ->setLabel('url:')\n )->addField(\n SharpShowTextField::make('vendor_id')\n ->setLabel('vendor_id')\n )->addField(\n SharpShowTextField::make('parent_id')\n ->setLabel('parent_id')\n )->addField(\n SharpShowTextField::make('created_at')\n ->setLabel('Created At:')\n )->addField(\n SharpShowTextField::make('updated_at')\n ->setLabel('Updated At:')\n )->addField(\n SharpShowEntityListField::make('products', 'product')\n ->hideFilterWithValue('category', function($instanceId) {\n return $instanceId;\n })\n ->showEntityState(false)\n ->showReorderButton(true)\n ->showCreateButton(false)\n );\n }",
"protected function configureShowFields(ShowMapper $showMapper){}",
"protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }",
"protected function initialize()\n {\n $this->viewData['list_sb'] = $this->list_sb = SkeletalBone::orderBy('name', 'asc')->pluck('name', 'id');\n $this->viewData['list_side'] = $this->list_side = SkeletalElement::$side;\n $this->viewData['list_completeness'] = $this->list_completeness = SkeletalElement::$completeness;\n $this->viewData['list_lab'] = $this->list_lab = Lab::where('type', 'Isotope')->get()->pluck('full_name', 'id');\n $this->viewData['list_status'] = $this->list_status = IsotopeBatch::$status;\n $this->viewData['batchStatus'] = $this->batchStatus = 'Open';\n $this->viewData['initialshow'] = $this->initialshow = false;\n }",
"public function show(Property $property)\n {\n //\n }",
"public function show(Property $property)\n {\n //\n }",
"public function populate()\n { \n $this->data = $this->iDatasourceModel->getData( $this->propertyTypeInfo );\n $this->state = self::STATE_POPULATED;\n return;\n }",
"protected function setupShowOperation()\n {\n $this->setupListOperation();\n CRUD::column('provider_update_url')->limit(1000);\n }",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"function show()\n {\n if (!$this->loaded)\n {\n $this->onReload( func_get_arg(0) );\n }\n parent::show();\n }",
"private function set_display_data( $data ) {\n\t\t$this->display_data = $data;\n\t}",
"protected function setupShowOperation()\n {\n CRUD::addColumn(['name' => 'text_one', 'label' => 'Текст первый.']); // columns\n CRUD::addColumn(['name' => 'image_one', 'type' => 'image', 'label' => 'Изображение первое.']); // columns\n CRUD::addColumn(['name' => 'text_two', 'label' => 'Текст второй.']); // columns\n CRUD::addColumn(['name' => 'image_two', 'type' => 'image', 'label' => 'Изображение второе.']); // columns\n CRUD::addColumn(['name' => 'text_third', 'label' => 'Текст третий.']); // columns\n CRUD::addColumn(['name' => 'image_third', 'type' => 'image', 'label' => 'Изображение третье.']); // columns\n CRUD::addColumn(['name' => 'image_four', 'type' => 'image', 'label' => 'Изображение четвертое.']); // columns\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }",
"public function hookPublicAppendToCollectionsShow()\n {\n $this->_appendToCollectionsShow(get_current_collection());\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 }",
"protected function configureShowFields(ShowMapper $showMapper)\n {\n $showMapper\n ->add('id')\n ->add('user')\n ->add('product');\n }",
"public function show( $data )\n\t\t{\n\t\t\tforeach($data as $key => $value)\n\t\t\t{\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t\n\t\t\tinclude $this->path;\n\t\t}",
"public function buildShowLayout()\n {\n $this->addSection('Section', function(ShowLayoutSection $section) {\n $section->addColumn(6, function(ShowLayoutColumn $column) {\n $column->withSingleField('id');\n $column->withSingleField('name');\n $column->withSingleField('url');\n $column->withSingleField('vendor_id');\n $column->withSingleField('parent_id');\n $column->withSingleField('created_at');\n $column->withSingleField('updated_at');\n });\n })->addEntityListSection('products', 'products');\n }",
"public function show(PropertyApplication $propertyApplication)\n {\n //\n }",
"public function __construct(){\n // 表示部分で使うオブジェクトを作成\n $this->initDisplayObj();\n }"
]
| [
"0.62103724",
"0.61622417",
"0.61457807",
"0.6104522",
"0.5991424",
"0.5964789",
"0.5963357",
"0.59220153",
"0.590709",
"0.58708745",
"0.58086276",
"0.57778734",
"0.57511103",
"0.56778336",
"0.5631176",
"0.56188",
"0.56188",
"0.5602784",
"0.5594011",
"0.55711395",
"0.5539801",
"0.5533874",
"0.5530906",
"0.55208945",
"0.55207396",
"0.551547",
"0.551535",
"0.5473642",
"0.54640603",
"0.5459965"
]
| 0.6283189 | 0 |
Get the subdivision that belongs to the city of the property. | public function subdivision()
{
$city = $this->city;
$this->subdivision = $city ? $city->subdivision : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function get_cities_origin() {\n $t_location = get_transient('wcis_location');\n return $t_location['cities'];\n }",
"public function get_ville()\n {\n return $this->_ville;\n }",
"public function getCity();",
"public function getCity()\n {\n\n return $this->fv_city;\n }",
"public function getCity() {}",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\n {\n return $this->city;\n }",
"public function getCity()\r\n {\r\n return $this->city;\r\n }",
"public function getCity()\r\n {\r\n return $this->city;\r\n }",
"public function getCity()\r\n {\r\n return $this->city;\r\n }"
]
| [
"0.6242184",
"0.61974883",
"0.61404765",
"0.6077991",
"0.6058759",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6030885",
"0.6006375",
"0.6006375",
"0.6006375"
]
| 0.7613744 | 0 |
////////////////////////////////////////////////////////////////////////// CREATE A CONNECTION TO THE POSTGRESQL SERVER ////////////////////////////////////////////////////////////////////////// | public function connect() {
$auth = $this->auth();
$this->connection = @pg_connect(
" host='" . $auth['server'] . "'" .
" dbname='" . $auth['database'] . "'" .
" user='" . $auth['username'] . "'" .
" password='" . $auth['password'] . "'" .
" connect_timeout='" . $auth['timeout'] . "'" .
" options='--client_encoding=UTF8'"
);
if ($this->connection === false) {
$error = error_get_last();
throw new pudlException(
$this,
'ERROR CONNECTING TO POSTGRESQL: ' . $error['message'],
PUDL_X_CONNECTION
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createConection(){\n\n\t\tglobal $db_host;\n\t\tglobal $db_usr;\n\t\tglobal $db_pwd;\n\t\tglobal $db_name;\n\t\tglobal $db_port;\n\n\t\treturn pg_connect('user='.$db_usr.' password='.$db_pwd.' host= '.$db_host.' dbname = '.$db_name.' port = '.$db_port);\n\t}",
"private static function get_connect(){\n static::$db = pg_connect(static::$host . \" \" . static::$port . \" \" . static::$database . \" \" . static::$user . \" \" . static::$pass);\n }",
"function Open(){\n\t\t$this->con = pg_connect($this->strCon);\n\t}",
"function dbconnect()\n\t{\n\t\t$dbConnString = \"host=173.254.28.90 options='--client_encoding=UTF8' user=feedmati_user dbname=feedmati_system password=PZi0wuz9n+XX\";\n\t\t$dbConn = pg_connect($dbConnString ) or die(\"Problem with connection to PostgreSQL:\".pg_last_error());\n\t\treturn $dbConn;\n\t}",
"function conectar(){\r\n\t\tpg_connect(\"host=localhost port=5432 dbname=moodleuece user=postgres password=root\");\t\t\t\t\r\n}",
"function db_connect()\n{\n return pg_connect(\"host=\" . DB_HOST . \" port=\" . DB_PORT . \" dbname=\" . DATABASE . \" user=\" . DB_ADMIN . \" password=\" . DB_PASSWORD);\n}",
"public function connect()\n { try{\n\n //$this->conn = pg_connect(\"host=localhost dbname=postgres user=postgres password=siem\");\n $this->conn = pg_connect(\"host=db dbname=siem2013 user=siem2013 password=fabiofernando\");\n\n }catch(Exception $e){\n return false;\n } \n if (!$this->conn) {\n return false;\n }\n $query = \"set schema 'explicafeup';\";\n pg_exec($this->conn, $query);\n return true;\n }",
"function connect()\n {\n\trequire_once dirname(__FILE__) . '/db_config.php';\n\t$connstring = \"host={$DB_SERVER} port={$DB_PORT} dbname={$DB_DATABASE} \".\n\t\t \"user={$DB_USER} password={$DB_PASSWORD}\";\n\t$db = pg_connect($connstring);\n\n\treturn $db;\n }",
"public function sql_pconnect() {}",
"public function sql_pconnect() {}",
"function pdo_connect_pgsql($host, $dbname, $username = null, $password = null, array $driver_options = array())\n {\n return pdo_connect(\"pgsql:host={$host};dbname={$dbname};user={$username};password={$password}\", $driver_options);\n }",
"public function __construct() {\n\t\t$this->con = pg_connect(\"host=mcsdb.utm.utoronto.ca port=5432 dbname=jaggisi1_309 user=jaggisi1 password=74162\");\n\t\tif(!$this->con){\n\t\t\t\techo(\"Can't connect to the database\");\n\t\t\t\texit;\n\t\t\t}\t\t\n\t\t}",
"static function open(string $params): void {\n /*PhpDoc: methods\n name: open\n title: static function open(string $params) - ouvre une connexion PgSql\n doc: |\n Le motif des paramètres est:\n - 'host={server}( port={port})? dbname={dbname} user={user}( password={password})?' ou\n - 'pgsql://{user}(:{password})?@{server}(:{port})?/{dbname}(/{schema})?'\n Si le mot de passe n'est pas fourni alors il est recherché dans le fichier secret.inc.php\n Si le schéma est fourni alors il est initialisé après l'ouverture de la base.\n */\n //echo \"PgSql::open($connection_string)\\n\";\n $pattern = '!^host=([^ ]+)( port=([^ ]+))? dbname=([^ ]+) user=([^ ]+)( password=([^ ]+))?$!';\n if (preg_match($pattern, $params, $matches)) {\n $server = $matches[1];\n $port = $matches[3];\n $database = $matches[4];\n $user = $matches[5];\n $passwd = $matches[7] ?? null;\n $schema = null;\n $conn_string = $params;\n }\n elseif (preg_match('!^pgsql://([^@:]+)(:[^@]+)?@([^:/]+)(:\\d+)?/([^/]+)(/.*)?$!', $params, $matches)) {\n $user = $matches[1];\n $passwd = $matches[2] ? substr($matches[2], 1) : null;\n $server = $matches[3];\n $port = $matches[4] ? substr($matches[4], 1) : '';\n $database = $matches[5];\n $schema = isset($matches[6]) ? substr($matches[6], 1) : null;\n //print_r($matches); die();\n $conn_string = \"host=$server\".($port ? \" port=$port\": '')\n .\" dbname=$database user=$user\".($passwd ? \" password=$passwd\": '');\n //echo \"conn_string=$conn_string\\n\";\n }\n else\n throw new Exception(\"Erreur: dans PgSql::open() params \\\"$params\\\" incorrect\");\n self::$server = $server;\n self::$database = $database;\n self::$schema = $schema;\n if (!$passwd) {\n if (!is_file(__DIR__.'/secret.inc.php'))\n throw new Exception(\"Erreur: dans PgSql::open($conn_string), fichier secret.inc.php absent\");\n else {\n $secrets = require(__DIR__.'/secret.inc.php');\n \n if (!($passwd = $secrets['sql'][\"pgsql://$user@$server\".($port?\":$port\":'')] ?? null))\n throw new Exception(\"Erreur: dans PgSql::open($params), mot de passe absent de secret.inc.php\");\n }\n $conn_string .= \" password=$passwd\";\n //echo \"conn_string=$conn_string\\n\"; //die();\n }\n if (!(self::$connection = @pg_connect($conn_string)))\n throw new Exception(\"Could not connect to \\\"pgsql://$user:***@$server\".($port?\":$port\":'').\"/\\\"\");\n \n if ($schema) {\n //echo \"query(SET search_path TO $schema)\\n\";\n self::query(\"SET search_path TO $schema\");\n }\n }",
"function db_pgsql($db_name, $db_user, $db_pass, $db_host, $db_port = 5432, $db_socket = '')\n\t{\n\t\tparent::database($db_name, $db_user, $db_pass, $db_host, $db_port, $db_socket);\n\t\t$pg_connstr = \"host=$db_host port=$db_port dbname=$db_name user=$db_user password=$db_pass\";\n\n\t\t$this->connection = @pg_connect($pg_connstr);\n\t}",
"function pg_connection_string() {\n\treturn \"dbname=d2ffcrdlj7m0dp host=ec2-54-197-246-197.compute-1.amazonaws.com port=5432 user=ihtxpbixayjwqp password=lk0N0phG-frjKVxCYIEUi4U-I6 sslmode=require\";\n}",
"function conectar(){\n\n\t\t$conec= pg_connect(\"host='\".HOST.\"' dbname=\".DBNAME.\" port=\".PORT.\" user=\".USER.\" password=\".PASSWORD) or die(\"ERROR EN LA CONEXION\".pg_last_error());\n\t\treturn $conec;\n\t}",
"function db_driver_connect()\n{\n global $_db;\n\n $_db['resource'][$_db['target']]['dbh'] = pg_connect('host=' . $_db['resource'][$_db['target']]['config']['host'] . ($_db['resource'][$_db['target']]['config']['port'] ? ' port=' . $_db['resource'][$_db['target']]['config']['port'] : '') . ' dbname=' . $_db['resource'][$_db['target']]['config']['name'] . ' user=' . $_db['resource'][$_db['target']]['config']['username'] . ' password=' . $_db['resource'][$_db['target']]['config']['password'], true);\n if (!$_db['resource'][$_db['target']]['dbh']) {\n if (LOGGING_MESSAGE) {\n logging('message', 'db: Connect error');\n }\n\n error('db: Connect error');\n }\n\n return;\n}",
"private static function getConnection() {\n if (self::$connection == NULL) {\n self::$connection = new PDO(\"pgsql:\");\n self::$connection->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n }\n \n return self::$connection; \n }",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"function conectar(){\n $this->conexion_bd = pg_connect(\"host=190.109.100.36 port=5432 dbname=scdat user=postgres password=invepal1nv3p4l\") or die('No pudo conectarse: ' . pg_last_error());\n// $this->conexion_bd = pg_connect(\"host=localhost port=5432 dbname=scdat user=postgres password=l4v1rg3n\") or die('No pudo conectarse: ' . pg_last_error());\n return ($this->conexion_bd);\n }",
"public function __construct() {\n //$username = \"postgres\";\n //$password = \"123456\";\n #die(\"--\");\n #$this->conn = pg_connect(\"host=\".$host.\" port=\".$port.\" dbname=\".$dbname.\" user=\".$username.\" password=\".$password);\n //$this->conn = oci_connect(sfConfig::get('USER_ORACLE'), sfConfig::get('PASS_ORACLE'), sfConfig::get('IP_ORACLE'),'AL32UTF8');\n #$this->conn = pg_connect(\"host=\".$host.\" port=\".$port.\" dbname=\".$dbname.\" user=\".$username.\" password=\".$password);\n //connect to database\n //$this->conn = mysqli_connect($host, $username, $password, $dbname) or die(mysqli_connect_error());\n\n $this->conn = mysqli_connect(sfConfig::get('IP_HOST'), sfConfig::get('USER_NAME'), sfConfig::get('PASS'), sfConfig::get('DB_NAME')) or die(mysqli_connect_error());\n\n mysqli_set_charset($this->conn,\"utf8\");\n\t}",
"function connectDb()\n{\n //$connect_query = 'host=localhost user=zeng dbname=bookdb_1981117';\n $conn = pg_connect('host=localhost port=5432 dbname=bookdb_1981117 user=postgres password=angels');\n if ($error = pg_last_error($conn)) {\n\n print $error;\n };\n\n return $conn;\n}",
"public function getConnection(){\n \n $this->conn = null;\n $dsn=\"mysql:host=\" . $this->host . \";port=\" . $this->port . \";dbname=\" . $this->db_name;\n \n try{\n $this->conn = new PDO($dsn, $this->username, $this->password);\n //$this->conn = new PDO(\"pgsql:host=localhost;port=5432;dbname=PHP_tutorial\", $this->username, $this->password);\n \n }catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage() . \"\\n\";\n echo \"DSN = \" . $dsn;\n }\n return $this->conn;\n }",
"function createConnect()\r\n\t\t{\r\n\t\t$this->conn=mysql_pconnect($this->host,$this->user,$this->password);\r\n\t\tif(!is_resource($this->conn))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to connect to the SQL Server.\";\r\n\t\t\t}\r\n\t\t$d = mysql_select_db($this->dbname, $this->conn);\r\n\t\tif(!is_resource($d))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to Use database \".$this->dbname.\".\";\r\n\t\t\t}\r\n\t\t}",
"public function __construct() {\n\t\t$this->db = pg_connect(\"host=localhost dbname='cdi13' user='cdi13' password='cdi13database'\");\n\t}",
"public function connect()\n {\n $config = $this->config;\n $config = array_merge($this->_baseConfig, $config);\n\n $conn = \"DATABASE='{$config['database']}';HOSTNAME='{$config['host']}';PORT={$config['port']};\";\n $conn .= \"PROTOCOL=TCPIP;UID={$config['username']};PWD={$config['password']};\";\n\n if (!$config['persistent']) {\n $this->connection = db2_connect($conn, PGSQL_CONNECT_FORCE_NEW);\n } else {\n $this->connection = db2_pconnect($conn);\n }\n $this->connected = false;\n\n if ($this->connection) {\n $this->connected = true;\n $this->query('SET search_path TO '.$config['schema']);\n }\n if (!empty($config['charset'])) {\n $this->setEncoding($config['charset']);\n }\n\n return $this->connection;\n }",
"public function connect() {\n\t\t$cnn_string = 'host='.$this->_dbhost.' port='.$this->_dbport.' user='.$this->_dbuser.' password='.$this->_dbpass.' dbname='.$this->_dbname;\n\t\t\n\t\t$this->_instance = pg_connect($cnn_string) or PK_debug(__FUNCTION__, \"No se ha podido conectar con la DB\\n\\n\".pg_errormessage(), array('class'=>'error'));\n\t\t\n\t\tif (!$this->_instance) {\n\t\t\techo '<h1>Error en la aplicacion</h1><p>No se ha podido conectar con la base de datos</p>';\n\t\t\tPK_debug('', '', 'output');\n\t\t\texit();\n\t\t}\n\t\t\n\t\treturn $this->_instance;\n\t}",
"public function getConnection(){\n $this->conn = null;\n \n $this->connection = \"host=\".$this->host.\" \";\n $this->connection .= \"port=\".$this->db_port.\" \";\n $this->connection .= \"dbname=\".$this->db_name.\" \";\n $this->connection .= \"user=\".$this->db_user.\" \";\n $this->connection .= \"dbname=\".$this->db_name.\" \";\n $this->connection .= \"password=\".$this->db_pass.\"\";\n \n try{\n $this->conn = pg_connect($this->connection) or die('Fail to connect');\n \n }catch (Exception $e){\n echo $e->getTraceAsString();\n $msg = \"[ERR] Falló al conectar con la BD. Error: \".$e.\" Fecha: \".$GLOBALS['date'].\"\\n\";\n errorLog($msg);\n \n }\n ## 3 more checks\n if(!$this->conn){\n $msg = \"[ERR] Error con la conexion en la base de datos \".$GLOBALS['date']. \"\\n\";\n errorLog($msg);\n print \"<h2 style=\\\"color:red;\\\">\".$msg.\"</h2>\";\n }\n \n $check2 = pg_get_result($this->conn);\n echo pg_result_error($check2);\n \n $check3 = pg_connection_status($this->conn);\n if ($check3 === PGSQL_CONNECTION_OK){\n $msg = \"[INFO] Connect to Database established \".$GLOBALS['date'].\"\\n\";\n controlLog($msg);\n }\n return $this->conn;\n\n }",
"function connectDB(): object\n{\n\t$dbh = new PDO('pgsql:host=database;dbname=proto', 'proto', 'proto');\n\t$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); //PHP warnings for SQL errors\n\treturn $dbh ;\n}",
"function connectToHostDb()\n {\n $this->setDb('host');\n $this->connect();\n if ($this->dbconnect)\n {\n return;\n }\n $this->setDb('postgres');\n $this->connect();\n if (!$this->dbconnect)\n {\n echo \"Error connecting to host postgres database.\\n\";\n echo \"Tried names 'host' and 'postgres'\\n\";\n }\n }"
]
| [
"0.7810851",
"0.72651434",
"0.72038406",
"0.71034694",
"0.70919365",
"0.7058086",
"0.7037945",
"0.7014107",
"0.700387",
"0.700387",
"0.7002035",
"0.6928738",
"0.692087",
"0.6908195",
"0.68989146",
"0.6871471",
"0.6849338",
"0.6846248",
"0.68344164",
"0.6831336",
"0.682009",
"0.6780089",
"0.6767154",
"0.67520887",
"0.6749636",
"0.67275697",
"0.6726941",
"0.6694496",
"0.66631633",
"0.6653679"
]
| 0.7293275 | 1 |
////////////////////////////////////////////////////////////////////////// GENERATE THE UPSERT PART OF THE QUERY ////////////////////////////////////////////////////////////////////////// | protected function _upsert($data) {
if (!pudl_array($data) || empty($data)) return false;
return ' ON CONFLICT (' .
$this->identifier(key($data)) .
') DO UPDATE SET ' .
$this->_update($data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 getInsertMixQuery()\n {\n\n /* Prepare data to insert into mysql */\n $this->equipment_id = isset($this->equipment_id) ? $this->equipment_id : \"0\";\n $this->department_id = isset($this->department_id) ? $this->department_id : \"0\";\n $this->voc = isset($this->voc) ? $this->voc : \"0.00\";\n $this->voclx = isset($this->voclx) ? $this->voclx : \"0.00\";\n $this->vocwx = isset($this->vocwx) ? $this->vocwx : \"0.00\";\n $this->rule_id = isset($this->rule_id) ? $this->rule_id : \"0\";\n\n\n $creation_time = isset($this->creation_time) ? $this->db->sqltext($this->creation_time) : time();\n\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $apmethod_id = isset($this->apmethod_id) ? \"{$this->db->sqltext($this->apmethod_id)}\" : \"NULL\";\n $exempt_rule = !empty($this->exempt_rule) ? \"'{$this->db->sqltext($this->exempt_rule)}'\" : \"NULL\";\n $waste_percent = isset($this->waste_percent) ? \"{$this->db->sqltext($this->waste_percent)}\" : \"NULL\";\n $recycle_percent = isset($this->recycle_percent) ? \"{$this->db->sqltext($this->recycle_percent)}\" : \"NULL\";\n $notes = !empty($this->notes) ? \"'{$this->db->sqltext($this->notes)}'\" : \"NULL\";\n $parentID = ($this->parent_id !== null) ? $this->db->sqltext($this->parent_id) : \"NULL\";\n $repairOrderId = ($this->wo_id !== null) ? $this->db->sqltext($this->wo_id) : \"NULL\";\n $stepId = ($this->getStepId() !== null) ? $this->db->sqltext($this->getStepId()) : \"NULL\";\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n\n $query = \"INSERT INTO \" . TB_USAGE . \" (equipment_id, department_id, \" .\n \"description, voc, voclx, vocwx, creation_time, spent_time, \" .\n \"rule_id, apmethod_id, exempt_rule, notes, waste_percent, \" .\n \"recycle_percent, iteration, parent_id, last_update_time, wo_id, step_id, pfp_id) VALUES (\" .\n \"{$this->db->sqltext($this->equipment_id)}, \" .\n \"{$this->db->sqltext($this->department_id)}, \" .\n \"'{$this->db->sqltext($this->description)}', \" .\n \"{$this->db->sqltext($this->voc)}, \" .\n \"{$this->db->sqltext($this->voclx)}, \" .\n \"{$this->db->sqltext($this->vocwx)}, \" .\n \"{$creation_time}, \" .\n \"{$spentTime}, \" .\n \"{$this->db->sqltext($this->rule_id)}, \" .\n \"{$apmethod_id}, \" .\n \"{$exempt_rule}, \" .\n \"{$notes}, \" .\n \"{$waste_percent}, \" .\n \"{$recycle_percent}, \" .\n \"{$this->db->sqltext($this->iteration)}, \" .\n \"{$parentID}, \" .\n \" NOW(), \" .\n \" {$repairOrderId}, \" .\n \" {$stepId}, \" .\n \" {$pfpId} \" .\n \") \";\n\n return $query;\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 }",
"private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }",
"function getInsertUpdateDataString($dataArray, $tableName)\r\n\t{\r\n\t\t//INSERT INTO table (primarykeycol,col1,col2) VALUES (1,2,3) ON DUPLICATE KEY UPDATE col1=0, col2=col2+1\r\n\t\t$dataArray = get_object_vars($dataArray);\r\n\t\t$fieldArr = array();\r\n\t\t$dataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$fieldArr[] = $key;\r\n\t\t\t$dataArr[] = \"'\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$field = implode(\", \",$fieldArr);\r\n\t\t$data = implode(\", \",$dataArr);\r\n\t\t\r\n\t\t$updateDataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$updateDataArr[] = $key.\" = '\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$updateData = implode(\", \",$updateDataArr);\r\n\t\t\r\n\t\t$query = \"INSERT INTO \".$tableName.\" (\".$field.\") VALUES (\".$data.\") ON DUPLICATE KEY UPDATE \".$updateData.\";\";\r\n\t\treturn $query;\r\n\t}",
"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 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}",
"private function insertUnMatched()\n {\n $newElements = $this->unMatchedCollection->map(function ($item) {\n\n //Unset primary key property because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns))\n {\n $newItem = new \\stdClass();\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n foreach ($this->associativePivots as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n return get_object_vars($item);\n\n })->toArray();\n\n if (!empty($newElements))\n $this->rowInserted = DB::table($this->baseTable)->insert($newElements);\n }",
"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()\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}",
"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(\"'\",\"\\'\"),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 }",
"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 getForUpdateSQL();",
"function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }",
"function augmentSQL(SQLQuery &$query) {\r\n\t}",
"public function mergeQuery(array $queryToBeAppended);",
"public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update)\n {\n $sql = $this->compileInsert($query, $values);\n\n $sql .= ' on conflict ('.$this->columnize($uniqueBy).') do update set ';\n\n $columns = collect($update)->map(function ($value, $key) {\n return is_numeric($key)\n ? $this->wrap($value).' = '.$this->wrapValue('excluded').'.'.$this->wrap($value)\n : $this->wrap($key).' = '.$this->parameter($value);\n })->implode(', ');\n\n return $sql.$columns;\n }",
"private function cObjData_updateRow( $uid )\n {\n static $firstVisit = true;\n\n // RETURN: empty row\n if ( empty( $this->rows[ $uid ] ) )\n {\n return;\n }\n // RETURN: empty row\n // Add each element of the row to cObj->data\n foreach ( ( array ) $this->rows[ $uid ] as $key => $value )\n {\n $this->pObj->cObj->data[ $key ] = $value;\n }\n\n // Add the field uid with the uid of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'uid' ] = $value;\n\n // Add the field value with the value of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'value' ] = $value;\n\n // Add the field hits with the hits of the filter item\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'hits' ] = $value;\n//$this->pObj->dev_var_dump( $this->pObj->cObj->data['hits'] );\n // Add the field rowNumber with the number of the current row\n $key = $this->pObj->prefixId . '.rowNumber';\n $value = $this->itemsPerHtmlRow[ 'currItemNumberInRow' ];\n\n // DRS\n if ( $firstVisit && $this->pObj->b_drs_cObjData )\n {\n foreach ( ( array ) $this->pObj->cObj->data as $key => $value )\n {\n $arr_prompt[] = '\\'' . $key . '\\' => \\'' . $value . '\\'';\n }\n $prompt = 'cObj->data of the first row: ' . implode( '; ', ( array ) $arr_prompt );\n t3lib_div::devlog( '[OK/COBJ] ' . $prompt, $this->pObj->extKey, -1 );\n }\n // DRS\n\n $firstVisit = false;\n }",
"public function addToInsertSQLArray();",
"function process_query_insert( $query )\n\t{\n\t\treturn $query;\n\t}",
"function execute(){\n\t\tcanonicalizeNQL($this->source->getDocument(),$this->source->getFirstChild()->getPath());\n\t\tcanonicalizeNQL($this->destination->getDocument(),$this->destination->getFirstChild()->getPath());\n\t\t\n\t\t// creating a third XML with only the root of the request, to copy the merging into it\n\t\t$operation = $this->source->nodename();\n\t\t$source_elementNode = $this->source->getFirstChild();\n\t\t$element = $source_elementNode->nodename();\n\t\t$this->query_final = new XML($this->source->toString());\n\t\t\n\t\t$this->query_final->removeChild('/*[1]/*[1]/INFO');\n\t\t$final_operationNode = $this->query_final->getElement('/*[1]');\n\t\t$final_elementNode = $this->query_final->getElement('/*[1]/*[1]');\n\t\t\n\t\t// mixing the INFO nodes\n\t\t$this->handleInfoNode();\n\t\t\n\t\t// copying SORT, PAGINATE, etc\n\t\t// first removing the existing one\n\t\tif($final_operationNode->getElement('SORT') && $this->destination->getElement('SORT')){\n\t\t\t$final_operationNode->removeChild('/SORT');\n\t\t}\n\t\tif($final_operationNode->getElement('PAGINATE') && $this->destination->getElement('PAGINATE')){\n\t\t\t$final_operationNode->removeChild('/PAGINATE');\n\t\t}\n\t\tif($final_operationNode->getElement('RETURN') && $this->destination->getElement('RETURN')){\n\t\t\t$final_operationNode->removeChild('/RETURN');\n\t\t}\n\t\t\n\t\t$nodes_to_import = $this->destination->getElements('/*[position()>1]');\n\t\tforeach($nodes_to_import as $node){\n\t\t\t$final_operationNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\t// copying other crits than INFO : DESCRIPTION, CATGEORY, DEPENDENCY\n\t\t//$final_elementNode->appendChild($this->destination->getFirstChild()->copyOf('/*[name()!=\"INFO\"]'));\n\t\t$other_children = $this->destination->getFirstChild()->getElements('/*[name()!=\"INFO\"]');\n\t\tforeach($other_children as $node){\n\t\t\t$final_elementNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\tquery_log($this->query_final->toString());\n\t\treturn $this->query_final;\n\t\treturn false;\n\t}",
"function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"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}",
"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}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }",
"function unify($connect,$pred,$arg_list,$bindings) {\n\n print_psql(\"<unify pred='$pred'>\");\n\n print_psql(\"<arglist>\");\n print_r($arg_list);\n print_psql(\"</arglist>\");\n\n print_psql(\"<bindings>\");\n print_r($bindings);\n print_psql(\"</bindings>\");\n\n\n // get_satisfiers returns a triple:\n //\n // a) pred id\n // b) arglist\n // c) bindings set\n\n print_psql(\"<get_sat_rows>\");\n $satisfier_rows = get_sat_rows($connect,$pred,$arg_list,$bindings);\n\n $solutions = array();\n $solutions_arg_lists = array();\n $soln_i = 0;\n\n while($sat_row = pg_fetch_array($satisfier_rows,NULL,PGSQL_ASSOC)) {\n $pred_id = $sat_row['pred_id'];\n\n print_psql(\"<foundrow id='{$sat_row['pred_id']}'>\");\n \n $sat_arg_list = array();\n $sat_bindings = array();\n \n $i = 1;\n while($sat_row['arg'.$i]) {\n // note that $arg_list is the list of\n // arguments that is for this unify() call,\n // not the list of arguments that this row is returning.\n // we are setting sat_bindings with keys being the former \n // ie, the unify() call's arguments, not the arguments in $sat_row.\n $arg = $arg_list[$i-1];\n\n $sat_arg_list[] = $sat_row['arg'.$i];\n\n if ($sat_row[\"arg\".$i.\"type\"] == \"c\") {\n\t$key = $arg;\n\t$val = $sat_row[\"arg\".$i];\n }\n else {\n\t$key = $sat_row[\"arg\".$i];\n\t$val = $bindings[$arg];\n }\n\n // check to see if we've already set a value variable $arg in $bindings\n if (isset($sat_bindings[$key])) {\n\t\n\t// already set : is it consistent?\n\tif ($sat_bindings[$arg] != $val) {\n\t // no: unify fails.\n\t // (fixme: error handling: replace die with continue when done testing)\n\t die(\"inconsistent binding: tried to set to : {$bindings[$arg]}, but already set to : {$bindings[$arg]}\");\n\t}\n\telse {\n\t // $sat_bindings equal to old bindings; nothing needed.\n\t}\n }\n else {\n\t$sat_bindings[$key] = $val;\n }\n $i++;\n }\n\n $solutions[] = $sat_bindings;\n\n print_psql(\"<sat_arg_list>\");\n print_r($sat_arg_list);\n print_psql(\"</sat_arg_list>\");\n\n print_psql(\"<sat_bindings>\");\n print_r($sat_bindings);\n print_psql(\"</sat_bindings>\");\n\n $right_side_tuple = right_side($connect,$pred_id);\n\n $right_side_rows = $right_side_tuple[1];\n\n // FIXME: unify treatment of right_side being empty or not: \n\n if (count($right_side) == 0) {\n $solutions_arg_lists[$soln_i] = $arg_list;\n $soln_i++;\n $solutions[] = $sat_bindings;\n $right_side_sets = array();\n }\n else {\n $right_side_rows = unify_right_side_rows($connect,$right_side_rows,$sat_bindings);\n }\n\n $soln_i = 1;\n while($right_side_row = pg_fetch_array($right_side_rows,NULL, PGSQL_ASSOC)) {\n // add a arg-list for each solution.\n print_psql(\"<rs_set num=\\\"{$soln_i}\\\">\");\n print_r($right_side_row);\n print_psql(\"</rs_set>\");\n $soln_i++;\n }\n\n // create UNION ALL sql to create a row set to return.\n // http://www.postgresql.org/docs/8.1/interactive/sql-select.html#SQL-UNION\n\n // \"The result of UNION does not contain any duplicate rows unless the ALL option \n // is specified. ALL prevents elimination of duplicates. \n // (Therefore, UNION ALL is usually significantly quicker than UNION; \n // use ALL when you can.)\"\n\n // eg: \n /* \n\ncompany=# SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Bob' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION \n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Greg' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Eugene' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Salman' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Gustavo' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Lei' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Xavier' AS a2, 'Y' AS a2_from, 'B' AS a2_to;\n\n a1 | a1_from | a1_to | a2 | a2_from | a2_to \n-----+----------+--------+----------+----------+-------\n Lex | X | A | Bob | Y | B\n Lex | X | A | Eugene | Y | B\n Lex | X | A | Greg | Y | B\n Lex | X | A | Gustavo | Y | B\n Lex | X | A | Lei | Y | B\n Lex | X | A | Salman | Y | B\n Lex | X | A | Xavier | Y | B\n(7 rows)\n\ncompany=# \n\n\n */\n\n print_psql(\"</foundrow>\");\n }\n\n $n = count($solutions);\n print_psql(\"<solutions pred='$pred' count='$n'>\");\n\n $soln_i = 0;\n\n foreach($solutions as $solution) {\n print_psql(\"<solution id='$soln_i'>\");\n\n print_r($solution);\n\n $arg_i = 0;\n foreach($solutions_arg_lists[$soln_i] as $arg) {\n $val = $solution[$arg];\n $num = $arg_i+1;\n $to_name = $arg_list[$arg_i];\n print_psql(\"<arg num='$num' from_name='$arg' to_name='$to_name' val='$val'/>\");\n $arg_i++;\n $solutions_arg_lists[$soln_i][$arg_i] = $to_name;\n $solutions[$soln_i][$to_name] = $val;\n }\n\n print_psql(\"</solution>\");\n $soln_i++;\n\n }\n\n print_psql(\"</solutions>\");\n\n print_psql(\"</get_sat_rows>\");\n\n $solutions = array();\n $solutions_arg_lists = array();\n $soln_i = 0;\n\n print_psql(\"<get_satisfiers>\");\n $satisfiers_set = get_satisfiers($connect,$pred,$arg_list,$bindings);\n\n foreach($satisfiers_set as $sat_tuple) {\n\n // each $sat_tuple is a triple: < pred_id , list of (formal) parameters, bindings >\n\n print_psql(\"<sat_arg_list>\");\n print_r($sat_tuple[1]);\n print_psql(\"</sat_arg_list>\");\n print_psql(\"<sat_bindings>\");\n print_r($sat_tuple[2]);\n print_psql(\"</sat_bindings>\");\n\n $pred_id = $sat_tuple[0];\n $sat_arg_list = $sat_tuple[1];\n $sat_bindings = $sat_tuple[2];\n\n // each $sat_bindings is a set of \n // variable -> value bindings.\n\n $right_side_tuple = right_side($connect,$pred_id);\n\n $right_side = $right_side_tuple[0];\n $right_side_rows = $right_side_tuple[1];\n\n // FIXME: unify treatment of right_side being empty or not: \n\n if (count($right_side) == 0) {\n $solutions_arg_lists[$soln_i] = $arg_list;\n $soln_i++;\n $solutions[] = $sat_bindings;\n $right_side_sets = array();\n }\n else {\n $right_side_sets = unify_right_side($connect,$right_side,$sat_bindings);\n }\n\n // add a arg-list for each solution.\n foreach($right_side_sets as $set) {\n $solutions_arg_lists[$soln_i] = $sat_arg_list;\n $soln_i++;\n\n print_psql(\"<set>\");\n print_r($set);\n print_psql(\"</set>\");\n\n }\n $solutions = array_merge($solutions,$right_side_sets);\n }\n print_psql(\"</get_satisfiers>\");\n\n $n = count($solutions);\n print_psql(\"<solutions pred='$pred' count='$n'>\");\n\n $soln_i = 0;\n\n foreach($solutions as $solution) {\n print_psql(\"<solution id='$soln_i'>\");\n\n $new_solutions_arg_lists[$soln_i] = array();\n\n $arg_i = 0;\n foreach($solutions_arg_lists[$soln_i] as $arg) {\n $val = $solution[$arg];\n $num = $arg_i+1;\n $to_name = $arg_list[$arg_i];\n print_psql(\"<arg num='$num' from_name='$arg' to_name='$to_name' val='$val'/>\");\n $arg_i++;\n $new_solutions_arg_lists[$soln_i][$arg_i] = $to_name;\n $new_solutions[$soln_i][$to_name] = $val;\n }\n\n print_psql(\"</solution>\");\n $soln_i++;\n\n }\n\n print_psql(\"</solutions>\");\n print_psql(\"</unify>\");\n\n return array($new_solutions,$new_solutions_arg_lists);\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 adv_update($table, array $data, array $where);",
"function data_merge($new)\n\t{\n\t\tif ((int) $this->debug >= 4) echo \"<p>so_sql::data_merge(\".print_r($new,true).\")</p>\\n\";\n\n\t\tif (!is_array($new) || !count($new))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach($this->db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tforeach($this->non_db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tif (isset($new[self::USER_TIMEZONE_READ]))\n\t\t{\n\t\t\t$this->data[self::USER_TIMEZONE_READ] = $new[self::USER_TIMEZONE_READ];\n\t\t}\n\t\tif ((int) $this->debug >= 4) _debug_array($this->data);\n\t}",
"function AddDataDescriptiveStatisticsToDatabase($condition_dict, $projectID, $set_id, $branch_id, $file_id, $db, $standard_id_mappings)\n{\n\t/*foreach ($condition_dict as $cond) {\n\t\tif ($cond->is_control===1)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$insertArray = array();\n\t\tforeach ($cond->quant_dict_control_normalized as $key => $value) {\n\t\t\tarray_push($insertArray, array($projectID, $file_id, $set_id, $branch_id, $cond->condition_id, $key, $cond->quant_dict_avg_val[$key], $cond->quant_dict_mean_normalized[$key], $value, $cond->quant_dict_mean_normalized_p_value[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value[$key], $cond->quant_dict_sds[$key], $cond->quant_dict_control_normalized_p_value_bonferroni[$key], $cond->quant_dict_mean_normalized_p_value_bonferroni[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value_fdr[$key], $cond->quant_dict_mean_normalized_p_value_fdr[$key], $standard_id_mappings[$key]));\n\t\t}\n\t\t$chunked_array = array_chunk($insertArray, 2000);\n\t\tforeach ($chunked_array as $chunk) {\n\t\t\t$row_length = count($chunk[0]);\n\t\t\t$nb_rows = count($chunk);\n\t\t\t$length = $row_length * $nb_rows;\n\t\t\t$args = implode(',', array_map(\n\t\t\t\tfunction($el) { return '('.implode(',', $el).')'; },\n\t\t\t\tarray_chunk(array_fill(0, $length, '?'), $row_length)\n\t\t\t\t));\n\n\t\t\t$query_params = array();\n\t\t\tforeach($chunk as $array)\n\t\t\t{\n\t\t\t\tforeach($array as $value)\n\t\t\t\t{\n\t\t\t\t\t$query_params[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$insertText = \"INSERT INTO data_descriptive_statistics (project_id, file_id, set_id, branch_id, condition_id, unique_identifier_id, quant_val, fold_change_mean_norm, fold_change_control_norm, p_value_mean_norm, p_value_control_norm, std_dev, bonferroni_p_value_control_norm, bonferroni_p_value_mean_norm, fdr_p_value_control_norm, fdr_p_value_mean_norm, standard_molecule_id) VALUES \" . $args;\n\t\t\t$stmt = $db->prepare($insertText);\n\t\t\t$result = $stmt->execute($query_params);\n\t\t}\n\t}*/\n\t$new_file = fopen($set_id . '_data_descriptive_statistics.txt', \"w\");\n\tforeach ($condition_dict as $cond) {\n\t\tif ($cond->is_control===1)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$insertArray = array();\n\t\tforeach ($cond->quant_dict_control_normalized as $key => $value) {\n\t\t\t$newArray = array($projectID, $file_id, $set_id, $branch_id, $cond->condition_id, $key, $cond->quant_dict_avg_val[$key], $cond->quant_dict_mean_normalized[$key], $value, $cond->quant_dict_mean_normalized_p_value[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value[$key], $cond->quant_dict_sds[$key], $cond->quant_dict_control_normalized_p_value_bonferroni[$key], $cond->quant_dict_mean_normalized_p_value_bonferroni[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value_fdr[$key], $cond->quant_dict_mean_normalized_p_value_fdr[$key], $standard_id_mappings[$key]);\n\t\t\tfwrite($new_file, implode(\"\\t\", $newArray) . \"\\r\\n\");\n\t\t}\n\t}\n\tfclose($new_file);\n\t$query = \"LOAD DATA LOCAL INFILE '/var/www/html/DV/\" . $projectID . \"/\" . $set_id . \"_data_descriptive_statistics.txt' INTO TABLE data_descriptive_statistics FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\\\"' LINES TERMINATED BY '\\r\\n' (project_id, file_id, set_id, branch_id, condition_id, unique_identifier_id, quant_val, fold_change_mean_norm, fold_change_control_norm, p_value_mean_norm, p_value_control_norm, std_dev, bonferroni_p_value_control_norm, bonferroni_p_value_mean_norm, fdr_p_value_control_norm, fdr_p_value_mean_norm, standard_molecule_id)\";\n\t$stmt = $db->prepare($query, array(PDO::MYSQL_ATTR_LOCAL_INFILE => true));\n\t$result = $stmt->execute();\n\tunlink($set_id . '_data_descriptive_statistics.txt');\n}"
]
| [
"0.55745363",
"0.5494977",
"0.5457562",
"0.5446959",
"0.5444521",
"0.5440326",
"0.5375321",
"0.53691095",
"0.53545326",
"0.53493947",
"0.53467995",
"0.53102493",
"0.5262142",
"0.52501136",
"0.52376956",
"0.5234941",
"0.5190493",
"0.5188034",
"0.5159706",
"0.5156091",
"0.51534104",
"0.51520675",
"0.5146681",
"0.51306826",
"0.5125334",
"0.5124692",
"0.51123476",
"0.50966096",
"0.50775397",
"0.5073956"
]
| 0.55072206 | 1 |
Parse and return an array of extensions from the XML. | protected function parseExtensions(\SimpleXMLElement $extensions): array
{
$extensions = $extensions->asXML();
$return = array();
if (preg_match('/<gpxtpx:hr>(.*)<\/gpxtpx:hr>/', $extensions, $matches)) {
$return[] = HR::fromValue($matches[1]);
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExtensionsForCheck()\n {\n $res = array();\n $items = (array) $this->getNode(self::XML_PATH_CHECK_EXTENSIONS);\n\n foreach ($items as $name => $value) {\n if (!empty($value)) {\n $res[$name] = array();\n foreach ($value as $subname => $subvalue) {\n $res[$name][] = $subname;\n }\n }\n else {\n $res[$name] = (array) $value;\n }\n }\n\n return $res;\n }",
"public function getSupportedExtensions()\n\t{\n\t\treturn array('xml');\n\t}",
"public function getExtensions(): array;",
"public function getExtensions();",
"public static function getAllExtensions():array;",
"public function extensions(): array;",
"public function getExtensions() {}",
"public function getExtensions() {}",
"protected function getExtensionsData()\n {\n $result = [];\n try {\n $extensionsData = file_get_contents(self::URL_EXTENSIONS);\n\n if ($extensionsData && is_string($extensionsData)) {\n $result = json_decode($extensionsData, true);\n }\n } catch (\\Exception $e) {\n return false;\n }\n\n return $result;\n }",
"public function extensionsContent(): array;",
"public static function getList(\\DOMElement $parent)\n {\n $ret = array();\n foreach (Utils::xpQuery($parent, './saml_protocol:Extensions/*') as $node) {\n $ret[] = new Chunk($node);\n }\n\n return $ret;\n }",
"public static function getLoadedExtensionListArray() {}",
"public function getExtensionsAsArray() {\n if($this->mode == 'serial') {\n return $this->getSerialExtensionsAsArray();\n }\n else {\n return $this->getParallelExtensionsAsArray();\n }\n }",
"protected function getExtensions() {\n $listing = new ExtensionDiscovery($this->root);\n // Ensure that tests in all profiles are discovered.\n $listing->setProfileDirectories([]);\n $extensions = $listing->scan('module', TRUE);\n $extensions += $listing->scan('profile', TRUE);\n $extensions += $listing->scan('theme', TRUE);\n return $extensions;\n }",
"public function listExtensions()\n {\n $result = [];\n foreach ($this->extensionClassNames as $className) {\n $result[] = $this->getExtension($className);\n }\n\n usort($result, function($a, $b) {\n if ($a->getExtensionSortOrder() >= $b->getExtensionSortOrder()) {\n return 1;\n }\n\n return -1;\n });\n\n return $result;\n }",
"public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'dom' => array('5.0.0', '', '20031129')\n );\n return $extensions;\n }",
"public function getExtensions()\n {\n return $this->extension;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getValidExtensions();",
"public function extensions(): array\n {\n return collect($this->extensions)\n ->filter(fn (bool $enabled) => $enabled)\n ->keys()\n ->mapWithKeys(fn (string $extension) => [\n $extension => $this->meta(\"extensions.$extension.view\") ?? ('seo::extensions.' . $extension),\n ])\n ->toArray();\n }",
"public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }",
"public static function loadedExtensions()\n {\n $list = [];\n foreach( get_loaded_extensions() as $ext )\n {\n $ext = strtolower( trim( $ext ) );\n $list[ $ext ] = $ext;\n }\n ksort( $list );\n return $list;\n }",
"public static function getAllowedExtension()\n\t{\n\t\treturn ['xml' => 'XML'];\n\t}",
"public static function getExtensions()\n {\n return self::$_extensions;\n }",
"public function get_supported_extensions() {\n return array();\n }",
"public function all()\n\t{\n\t\t$extensions = array();\n\n\t\t// Loop through extensions directories\n\t\tforeach ($this->extensions_directories() as $directory)\n\t\t{\n\t\t\t// Get our extension slug - always\n\t\t\t// matches the folder name.\n\t\t\t$slug = basename($directory);\n\n\t\t\t// Read extension info. Always do this even\n\t\t\t// if no details are required as this will\n\t\t\t// validate the extension.\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$extensions[$slug] = $this->get($slug);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tksort($extensions);\n\t\treturn array_values($extensions);\n\t}",
"protected function getExtensions()\n {\n if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {\n $this->config = require realpath(__DIR__.'/../../../../../config/twig.php');\n } else {\n $this->config = require realpath(__DIR__.'/../../config/twig.php');\n }\n\n return isset($this->config['extensions']) ? $this->config['extensions'] : [];\n }"
]
| [
"0.7070322",
"0.6718482",
"0.6706279",
"0.66566133",
"0.66333497",
"0.66222453",
"0.64639866",
"0.64633375",
"0.6461583",
"0.6433685",
"0.6416894",
"0.6402385",
"0.6389342",
"0.6364007",
"0.62730086",
"0.61852634",
"0.6159045",
"0.6148548",
"0.6148548",
"0.6148548",
"0.6148548",
"0.61477655",
"0.6123394",
"0.6067732",
"0.60479283",
"0.602232",
"0.60197884",
"0.60006183",
"0.59558153",
"0.5953549"
]
| 0.691873 | 1 |
Get the value of admin | public function getAdmin()
{
return $this->admin;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAdminId()\n {\n return $this->data['fields']['admin_id'];\n }",
"public function getAdmin() {\n \n return $this->admin;\n }",
"function get_admin_name() {\n return $this->admin_name;\n }",
"public function getAdmin() {\n $sql = \"SELECT *\n FROM {$this->tablename} p\n WHERE p.status='admin'\";\n return $this->db->query($sql)->single($this->entity);\n }",
"function userAdmin( )\n {\n return $this->UserAdmin ;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminName()\n {\n return $this->admin_name;\n }",
"public function getAdminName()\n {\n return $this->admin_name;\n }",
"public static function admin() {\n\t\t\treturn self::$admin;\n\t\t}",
"public function getIdAdmin() {\n\t\treturn $this->id_admin;\n\t}",
"public function getNomAdmin() {\n\t\treturn $this->nom_admin;\n\t}",
"public function getAdminId(){\n return $this->a_id;\n }",
"public function getInAdmin() {\n\t\treturn $this->in_admin;\n\t}",
"public function getSenhaAdmin(){\n\t\t\treturn $this-> senha_admin;\n\t\t}",
"public function getIdentifiantAdmin() {\n\t\treturn $this->identifiant_admin;\n\t}",
"public function GetAdmin ();",
"public function getOGAdminID();",
"public function getAdminAttribute()\n {\n return User::whereId($this->accountId)->first();\n }",
"function current_admin()\n {\n return admin_auth()->user();\n }",
"public function getAdminUser()\n {\n return $this->registry->registry('current_admin_user');\n }",
"public function getAdminName() {\n return $this->scopeConfig->getValue ( static::XML_ADMIN_NAME, ScopeInterface::SCOPE_STORE );\n }",
"abstract public function getAdminType();",
"function AdminType()\n\t{\n\t\treturn $this->isAdmin()\n\t\t ? 'a'\n\t\t : 'c';\n\t}",
"function getAdminName() {\r\n\t\t\t$query = $this->pdo->prepare('select admin_name from admin_account');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}",
"function get_value_edit()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getAdminLabel()\n {\n return (strlen($this->_adminLabel)) ? $this->_adminLabel : $this->getLabel();\n }",
"public function getAdmin()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true) {\n $this->_f3->set('admin', $admin);\n }\n }",
"public function admin($bValue = NULL) {\t\t\tif (!is_null($bValue)) $this->bAdmin = $bValue; \n\t\t\treturn $this->bAdmin; \n\t\t}"
]
| [
"0.7655957",
"0.75225335",
"0.75152075",
"0.75036067",
"0.7360108",
"0.73347753",
"0.73347753",
"0.73347753",
"0.7312479",
"0.7312479",
"0.7278925",
"0.71919763",
"0.7129663",
"0.7109811",
"0.70641136",
"0.7057862",
"0.7021233",
"0.69675887",
"0.6905841",
"0.681004",
"0.6781938",
"0.67761874",
"0.6769195",
"0.67368114",
"0.6728291",
"0.67207557",
"0.6713408",
"0.67108387",
"0.6689978",
"0.66783583"
]
| 0.7666034 | 0 |
/ Called when a group is attempting to be deleted Check if there are subgroups and sort out what happens them and content | function au_subgroups_delete_group($hook, $type, $return, $params) {
$guid = get_input('guid');
if (!$guid) {
$guid = get_input('group_guid');
}
$group = get_entity($guid);
if (elgg_instanceof($group, 'group')) {
// determine if the group has any child groups
$child = au_subgroups_get_subgroups($group, 1);
$parent = au_subgroups_get_parent_group($group);
if ($child || $parent) {
// here we are, we're deleting something with subgroups or a parent
// if we've already sorted out what happens to content
// we'll have a special input
$content_policy = get_input('au_subgroups_content_policy', false);
if (!$content_policy) {
forward(elgg_get_site_url() . "groups/subgroups/delete/{$group->guid}");
}
// this is the top level to delete, so if transferring content to parent, it's the parent of this
// apply content policy recursively, then delete all subgroups recursively
// this could take a while...
set_time_limit(0);
$guids = au_subgroups_get_all_children_guids($group);
if (is_array($guids) && count($guids)) {
if ($content_policy != 'delete' && is_array($guids) && count($guids)) {
$options = array(
'container_guids' => $guids,
'au_subgroups_content_policy' => $content_policy,
'au_subgroups_parent_guid' => $parent->guid,
'limit' => 0
);
$batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_move_content', 25);
}
// now delete the groups themselves
$options = array(
'guids' => $guids,
'types' => array('group'),
'limit' => 0
);
$batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_delete_entities', 25, false);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDeleteGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function _deleteGroup()\n\t{\n\t\t// Get the informations\n\t\t$group = kform::getInput('group');\n\t\tlist($drawId, $groupname) = explode(';', $group);\n\n\t\t// Delete the draws\n\t\t$oGroup = new objgroup();\n\t\t$oGroup->deleteGroup($drawId, $groupname);\n\t\t$page = new utPage('none');\n\t\t$page->close(true, 'draws', DRAW_DISPLAY , $drawId);\n\t\texit();\n\t}",
"public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function deleteGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if( !isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg(\"group id not provided\");\n \n if( !is_numeric($request['group_id']) )\n throw_error_msg(\"invalid group id\");\n\n $id = (int)$request['group_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n global $cbgroup;\n\n $cbgroup->delete_group($id);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function delete() {\n\t\t// Delete passwords and all ssl data of this group\n\t\t$passwordList = $this->getPasswordList();\n\t\t$passwordList->deleteListItems();\n\n\t\t// Delete members from group\n\t\t$memberList = $this->getMemberList();\n\t\t$memberList->deleteListItems();\n\n\t\t// Delete group\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'], 'tx_passwordmgr_group')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroup', 'Removed group '.$this['uid']);\n\t}",
"function delete_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n list($flag, $msg) = $this->m_general->delete('users_group', $where);\n\n return JSONRES($flag, $msg);\n }",
"public function admin_delete(){\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n // Delete the group\n $delete_attempt = $this->Group->delete($this->params->id);\n if ($delete_attempt){\n $this->Session->setFlash('Group \\''.$group['Group']['name'].'\\' successfully deleted.', 'default', array('class' => 'alert alert-success'));\n CakeLog::write('admin', '[success] Group \\''.$group['Group']['name'].'\\' deleted.');\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n } else {\n $this->Session->setFlash('There was an error deleting the \\''.$group['Group']['name'].'\\' group.', 'default', array('class' => 'alert alert-error'));\n CakeLog::write('admin', '[error] Group \\''.$group['Group']['name'].'\\' could not be deleted.');\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }",
"function delGroupHandler() {\n global $inputs;\n\n $sql = \"delete from `group` where id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}",
"public function processGroupBeforeDelete($event)\n {\n $group_id = isset($event->data['aGroup']['Group']['id']) ? $event->data['aGroup']['Group']['id'] : '';\n if (!empty($group_id)) {\n $activityModel = MooCore::getInstance()->getModel('Activity');\n $this->Photo = ClassRegistry::init('Photo.Photo');\n $photos = $this->Photo->getPhotos('Group_Group', $group_id, null, null);\n foreach ($photos as $p) {\n $this->Photo->delete($p['Photo']['id']);\n\n // delete activity comment_add_photo\n $activityModel->deleteAll(array('Activity.item_type' => 'Photo_Photo', 'Activity.action' => 'comment_add_photo', 'Activity.item_id' => $p['Photo']['id']));\n\n // delete activity photos_tag\n $activityModel->deleteAll(array('Activity.item_type' => 'Photo_Photo', 'Activity.action' => 'photos_tag', 'Activity.items' => $p['Photo']['id']));\n }\n }\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM umgroup\n\t\t\t\tWHERE GpID=?\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID));\n\n\t}",
"public function deleteGroup() {\n $errors = $this->checkIsValidForDelete();\n if($errors === false){\n $sql = \"DELETE FROM `SM_GROUP` WHERE sm_idGroup ='$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n return true;\n }\n }else{\n return $errors;\n }\n }",
"function groups_delete_group($grouporid) {\n global $CFG;\n require_once($CFG->libdir.'/gdlib.php');\n\n if (is_object($grouporid)) {\n $groupid = $grouporid->id;\n $group = $grouporid;\n } else {\n $groupid = $grouporid;\n if (!$group = get_record('groups', 'id', $groupid)) {\n return false;\n }\n }\n\n // delete group calendar events\n delete_records('event', 'groupid', $groupid);\n //first delete usage in groupings_groups\n delete_records('groupings_groups', 'groupid', $groupid);\n //delete members\n delete_records('groups_members', 'groupid', $groupid);\n //then imge\n delete_profile_image($groupid, 'groups');\n //group itself last\n $result = delete_records('groups', 'id', $groupid);\n\n if ($result) {\n //trigger groups events\n events_trigger('groups_group_deleted', $group);\n }\n\n return $result;\n}",
"public function deletegroupAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$group = GroupNamespace::getCurrentGroup();\n \tif (isset($group))\n \t{\n \t\tGroupDAO::getGroupDAO()->deleteGroup($group);\n \t}\n \tGroupNamespace::clearCurrentGroup();\n \t$this->_helper->redirector('index', 'user');\n }",
"public function deleteGroup($id){\n\t\t//The downside to this approach is that in case you inherit the groups from another admin, you will not be able to delete them unless you are logged in with his or her credentials\n\t\t//Yet the upside is that you cannot delete groups created by other admin accounts\n\t\t$userGroup = DB::select(DB::raw(\n\t\t\t\t\t\t\t\t\t\"select user_groups.id from user_groups where user_groups.id = :groupId and user_groups.created_by = :createdBy\"),\n\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id,\"createdBy\"=>Auth::User()->id));\n\t\t//Check that there surveys in this group\n\t\t$surveysInGroup = DB::select(DB::raw(\n\t\t\t\t\t\t\t\t\t\"select surveys.id, surveys.type_id from surveys where surveys.user_group_id = :groupId\"),\n\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t if(!empty($userGroup)){//Means the group exists\n\t\t\t\t\t DB::beginTransaction();\n\t\t\t\t\t try{\n\t\t\t\t\t if(!empty($surveysInGroup)){//Means there are surveys in the group\n\t\t\t\t\t\t foreach($surveysInGroup as $survey){//Iterate over each survey in the group and delete it\n\t\t\t\t\t\t\t if ($survey->type_id == 1) {\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from results where results.survey_id = :surveyId and results.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from participants where participants.survey_id = :surveyId and participants.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from surveys where surveys.id = :surveyId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($survey->type_id == 2) {\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from peer_results where peer_results.peer_survey_id = :surveyId and peer_results.peer_survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from peer_surveys where peer_surveys.survey_id = :surveyId and peer_surveys.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from participants where participants.survey_id = :surveyId and participants.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from surveys where surveys.id = :surveyId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Now that you have removed the surveys you can delete the users in this group\n\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\"delete from user_in_groups where user_in_groups.user_group_id = :groupId and user_in_groups.user_group_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t//At this point it should be safe to delete the group\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\"delete from user_groups where user_groups.id = :groupId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t\n\t\t\t\t\t\tDB::commit();\n\t\t\t\t\t\treturn Redirect::to('admin/usergroup')->with('success','A user group has been deleted successfully.');\n\t\t\t\t\t\t}catch(\\Exception $e){\n\t\t\t\t\t\t\tDB::rollback();\n\t\t\t\t\t\t\treturn \"An error occured; your request could not be completed \".$e->getMessage();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn Redirect::to('admin/usergroup')->with('warning','A user group could not be deleted: check if you are the one who created the group.');\n \t\n }",
"function CleanUp () {\n global $zOLDAPPLE;\n\n $criteria = array (\"groupInformation_tID\" => $this->tID,\n \"Body\" => DELETED_GROUP_ENTRY);\n $this->groupContent->SelectByMultiple ($criteria);\n\n // Break out if no deleted posts left. \n if ($this->groupContent->CountResult() == 0) return (TRUE);\n\n while ($this->groupContent->FetchArray ()) {\n $CHILDREN = new cGROUPCONTENT ();\n $childcriteria = array (\"parent_tID\" => $this->groupContent->tID,\n \"groupInformation_tID\" => $this->tID,\n \"Context\" => $zOLDAPPLE->Context);\n $CHILDREN->SelectByMultiple ($childcriteria);\n\n // If no children, delete.\n if ($CHILDREN->CountResult () == 0) {\n $this->groupContent->Delete ();\n $this->CleanUp ();\n } // if\n unset ($CHILDREN);\n } // while\n }",
"public function phrase_delete_group()\n {\n $group_id = ee()->input->get('phrase_group_id', TRUE);\n $groups = array('' => '- Select -');\n\n foreach (ee()->publisher_phrase->get_groups() as $id => $group)\n {\n if ($group_id != $id)\n {\n $groups[$id] = $group->group_label;\n }\n }\n\n $vars = array(\n 'group_name' => ee()->publisher_phrase->get_group($group_id)->group_label,\n 'groups' => $groups,\n 'hidden' => array('group_id' => $group_id),\n 'delete_url' => ee()->publisher_helper_cp->mod_link('phrase_delete_group_execute', array(), TRUE),\n );\n\n return ee()->load->view('phrase/delete_group', $vars, TRUE);\n }",
"public function delete()\n {\n // Do not delete children, because they are fake objects\n if (false === $this->parent_target_group && $this->target_group_id > 0) {\n $result = rex_sql::factory();\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n $return = ($result->hasError() ? false : true);\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n // reset priorities\n $this->setPriority(true);\n\n // Don't forget to regenerate URL cache\n d2u_addon_backend_helper::generateUrlCache('target_group_id');\n d2u_addon_backend_helper::generateUrlCache('target_group_child_id');\n\n return $return;\n }\n\n return false;\n\n }",
"function dbDeleteGroup($group_id){\n try {\n\n $db = pdoConnect();\n global $db_table_prefix;\n\n $groupDetails = fetchGroupDetails($group_id);\n\n if ($groupDetails['can_delete'] == '0'){\n addAlert(\"danger\", lang(\"CANNOT_DELETE_PERMISSION_GROUP\", array($groupDetails['name'])));\n return false;\n }\n\n $stmt = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"groups\n WHERE id = :group_id\");\n\n $stmt2 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"user_group_matches\n WHERE group_id = :group_id\");\n\n $stmt3 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"group_page_matches\n WHERE group_id = :group_id\");\n\n $stmt4 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"group_action_permits\n WHERE group_id = :group_id\");\n\n $sqlVars = array(\":group_id\" => $group_id);\n\n $stmt->execute($sqlVars);\n\n if ($stmt->rowCount() > 0) {\n // Delete user and page matches for this group.\n $stmt2->execute($sqlVars);\n $stmt3->execute($sqlVars);\n $stmt4->execute($sqlVars);\n return $groupDetails['name'];\n } else {\n addAlert(\"danger\", \"The specified group does not exist.\");\n return false;\n }\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}",
"function delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }",
"public function delete(){\n\t\treturn $this->api->deleteGroup($this->getID());\n\t}",
"function groups_delete_groupings_groups($courseid, $showfeedback=false) {\n global $CFG;\n\n $groupssql = \"SELECT id FROM {$CFG->prefix}groups g WHERE g.courseid = $courseid\";\n delete_records_select('groupings_groups', \"groupid IN ($groupssql)\");\n\n //trigger groups events\n events_trigger('groups_groupings_groups_removed', $courseid);\n\n if ($showfeedback) {\n notify(get_string('deleted').' groupings_groups');\n }\n\n return true;\n}",
"public function testRemoveGroup(){\n self::$grpId4 = jAcl2DbUserGroup::createGroup('group4');\n $records2 = self::$groups;\n $records2[] = array('id_aclgrp'=>self::$grpId4,\n 'name'=>'group4',\n 'grouptype'=>0,\n 'ownerlogin'=>null);\n $this->assertTableContainsRecords('jacl2_group', $records2);\n\n // destruction d'un groupe (ici qui n'a pas de user)\n jAcl2DbUserGroup::removeGroup(self::$grpId4);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n }",
"protected function bp_gtm_delete_g_data($data) {\n global $bp, $wpdb;\n\n if (!check_admin_referer('bp_gtm_delete'))\n return false;\n $paths = $wpdb->get_results($wpdb->prepare(\"SELECT path FROM {$bp->gtm->table_files} WHERE `group_id` = %d\", $_POST['cur_group']));\n foreach ($paths as $path) {\n if (file_exists(bp_gtm_file_dir($path->path)))\n unlink(bp_gtm_file_dir($path->path));\n }\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_files} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_projects} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_tasks} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_taxon} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_terms} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_resps} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_discuss} WHERE `group_id` = %d\", $_POST['cur_group']));\n\n bp_core_add_message(__('Everything was deleted successfully.', 'bp_gtm'));\n\n do_action('bp_gtm_delete_g_data', $bp->groups->current_group->id);\n bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . $bp->gtm->slug . '/delete/');\n }",
"public function delete() {\r\n\r\n // Does the Group object have an ID?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::delete(): Attempt to delete a Group object that does not have it's ID property set.\", E_USER_ERROR );\r\n\r\n // Delete the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $st = $conn->prepare ( \"DELETE FROM \" . DB_PREFIX . \"groups WHERE id = :id LIMIT 1\" );\r\n \r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n }",
"public function deleteGroup()\n {\n // If the group has system attributes, we can't delete it.\n if ($this->groupProtected) {\n $this->notify(\n __('adminhub::notifications.attribute-groups.delete_protected')\n );\n\n return;\n }\n DB::transaction(function () {\n DB::table(config('getcandy.database.table_prefix').'attributables')\n ->whereIn(\n 'attribute_id',\n $this->attributeGroupToDelete->attributes()->pluck('id')->toArray()\n )->delete();\n $this->attributeGroupToDelete->attributes()->delete();\n $this->attributeGroupToDelete->delete();\n });\n $this->deleteGroupId = null;\n $this->refreshGroups();\n\n $this->notify(\n __('adminhub::notifications.attribute-groups.deleted')\n );\n }",
"function db_delete_group($gid)\n{\n\tglobal $db_errno;\n\tglobal $db_errmsg;\n\n\tif ($gid == -1)\n\t{\n\t\t// Can't delete \"All\".\n\t\t$db_errno = 0;\t# XXX - Is this kosher?\n\t\t$db_errmsg = \"Can't delete group \\\"All\\\".\";\n\t\treturn FALSE;\n\t}\n\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_group($gid);\n\tif ($old === NULL)\n\t\t// No such feed. I guess we can go home early.\n\t\treturn TRUE;\n\n\t// Move any members of this group to its parent.\n\t// \"IGNORE\" says to ignore records where the operation would\n\t// fail. Thus, if we have\n\t//\t\"New York Times\" in group \"News\"\n\t//\t\"New York Times\" in group \"Politics\"\n\t// \tgroup \"Politics\" in group \"News\"\n\t// we have a feed (New York Times) in both a group (Politics)\n\t// and its parent (News).\n\t//\n\t// If we now delete \"Politics\", we want to move all members of\n\t// Politics up one level. So normally we'd wind up with two\n\t// instances of \"New York Times in News\". \"IGNORE\" says to\n\t// skip those cases. We'll handle them separately, next.\n\t$query = sprintf(\"UPDATE IGNORE `group_members` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t/* Delete any duplicates */\n\t$query = sprintf(\"DELETE FROM `group_members` WHERE parent=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* If this group has any child groups, move them up one level\n\t * as well, into the parent of $gid.\n\t */\n\t$query = sprintf(\"UPDATE `groups` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* Delete this group from `groups` */\n\t$query = sprintf(\"DELETE FROM `groups` WHERE id=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\treturn TRUE;\t\t// Success\n}",
"function delete_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete($id);\n\t}",
"function timeconditions_timegroups_del_group($timegroup) {\n\tglobal $db;\n\n\t$sql = \"delete from timegroups_details where timegroupid = $timegroup\";\n\t$db->query($sql);\n\t$sql = \"delete from timegroups_groups where id = $timegroup\";\n\t$db->query($sql);\n\tneedreload();\n}",
"function system_delete_group($paramv)\n{\n}",
"function delete_group($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_delete_this_grp\"));\n else {\n //Deleting Everything Related To This Group\n $this->delete_group_topics($gid);\n $this->delete_group_videos($gid);\n $this->delete_group_members($gid);\n $db->delete(tbl($this->gp_tbl), array(\"group_id\"), array($gid));\n $this->update_user_total_groups($group['userid']);\n e(lang(\"grp_deleted\"), \"m\");\n }\n }"
]
| [
"0.7309016",
"0.7189372",
"0.7019656",
"0.7003522",
"0.6992807",
"0.6908704",
"0.69075",
"0.6874594",
"0.6864696",
"0.6840422",
"0.6818331",
"0.6803001",
"0.6788614",
"0.6788448",
"0.67875534",
"0.67852354",
"0.67308295",
"0.67292714",
"0.6700311",
"0.66999066",
"0.66378796",
"0.6614447",
"0.66097724",
"0.65994745",
"0.659782",
"0.65694475",
"0.6523548",
"0.6518544",
"0.6510263",
"0.6508262"
]
| 0.7353069 | 0 |
prevent users from being invited to subgroups they can't join | function au_subgroups_group_invite($hook, $type, $return, $params) {
$user_guid = get_input('user_guid');
$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
$parent = au_subgroups_get_parent_group($group);
// if $parent, then this is a subgroup they're being invited to
// make sure they're a member of the parent
if ($parent) {
if (!is_array($user_guid)) {
$user_guid = array($user_guid);
}
$invalid_users = array();
foreach($user_guid as $guid) {
$user = get_user($guid);
if ($user && !$parent->isMember($user)) {
$invalid_users[] = $user;
}
}
if (count($invalid_users)) {
$error_suffix = "<ul>";
foreach($invalid_users as $user) {
$error_suffix .= "<li>{$user->name}</li>";
}
$error_suffix .= "</ul>";
register_error(elgg_echo('au_subgroups:error:invite') . $error_suffix);
return false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}",
"public function UserIsMemberOfGroupAdminOrDie() {\n\t\t\n\t\t// User must be member of group adm or die\n\t\tif($_SESSION['groupMemberUser'] != 'adm') \n\t\t\tdie('You do not have the authourity to access this page');\n\t}",
"function del_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tremove_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}",
"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 abort()\n {\n $user = Auth::user();\n\n // Check if has not group throw forbidden\n if ($user->role_id != 1) \n return App::abort(403);\n\n }",
"public function elevatePremissions() {\n\t\tif($user->group == 'USR'){\n\t\t\t$user->group = \"ROOT\";\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('This user group cannot elevate permissions');\n\t\t}\n\t}",
"public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}",
"function checkIfDesacivable($memberOf, $refusedGroup=\"\"){\n $blacklisted = FALSE;\n foreach ($memberOf as $group) {\n if ($group == $refusedGroup){\n $blacklisted = TRUE;\n }\n }\n return $blacklisted;\n}",
"public function adminUserConditionDoesNotMatchRegularUser() {}",
"function getUsersNotInGroup() {\n\n\tglobal $db;\n\treturn $db->getUsersNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"function add_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tadd_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}",
"public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }",
"function stop_members_from_renewing($okay)\n{\n global $current_user;\n // If something else isn't okay, stop from running this code further.\n if (!$okay) {\n return $okay;\n }\n // If the user doesn't have a membership level carry on with checkout.\n if (!pmpro_hasMembershipLevel()) {\n return true;\n }\n // Check if the user's current membership level is the same for checking out.\n if (pmpro_hasMembershipLevel($_REQUEST['level'])) { // Change level ID to a different level.\n pmpro_setMessage('This is your current membership level. Please select a different membership level.', 'pmpro_error');\n return false;\n }\n if (PMPro_Alveoles::has_commitment_level()) {\n $user_id = $current_user->ID;\n $membership_levels = pmpro_getMembershipLevelsForUser( $user_id );\n /** @var PMPro_Membership_Level $level */\n foreach ($membership_levels as $l) {\n if (PMPro_Alveoles::is_with_commitment($l->ID)) {\n if ($date = PMPro_Alveoles::contracted($l->ID)) { //still engaged\n pmpro_setMessage(PMPro_Alveoles::getContractedMessage($date,$l->ID), 'pmpro_error');\n return false;\n }\n }\n }\n }\n return true;\n}",
"function inviteGroup($group_id)\n\t\t{\n\t\t\tglobal $ilAccess;\n\t\t\t$invited = 0;\n\t\t\tinclude_once \"./Modules/Group/classes/class.ilObjGroup.php\";\n\t\t\t$group = new ilObjGroup($group_id);\n\t\t\t$members = $group->getGroupMemberIds();\n\t\t\tforeach ($members as $user_id)\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccessOfUser($user_id, \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t{\n\t\t\t\t\t$this->inviteUser($user_id);\n\t\t\t\t\tif ($this->getInvitation() == self::INVITATION_ON)\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\t\t\t\t\tilObjUser::_addDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $invited;\n\t\t}",
"function email_choose_users_to_send($courseid, $roleid, $currentgroup) {\n\n\tglobal $CFG, $USER;\n\n\tif (! $course = get_record('course', 'id', $courseid) ) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n\t// Prepare users to choose us\n\tif ( $courseid ) {\n\n\t\tif ($course->id == SITEID) {\n\t $context = get_context_instance(CONTEXT_SYSTEM, SITEID); // SYSTEM context\n\t } else {\n\t $context = get_context_instance(CONTEXT_COURSE, $course->id); // Course context\n\t }\n\n\t\t// Security issue\n\t $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n\t $frontpagectx = get_context_instance(CONTEXT_COURSE, SITEID);\n\n\t if ($context->id != $frontpagectx->id) {\n\t require_capability('moodle/course:viewparticipants', $context);\n\t } else {\n\t require_capability('moodle/site:viewparticipants', $sitecontext);\n\t }\n\n\t\t$rolesnames = array();\n \t$avoidroles = array();\n\n\t if ($roles = get_roles_used_in_context($context, true)) {\n\t $canviewroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);\n\t $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);\n\n\t if ( ! $CFG->email_add_admins ) {\n\t \t$adminsroles = get_roles_with_capability('moodle/legacy:admin', CAP_ALLOW, $sitecontext);\n\t }\n\n\t foreach ($roles as $role) {\n\t if (!isset($canviewroles[$role->id])) { // Avoid this role (eg course creator)\n\t $avoidroles[] = $role->id;\n\t unset($roles[$role->id]);\n\t continue;\n\t }\n\t if (isset($doanythingroles[$role->id])) { // Avoid this role (ie admin)\n\t $avoidroles[] = $role->id;\n\t unset($roles[$role->id]);\n\t continue;\n\t }\n\n\t if ( ! $CFG->email_add_admins ) {\n\t \tif (isset($adminsroles[$role->id])) { // Avoid this role (ie admin)\n\t\t $avoidroles[] = $role->id;\n\t\t unset($roles[$role->id]);\n\t\t continue;\n\t\t }\n\t }\n\n\t // Prevent - CONTRIB-609\n\t \tif ( function_exists('role_get_name') ) {\n\t \t\t$rolenames[$role->id] = strip_tags(role_get_name($role, $context)); // Used in menus etc later on\n\t \t} else {\n\t \t\t$rolenames[$role->id] = strip_tags(format_string($role->name)); // Used in menus etc later on\n\t \t}\n\n\t }\n\t }\n\n\t // we are looking for all users with this role assigned in this context or higher\n\t if ($usercontexts = get_parent_contexts($context)) {\n\t $listofcontexts = '('.implode(',', $usercontexts).')';\n\t } else {\n\t $listofcontexts = '('.$sitecontext->id.')'; // must be site\n\t }\n\t if ($roleid) {\n\t $selectrole = \" AND r.roleid = $roleid \";\n\t } else {\n\t $selectrole = \" \";\n\t }\n\n\t if ($context->id != $frontpagectx->id) {\n\t $select = 'SELECT DISTINCT u.id, u.username, u.firstname, u.lastname ';\n\t } else {\n\t $select = 'SELECT u.id, u.username, u.firstname, u.lastname ';\n\t }\n\n\t if ($context->id != $frontpagectx->id) {\n\t $from = \"FROM {$CFG->prefix}user u\n\t LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t ON (u.id=ctx.instanceid AND ctx.contextlevel = \".CONTEXT_USER.\")\n\t JOIN {$CFG->prefix}role_assignments r\n\t ON u.id=r.userid\n\t LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul\n\t ON (r.userid=ul.userid and ul.courseid = $course->id) \";\n\t } else {\n\t $from = \"FROM {$CFG->prefix}user u\n\t LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t ON (u.id=ctx.instanceid AND ctx.contextlevel = \".CONTEXT_USER.\") \";\n\n\t }\n\n\t\t$hiddensql = has_capability('moodle/role:viewhiddenassigns', $context)? '':' AND r.hidden = 0 ';\n\n\t // exclude users with roles we are avoiding\n\t if ($avoidroles) {\n\t $adminroles = 'AND r.roleid NOT IN (';\n\t $adminroles .= implode(',', $avoidroles);\n\t $adminroles .= ')';\n\t } else {\n\t $adminroles = '';\n\t }\n\n\t // join on 2 conditions\n\t // otherwise we run into the problem of having records in ul table, but not relevant course\n\t // and user record is not pulled out\n\n\t if ($context->id != $frontpagectx->id) {\n\t $where = \"WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)\n\t AND u.deleted = 0 $selectrole\n\t AND (ul.courseid = $course->id OR ul.courseid IS NULL)\n\t AND u.username != 'guest'\n\t $adminroles\n\t $hiddensql \";\n\t } else {\n\t $where = \"WHERE u.deleted = 0\n\t AND u.username != 'guest'\";\n\t }\n\n\t if ($currentgroup and $course->groupmode != 0) { // Displaying a group by choice\n\t $from .= 'LEFT JOIN '.$CFG->prefix.'groups_members gm ON u.id = gm.userid ';\n\n\t // $currentgroup can be an array of groups id\n\t if (is_array($currentgroup)) {\n\t $where .= ' AND gm.groupid IN ('.implode(',', $currentgroup).') ';\n\t } else {\n\t if ($currentgroup == 0) {\n\t if (!has_capability('block/email_list:viewallgroups', $context) && $COURSE->groupmode == 1) {\n\t $groupids = groups_get_groups_for_user($USER->id, $COURSE->id);\n\t $where .= 'AND gm.groupid IN ('.implode(',', $groupids).')';\n\t }\n\t } else {\n\t $where .= 'AND gm.groupid = '.$currentgroup;\n\t }\n\t }\n\n\t $where .= ' AND gm.groupid = '.$currentgroup;\n\t }\n\n\t $sort = ' ORDER BY u.firstname, u.lastname';\n\n\t\t$userlist = get_records_sql($select.$from.$where.$sort);\n\n\n\t if ( $userlist ) {\n\t\t\tforeach ($userlist as $user) {\n\t \t$unselectedusers[$user->id] = addslashes(fullname($user, has_capability('moodle/site:viewfullnames', $context)));\n\t }\n\t }\n\n\t /// If there are multiple Roles in the course, then show a drop down menu for switching\n\t if (count($rolenames) > 1) {\n\t echo '<div class=\"rolesform\">';\n\t echo get_string('currentrole', 'role').': ';\n\t $rolenames = array(0 => get_string('all')) + $rolenames;\n\t popup_form(\"$CFG->wwwroot/blocks/email_list/email/participants.php?id=$courseid&group=$currentgroup&contextid=$context->id&roleid=\", $rolenames,\n\t 'rolesform', $roleid, '');\n\t echo '</div>';\n\t }\n\n\t // Prints group selector for users with a viewallgroups capability if course groupmode is separate\n\t echo '<br />';\n\t\tgroups_print_course_menu($course, $CFG->wwwroot.'/blocks/email_list/email/participants.php?id='.$course->id);\n\t\techo '<br /><br />';\n\t}\n\n // Prepare tags\n $straddusersto = get_string('addusersto', 'block_email_list');\n $stradduserscc = get_string('cc', 'block_email_list');\n $straddusersbcc = get_string('bcc', 'block_email_list');\n $stradd = get_string('ok');\n $strto = get_string('to', 'block_email_list');\n $strcc = get_string('cc', 'block_email_list');\n $strbcc = get_string('bcc', 'block_email_list');\n $strselectedusersremove = get_string('selectedusersremove', 'block_email_list');\n $straction = get_string('selectaction', 'block_email_list');\n $strcancel = get_string('cancel');\n\n\t// Create an object for define parametrer\n\t$options = new stdClass();\n\t$options->id = $courseid;\n\t// Prepare url\n\t$toform = email_build_url($options, true);-\n\n\t$url = $CFG->wwwroot.'/blocks/email_list/email/sendmail.php';\n\n\tif ( $options ) {\n\t\t$urlhtml = email_build_url($options);\n\t}\n\n include_once('participants.html');\n\n}",
"function groups_get_users_not_in_group_by_role($courseid, $groupid, $searchtext='', $sort = 'u.lastname ASC') {\n\n global $CFG;\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n\n if ($searchtext !== '') { // Search for a subset of remaining users\n $LIKE = sql_ilike();\n $FULLNAME = sql_fullname();\n $wheresearch = \" AND u.id IN (SELECT id FROM {$CFG->prefix}user WHERE $FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%' )\";\n } else {\n $wheresearch = '';\n }\n\n/// Get list of allowed roles \n if(!($validroleids=groups_get_possible_roles($context))) {\n return;\n }\n \n $roleids = '('.implode(',', $validroleids).')';\n\n/// Construct the main SQL\n $select = \" SELECT r.id AS roleid,r.shortname AS roleshortname,r.name AS rolename,\n u.id AS userid, u.firstname, u.lastname\";\n $from = \" FROM {$CFG->prefix}user u\n INNER JOIN {$CFG->prefix}role_assignments ra ON ra.userid = u.id\n INNER JOIN {$CFG->prefix}role r ON r.id = ra.roleid\";\n\n $where = \" WHERE ra.contextid \".get_related_contexts_string($context).\"\n AND u.deleted = 0\n AND ra.roleid in $roleids\n AND u.id NOT IN (SELECT userid\n FROM {$CFG->prefix}groups_members\n WHERE groupid = $groupid)\n $wheresearch\";\n $orderby = \" ORDER BY $sort\";\n\n return groups_calculate_role_people(get_recordset_sql(\n $select.$from.$where.$orderby),$context);\n}",
"private static function accept($args, $invite, $auth) {\n // insert a groups_users record\n $values = array(\n 'group_id'=>$invite['group_id'],\n 'user_id'=>hostsite_get_user_field('indicia_user_id'),\n 'administrator' => 'f'\n );\n $auth['write_tokens']['persist_auth']=true;\n $s = submission_builder::build_submission($values, array('model' => 'groups_user'));\n $r = data_entry_helper::forward_post_to('groups_user', $s, $auth['write_tokens']);\n // either a success, or already a member (2004=unique key violation)\n if (!isset($r['success']) && (!isset($r['code']) || $r['code']!==2004)) {\n // @todo Unique constraint needs to be added to groups_users\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to accept an invite: '.print_r($r, true));\n return self::fail_message('An internal error occurred whilst trying to accept the invite', $args);\n } elseif (isset($r['code']) && $r['code']===2004) {\n hostsite_show_message(lang::get(\n 'There is no need to accept this invitation as you are already a member of {1}.', $invite['group_title']));\n hostsite_goto_page($args['groups_page_path']);\n } else {\n // delete the invitation\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 $group = data_entry_helper::get_population_data(array(\n 'table' => 'group',\n 'extraParams' => $auth['read'] + array('id'=>$invite['group_id'])\n ));\n if (!isset($r['success'])) {\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to delete an accepted invite: '.print_r($r, true));\n // probably no point telling the user, as the invite accept worked OK\n }\n hostsite_goto_page($args['group_home_path'], array('group_id'=>$invite['group_id']));\n module_load_include('inc', 'iform', 'iform.groups');\n return iform_show_group_join_success($group[0], $auth, true, $args['group_home_path'], $args['group_page_path']);\n }\n return '';\n }",
"function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}",
"private function _invited()\n {\n // Check we're not over-joined\n if (count($this->_currentChannels) < $this->_maxChannels)\n {\n $this->setChannels($this->_data->message);\n $this->_irc->join($this->_data->message);\n }\n else {\n $this->_privmessage(\n 'Sorry, I\\'m already in too many channels.', \n $this->_data->nick\n );\n }\n }",
"function invite_member($user, $gid, $owner = NULL) {\n global $cbemail, $db, $userquery;\n $group = $this->get_group_details($gid);\n\n if (!$owner)\n $owner = userid();\n\n $sender = $userquery->get_user_details($owner);\n $reciever = $userquery->get_user_details($user);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$sender)\n e(lang(\"unknown_sender\"));\n elseif (!$reciever)\n e(lang(\"unknown_reciever\"));\n elseif ($this->is_member($user, $gid))\n e(lang(\"user_already_group_mem\"));\n elseif ($owner != $group['userid'])\n e(lang(\"grp_owner_err1\"));\n else {\n //Inserting Invitation Code in database\n $db->insert(tbl($this->gp_invite_tbl), array('group_id', 'userid', 'invited', 'date_added'), array($gid, $owner, $reciever['userid'], now()));\n e(lang(\"grp_inv_msg\"), \"m\");\n\n //Now Sending Email To User\n $tpl = $cbemail->get_template('group_invitation');\n\n $more_var = array\n (\n '{reciever}' => $reciever['username'],\n '{sender}' => $sender['username'],\n '{group_url}' => group_link(array('details' => $group)),\n '{group_name}' => $group['group_name'],\n '{group_description}' => $group['group_description']\n );\n\n if (!is_array($var))\n $var = array();\n $var = array_merge($more_var, $var);\n $subj = $cbemail->replace($tpl['email_template_subject'], $var);\n $msg = nl2br($cbemail->replace($tpl['email_template'], $var));\n //Now Finally Sending Email\n cbmail(array('to' => $reciever['email'], 'from' => WEBSITE_EMAIL, 'subject' => $subj, 'content' => $msg));\n }\n }",
"public function restrict_joining_group( $button ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $button;\n\n\t\t\t// Check if user has enough to join group\n\t\t\t$cost = abs( $this->prefs['join']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $button;\n\n\t\t}",
"function ProcessInvites () {\n global $zLOCALUSER;\n\n global $gINVITES, $gSITEDOMAIN;\n global $gINVITINGUSER, $gGROUPFULLNAME, $gGROUPURL;\n global $gGROUPINVITEACTION, $gGROUPINVITEUSERNAME, $gGROUPINVITEDOMAIN;\n\n // Loop through the action list.\n foreach ($gGROUPINVITEACTION as $count => $action) {\n $username = $gGROUPINVITEUSERNAME[$count];\n $domain = $gGROUPINVITEDOMAIN[$count];\n switch ($action) {\n case GROUP_ACTION_REMOVE:\n $USER = new cOLDUSER ();\n $USER->Select (\"Username\", $username);\n $USER->FetchArray ();\n if ($USER->uID != $this->userAuth_uID) {\n //$this->Leave ($username, $domain);\n } // if\n unset ($USER);\n break;\n } // switch\n } // foreach\n\n $gINVITINGUSER = $zLOCALUSER->userProfile->GetAlias ();\n $gGROUPFULLNAME = $this->Fullname;\n $groupaddress = $this->Name . '@' . $gSITEDOMAIN;\n $gGROUPURL = \"!##asd group='$groupaddress' /##!\";\n\n $invitelist = explode (',', $gINVITES);\n foreach ($invitelist as $id => $address) {\n list ($username, $domain) = explode ('@', $address);\n\n $checkcriteria = array (\"groupInformation_tID\" => $this->tID,\n \"Username\" => $username,\n \"Domain\" => $domain);\n $this->groupMembers->SelectByMultiple ($checkcriteria);\n if ($this->groupMembers->CountResult () > 0) {\n // User is already in the list. Continue.\n continue;\n } // if\n $this->groupMembers->Username = $username;\n $this->groupMembers->Domain = $domain;\n $this->groupMembers->groupInformation_tID = $this->tID;\n $this->groupMembers->Verification = GROUP_VERIFICATION_INVITED;\n $this->groupMembers->Stamp = SQL_NOW;\n $this->groupMembers->Add ();\n \n // NOTE: Message shouldn't use globals for recipients.\n $MESSAGE = new cMESSAGE ();\n\n global $gRECIPIENTNAME, $gRECIPIENTDOMAIN, $gRECIPIENTADDRESS;\n $gRECIPIENTNAME = $username;\n $gRECIPIENTDOMAIN = $domain;\n $gRECIPIENTADDRESS = $gRECIPIENTNAME . '@' . $gRECIPIENTDOMAIN;\n \n global $gSUBJECT, $gBODY;\n $gBODY = __(\"Group Invite Body\", array ( \"name\" => $gRECIPIENTNAME, \"domain\" => $gRECIPIENTDOMAIN, \"address\" => $gRECIPIENTADDRESS ) );\n $gBODY = str_replace (\"!##\", \"<\", $gBODY);\n $gBODY = str_replace (\"##!\", \">\", $gBODY);\n $gSUBJET = __(\"Group Invite Subject\", array ( \"name\" => $gRECIPIENTNAME) );\n $MESSAGE->Send ($zLOCALUSER->Username);\n unset ($MESSAGE);\n } // foreach\n\n $this->Message = __(\"User Invited To Group\");\n $this->Error = 0;\n\n return (TRUE);\n\n }",
"public static function acceptMembershipRequests(\\Elgg\\Event $event): void {\n\t\t$entity = $event->getObject();\n\t\tif (!$entity instanceof \\ElggGroup || !$entity->canEdit()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (elgg_get_plugin_setting('auto_accept_membership_requests', 'group_tools') !== 'yes') {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!$entity->isPublicMembership()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// just in case\n\t\tset_time_limit(0);\n\t\t\n\t\t// get pending requests\n\t\t/* @var $pending_requests \\ElggBatch */\n\t\t$pending_requests = $entity->getEntitiesFromRelationship([\n\t\t\t'type' => 'user',\n\t\t\t'relationship' => 'membership_request',\n\t\t\t'inverse_relationship' => true,\n\t\t\t'limit' => false,\n\t\t\t'batch' => true,\n\t\t\t'batch_inc_offset' => false,\n\t\t]);\n\t\t/* @var $requesting_user \\ElggUser */\n\t\tforeach ($pending_requests as $requesting_user) {\n\t\t\t// join the group\n\t\t\tif (!$entity->join($requesting_user)) {\n\t\t\t\t$pending_requests->reportFailure();\n\t\t\t}\n\t\t}\n\t}",
"function isGroupAdmin($authorisers)\r\n{\r\n if ($authorisers == 999 || $authorisers == 0)\r\n return false;\r\n\r\n\treturn in_array($authorisers, $GLOBALS['group_membership']) \r\n\t\t\t|| \r\n\t\t\t\tin_array(2, $GLOBALS['group_membership']);\r\n}",
"final public function addItemGroupWithoutSupervisor() {\n\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id'] > 0) {\n $this->addForGroup(2, $val->fields['groups_id']);\n }\n }\n }\n }",
"public function validateAdminUserAction()\n {\n $id = $this->_request->getParam('user_id');\n if ($id) {\n $limited = $this->_collectionsFactory->create()->getUsersOutsideLimitedScope(\n $this->_role->getIsAll(),\n $this->_role->getWebsiteIds(),\n $this->_role->getStoreGroupIds()\n );\n\n if (in_array($id, $limited)) {\n $this->_forward();\n return false;\n }\n }\n return true;\n }",
"function updateMemberGroup()\n {\n // ------------------------------------\n // Only super admins can administrate member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1) {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n $edit = (bool) Request::has('group_id');\n\n $group_id = Request::input('group_id');\n $clone_id = Request::input('clone_id');\n\n unset($_POST['group_id']);\n unset($_POST['clone_id']);\n\n // No group name\n if ( ! Request::input('group_name')) {\n return Cp::errorMessage(__('members.missing_group_name'));\n }\n\n $return = (Request::has('return'));\n\n $site_ids = [];\n $plugin_ids = [];\n $weblog_ids = [];\n $template_ids = [];\n\n // ------------------------------------\n // Remove and Store Weblog and Template Permissions\n // ------------------------------------\n\n $data = [\n 'group_name' => Request::input('group_name'),\n 'group_description' => Request::input('group_description'),\n ];\n\n $duplicate = DB::table('member_groups')\n ->where('group_name', $data['group_name']);\n\n if (!empty($group_id)) {\n $duplicate->where('group_id', '!=', $group_id);\n }\n\n if($duplicate->count() > 0) {\n return Cp::errorMessage(__('members.duplicate_group_name'));\n }\n\n // ------------------------------------\n // Preferences\n // ------------------------------------\n\n $preferences['group_id'] = $group_id;\n $preferences['is_locked'] = Request::input('is_locked');\n\n foreach(static::$group_preferences as $group => $prefs) {\n foreach((array) $prefs as $key => $default) {\n if (Request::has($key)) {\n $preferences[$key] = Request::get($key);\n }\n }\n }\n\n foreach (Request::all() as $key => $val)\n {\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } else {\n continue;\n }\n }\n\n if ($edit === false)\n {\n $group_id = DB::table('member_groups')->insertGetId($data);\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $uploads = DB::table('upload_prefs')\n ->select('id')\n ->get();\n\n foreach($uploads as $yeeha)\n {\n DB::table('upload_no_access')\n ->insert(\n [\n 'upload_id' => $yeeha->id,\n 'upload_loc' => 'cp',\n 'member_group' => $group_id\n ]);\n }\n\n $message = __('members.member_group_created').' '.$_POST['group_name'];\n }\n else\n {\n DB::table('member_groups')\n ->where('group_id', $data['group_id'])\n ->update($data);\n\n DB::table('member_group_preferences')\n ->where('group_id', $data['group_id'])\n ->delete();\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $message = __('members.member_group_updated').' '.$_POST['group_name'];\n }\n\n // Update CP log\n Cp::log($message);\n\n $this->clearMemberGroupCache($data['group_id']);\n\n if ($return == true) {\n return $this->member_group_manager($message);\n }\n\n return $this->editMemberGroup($message, $group_id);\n }",
"function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }",
"function projectsNotInGroup() {\n\n\tglobal $db;\n\treturn $db->projectsNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}"
]
| [
"0.6403085",
"0.6118794",
"0.605944",
"0.59526056",
"0.57342535",
"0.5721309",
"0.56360734",
"0.5636036",
"0.5632193",
"0.5569195",
"0.5568988",
"0.5556467",
"0.5541279",
"0.5515305",
"0.5490671",
"0.5484996",
"0.54816407",
"0.54723686",
"0.5465246",
"0.5463045",
"0.5448393",
"0.5437698",
"0.5433913",
"0.5417289",
"0.5415983",
"0.5407691",
"0.54071635",
"0.5400985",
"0.53666556",
"0.53570724"
]
| 0.6696632 | 0 |
A role can have een parent role. | public function parentrole()
{
return $this->belongsTo(self::class, 'parent_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function parentRole()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"protected function parentRole()\n {\n return !empty($this->parentRole) ? $this->parentRole : $this->parent->recordRole();\n }",
"public function parent()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"public function parent()\n {\n return $this->belongsTo(config('rbac.models.role'),'parent_id');\n }",
"public function setParent(Role $parent)\n {\n $this->parent = $parent;\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"final public function allowsParent() {\n\t\treturn true;\n\t}",
"public function hasParent() {}",
"public function isParent();",
"public function hasParent()\n {\n }",
"public function hasParent();",
"public function hasParent();",
"public function hasParent();",
"protected function hasParentMenuItem() {}",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"public function setRole($role)\n {\n $this->parentRole = $role;\n }",
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function canHaveChildren() {}",
"function parentNode() {\n if (!$this->id && empty($this->data)) {\n return null;\n }\n if (isset($this->data['User']['role_id'])) {\n $roleId = $this->data['User']['role_id'];\n } else {\n $roleId = $this->field('role_id');\n }\n if (!$roleId) {\n return null;\n } else {\n return array('Role' => array('id' => $roleId));\n }\n }",
"public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}",
"public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }",
"public function hasRole() {\n return $this->_has(2);\n }",
"function is_role($roles = array(), $use_role_name = TRUE, $check_parent = TRUE)\n\t{\n\t\t// Default return value\n\t\t$result = FALSE;\n\t\n\t\t// Build checking array\n\t\t$check_array = array();\n\t\t\n\t\tif ($check_parent)\n\t\t{\n\t\t\t// Add parent roles into check array\n\t\t\tif ($use_role_name)\n\t\t\t{\n\t\t\t\t$check_array = $this->ci->session->userdata('DX_parent_roles_name');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$check_array = $this->ci->session->userdata('DX_parent_roles_id');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add current role into check array\n\t\tif ($use_role_name)\n\t\t{\n\t\t\tarray_push($check_array, $this->ci->session->userdata('DX_role_name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarray_push($check_array, $this->ci->session->userdata('DX_role_id'));\n\t\t}\n\t\t\n\t\t// If $roles not array then we add it into an array\n\t\tif ( ! is_array($roles))\n\t\t{\n\t\t\t$roles = array($roles);\n\t\t}\n\t\t\n\t\tif ($use_role_name)\n\t\t{\n\t\t\t// Convert check array into lowercase since we want case insensitive checking\n\t\t\tfor ($i = 0; $i < count($check_array); $i++)\n\t\t\t{\n\t\t\t\t$check_array[$i] = strtolower($check_array[$i]);\n\t\t\t}\n\t\t\n\t\t\t// Convert roles into lowercase since we want insensitive checking\n\t\t\tfor ($i = 0; $i < count($roles); $i++)\n\t\t\t{\n\t\t\t\t$roles[$i] = strtolower($roles[$i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check if roles exist in check_array\n\t\tif ($this->_array_in_array($roles, $check_array))\n\t\t{\n\t\t\t$result = TRUE;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function role()\n {\n return $this->hasOne('App\\Models\\Role');\n }",
"public function parentPermissions()\n {\n $parentPermissions = collect([]);\n\n $parent = $this->parentrole;\n\n while (!is_null($parent)) {\n if ($parent->permissions->count()) {\n $parentPermissions->push($parent->permissions);\n }\n $parent = $parent->parentrole;\n }\n\n return $parentPermissions;\n }",
"public function hasParentId(){\n return $this->_has(3);\n }",
"public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }",
"abstract public function parent();",
"public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }"
]
| [
"0.7558466",
"0.72053415",
"0.7043911",
"0.70424426",
"0.6691024",
"0.6591013",
"0.6505603",
"0.6461153",
"0.6369699",
"0.6353067",
"0.626471",
"0.62257785",
"0.62257785",
"0.62257785",
"0.620633",
"0.6202284",
"0.61791736",
"0.6111024",
"0.60926",
"0.60570765",
"0.6054575",
"0.60345095",
"0.6027444",
"0.59641683",
"0.59289736",
"0.5904427",
"0.5901599",
"0.5894751",
"0.5886294",
"0.58840185"
]
| 0.7532712 | 1 |
Get all parent roles. | public function getParentRoles()
{
$parents = collect([]);
$parent = $this->parent;
while (!is_null($parent)) {
$parents->push($parent);
$parent = $parent->parent;
}
return $parents;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function parentPermissions()\n {\n $parentPermissions = collect([]);\n\n $parent = $this->parentrole;\n\n while (!is_null($parent)) {\n if ($parent->permissions->count()) {\n $parentPermissions->push($parent->permissions);\n }\n $parent = $parent->parentrole;\n }\n\n return $parentPermissions;\n }",
"public function getRoles()\n {\n return $this->acl->getRoleAndParents($this->getRole());\n }",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"protected function parentRole()\n {\n return !empty($this->parentRole) ? $this->parentRole : $this->parent->recordRole();\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"private function get_all_roles(){\n return Role::all();\n }",
"public function parentRole()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"public function getParents()\n {\n return Menu::where('locale', getCurrentSessionAppLocale())\n ->where(function ($query){\n $query->whereNull('parent_slug')\n ->orWhere('parent_slug', '');\n })\n ->orderBy('menu_order', 'asc')\n ->get();\n }",
"public function getRoles()\n {\n return $this->getRelation('roles');\n }",
"public function getAllRoles()\n {\n return $this->repository->getAllRoles();\n }",
"public function getRoles() {\n return $this->getRelation(\"roles\");\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function roles()\n {\n\n return Role::all();\n }",
"public function getRoles()\n {\n $roles = $this->getExplicitRoles();\n\n if (!$roles) {\n return null;\n }\n\n $finalRoles = array();\n foreach ($roles as $role) {\n $childRoles = $role->getChildRoles();\n\n foreach ($childRoles as $childRole) {\n if (!in_array($childRole, $finalRoles)) {\n $finalRoles[] = $childRole;\n }\n }\n\n if (!in_array($role, $finalRoles)) {\n $finalRoles[] = $role;\n }\n }\n\n return $finalRoles;\n }",
"public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }",
"public function getRoles(): iterable\n {\n return [];\n }",
"public function getChildren($role)\n {\n $children = array();\n $model = Pi::model('acl_inherit');\n $rowset = $model->select(array('parent' => $role));\n\n foreach ($rowset as $row) {\n $children[] = $row->child;\n $sub = $this->getChildren($row->child);\n $children = array_unique(array_merge($children, $sub));\n }\n\n return $children;\n }",
"public function getParents()\n\t{\n\t\tif ($this->get('parents'))\n\t\t{\n\t\t\treturn $this->get('parents');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->setParents();\n\t\t}\n\t}",
"public function getDirectRoles() {\n return $this->roles;\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function getParents()\n {\n return $this->parents;\n }",
"public function getMenuParents()\n {\n return $this->db->select('*')->from('admin_menu')->where('parent',0)->get()->result_array();\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }",
"public function getAllParents()\n {\n $parents = array();\n\n $parent = $this;\n\n while ($parent = $parent->getParent()) {\n $parents[] = $parent;\n }\n\n return $parents;\n }",
"public function all()\n {\n $roles = collect($this->table()->where('user_id', $this->user->id())->get());\n\n if ($roles->isEmpty()) {\n return collect();\n }\n\n return $roles; // todo: groups\n }"
]
| [
"0.8765492",
"0.74436235",
"0.7337989",
"0.72473437",
"0.7016529",
"0.68748724",
"0.67876744",
"0.6731614",
"0.6718011",
"0.6700322",
"0.6654085",
"0.6645281",
"0.65859544",
"0.6573733",
"0.65629727",
"0.6554917",
"0.6536156",
"0.6528295",
"0.6515692",
"0.65018666",
"0.6501254",
"0.6467297",
"0.64321804",
"0.6419158",
"0.63911664",
"0.63813287",
"0.6375184",
"0.6370076",
"0.6367716",
"0.6366935"
]
| 0.8359708 | 1 |
Get permissions from all parent roles. | public function parentPermissions()
{
$parentPermissions = collect([]);
$parent = $this->parentrole;
while (!is_null($parent)) {
if ($parent->permissions->count()) {
$parentPermissions->push($parent->permissions);
}
$parent = $parent->parentrole;
}
return $parentPermissions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function getPermissionsViaRole()\n {\n return $this->roles->map(function (Role $role) {\n return $role->getAllPermissions();\n })->flatten();\n }",
"protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }",
"public function getAllPermissions()\n {\n $roles = $this->getAllRoles();\n $permissions = $roles ? call_user_func_array('array_merge', array_map(function(RoleInterface $role) {\n return $role->getAllPermissions();\n }, $roles)) : [];\n\n return (new Collection($permissions))->combine('slug', function($permission) {\n return $permission;\n })\n ->toArray();\n }",
"public function getRolePermissions()\n {\n return self::select(\"r.*, p.*\")\n ->leftJoin('role_permissions rp', 'r.roleID = rp.roleID')\n ->leftJoin('permissions p', 'p.permissionID = rp.permissionID')\n ->get();\n }",
"public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }",
"public function allPermissions(): Collection\n {\n return $this->permissions->merge($this->rolePermissions());\n }",
"public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function getPermissions(Roleable $resource = null);",
"public function getParentRoles()\n {\n $parents = collect([]);\n\n $parent = $this->parent;\n\n while (!is_null($parent)) {\n $parents->push($parent);\n $parent = $parent->parent;\n }\n\n return $parents;\n }",
"public function allPermissions(): Collection\n {\n if ($this->allPermissions) {\n return $this->allPermissions;\n }\n\n return $this->allPermissions =\n $this->roles\n ->pluck('permissions')\n ->flatten()\n ->keyBy($this->getKeyName());\n }",
"public function permissions()\n {\n return $this->embedsMany(\n config('laravel-permission.table_names.role_has_permissions')\n );\n }",
"public function getAllPermissionsAttribute()\n {\n // Check for inherited permissions and merge them in\n if($this->has_parent){\n return $this->permissions->merge(\n $this->parent->all_permissions\n );\n }\n\n return $this->permissions;\n }",
"public function rolePermissions(): Collection\n {\n return $this->roles?->loadMissing('permissions')->pluck('permissions')->flatten() ?? collect();\n }",
"protected function getPermissions()\n {\n if (!$this->tablePermissionsExists()) {\n return [];\n }\n return Permission::with('roles')->get();\n }",
"function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }",
"private function getUserRolePermissions()\n {\n return [];\n }",
"public function roles()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsToMany($classMapper->getClassMapping('role'), 'permission_roles', 'permission_id', 'role_id')->withTimestamps();\n }",
"public function getRoles()\n {\n return $this->acl->getRoleAndParents($this->getRole());\n }",
"public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}",
"public function getAllPermissions()\n {\n return $this->repository->getAllPermissions();\n }",
"public function getAllPermissions();",
"public function getAllPermissions();",
"private function get_all_roles(){\n return Role::all();\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"public function getPermissions()\n {\n\n $roles = Role::where(function($query){\n\n $query->whereIn('id',$this->roles()->pluck('role_id'));\n\n })->with('permissions')->get();\n\n\n $permissions = $roles->map(function($role){\n\n $permissionData = $role->permissions->pluck('permission');\n\n if(sizeOf($permissionData) > 0)\n {\n return $permissionData[0];\n }\n\n })->filter(function($item){\n if($item !== null)\n {\n return $item;\n }\n });\n\n if ($permissions->count() <= 1)\n {\n return $permissions;\n }\n\n return $permissions->unique();\n\n }",
"public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }",
"public function permissions()\n {\n return $this->belongsToManyThrough(\n EloquentTestPermission::class,\n EloquentTestRole::class,\n 'role_users',\n 'user_id',\n 'role_id',\n 'permission_roles',\n 'role_id',\n 'permission_id'\n );\n }",
"public static function getAllPermissions()\n\t{\n\t\treturn Permission::all();\n\t}"
]
| [
"0.725679",
"0.70296824",
"0.699677",
"0.68958336",
"0.6870528",
"0.6829015",
"0.66528183",
"0.6624707",
"0.6621569",
"0.66188425",
"0.6608916",
"0.65669155",
"0.6542632",
"0.6509425",
"0.6507237",
"0.6491133",
"0.6443972",
"0.6328512",
"0.62803066",
"0.6271014",
"0.62388605",
"0.6229176",
"0.6224069",
"0.6224069",
"0.6204945",
"0.6196641",
"0.61853963",
"0.6165575",
"0.613569",
"0.6129622"
]
| 0.77577955 | 0 |
Set whether or not to allow external connections This is useful for testing to see responses, and stub out services | static function setAllowExternalConnections($b) {
self::$allow_external_connections = $b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function doesAllowExternalConnections() {\n return self::$allow_external_connections;\n }",
"public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"function setRequiredExternalAccess( $flag = true )\r\n\t{\r\n\t $this->require_external_access = $flag;\r\n\t}",
"public function allowRequest(): bool\n {\n return true;\n }",
"function __allowRelay($allow)\n {\n $this->__relayAllowed=$allow;\n }",
"public function setIsWebRequest($val)\r\n\t{\r\n\t\tif (!is_bool($val))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Invalid value');\r\n\t\t}\r\n\t\t$this->isWebRequest = $val;\r\n\t}",
"public function setHttpProxyTunnelUsed($used);",
"function enableclient()\n {\n exec('ifconfig ' . escapeshellarg($this->interface) . ' up');\n exec($this->arfilelocation['iwpriv'] . ' ' . escapeshellarg($this->interface) . ' set SiteSurvey=1');\n }",
"private function setConnectionStat($bool){\n\t\t$this->m_IsConnected = $bool;\n\t}",
"private function setCurlUse(bool $bool){\n\t\t$this->curluse = $bool;\n\t}",
"public function setSecureOnly()\n\t{\n\t\tif ( isset( $this->OAuthSecret ) ) {\n\t\t\t$this->secure = true;\n\t\t}\n\t}",
"public function setUseSSL($use_ssl){\r\n\t\t$this->useSSL = $use_ssl;\r\n\t}",
"public function setAllow($value) {\r\n $this->allow = $value;\r\n }",
"function instance_allow_config() {\n return true;\n }",
"function instance_allow_config() {\n\n return false;\n }",
"function secure_connection() {\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"protected function use_http_get() {\n return false;\n }",
"public static function setTrustProxy($isTrusted = true) {\n\t self::$trust = $isTrusted ? true : false;\n\t}",
"public function set_is_api_request() {\n\t\t// Constant is not defined until parse_request.\n\t\tif ( ! $this->is_api_request ) {\n\t\t\t$this->is_api_request = defined( 'REST_REQUEST' ) && REST_REQUEST;\n\t\t}\n\t}",
"public function checkConnection(){\r\n\t\treturn false;\r\n\t}",
"public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }",
"public function allowResponse() {\n return $this->allow_response;\n }",
"public function useRemoteSubscription()\n {\n return false;\n }",
"public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }",
"public function connect(bool $sandbox = false);",
"public function instance_allow_config() {\n return false;\n }",
"function instance_allow_config()\r\n\t\t{\r\n\t\t\r\n\t\t}",
"public function instance_allow_config() {\n return true;\n }",
"public function enableSecureApiUrl()\n\t{\n\t\t$this->api_url = self::API_SECURE_URL;\n\t}"
]
| [
"0.6615528",
"0.62036014",
"0.60414904",
"0.6011218",
"0.575766",
"0.573498",
"0.5678765",
"0.5637087",
"0.55337846",
"0.5501304",
"0.5497651",
"0.54956484",
"0.5464986",
"0.5451374",
"0.5445402",
"0.54255193",
"0.5424967",
"0.5372971",
"0.5366408",
"0.5359078",
"0.5356375",
"0.5347017",
"0.5329687",
"0.53291076",
"0.5321233",
"0.5319417",
"0.53175724",
"0.53022945",
"0.5277735",
"0.52757233"
]
| 0.69687444 | 0 |
get whether or not we are allowing external connections | static function doesAllowExternalConnections() {
return self::$allow_external_connections;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkConnection(){\r\n\t\treturn false;\r\n\t}",
"public function isConnect()\n {\n return $this->bbb->isConnectionWorking();\n }",
"abstract function _is_conn();",
"public function isOnline() \n {\n // pings example.com and google.com\n $is_conn = null;\n $connected1 = @fsockopen(\"www.example.com\", 80); //website, port (try 80 or 443)\n $connected2 = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n // if either is successful\n if ($connected1 || $connected2){\n $is_conn = true; //action when connected\n fclose($connected1);\n fclose($connected2);\n }else{\n $is_conn = false; //action in connection failure\n }\n return $is_conn;\n }",
"public function isConnectionOpen(): bool;",
"public function isConnected() {}",
"public function isConnected() {}",
"public function isConnected() {}",
"public function is_connected()\n {\n $result = @$this->mcache->getExtendedStats();\n $canconnect = false;\n\n if($result) {\n foreach($result as $server => $stats) {\n if($stats) {\n $canconnect = true;\n break;\n }\n }\n }\n \n return $canconnect;\n }",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected(): bool;",
"public function isConnected(): bool;",
"public function isConnected(): bool;",
"public static function get_allowed_on_network()\n {\n }",
"function is_connected()\n\t{\n\t\t$connected = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n\t\tif ($connected){\n\t\t \t$is_conn = true; //action when connected\n\t\t\tfclose($connected);\n\t\t}else{\n\t\t\t$is_conn = false; //action in connection failure\n\t\t}\n\t\treturn $is_conn;\n\n\t}",
"public function serverOnline()\n {\n return @fsockopen( setting('server.ip', '127.0.0.1'), config( 'pw-api.ports.client' ), $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }",
"public function isConnected()\n\t{\n\t\treturn $this->isUser() || $this->isOrga();\n\t}",
"public static function checkConnection() {\r\n\t\t$url = MoufReflectionProxy::getLocalUrlToProject().\"src/direct/test_connection.php\";\r\n\t\r\n\t\t$response = self::performRequest($url);\r\n\t\t\r\n\t\tif ($response == 'ok') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function isConnected():bool;",
"public function CheckConnection() {\n\t\tif (is_resource($this->SQLConnection)\n\t\t\t&& strpos(get_resource_type($this->SQLConnection), 'odbc link') !== false)\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isConnected(){\n\n if (is_a($this->resourceId,\"mysqli\")) {\n return mysqli_ping($this->resourceId);\n }\n return false;\n }",
"public function aim_connected()\r\n\t{\r\n\t\tif (is_resource($this->resource)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('Unable to find active connection');\r\n\t\t}\r\n return false;\r\n\t}",
"public function IsConnected()\r\n\t{\r\n\t\tif( gettype( $this->db_link ) == 'resource' )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }",
"function is_connected()\n {\n static $isConnected = null;\n if ($isConnected !== null) {\n return $isConnected;\n }\n $isConnected = false;\n $connection = env('IS_CONNECTED', true) ? @fsockopen('www.google.com', 80) : null;\n if ($connection) {\n fclose($connection);\n $isConnected = true;\n }\n\n return $isConnected;\n }"
]
| [
"0.7054565",
"0.7030525",
"0.6975314",
"0.68853116",
"0.68583184",
"0.6839419",
"0.6839419",
"0.6839076",
"0.6828748",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6771379",
"0.6771379",
"0.6771379",
"0.67427135",
"0.6720285",
"0.6688985",
"0.66861385",
"0.6672659",
"0.6656094",
"0.6654841",
"0.6631892",
"0.66084677",
"0.66040736",
"0.6588644",
"0.6587997"
]
| 0.8181926 | 0 |
Perform a put request on the given url with optional body and headers | static function put($url, $body = null, $headers = array()) {
$request = new NiceHTTP\PutRequest($url, $body, $headers);
return $request->send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function put($url, $body = array(), $query = array(), $headers = array());",
"public function put(string $url, array $input = [], $headers = null);",
"public function put($url, $headers = [], $data = [], $options = [])\n {\n }",
"public function _put($url = null, array $parameters = []);",
"public static function put($url, $headers = [], $data = [], $options = [])\n {\n }",
"function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}",
"public static function put($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n static::set_body($ch, $options);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }",
"function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}",
"function put($url, $data = \"\", $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n $http_options[CURLOPT_POSTFIELDS] = $data;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }",
"public function put( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'PUT', $headers, $data );\n }",
"public function put($uri, $body = null, array $headers = []): ResponseInterface;",
"public function put($location, $body);",
"public function put(string $uri, array $params = [], $body = null, array $headers = []): ResponseInterface;",
"public function put($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::PUT, $options, $timeout);\n\t\t}",
"public static function put($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }",
"public function Put( $sUrl, $vRequestBody, $bJsonEncode = false );",
"public function put($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_PUT);\n\t}",
"public function put($url, $params = []) \n {\n return $this->request('PUT', $url, $params);\n }",
"public function put($url, $params = null)\n {\n return $this->request('PUT', $url, $params);\n }",
"function put(Request &$request, Response &$response);",
"public static function urlPUT($url, $data, $headers=null) {\n\n $isJsonForm = false;\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n $arrKeys = array_keys($data);\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n curl_close($ch);\n\n return utf8_encode($contents);\n }",
"public function put($url)\n {\n $this->requestType = Client::REQUEST_PUT;\n $this->url = $url;\n return $this;\n }",
"public function put($url, $params = [])\n {\n return $this->request($url, 'PUT', $params);\n }",
"protected function makePutRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }",
"public function _PUT($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'PUT', $params, $username, $password, $contentType);\n\n return $this->parseResponse($this->convertEncoding($response, 'utf-8', $this->_encode));\n }",
"private function curl_put($url, $data)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"protected function _doPut($in_url, $in_content, $in_content_type, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'PUT', $in_content, $in_content_type, $in_additional_curl_options);\r\n }",
"private function put($url, $content = '', $type = 'application/xml', $header = '') {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Set headers.\n\t\t$headers = array();\n\t\tif (!empty($type)) {\n\t\t\t$headers[] = 'Content-Type: ' . $type . '; charset=UTF-8';\n\t\t}\n\t\t$headers[] = 'Content-Length: ' . strlen($content);\n\t\tif (!empty($header)) {\n\t\t\t$headers[] = $header;\n\t\t}\n\n\t\t// PUT in PHP requires content to be in a file. Store in temp.\n\t\t$fp = fopen(\"php://temp\", \"r+\");\n\t\tfputs($fp, $content);\n\t\trewind($fp);\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tif (count($headers) > 0) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\tfclose($fp);\n\t\treturn $output;\n\t}",
"public function put($uri = null, $headers = null, $body = null)\n {\n return $this->createRequest('PUT', $uri, $headers, $body);\n }",
"public function doPut($path, array $parsed_body);"
]
| [
"0.8788709",
"0.7896316",
"0.7800557",
"0.77750427",
"0.77601177",
"0.767182",
"0.76223975",
"0.75847673",
"0.7391131",
"0.73700523",
"0.7259284",
"0.7214415",
"0.7204495",
"0.72022486",
"0.72010416",
"0.7130234",
"0.70983815",
"0.70396346",
"0.6986912",
"0.69466424",
"0.69305927",
"0.6922778",
"0.6906447",
"0.6893126",
"0.68771285",
"0.6862273",
"0.6834371",
"0.6792628",
"0.6762698",
"0.6732069"
]
| 0.7913318 | 1 |
Search for a matcher for the given Request. If we find one, return the proper response, otherwise return null | static function match($request) {
foreach (self::$matchers as $matcher) {
$response = $matcher($request);
if ($response !== null) {
$response->request = $request;
return $response;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function match($request)\r\n {\r\n foreach ($this->routes as $name => $route)\r\n {\r\n $route = $this->getRoute($name);\r\n\r\n if (is_array($params = $route->match($request))) {\r\n return new MatchedRoute($route, $name, $params);\r\n }\r\n }\r\n\r\n return null;\r\n }",
"public function match(Request $request) {\n\t\tif (! method_exists ( $request, 'getUri' )) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif ($this->baseUrl === null && method_exists ( $request, 'getBaseUrl' )) {\n\t\t\t$this->setBaseUrl ( $request->getBaseUrl () );\n\t\t}\n\t\t\n\t\t$uri = $request->getUri ();\n\t\t$baseUrlLength = strlen ( $this->baseUrl ) ? : null;\n\t\t\n\t\tif ($this->requestUri === null) {\n\t\t\t$this->setRequestUri ( $uri );\n\t\t}\n\t\t\n\t\tif ($baseUrlLength !== null) {\n\t\t\t$pathLength = strlen ( $uri->getPath () ) - $baseUrlLength;\n\t\t\t\n\t\t\tforeach ( $this->routes as $name => $route ) {\n\t\t\t\tif (($match = $route->match ( $request, $baseUrlLength )) instanceof RouteMatch && $match->getLength () === $pathLength) {\n\t\t\t\t\t$match->setMatchedRouteName ( $name );\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $this->defaultParams as $paramName => $value ) {\n\t\t\t\t\t\tif ($match->getParam ( $paramName ) === null) {\n\t\t\t\t\t\t\t$match->setParam ( $paramName, $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn $match;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn parent::match ( $request );\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function match(Request $request)\n {\n if (!method_exists($request, 'getMethod')) {\n return null;\n }\n\n $requestVerb = strtoupper($request->getMethod());\n\n if ($requestVerb === 'GET') {\n return new RouteMatch($this->defaults);\n }\n\n return null;\n }",
"function match(Nette\\Http\\IRequest $httpRequest): ?array;",
"public function match(Request $request)\n {\n if (!method_exists($request, 'getUri')) {\n return;\n }\n\n $uri = $request->getUri();\n $path = $uri->getPath();\n\n try {\n $parser = new UriParser($this->options);\n $result = $parser->parseUri($path);\n\n if (!$result instanceof Result) {\n return;\n }\n } catch (UnexpectedValueException $exception) {\n return; // todo: think about this\n } catch (TransformerNotFoundException $exception) {\n return; // todo: think about this\n }\n\n $routeMatch = new RouteMatch($this->options, strlen($path));\n $routeMatch->setParserResult($result);\n\n return $routeMatch;\n }",
"public function Matches (\\MvcCore\\IRequest $request);",
"function matchRequest(Request $request) {\n $requestPath = $request->getPath();\n\n if (mb_strpos($requestPath, $this->staticPrefix) !== 0) {\n return false;\n }\n\n if ($this->methodRequirement != null){\n if(mb_strcasecmp($this->methodRequirement, $request->getMethod()) != 0){\n return false;\n }\n }\n\n $result = preg_match($this->regex, $requestPath, $matches);\n\n if ($result == false) {\n return false;\n }\n\n foreach ($this->fnCheck as $fnCheck) {\n $result = $fnCheck($request);\n if (!$result) {\n return false;\n }\n }\n\n //Route has matched\n $params = array();\n\n foreach($this->variables as $routeVariable){\n if(array_key_exists($routeVariable->name, $matches) == true && \n strlen($matches[$routeVariable->name]) != 0) {\n $params[$routeVariable->name] = $matches[$routeVariable->name];\n }\n else if($routeVariable->default != null){\n $params[$routeVariable->name] = $routeVariable->default;\n }\n }\n\n return $params;\n }",
"public function find_route( Request $request ) {\n $this->context->logger()->debug( 'processing Request ' . $request );\n\n if(empty($this->routes)) $this->load_routes();\n\n foreach($this->routes as $route) {\n if($route->match($request)) {\n $this->context->logger()->debug( 'matched to Route ' . $route );\n return $route;\n }\n }\n throw new Exception(sprintf('Couldn\\'t find a route to match your request: %s', $request));\n }",
"private static function findRouteForRequest(Request $request) {\n\t\t\tforeach (JiaoyuCore::getRoutes() as $route) {\n\n\t\t\t\t// First we look for method - bail out if this route\n\t\t\t\t// doesn't match it\n\t\t\t\tif (!in_array($request->method, $route->methods)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Next look for a literal string match (no url params)\n\t\t\t\tif ($request->path == $route->path) {\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\n\t\t\t\t// Now we have to look for the patterns\n\t\t\t\t$requestParts = explode('/', $request->path);\n\t\t\t\t$routeParts = explode('/', $route->path);\n\t\t\t\tif (count($requestParts) != count($routeParts)) {\n\t\t\t\t\t// Matching pairs will have the same number of parts\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$matchCount = 0;\n\t\t\t\tfor ($i = 0; $i < count($requestParts); $i++) {\n\t\t\t\t\t// Exact match check for this pair of parts\n\t\t\t\t\tif ($routeParts[$i] == $requestParts[$i]) {\n\t\t\t\t\t\t$matchCount++;\n\t\t\t\t\t} else if (preg_match(\"/^\\{.+\\}$/\", $routeParts[$i])) {\n\t\t\t\t\t\t// This is an ugly check for the {varname} pattern in\n\t\t\t\t\t\t// routes with url params\n\t\t\t\t\t\t$matchCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($matchCount == count($requestParts)) {\n\t\t\t\t\t// All parts matched\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Found nothing\n\t\t\treturn null;\n\t\t}",
"public function match(Request $request)\n {\n $matcher = new CompiledUrlMatcher(\n $this->compiled, (new RequestContext)->fromRequest(\n $trimmedRequest = $this->requestWithoutTrailingSlash($request)\n )\n );\n\n $route = null;\n\n try {\n if ($result = $matcher->matchRequest($trimmedRequest)) {\n $route = $this->getByName($result['_route']);\n }\n } catch (ResourceNotFoundException|MethodNotAllowedException $e) {\n try {\n return $this->routes->match($request);\n } catch (NotFoundHttpException $e) {\n //\n }\n }\n\n if ($route && $route->isFallback) {\n try {\n $dynamicRoute = $this->routes->match($request);\n\n if (! $dynamicRoute->isFallback) {\n $route = $dynamicRoute;\n }\n } catch (NotFoundHttpException|MethodNotAllowedHttpException $e) {\n //\n }\n }\n\n return $this->handleMatchedRoute($request, $route);\n }",
"public function match(ServerRequestInterface $request):Result;",
"public function match ( Request $request ) {\n $params = [];\n $match = false;\n \n // set Request Url if it isn't passed as parameter\n $requestUrl = $request->requesturi();\n \n // set Request Method if it isn't passed as a parameter\n $requestMethod = $request->method();\n foreach($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n $method_match = (stripos($methods, $requestMethod) !== false);\n // Method did not match, continue to next route.\n if (!$method_match) continue;\n \n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url\n if (strncmp($requestUrl, $route, $position) !== 0) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n if ($match) {\n if ($params) {\n foreach($params as $key => $value) {\n if(is_numeric($key)) unset($params[$key]);\n }\n }\n return array(\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n );\n }\n }\n return false;\n }",
"public function getResponse(\\BearFramework\\App\\Request $request)\n {\n $requestPath = (string) $request->path;\n foreach ($this->data as $route) {\n foreach ($route[0] as $pattern) {\n $found = preg_match('/^' . str_replace(['%2F', '%3F', '%2A'], ['\\/', '[^\\/]+?', '.+?'], urlencode($pattern)) . '$/u', $requestPath) === 1; // symbols: /, ?, *\n if ($found && !empty($route[2])) {\n $hasMethodOption = false;\n $isMethodValid = false;\n $hasSchemeOption = false;\n $isSchemeValid = false;\n foreach ($route[2] as $option) {\n $option = strtolower($option);\n if ($option === 'get' || $option === 'head' || $option === 'post' || $option === 'delete' || $option === 'put' || $option === 'patch' || $option === 'options') {\n $hasMethodOption = true;\n if ($option === strtolower($request->method)) {\n $isMethodValid = true;\n }\n } elseif ($option === 'http' || $option === 'https') {\n $hasSchemeOption = true;\n if ($option === strtolower($request->scheme)) {\n $isSchemeValid = true;\n }\n }\n }\n if (($hasMethodOption && !$isMethodValid) || ($hasSchemeOption && !$isSchemeValid)) {\n $found = false;\n }\n }\n if ($found) {\n foreach ($route[1] as $callable) {\n ob_start();\n try {\n $response = call_user_func($callable);\n ob_end_clean();\n } catch (\\Exception $e) {\n ob_end_clean();\n throw $e;\n }\n if ($response instanceof App\\Response) {\n return $response;\n }\n }\n // continue searching\n }\n }\n }\n if ($request->method === 'HEAD') {\n $getRequest = clone($request);\n $getRequest->method = 'GET';\n $response = $this->getResponse($getRequest);\n if ($response instanceof App\\Response) {\n $response->content = '';\n return $response;\n }\n }\n return null;\n }",
"public function match(Request $request)\n {\n $pipes = $this->get($request->keys());\n\n // First, we will see if we can find a matching pipe for this current request\n // method. If we can, great, we can just return it so that it can be called\n // by the consumer.\n $pipe = $this->matchAgainstPipes($pipes, $request);\n\n if (! is_null($pipe)) {\n return $pipe->bind($request);\n }\n\n throw new NotFoundPipeException($request);\n }",
"public function match(Request $request)\n {\n }",
"public function match($requestUrl = null, $requestMethod = null)\n {\n\n $params = [];\n\n // set Request Url if it isn't passed as parameter\n if ($requestUrl === null) {\n $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\n }\n\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n\n // Strip query string (?a=b) from Request Url\n if (($strpos = strpos($requestUrl, '?')) !== false) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n\n $lastRequestUrlChar = $requestUrl[strlen($requestUrl) - 1];\n\n // set Request Method if it isn't passed as a parameter\n if ($requestMethod === null) {\n $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n }\n\n foreach ($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n\n $method_match = (stripos($methods, $requestMethod) !== false);\n\n if ($route === '*') {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n // Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)\n if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position - 1] !== '/')) {\n continue;\n }\n\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n\n if ($match) {\n if ($params) {\n foreach ($params as $key => $value) {\n if (is_numeric($key)) {\n unset($params[$key]);\n }\n }\n }\n\n // Method did not match, continue to next route.\n if (!$method_match) {\n $this->methodError = true;\n continue;\n } else {\n $this->methodError = false;\n }\n\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n ];\n }\n }\n\n if ($this->methodError) {\n return self::METHOD_ERROR;\n } else {\n return self::NO_MATCH;\n }\n }",
"public function match(ServerRequestInterface $request);",
"public function matches ($request)\r\n {\r\n return preg_match ('@^'. $this->pattern .'$@', $request, $this->match);\r\n }",
"public function lookup($request) {\n // Search for the matching HttpResponse object\n for ($i=0; $i<count($this->requests); $i++) {\n if ($this->requests[$i] == $request) {\n break;\n }\n }\n \n // If the matching HttpResponse object was found return it, otherwise throw an exception.\n if ($i == count($this->requests)) {\n //var_dump($this->requests[0]); // only show the first request in the map\n var_dump($this->requests); // show all requests in the map\n throw new RangeException(\"Matching HTTP response not found\");\n } else {\n return $this->responses[$i];\n }\n }",
"public function match(Request $request)\n {\n if ($this->method) {\n if ($request->getMethod() != $this->method) {\n return false;\n }\n }\n if ($this->hostname && $request->hasHeader('host')) {\n if ($request->getHeader('hostname') != $this->host) {\n return false;\n }\n }\n\n // Ejecutamos la función de validación\n $function = [$this, 'match' . $this->type];\n\n $url = $request->getRequestTarget();\n $result = $function($url);\n\n if ($result) {\n // Encontramos un match. Añadimos los args del request\n $result['args'] = array_merge($this->args, \n $result['args']);\n\n return $result;\n }\n\n\n // Not valid\n return false;\n }",
"public function matchRoute(Request $request){\n $context = new RequestContext();\n $context->fromRequest($request);\n\n $matcher = new UrlMatcher($this->routeCollection, $context);\n $parameters = $matcher->match($context->getPathInfo());\n return $parameters;\n }",
"public function dispatch(RequestContract $request) {\n\n\t\t$response = NULL;\n\n\t\tforeach ($this->routes as $route) {\n\n\t\t\tif ($route->matches($request)) {\n\n\t\t\t\t$response = $route->fire($request);\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $response;\n\n\t}",
"public function match(Request $request)\n {\n foreach($this->routes as $url => $route) {\n if(!$route->test($request)) {\n continue;\n }\n $this->matched_url = $url;\n $action = $route->getAction();\n $this->cacheAction($request, $action);\n return $action;\n }\n throw new RouteNotFoundException(sprintf('No route found that matches \"%s\"', $request->getPathInfo()));\n }",
"public function match(ServerRequestInterface $request): ?Route\n {\n $result = $this->router->match($request);\n\n if ($result->isSuccess()) {\n return new Route(\n $result->getMatchedRouteName(),\n $result->getMatchedRoute()->getMiddleware()->getCallback(),\n $result->getMatchedParams()\n );\n }\n\n return null;\n }",
"public function match(ServerRequestInterface $request): ?Route\n\t{\n\t\t$result = $this->router->match($request); // instance of \\Zend\\Expressive\\Router\\RouteResult\n\t\tif ($result->isSuccess()) {\n\t\t\treturn new Route(\n $result->getMatchedRouteName(),\n\t\t\t\t$result->getMatchedRoute()->getMiddleware(),\n\t\t\t\t$result->getMatchedParams()\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}",
"public function get(Request $request)\n {\n if (!$this->allowQueries) {\n return null;\n }\n $parsedRequest = new RequestParser($request);\n $cacheKey = $parsedRequest->cacheKey();\n // If the request is not cacheable, return null\n if (!$cacheKey) {\n return null;\n }\n $cacheValue = $this->repository->get($cacheKey);\n // If no response was found, return null\n if (!$cacheValue) {\n return null;\n }\n $parsedResponse = new CacheParser($cacheValue);\n return $parsedResponse->response();\n }",
"public function onMatchRequest(GetResponseEvent $event)\n {\n $this->matcher->matches($event->getRequest());\n }",
"public function match($requestUrl = null, $requestMethod = null)\n {\n $params = [];\n // set Request Url if it isn't passed as parameter\n if ( $requestUrl === null ) {\n $requestUrl = Server::isSetted('REQUEST_URI') ? Server::get('REQUEST_URI') : '/';\n }\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n // Strip query string (?a=b) from Request Url\n if ( ($strpos = strpos($requestUrl, '?')) !== false ) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';\n // set Request Method if it isn't passed as a parameter\n if ( $requestMethod === null ) {\n $requestMethod = Server::isSetted('REQUEST_METHOD') ? Server::get('REQUEST_METHOD') : 'GET';\n }\n foreach ($this->routes as $handler) {\n list($methods,$route,$target,$name,$permissions) = $handler;\n $method = (stripos($methods,$requestMethod) !== false);\n // Method did not match, continue to next route.\n if ( !$method ) {\n continue;\n }\n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif ( isset($route[0]) && $route[0] === '@' ) {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif ( ($position = strpos($route, '[')) === false ) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n if ( strncmp($requestUrl,$route,$position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/') ) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex,$requestUrl,$params) === 1;\n }\n if ( $match ) {\n if ( $params ) {\n foreach ($params as $key => $value) {\n if ( TypeCheck::isInt($key) ) {\n unset($params[$key]);\n }\n }\n }\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name,\n 'permissions' => $permissions\n ];\n }\n }\n return false;\n }",
"public function findFirst($request = null)\r\n\t{\r\n\t\treturn current($this->find($request));\r\n\t}",
"public function match(Request $request, $pathOffset = null)\r\n {\r\n if (!method_exists($request, 'getUri')) {\r\n return null;\r\n }\r\n\r\n $uri = $request->getUri();\r\n $fullPath = $uri->getPath();\r\n\r\n $path = substr($fullPath, $pathOffset);\r\n $alias = trim($path, '/');\r\n\r\n $model = $this->routerPluginManager->getServiceLocator()->get('DotsPages\\Db\\Model\\Page');\r\n $page = $model->getByAlias($alias);\r\n\r\n if ($page) {\r\n $options = $this->defaults;\r\n $options = array_merge($options, array('alias' => $alias, 'page' => $page));\r\n return new RouteMatch($options, strlen($path));\r\n }\r\n return null;\r\n }"
]
| [
"0.6781053",
"0.6550235",
"0.6517535",
"0.6255369",
"0.6147484",
"0.60608935",
"0.6049397",
"0.60195595",
"0.60067314",
"0.5973606",
"0.5924475",
"0.59000385",
"0.581304",
"0.57457614",
"0.56507015",
"0.564384",
"0.5638988",
"0.5636702",
"0.56269705",
"0.56119657",
"0.560896",
"0.55899584",
"0.5584784",
"0.5564716",
"0.55464715",
"0.55377007",
"0.5514692",
"0.55102277",
"0.5494858",
"0.5487297"
]
| 0.8107515 | 0 |
Finds and displays a PortfolioItem entity. | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$portfolio = $em->getRepository('AntBundle:Portfolio')->find($id);
$portfolioItem = $em->getRepository('AntBundle:PortfolioItem')->findByPortfolioId($id);
if (!$portfolioItem) {
throw $this->createNotFoundException('Unable to find PortfolioItem entity.');
}
return $this->render('AntBundle:PortfolioItem:show.html.twig', array(
'portfolioItem' => $portfolioItem,
'portfolio' => $portfolio
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Portfolio $portfolio)\n {\n //\n }",
"public function showAction(PortfolioItem $portfolioitem)\r\n {\r\n $user = $this->getUser();\r\n $account = $user->getAccount();\r\n if ($account != $portfolioitem->getAccount()) return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n\r\n $editForm = $this->createEditForm($portfolioitem);\r\n $deleteForm = $this->createDeleteForm($portfolioitem);\r\n\r\n return $this->render('UniPortfolioBundle:PortfolioItem:show.html.twig', array(\r\n 'portfolioitem' => $portfolioitem,\r\n 'editForm' => $editForm->createView(),\r\n 'deleteForm' => $deleteForm->createView(),\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $portfolioSet = $em->getRepository('AntBundle:Portfolio')->findAll();\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $portfolioSet,\n $this->get('request')->query->get('page', 1)/*page number*/,\n 10/*limit per page*/\n );\n\n foreach ($portfolioSet as $portfolio) {\n $portfolioId = $portfolio->getId();\n $this->ImageAction($portfolioId);\n };\n\n return $this->render('AntBundle:PortfolioItem:index.html.twig', array(\n 'portfolio' =>$portfolio,\n 'portfolioSet'=>$portfolioSet,\n 'pagination' => $pagination\n ));\n }",
"public function show(Item $item)\n {\n \n }",
"public function show(Item $item)\n {\n //\n }",
"public function show(Item $item)\n {\n //\n }",
"protected function findModelPortfolio($id)\n {\n if (($model = Portfolio::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function show(FacturaItem $facturaItem)\n {\n //\n }",
"public function show(Item $item)\n {\n }",
"public function show($id)\n {\n $portfolio = Portfolio::find($id);\n return view('admin.pages.portfolio.show')->with(compact('portfolio'));\n }",
"public function show($id)\n {\n //\n $portfolio= Portfolio::find($id);\n\n return view('admin.portfolio.show',compact('portfolio'));\n }",
"public function show($id)\n {\n $portfolio = Portfolio::findOrFail($id);\n\n return view('admin.portfolio.show', compact('portfolio'));\n }",
"function showItems() {\n global $DB;\n\n $budgets_id = $this->fields['id'];\n\n if (!$this->can($budgets_id, READ)) {\n return false;\n }\n\n $iterator = $DB->request([\n 'SELECT' => 'itemtype',\n 'DISTINCT' => true,\n 'FROM' => 'glpi_infocoms',\n 'WHERE' => [\n 'budgets_id' => $budgets_id,\n 'NOT' => ['itemtype' => ['ConsumableItem', 'CartridgeItem', 'Software']]\n ],\n 'ORDER' => 'itemtype'\n ]);\n\n $number = count($iterator);\n\n echo \"<div class='spaced'><table class='tab_cadre_fixe'>\";\n echo \"<tr><th colspan='2'>\";\n Html::printPagerForm();\n echo \"</th><th colspan='4'>\";\n if ($number == 0) {\n echo __('No associated item');\n } else {\n echo _n('Associated item', 'Associated items', $number);\n }\n echo \"</th></tr>\";\n\n echo \"<tr><th>\".__('Type').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Serial number').\"</th>\";\n echo \"<th>\".__('Inventory number').\"</th>\";\n echo \"<th>\"._x('price', 'Value').\"</th>\";\n echo \"</tr>\";\n\n $num = 0;\n $itemtypes = [];\n while ($row = $iterator->next()) {\n $itemtypes[] = $row['itemtype'];\n }\n $itemtypes[] = 'Contract';\n $itemtypes[] = 'Ticket';\n $itemtypes[] = 'Problem';\n $itemtypes[] = 'Change';\n $itemtypes[] = 'Project';\n\n foreach ($itemtypes as $itemtype) {\n if (!($item = getItemForItemtype($itemtype))) {\n continue;\n }\n\n if ($item->canView()) {\n switch ($itemtype) {\n\n case 'Contract' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_contractcosts.cost AS value'\n ],\n 'FROM' => 'glpi_contractcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_contractcosts' => 'contracts_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_contractcosts.budgets_id' => $budgets_id,\n $item->getTable() . '.is_template' => 0\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Ticket' :\n case 'Problem' :\n case 'Change' :\n $costtable = getTableForItemType($item->getType().'Cost');\n\n $sum = new QueryExpression(\n \"SUM(\" . $DB->quoteName(\"$costtable.actiontime\") . \" * \" . $DB->quoteName(\"$costtable.cost_time\") . \"/\".HOUR_TIMESTAMP.\"\n + \" . $DB->quoteName(\"$costtable.cost_fixed\") . \"\n + \" . $DB->quoteName(\"$costtable.cost_material\") . \") AS \" . $DB->quoteName('value')\n );\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n $sum\n ],\n 'FROM' => $costtable,\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n $costtable => $item->getForeignKeyField()\n ]\n ]\n ],\n 'WHERE' => [\n $costtable . '.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Project' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_projectcosts.cost AS value'\n ],\n 'FROM' => 'glpi_projectcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_projectcosts' => 'projects_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_projectcosts.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Cartridge' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_cartridgeitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_cartridgeitems' => [\n 'ON' => [\n $item->getTable() => 'cartridgeitems_id',\n 'glpi_cartridgeitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n case 'Consumable' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_consumableitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_consumableitems' => [\n 'ON' => [\n $item->getTable() => 'consumableitems_id',\n 'glpi_consumableitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n default:\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_infocoms.value',\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n $item->getTable() . '.entities_id'\n ]\n ];\n if ($item->maybeTemplate()) {\n $criteria['WHERE'][$item->getTable() . '.is_template'] = 0;\n }\n\n if ($item instanceof Item_Devices) {\n $criteria['ORDERBY'][] = $item->getTable() .'.itemtype';\n } else {\n $criteria['ORDERBY'][] = $item->getTable() . '.name';\n }\n break;\n }\n\n $iterator = $DB->request($criteria);\n $nb = count($iterator);\n if ($nb > $_SESSION['glpilist_limit']) {\n echo \"<tr class='tab_bg_1'>\";\n $name = $item->getTypeName($nb);\n //TRANS: %1$s is a name, %2$s is a number\n echo \"<td class='center'>\".sprintf(__('%1$s: %2$s'), $name, $nb).\"</td>\";\n echo \"<td class='center' colspan='2'>\";\n\n $opt = ['order' => 'ASC',\n 'is_deleted' => 0,\n 'reset' => 'reset',\n 'start' => 0,\n 'sort' => 80,\n 'criteria' => [0 => ['value' => '$$$$'.$budgets_id,\n 'searchtype' => 'contains',\n 'field' => 50]]];\n\n echo \"<a href='\". $item->getSearchURL() . \"?\" .Toolbox::append_params($opt). \"'>\".\n __('Device list').\"</a></td>\";\n echo \"<td class='center'>-</td><td class='center'>-</td><td class='center'>-\".\n \"</td></tr>\";\n\n } else if ($nb) {\n for ($prem=true; $data = $iterator->next(); $prem=false) {\n $name = NOT_AVAILABLE;\n if ($item->getFromDB($data[\"id\"])) {\n if ($item instanceof Item_Devices) {\n $tmpitem = new $item::$itemtype_2();\n if ($tmpitem->getFromDB($data[$item::$items_id_2])) {\n $name = $tmpitem->getLink(['additional' => true]);\n }\n } else {\n $name = $item->getLink(['additional' => true]);\n }\n }\n echo \"<tr class='tab_bg_1'>\";\n if ($prem) {\n $typename = $item->getTypeName($nb);\n echo \"<td class='center top' rowspan='$nb'>\".\n ($nb>1 ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename).\"</td>\";\n }\n echo \"<td class='center'>\".Dropdown::getDropdownName(\"glpi_entities\",\n $data[\"entities_id\"]);\n echo \"</td><td class='center\";\n echo (isset($data['is_deleted']) && $data['is_deleted'] ? \" tab_bg_2_2'\" : \"'\");\n echo \">\".$name.\"</td>\";\n echo \"<td class='center'>\".(isset($data[\"serial\"])? \"\".$data[\"serial\"].\"\" :\"-\");\n echo \"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"otherserial\"])? \"\".$data[\"otherserial\"].\"\" :\"-\").\"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"value\"]) ? \"\".Html::formatNumber($data[\"value\"], true).\"\"\n :\"-\");\n\n echo \"</td></tr>\";\n }\n }\n $num += $nb;\n }\n }\n\n if ($num>0) {\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td class='center b'>\".sprintf(__('%1$s = %2$s'), __('Total'), $num).\"</td>\";\n echo \"<td colspan='5'> </td></tr> \";\n }\n echo \"</table></div>\";\n }",
"public function show($id)\n {\n $portfolio = $this->portfolioRepository->find($id);\n\n if (empty($portfolio)) {\n Flash::error('Portfolio not found');\n\n return redirect(route('portfolios.index'));\n }\n\n return view('portfolios.show')->with('portfolio', $portfolio);\n }",
"public function actionPortfolio()\n {\n $searchModel = new PostSearchPortfolio();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('portfolio/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function showPortfolio() {\n Page::$title = 'Arthub - Portfolio';\n require(APP_NON_WEB_BASE_DIR . 'views/portfolio.php');\n }",
"public function view_portfolio()\n {\n return view('dashboardpages.portfolio.portfolio');\n }",
"public function actionViewPortfolio($id)\n {\n return $this->render('portfolio/view', [\n 'model' => $this->findModelPortfolio($id),\n ]);\n }",
"public function show(Company $company, InvoiceItem $invoiceItem)\n {\n //\n }",
"public function show($id)\n {\n $filter = Filter::find($id);\n $portfolio = $filter->portfolioAll;\n if(view()->exists('admin.portfolio.portfolio.index')) {\n return view('admin.portfolio.portfolio.index', ['filter' => $filter, 'portfolio' => $portfolio]);\n }\n abort(404);\n }",
"public function getShowPortfolio($id)\n {\n $itemProgramacao = $this->itemProgramacaoRepository->findWithoutFail($id);\n\n if (empty($itemProgramacao)) {\n $itemProgramacao = $this->itemProgramacaoRepository->findByField('url_amigavel', $id)->first();\n }\n\n if (empty($itemProgramacao)) {\n Flash::error('Programação não encontrada');\n return redirect(route('itemProgramacaos.index'));\n }\n\n return view('pages.portfolio-interno')->with([\"itemProgramacao\" => $itemProgramacao]);\n }",
"public function edit(Portfolio $portfolio)\n {\n //\n }",
"public function showItem(Request $req,$item){\n $i = $this->itemRepo->getItemById($item);\n return view('marketItem.showItem', [\n 'item' => $i,\n ]);\n }",
"public function show(Portfolio $portfolio)\n {\n return view('Portfolio.show')->with('portfolio',$portfolio);\n }",
"public function editAction(Request $request, PortfolioItem $portfolioitem)\r\n {\r\n $user = $this->getUser();\r\n $account = $user->getAccount();\r\n if ($account != $portfolioitem->getAccount()) return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n\r\n $editForm = $this->createEditForm($portfolioitem);\r\n $deleteForm = $this->createDeleteForm($portfolioitem);\r\n $editForm->handleRequest($request);\r\n\r\n if ($editForm->isSubmitted()) {\r\n if($editForm->isValid()) {\r\n $em = $this->getDoctrine()->getManager();\r\n $em->persist($portfolioitem);\r\n $em->flush();\r\n $request->getSession()->getFlashBag()->add( 'success', 'portfolioitem.edit.flash' );\r\n return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n }\r\n }\r\n\r\n return $this->render('UniPortfolioBundle:PortfolioItem:edit.html.twig', array(\r\n 'portfolioitem' => $portfolioitem,\r\n 'editForm' => $editForm->createView(),\r\n 'deleteForm' => $deleteForm->createView(),\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findAll();\n\n return $this->render('StriideInventoryBundle:Item:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"static function get_portfolio_by_id($id){\n\t\treturn self::$db->where('id',$id)->get('portfolio')->row();\n\t}",
"public function showitemAction() {\n\t\t$story_id \t\t= $this->getRequest()->getParam(\"story\");\n\t\t$source_id \t\t= $this->getRequest()->getParam(\"source\");\n\t\t$item_id\t\t= $this->getRequest()->getParam(\"item\");\n\t\t\n\t\t//Verify if the requested story exist\n\t\t$stories\t\t= new Stories();\n\t\tif (!($story\t= $stories->getStory($story_id))) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\n\t\t// Check if we are the owner\n\t\tif ($this->_application->user->id != $story->user_id) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\t\t\n\t\t// Ok, we can show the item\n\t\t$storyItems\t\t= new StoryItems();\n\t\t$storyItems->showItem($story_id, $source_id, $item_id);\n\t\treturn $this->_helper->json->sendJson(true);\n\t}",
"public function show($id)\n {\n $item = $this->itemCRUD->find_item($id);\n\n\n $this->load->view('theme/header');\n $this->load->view('itemCRUD/show',array('item'=>$item));\n $this->load->view('theme/footer');\n }",
"public function show(Item $item)\n {\n //\n // $result = DB::table('items')->where('id', $item->id)->get();\n $result = Item::Where('id', $item->id)->first();\n return $result;\n }"
]
| [
"0.68475884",
"0.6654383",
"0.59879124",
"0.5963228",
"0.58728725",
"0.58728725",
"0.5872448",
"0.5851569",
"0.58394796",
"0.58378035",
"0.58039135",
"0.58003455",
"0.5768453",
"0.5746798",
"0.5730695",
"0.5718938",
"0.5716693",
"0.56668675",
"0.565931",
"0.5637816",
"0.56364465",
"0.56348747",
"0.5623823",
"0.55985147",
"0.5585632",
"0.5578798",
"0.55764985",
"0.55593383",
"0.5555722",
"0.5494533"
]
| 0.73384213 | 0 |
Mark WC Vendors order as Shipped | function wcfm_wcvendors_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order = wc_get_order( $order_id );
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$vendors = WCV_Vendors::get_vendors_from_order( $order );
$vendor_ids = array_keys( $vendors );
if ( !in_array( $user_id, $vendor_ids ) ) {
_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );
die;
}
$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
// If not in the shippers array mark as shipped otherwise do nothing.
if( !in_array($user_id, $shippers)) {
$shippers[] = $user_id;
//$mails = $woocommerce->mailer()->get_emails();
//if ( !empty( $mails ) ) {
// $mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );
//}
//do_action('wcvendors_vendor_ship', $order_id, $user_id);
_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );
} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {
unset( $shippers[$key] ); // Remove user from the shippers array
}
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$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 );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
update_post_meta( $order_id, 'wc_pv_shipped', $shippers );
} else {
$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');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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}",
"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}",
"function wcfm_dokan_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 = $_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\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \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 } else {\r\n \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 }\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 setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"function wcfm_wcpvendors_order_mark_fulfilled() {\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( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\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\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\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\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function setShippingValues(Order $order): void;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function notify_warehouse( $order ) {\n\t\t$order_info = $this->get_order_info($order);\n\t\t$supplier_codes = $order_info['suppliers'];\n\t\t// for each supplier code, loop and send email with product info\n\t\tforeach($supplier_codes as $code => $supplier_info) {\n\t\t\tdo_action('wc_dropship_manager_send_order',$order_info,$supplier_info);\n\t\t}\n\t}",
"function plgVmConfirmedOrder (VirtueMartCart $cart, $order) {\n\n\t\tif (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_shipmentmethod_id))) {\n\t\t\treturn NULL; // Another method was selected, do nothing\n\t\t}\n\t\tif (!$this->selectedThisElement ($method->shipment_element)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t$values['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;\n\t\t$values['order_number'] = $order['details']['BT']->order_number;\n\t\t$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;\n\t\t$values['shipment_name'] = $this->renderPluginName ($method);\n\t\t$values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);\n\t\t$values['shipment_weight_unit'] = $method->weight_unit;\n\n\t\t$costs = $this->getCosts($cart,$method,$cart->cartPrices);\n\t\tif(empty($costs)){\n\t\t\t$values['shipment_cost'] = 0;\n\t\t\t$values['shipment_package_fee'] = 0;\n\t\t} else {\n\t\t\t$values['shipment_cost'] = $method->shipment_cost;\n\t\t\t$values['shipment_package_fee'] = $method->package_fee;\n\t\t}\n\n\t\t$values['tax_id'] = $method->tax_id;\n\t\t$this->storePSPluginInternalData ($values);\n\n\t\treturn TRUE;\n\t}",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function testUpdateExternalShipment()\n {\n }"
]
| [
"0.8012149",
"0.78245276",
"0.74902797",
"0.6935354",
"0.6845717",
"0.66986763",
"0.64345485",
"0.63858855",
"0.63169616",
"0.6295898",
"0.6274096",
"0.62528867",
"0.6143075",
"0.6106249",
"0.60485643",
"0.60382515",
"0.5964262",
"0.59186786",
"0.5904106",
"0.58712393",
"0.5858244",
"0.5747031",
"0.57151896",
"0.57102555",
"0.5691527",
"0.56827396",
"0.5665641",
"0.5610285",
"0.56015754",
"0.55954105"
]
| 0.80748504 | 0 |
Mark WC Product Vendors order as Fulfilled | function wcfm_wcpvendors_order_mark_fulfilled() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order = wc_get_order( $order_id );
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( $order_item_id ) {
if( wcfm_is_vendor() ) {
$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();
WC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );
WC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );
WC_Product_Vendors_Utils::clear_reports_transients();
$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';
$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 );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
} else {
$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');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
}
echo "complete";
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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}",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"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}",
"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}",
"function wcfm_dokan_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 = $_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\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \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 } else {\r\n \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 }\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 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 lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"protected function _fcpoMarkOrderAsProblematic() {\n $this->_blOrderHasProblems = true;\n }",
"public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"public function completeProductOrder($order_product_id)\n\t{\n\t\t$query1=$this->db->query(\"SELECT pyr.confirm_id as payer_confirm_id FROM `payer` pyr where pyr.order_product_id=\".$order_product_id);\n\t\t$result1=$query1->result_array();\n\t\t$query2=$this->db->query(\"SELECT pye.confirm_id as payee_confirm_id FROM `payee` pye where pye.order_product_id=\".$order_product_id);\n\t\t$result2=$query2->result_array();\n\t\tif(isset($result1[0]) && isset($result2[0]))\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =6 where order_product_id = \".$order_product_id);\n\t\telse\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =5 where order_product_id = \".$order_product_id);\n\t\t$this->sendcompleteProductOrderMail($order_product_id);\n\t\t\n\t}",
"public function change_purse( $request ) {\n $params = $request->get_params();\n\n $customer_orders = get_posts( array(\n 'numberposts' => 1,\n 'meta_key' => '_customer_user',\n 'meta_value' => get_current_user_id(),\n 'post_type' => wc_get_order_types(),\n 'post_status' => 'wc-processing',\n 'order' => 'DESC'\n ) );\n\n if (!isset($customer_orders[0])) {\n return new WP_REST_Response([\n 'message' => 'No order with \"processing\" status found',\n 'status' => '400'\n ], 400);\n }\n\n $post_order = $customer_orders[0];\n $order = new WC_Order($post_order->ID);\n $items = $order->get_items();\n $product = null;\n\n foreach ($items as $item) {\n $data = $item->get_data();\n $product = wc_get_product($data['product_id']);\n $product_type = $product->get_type();\n\n if ($product_type == 'variable') {\n $variation = wc_get_product($data['variation_id']);\n $order->remove_item($item->get_id());\n $order->save(); // reduce_order_stock reduce stock from order saved in memory\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n\n wc_update_product_stock($variation->get_id(), $variation->get_stock_quantity() + 1);\n $variation->save();\n break;\n }\n $product = null;\n }\n\n if (!$product) {\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n }\n\n $product_data = $new_product->get_data();\n $product_attributes = $new_product->get_variation_attributes();\n\n return new WP_REST_Response([\n 'id' => $new_product->get_id(),\n 'price' => $product_data['price'],\n 'name' => $product_data['name'],\n 'short_description' => $product_data['short_description'],\n 'sku' => $product_data['sku'],\n 'images' => $this->get_images($new_product),\n 'colors' => isset($product_attributes['pa_colors']) ? $product_attributes['pa_colors'] : false,\n 'sizes' => isset($product_attributes['pa_sizes']) ? $product_attributes['pa_sizes'] : false,\n ], 200);\n\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"function acadp_order_completed( $order ) {\n\n\t// update order details\n\tupdate_post_meta( $order['id'], 'payment_status', 'completed' );\n\tupdate_post_meta( $order['id'], 'transaction_id', $order['transaction_id'] );\n\n\t// If the order has featured\n\t$featured = get_post_meta( $order['id'], 'featured', true );\n\n\tif( ! empty( $featured ) ) {\n\t\t$post_id = get_post_meta( $order['id'], 'listing_id', true );\n\t\tupdate_post_meta( $post_id, 'featured', 1 );\n\t}\n\n\t// Hook for developers\n\tdo_action( 'acadp_order_completed', $order['id'] );\n\n\t// send emails\n\tacadp_email_listing_owner_order_completed( $order['id'] );\n\tacadp_email_admin_payment_received( $order['id'] );\n\n}",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"public function check_manual_order_for_pre_order_products( $order_id ) {\n\t\t// Make sure we are in the administration panel and we're saving an order\n\t\tif ( ! is_admin() || ! isset( $_POST['post_type'] ) || 'shop_order' != $_POST['post_type'] )\n\t\t\treturn;\n\n\t\t$order = new WC_Order( $order_id );\n\n\t\t// Check if the order hasn't been processed already\n\t\tif ( WC_Pre_Orders_Order::order_contains_pre_order( $order ) )\n\t\t\treturn;\n\n\t\t// Order has not been processed yet (or doesn't contain pre orders)\n\t\t$contains_pre_orders = false;\n\n\t\tforeach ( $order->get_items() as $item ) {\n\t\t\tif ( 'line_item' == $item['type'] ) {\n\t\t\t\t$product = get_product( $item['item_meta']['_product_id'][0] );\n\n\t\t\t\tif ( 'yes' == $product->wc_pre_orders_enabled ) {\n\t\t\t\t\t// Set correct flags for this order, making it a pre order\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_is_pre_order', 1 );\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_when_charged', $product->wc_pre_orders_when_to_charge );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function set_vendor_product_commission_paid( $vendor_id, $product_id, $order_id )\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\n\t\t$query = \"UPDATE `{$table_name}` SET `status` = 'paid' WHERE vendor_id = $vendor_id AND order_id = $order_id AND product_id = $product_id\";\n\t\t$result = $wpdb->query( $query );\n\n\t\treturn $result;\n\t}",
"private function maybe_install() {\n\t\tglobal $woocommerce;\n\n\t\t$installed_version = get_option( 'wc_pre_orders_version' );\n\n\t\t// install\n\t\tif ( ! $installed_version ) {\n\n\t\t\t// add 'pre-order' shop order status term\n\t\t\t$woocommerce->init_taxonomy();\n\t\t\tif ( ! get_term_by( 'slug', 'pre-ordered', 'shop_order_status' ) )\n\t\t\t\twp_insert_term( 'pre-ordered', 'shop_order_status' );\n\n\t\t\t// install default settings\n\t\t\tforeach ( $this->get_settings() as $setting ) {\n\n\t\t\t\tif ( isset( $setting['default'] ) )\n\t\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\n\t\t// upgrade - installed version lower than plugin version?\n\t\tif ( -1 === version_compare( $installed_version, WC_Pre_Orders::VERSION ) ) {\n\n\t\t\t$this->upgrade( $installed_version );\n\n\t\t\t// new version number\n\t\t\tupdate_option( 'wc_pre_orders_version', WC_Pre_Orders::VERSION );\n\t\t}\n\t}",
"private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }",
"public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function markCartsAdditionalProducts(Order $draftOrder): bool;",
"function completeOrder($orderId, $pack, $deli, $cost, $delicost, $plain, $salted, $masala, $garlic, $chilli, $strawberry) {\n\t\t$data = array('box_type' => $pack, 'delivery_type'=>$deli, 'cost'=>$cost, 'delivery_cost'=>$delicost, 'order_status'=>'3', \n\t\t'plain'=>$plain, 'salted'=>$salted, 'masala'=>$masala, 'garlic'=>$garlic, 'chilli'=>$chilli, 'strawberry'=>$strawberry);\n\t\t$this -> db -> where('id', $orderId);\n\t\t$result = $this -> db -> update('registrations', $data);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}",
"function payment_complete( $order ){\n\n if( $order->status == 'processing' ){\n\n $order->update_status( 'completed' );\n\n add_post_meta( $order->id, '_paid_date', current_time('mysql'), true );\n\n $this_order = array(\n 'ID' => $order->id,\n 'post_date' => current_time( 'mysql', 0 ),\n 'post_date_gmt' => current_time( 'mysql', 1 )\n );\n wp_update_post( $this_order );\n \n if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $order->id ) ) {\n $order->reduce_order_stock(); // Payment is complete so reduce stock levels\n }\n\n do_action( 'woocommerce_payment_complete', $order->id );\n }\n }",
"function completeOrder($order)\n{\n\t//$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);\n\n\tif ($order->getState() != Mage_Sales_Model_Order::STATE_COMPLETE)\n\t{\n\t\tif(abs($order->getGrandTotal() - $order->getBaseTotalPaid()) < 0.00001) {\n\t\t\t$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);\n\t\t\t$order->setStatus(\"complete\");\n\n\t\t\t$order->addStatusHistoryComment('Pedido finalizado pela distribuidora.');\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$order->save();\n\t\t\t\tdebug('Pedido '.$order->getId().' finalizado.');\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tdebug('Pedido não finalizado: ' . $e->getMessage());\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo 'O pedido já foi finalizado'.\"\\n\";\n\t}\n}",
"function markPurchased($opm_productid,$accountid) {\n \n \t$this->load->model('accounts_model');\n\n\t\tif (checkPerms('can_mark_purchased',true)) {\n\n\t\t\t\n\t\t\tif ($this->accounts_model->markProductPurchased($opm_productid,$accountid)) {\n\t\t\t\t\n\t\t\t\t// fetch account name for history entry\n\t\t\t\t\n\t\t\t\t$account = $this->accounts_model->fetchAccount($accountid);\n\t\t\t\t\n\t\t\t\t$message = $account->account . \" purchased this product (entered by \" . $this->userinfo->username . \")\";\n\t\t\t\t\n\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t$this->opm->displayAlert(\"Product marked Purchased by \" . $account->account . \".\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\n }",
"function may_be_complete_order( $next_step_id, $order_id ) {\n\n\t\twcf()->logger->log( 'Entering: ' . __CLASS__ . '::' . __FUNCTION__ );\n\n\t\t$template_type = get_post_meta( $next_step_id, 'wcf-step-type', true );\n\n\t\tif ( 'thankyou' === $template_type ) {\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\twcf_pro()->order->may_be_normalize_status( $order );\n\t\t}\n\t}",
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }"
]
| [
"0.66662884",
"0.6451834",
"0.63869214",
"0.6166922",
"0.59090817",
"0.59000254",
"0.58038867",
"0.56576085",
"0.56402695",
"0.5597151",
"0.5570989",
"0.5551745",
"0.5549113",
"0.5529215",
"0.5507449",
"0.5482616",
"0.5479839",
"0.54728526",
"0.5471566",
"0.5453172",
"0.5442421",
"0.5424943",
"0.54234374",
"0.54147094",
"0.5401136",
"0.5384468",
"0.53829247",
"0.537667",
"0.53687406",
"0.5355456"
]
| 0.7994449 | 0 |
Mark WC Marketplace order as Shipped | function wcfm_wcmarketplace_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = absint( $_POST['productid'] );
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$vendor = get_wcmp_vendor($user_id);
$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);
$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);
if (!in_array($user_id, $shippers)) {
$shippers[] = $user_id;
//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];
//if (!empty($mails)) {
//$customer_email = get_post_meta($order_id, '_billing_email', true);
//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );
//}
do_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);
array_push($shippers, $user_id);
}
$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");
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$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 );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
add_comment_meta( $comment_id, '_vendor_id', $user_id );
update_post_meta($order_id, 'dc_pv_shipped', $shippers);
} else {
$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');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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}",
"function wcfm_dokan_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 = $_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\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \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 } else {\r\n \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 }\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}",
"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}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function setShippingValues(Order $order): void;",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\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( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\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\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\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\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function isAutoShipping(): bool;",
"public function testUpdateExternalShipment()\n {\n }"
]
| [
"0.78274375",
"0.73035306",
"0.72957855",
"0.6953338",
"0.6892787",
"0.667168",
"0.6615628",
"0.6483965",
"0.6479015",
"0.6428056",
"0.63306314",
"0.62906265",
"0.62633115",
"0.6199688",
"0.61819476",
"0.6040608",
"0.60170656",
"0.6007457",
"0.6005998",
"0.5998495",
"0.59858423",
"0.59788126",
"0.58806103",
"0.5840483",
"0.5778392",
"0.57629",
"0.5761527",
"0.5754946",
"0.57525736",
"0.57326025"
]
| 0.77424556 | 1 |
Mark WCfM Marketplace order as Shipped | function wcfm_wcfmmarketplace_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = absint( $_POST['productid'] );
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$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");
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$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 );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
add_comment_meta( $comment_id, '_vendor_id', $user_id );
} else {
$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');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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}",
"function wcfm_dokan_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 = $_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\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \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 } else {\r\n \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 }\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}",
"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}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function setShippingValues(Order $order): void;",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\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( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\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\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\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\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\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}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }"
]
| [
"0.77678424",
"0.7331125",
"0.7266354",
"0.6888803",
"0.67891973",
"0.6565327",
"0.64468884",
"0.6426397",
"0.64220524",
"0.64009774",
"0.63673973",
"0.6310734",
"0.61712736",
"0.61693716",
"0.61505574",
"0.6112471",
"0.6097632",
"0.60953647",
"0.6080662",
"0.605693",
"0.6004989",
"0.59561723",
"0.59424216",
"0.5939528",
"0.5884265",
"0.58832514",
"0.58553666",
"0.57321966",
"0.5731827",
"0.5730442"
]
| 0.79052174 | 0 |
Mark Dokan order as Shipped | function wcfm_dokan_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = $_POST['productid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$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 );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
} else {
$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');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"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}",
"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}",
"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}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"public function setShippingValues(Order $order): void;",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function createTemandoShipment(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $shippingAddress = $order->getShippingAddress();\n $deprecateSkus = array();\n\n $shippingMethod = $order->getShippingMethod();\n $titleOptions = $this->_type->toOptionArray();\n $titles = array();\n foreach ($titleOptions as $value => $optionTitle) {\n $titles[$value] = $optionTitle['label'];\n }\n\n $quote = $this->_quoteRepository->get($order->getQuoteId());\n $quoteShippingAddress = $quote->getShippingAddress();\n\n $origin = $this->_originCollection->getOriginByInventory(\n $order->getAllVisibleItems(),\n $quoteShippingAddress->getPostcode()\n );\n //$origin = $this->_originCollection->getOriginByPostcode($quoteShippingAddress->getPostcode());\n $this->_shipment->setData('order_id', $order->getId());\n $this->_shipment->setData('order_increment_id', $order->getIncrementId());\n $this->_shipment->setData('origin_id', $origin->getId());\n\n $orderSkus = $this->_helper->getOrderSkus($order);\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::PENDING;\n\n $exclusiveOD = $this->_helper->orderContainsExclusively($order, \"OD\");\n foreach ($orderSkus as $sku => $details) {\n if ($details['stock_availability_code'] == \"OD\") {\n $hasStock = $origin->hasStock(array($sku => $details['qty']));\n if ($hasStock) {\n $deprecateSkus[$sku] = $details['qty'];\n } elseif ($exclusiveOD) {\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::BACK_ORDER;\n }\n } else {\n $deprecateSkus[$sku] = $details['qty'];\n }\n }\n $this->_shipment->setData('status', $shipmentStatus);\n $this->_shipment->setData('destination_contact_name', $shippingAddress->getName());\n $this->_shipment->setData('destination_company_name', $shippingAddress->getCompany());\n $streetAddress = $shippingAddress->getStreetLine(1);\n if ($shippingAddress->getStreetLine(2)) {\n $streetAddress .= \", \" . $shippingAddress->getStreetLine(2);\n }\n $this->_shipment->setData('destination_street', $streetAddress);\n $this->_shipment->setData('destination_city', $shippingAddress->getCity());\n $this->_shipment->setData('destination_postcode', $shippingAddress->getPostcode());\n $this->_shipment->setData('destination_region', $shippingAddress->getRegion());\n $this->_shipment->setData('destination_country', $shippingAddress->getCountryId());\n $this->_shipment->setData('destination_phone', $shippingAddress->getTelephone());\n $this->_shipment->setData('destination_email', $order->getCustomerEmail());\n\n //set customer selected quote data\n $temandoQuoteData = explode('_', $shippingMethod);\n $temandoQuoteId = $temandoQuoteData[2];\n\n $quoteDescription = '-';\n switch ($temandoQuoteData[2]) {\n default:\n $temandoQuote = $this->_quote->load($temandoQuoteId);\n $carrier = $this->_helper->getCarrierByTemandoId($temandoQuote->getCarrierId());\n $quoteDescription = $carrier->getCompanyName() . ' - ' . $temandoQuote->getDeliveryMethod();\n $totalPrice = $temandoQuote->getTotalPrice();\n break;\n }\n\n $this->_shipment->setData('customer_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('customer_selected_options', $shippingMethod);\n $this->_shipment->setData('customer_selected_quote_description', $quoteDescription);\n $this->_shipment->setData('admin_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('anticipated_cost', $totalPrice);\n\n if ($shippingAddress->getIsBusinessAddress()) {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::BUSINESS\n );\n } else {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::RESIDENTIAL\n );\n }\n\n if ($shippingAddress->getAuthorityToLeave()) {\n $this->_shipment->setData('destination_authority_to_leave', 1);\n } else {\n $this->_shipment->setData('destination_authority_to_leave', 0);\n }\n\n try {\n $this->_shipment->save();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment') . ' ' . $e->getMessage());\n }\n //register the quotes with the shipment\n //$this->registerQuotes($order);\n try {\n $this->_shipment->saveAllItems();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment items') . ' ' . $e->getMessage());\n }\n\n\n //how many boxes required?\n $this->saveBoxes($order);\n\n if ((count($deprecateSkus)) && ($origin->getErpId())) {\n $this->deprecateSkus($origin->getErpId(), $deprecateSkus);\n }\n //$this->_shipment->fetchQuotes();//or update existing quotes to use this shipment\n\n $this->clearSessionData();\n\n return $this->_shipment;\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}"
]
| [
"0.7431695",
"0.74207926",
"0.7234685",
"0.70458853",
"0.6996642",
"0.69393206",
"0.6919671",
"0.6882646",
"0.6828139",
"0.68119454",
"0.6557791",
"0.64496154",
"0.6401753",
"0.6335188",
"0.6334433",
"0.6252315",
"0.6167029",
"0.611768",
"0.60541797",
"0.6018588",
"0.59834313",
"0.5952987",
"0.5949846",
"0.59187585",
"0.591746",
"0.5913608",
"0.5884216",
"0.5875998",
"0.5863245",
"0.5853549"
]
| 0.75513273 | 0 |
Mark Order item as Received | function wcfm_mark_as_recived() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
if ( !empty( $_POST['orderitemid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
//$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');
// Keep Tracking URL as Order Item Meta
$sql = "INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta";
$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';
$sql .= ' VALUES ( %s, %s, %s )';
$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );
$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );
$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );
// WCfM Marketplace Table Update
if( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {
$wpdb->query("UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id");
}
// Notification
$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );
$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );
// Vendor Notification
if( $vendor_id ) {
$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );
}
// WC Order Note
$comment_id = $order->add_order_note( $wcfm_messages, '1');
do_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }",
"function setReceived($received) \n {\n if ($received == true) \n\t { \n \t$this->setValueByFieldName('cashtransaction_recd','1');\n \t }\n \t else \n \t {\n\t \t$this->setValueByFieldName('cashtransaction_recd','0');\n \t } \n \t\t\t\n }",
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"public function isRedelivered();",
"protected function setReceivedTransactionStatuses(): void\n {\n $txId = $this->postData['brq_transactions'];\n $statusCode = $this->postData['brq_statuscode'];\n\n if (empty($txId) || empty($statusCode)) {\n return;\n }\n\n $payment = $this->order->getPayment();\n\n $receivedTxStatuses = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES) ?? [];\n $receivedTxStatuses[$txId] = $statusCode;\n\n $payment->setAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES, $receivedTxStatuses);\n }",
"public function onSendMail(OrderItemStateEvent $event) {\n $line = $event->getOrderItem();\n if ($line->get('field_estado')->value == 'enviado') {\n $order = $line->getOrder();\n if ($this->checkOrderSent($order)) {\n $commerce_order = new OrderController($order);\n /** @var User $proveedor */\n $proveedor = User::load($this->account->id());\n $lines = $commerce_order->getOrderItemsProvider($proveedor);\n\n $mail = Mail::load(Mail::TYPE_SENT_ORDER_PROVIDER);\n if ($mail instanceof Mail) {\n $subject = $mail->getSubject();\n $body = $mail->getBody();\n\n if ($customer = $order->getCustomer()) {\n $langcode = $customer->getPreferredLangcode();\n }\n else {\n $langcode = $this->languageManager->getDefaultLanguage()->getId();\n }\n\n $to = $order->getEmail();\n\n $profiles = $order->collectProfiles();\n $envio = '';\n if (isset($profiles['shipping']) && $profiles['shipping'] instanceof Profile) {\n $envio = [\n '#theme' => 'correo_informacion_envio',\n '#profile' => $profiles['shipping'],\n ];\n $envio = \\Drupal::service('renderer')->render($envio);\n }\n\n $token_service = \\Drupal::token();\n $subject = $token_service->replace($subject, [\n 'commerce_order' => $order\n ]);\n $body = $token_service->replace($body, [\n 'commerce_order' => $order\n ]);\n $body = str_replace('[datos_envio]', $envio, $body);\n\n $resumen = [\n '#theme' => 'correo_resumen_pedido_proveedor',\n '#order_items' => $lines,\n ];\n $resumen = \\Drupal::service('renderer')->render($resumen);\n $body = str_replace('[resumen]', $resumen, $body);\n $params = [\n 'from' => $order->getStore()->getEmail(),\n 'subject' => $subject,\n 'body' => ['#markup' => Markup::create($body)],\n ];\n\n $this->mailManager->mail('commerce', 'receipt', $to, $langcode, $params);\n\n \\Drupal::logger('correo')->info('Pedido #' . $order->id() . ' enviado a ' . $to);\n\n }\n }\n $this->checkOrderCompleted($order);\n }\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"public function markSentItems(array $orders) {\n $ordersTable = Intelivemetrics_Unityreports_Model_Utils::getTableName('unityreports/orders');\n $now = date('Y-m-d H:i:s');\n try {\n foreach ($orders as $order) {\n $query = \"INSERT INTO $ordersTable (increment_id,sents,last_sent_at) VALUES ('{$order['increment_id']}',1,'{$now}')\n ON DUPLICATE KEY UPDATE sents = sents+1,last_sent_at='{$now}';\";\n $this->_getDb()->query($query);\n }\n } catch (Exception $ex) {\n Mage::helper('unityreports')->debug($ex->getMessage());\n }\n }",
"public function setSent();",
"public function postMarkPaymentReceived(Request $request, $order_id)\n {\n $order = Order::scope()->findOrFail($order_id);\n\n $order->is_payment_received = 1;\n $order->order_status_id = 1;\n\n $order->save();\n\n session()->flash('message', trans(\"Controllers.order_payment_status_successfully_updated\"));\n\n return response()->json([\n 'status' => 'success',\n ]);\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function salesOrderSaveAfter($observer)\n\t{\n\t\t// Get the settings\n\t\t$settings = Mage::helper('smsnotifications/data')->getSettings();\n\n\t\t// Get the new order object\n\t\t$order = $observer->getEvent()->getOrder();\n\n\t\t// Get the old order data\n\t\t$oldOrder = $order->getOrigData();\n\n\t\t// If the order status hasn't changed, don't do anything\n\t\tif($oldOrder['status'] === $order->getStatus()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the order status has changed, check if a notification should be sent\n\t\t// for the new status. If not, don't do anything\n\t\tif($order->getStatus() !== $settings['order_notification_status']) {\n\t\t\treturn;\n\t\t}\n\n\t\tMage::log('sending', null, 'm.txt');\n\n\t\t// Generate the body for the notification\n\t\t$store_name = Mage::app()->getStore()->getFrontendName();\n\t\t$customer_name = $order->getCustomerFirstname();\n\t\t$customer_name .= ' ' . $order->getCustomerLastname();\n\t\t$order_amount = $order->getBaseCurrencyCode();\n\t\t$order_amount .= ' ' . $order->getBaseGrandTotal();\n\n\t\t$body = sprintf('%s: %s has just placed an order for %s', $store_name, $customer_name, $order_amount);\n\n\t\t// If no recipients have been set, we can't do anything\n\t\tif(!count($settings['order_noficication_recipients'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the order notification by SMS\n\t\t$result = Mage::helper('smsnotifications/data')->sendSms($body, $settings['order_noficication_recipients']);\n\n\t\t// Check if the sending was successful\n\t\tif(!$result) {\n\t\t\t// If an error occured, notify the administrator\n\t\t\tMage::helper('smsnotifications/data')->sendAdminEmail(sprintf('%s was unable to send one or more order notifications to the specified number(s). Please check your configuration to make sure that your Twilio API settings are correct!', Mage::helper('smsnotifications/data')->app_name));\n\t\t}\n\t}",
"function deliverOrder($orderNum)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $query = \" update check_tb set status = '2' where id='\".$orderNum.\"' \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n $mysqli->query(\"CREATE EVENT updateStatus\".$orderNum.\" ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE DO \n \tupdate check_tb set status = '1' where id='\".$orderNum.\"' ;\n \t\") or die (mysqli_error($mysqli));\n\t\t\tif($res)\n\t\t\t{\n\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\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( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\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\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\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\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"private function setOrderAsPending($order){\r\n $this->log('Setting as pending order #'.$order->get_order_number());\r\n //Since the default status of the order is pending, we only add a note here.\r\n $this->addOrderNote($order, 'La orden se encuentra pendiente.');\r\n }",
"public function setPendingReceived($value)\n {\n return $this->set(self::pending_received, $value);\n }",
"function hook_commerce_adyen_capture_received(\\Commerce\\Adyen\\Payment\\Transaction\\Payment $transaction, \\stdClass $order) {\n /* @var \\EntityDrupalWrapper $message */\n $message = entity_metadata_wrapper('message', message_create('commerce_adyen', [\n 'arguments' => [\n '@message' => t('Capture request for %order_number order has been received.', [\n '%order_number' => $order->order_number,\n ]),\n ],\n ]));\n\n $message->message_commerce_order = $order->order_id;\n $message->save();\n}",
"public function sendStatusUpdateNotifications(OrderEvent $event)\n {\n $order = $event->getOrder();\n switch ($order->getStatus()) {\n\n case Order::STATUS_AWAITING_SEPA:\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_NEW:\n // get payment\n $payment = $order->getPayments()->first();\n\n // is transport\n $isTransport = true;\n if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {\n $isTransport = false;\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $payment->getChargeId(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_CANCELED:\n // order has been canceled by the customer\n if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n case Order::STATUS_TRANSIT:\n\n // get shipment\n $shipments = $order->getShipments();\n /** @var Shipment $shipment */\n $shipment = $shipments[0];\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'trackingUrl' => $shipment->getTrackingUrl(),\n 'trackingNumber' => $shipment->getParcelNumber(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_READY_FOR_PICKUP:\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_REFUNDED:\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // get order refund id\n $refundId = 'n/a';\n $refunds = $order->getRefunds();\n if (0 < count($refunds)) {\n /** @var Refund $refund */\n $refund = $refunds[0];\n $refundId = $refund->getRefundId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'refundId' => $refundId,\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_DELIVERED:\n\n // send customer e-mail\n /* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n //'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'\n 'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATING,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n */\n break;\n\n case Order::STATUS_CLOSED:\n\n if ($order->getRating()->getEnabled() == True ) {\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderRateValue' => $order->getRating()->getRate(),\n 'orderRateValue' => $order->getRating()->getComment(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATE,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n\n\n\n case Order::STATUS_FILE_AVAILABLE:\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_REJECTED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_VALIDATED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n }\n }",
"public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }",
"public function amountRecived(Request $request) {\n $driver_orders = unserialize(base64_decode($request->orders));\n \n foreach ($driver_orders as $driver_order) {\n if ($driver_order->order->status == 'Delivered') {\n $order = Order::find($driver_order->order->id);\n $order->status = 'Amount received from driver';\n $order->save();\n }\n }\n \n $driver = Driver::where('id', $request->driver_id)->with('user')->first();\n \n return back()->with('success','Recived '.$request->amount.' from'.' '.$driver->user->name);\n }",
"protected static function on_change_order_state($order)\n {\n \n }",
"function setOrderCancelled($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"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}",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function it_exchange_abandoned_carts_mark_email_clicked_through( $email_id, $cart_id ) {\n\t$cart_emails = get_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', true );\n\n\t// Make sure this email hasn't already been credited for reengaging the custumer.\n\tforeach( (array) $cart_emails as $key => $email ) {\n\t\tif ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id && ! empty( $email['clickedthrough'] ) ) {\n\t\t\treturn;\n\t\t} else if ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id ) {\n\t\t\t$cart_emails[$key]['clickedthrough'] = time();\n\t\t\tupdate_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', $cart_emails );\n\t\t}\n\t}\n\n\t// If we made it this far the abadoned cart's sent_email has been flagged as reengaged and we need to increment the clickthroughs for the email.\n\t$clickedthrough = (int) get_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_clickedthrough', true );\n\tupdate_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_clickedthrough', ( $clickedthrough + 1 ) );\n}",
"function wcfm_dokan_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 = $_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\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \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 } else {\r\n \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 }\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}"
]
| [
"0.64777887",
"0.6158849",
"0.5981303",
"0.5977248",
"0.5903778",
"0.57888186",
"0.5784632",
"0.57198447",
"0.563626",
"0.5581515",
"0.5546358",
"0.5473458",
"0.54663837",
"0.54459774",
"0.54220086",
"0.5407221",
"0.54020214",
"0.5385952",
"0.5376946",
"0.5348169",
"0.5345237",
"0.53449976",
"0.53396285",
"0.5326104",
"0.53135383",
"0.5308295",
"0.52983046",
"0.52853835",
"0.5284306",
"0.5278579"
]
| 0.6721483 | 0 |
Shopping Cart has many Cart Items | public function cartItems() {
return $this->hasMany(CartItem::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cart()\n {\n return $this->hasMany(Item::class);\n }",
"public function cartItem()\n {\n return $this->hasMany('App\\Model\\CartItem');\n }",
"public function carts()\n\t{\n\t\treturn $this->belongsToMany(Cart::class, 'items_carts', 'item_id', 'cart_id');\n\t}",
"public function carts()\n {\n return $this->hasMany('App\\Cart');\n }",
"public function carts()\n {\n return $this->hasMany(Cart::class);\n }",
"public function carts()\n {\n return $this->hasMany(Cart::class);\n }",
"public function carts()\n {\n return $this->hasMany(Cart::class);\n }",
"public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }",
"public function cart() {\n return $this->belongsTo('App\\Cart');\n }",
"public function shoppingCart()\n {\n return $this->hasMany(ShoppingCart::class);\n }",
"public function cart()\n {\n return $this->belongsTo(Cart::class);\n }",
"public function carts(){\n return $this->hasMany('App\\Model\\Cart','customer_id','id');\n }",
"public function cart()\n {\n return $this->belongsTo('JulioBitencourt\\Cart\\Storage\\Eloquent\\Entities\\Cart');\n }",
"public function cart() : BelongsTo\n {\n return $this->belongsTo(Cart::class);\n }",
"public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }",
"public function cart()\n {\n return $this->belongsTo('TechTrader\\Models\\Cart');\n }",
"public function cart()\n {\n return $this->belongsTo('App\\Models\\Cart', 'cart_id', 'id');\n }",
"public function carts() {\n return $this->belongsToMany('App\\Cart', 'sales', 'sale_id',\n 'sale_id', 'sale_id', 'sale_id')\n ;\n }",
"public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }",
"public function carts()\n {\n return $this->belongsToMany(Cart::class)->withPivot('quantity')->withTimestamps();\n }",
"public function UserCart()\n {\n return $this->hasMany(UserCart::class, 'id_user_cart', 'id');\n }",
"public function cart()\n {\n return $this->hasOne('App\\Cart', 'id_user');\n }",
"public function carts()\n {\n return $this->belongsToMany(Cart::class, 'cart_discount_code', 'discount_code_id', 'cart_id')->withPivot(\n 'cart_id',\n 'discount_code_id',\n 'attributed_at',\n 'converted_at',\n 'deleted_at',\n 'new_referral'\n );\n }",
"public function getCartItems($cart_id);",
"public function getCart();",
"public function getCartDetails()\n {\n return $this->hasMany(CartDetails::className(), ['cart_id' => 'id']);\n }",
"public function details()\n {\n\n return $this->hasMany(CartDetail::class);\n }",
"public function getCartable();",
"public function addCart($cart){\n $this->cart_id = $cart; \n }",
"public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }"
]
| [
"0.8017298",
"0.79342914",
"0.76961607",
"0.76542604",
"0.75875205",
"0.75875205",
"0.75875205",
"0.75695926",
"0.753876",
"0.7495373",
"0.7487104",
"0.74207026",
"0.73673517",
"0.7315237",
"0.7308528",
"0.730656",
"0.72836226",
"0.72270525",
"0.7177483",
"0.7087602",
"0.70848566",
"0.7060097",
"0.6789553",
"0.6712723",
"0.66845864",
"0.66188747",
"0.6503362",
"0.64864624",
"0.6257092",
"0.62193966"
]
| 0.8001362 | 1 |
Transform a guest account into a registered customer account | public function processGuestToCustomer()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _ensureCustomer()\n {\n if ( $this->_isGuestOrder() && Mage::helper('gueststorecredit')->canConvertGuest() ) {\n $customer = Mage::helper('gueststorecredit')->createNewCustomerFromOrder($this->getOrder());\n\n $this->getCreditMemo()->setCustomerId($customer->getId());\n\n $this->setCustomerId($customer->getId())\n ->setCustomer($customer);\n\n $this->setIsFromGuestFlag(true);\n }\n\n parent::_ensureCustomer();\n }",
"public function testCustomerGuestTest()\n {\n $customerId = 0;\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue(\"Guest\" == $customer->first_name);\n }",
"public function getCustomerIsGuest();",
"public function getCustomer();",
"public function createCustomer(Customer $customer): Customer;",
"function ciniki_poma_customerAccountGet($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'customer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Customer'),\n 'order_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Order'),\n 'sections'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'name'=>'Return Orders'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'checkAccess');\n $rc = ciniki_poma_checkAccess($ciniki, $args['tnid'], 'ciniki.poma.customerAccountGet');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Load poma maps\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'maps');\n $rc = ciniki_poma_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki, 'php');\n\n $rsp = array('stat'=>'ok', 'customer_details'=>array(), 'orders'=>array());\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'hooks', 'customerDetails');\n\n //\n // Get the customer details\n //\n if( isset($args['sections']) && in_array('details', $args['sections']) ) {\n $rc = ciniki_customers_hooks_customerDetails($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) ) {\n $rsp['customer_details'] = $rc['details'];\n }\n if( isset($rc['customer']['member_status_text']) && $rc['customer']['member_status_text'] != '' ) {\n if( isset($rc['customer']['member_lastpaid']) && $rc['customer']['member_lastpaid'] != '' ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'] . ' <span class=\"subdue\">[' . $rc['customer']['member_lastpaid'] . ']</span>',\n ));\n } else {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'],\n ));\n }\n }\n\n //\n // Get the current account balance\n //\n $strsql = \"SELECT ciniki_poma_customer_ledgers.id, \"\n . \"ciniki_poma_customer_ledgers.description, \"\n . \"ciniki_poma_customer_ledgers.transaction_date, \"\n . \"ciniki_poma_customer_ledgers.transaction_type, \"\n . \"ciniki_poma_customer_ledgers.customer_amount, \"\n . \"ciniki_poma_customer_ledgers.balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 15 \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'entries', 'fname'=>'id', \n 'fields'=>array('id', 'description', 'transaction_date', 'transaction_type', 'customer_amount', 'balance'),\n 'utctotz'=>array('transaction_date'=>array('timezone'=>$intl_timezone, 'format'=>$date_format)),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['recent_ledger'] = array();\n if( isset($rc['entries']) ) {\n foreach($rc['entries'] as $entry) {\n if( !isset($balance) ) {\n $balance = $entry['balance'];\n }\n if( $entry['transaction_type'] == 10 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 30 ) {\n $entry['amount'] = '-$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 60 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n }\n $entry['balance_text'] = ($entry['balance'] < 0 ? '-':'') . '$' . number_format(abs($entry['balance']), 2);\n// array_unshift($rsp['recent_ledger'], $entry);\n }\n if( isset($balance) ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Account',\n 'value'=>($balance < 0 ? '-' : '') . '$' . number_format(abs($balance), 2),\n ));\n // if( $balance < 0 && $balance != $rsp['order']['balance_amount'] ) {\n // $rsp['order']['default_payment_amount'] = abs($balance);\n // }\n // if( $balance < 0 ) {\n // $rsp['checkout_account'] = array(\n // array('label'=>'Account Balance Owing', 'status'=>'red', 'value'=>'$' . number_format(abs($balance), 2)),\n // );\n // }\n }\n }\n }\n\n //\n // Get the orders\n //\n if( isset($args['sections']) && in_array('orders', $args['sections']) ) {\n $strsql = \"SELECT orders.id, \"\n . \"orders.customer_id, \"\n . \"orders.order_number, \"\n . \"orders.order_date, \"\n . \"orders.status, \"\n . \"orders.status AS status_text, \"\n . \"orders.payment_status, \"\n . \"orders.payment_status AS payment_status_text, \"\n . \"orders.billing_name, \"\n . \"orders.total_amount \"\n . \"FROM ciniki_poma_orders AS orders \"\n . \"WHERE orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY orders.order_date DESC \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'orders', 'fname'=>'id', 'fields'=>array('id', 'customer_id', 'order_number', 'order_date', \n 'status', 'status_text', 'payment_status', 'payment_status_text', 'billing_name', 'total_amount'),\n 'utctotz'=>array('order_date'=>array('timezone'=>'UTC', 'format'=>$date_format)),\n 'maps'=>array('status_text'=>$maps['order']['status'],\n 'payment_status_text'=>$maps['order']['payment_status']),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['orders']) ) {\n $rsp['orders'] = $rc['orders'];\n foreach($rsp['orders'] as $oid => $order) {\n $rsp['orders'][$oid]['total_amount_display'] = '$' . number_format($order['total_amount'], 2);\n }\n }\n }\n\n //\n // Get the records for the account\n //\n if( isset($args['sections']) && in_array('records', $args['sections']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'accountRecords');\n $rc = ciniki_poma_accountRecords($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['records'] = isset($rc['records']) ? $rc['records'] : array();\n }\n\n //\n // Get the order\n //\n $rsp['order_messages'] = array();\n if( isset($args['order_id']) && $args['order_id'] > 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderLoad');\n $rc = ciniki_poma_orderLoad($ciniki, $args['tnid'], $args['order_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['order']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.28', 'msg'=>'Unable to find order'));\n }\n $rsp['order'] = $rc['order'];\n// $rsp['order']['default_payment_amount'] = $rc['order']['balance_amount'];\n\n //\n // Build the nplists\n //\n// foreach($rsp['order']['items'] as $item) {\n// $rsp['nplists']['orderitems'][] = $item['id'];\n// }\n //\n // Check if there are any messages for this order\n //\n if( isset($ciniki['tenant']['modules']['ciniki.mail']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'hooks', 'objectMessages');\n $rc = ciniki_mail_hooks_objectMessages($ciniki, $args['tnid'], array('object'=>'ciniki.poma.order', 'object_id'=>$args['order_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['order_messages'] = isset($rc['messages']) ? $rc['messages'] : array();\n } \n }\n\n return $rsp;\n}",
"public function getOrCreateCustomer();",
"public function getAccount();",
"protected function gigyaCreateUser($resultRedirect, $gigya_user_account) {\n try {\n // $address = $this->extractAddress();\n // $addresses = $address === null ? [] : [$address];\n\n $customer = $this->customerExtractor->extract('customer_account_create', $this->_request);\n\n $this->gigyaSetCustomerFields($customer, $gigya_user_account);\n\n /// $password = $this->getRequest()->getParam('password');\n // $confirmation = $this->getRequest()->getParam('password_confirmation');\n $password = $this->_objectManager->create('Gigya\\GigyaM2\\Helper\\Data')->generatePassword();\n $redirectUrl = $this->session->getBeforeAuthUrl();\n // $this->checkPasswordConfirmation($password, $confirmation);\n\n $customer = $this->accountManagement\n ->createAccount($customer, $password, $redirectUrl);\n\n if ($this->getRequest()->getParam('is_subscribed', false)) {\n $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());\n }\n\n $this->_eventManager->dispatch(\n 'customer_register_success',\n ['account_controller' => $this, 'customer' => $customer]\n );\n\n $confirmationStatus = $this->accountManagement->getConfirmationStatus($customer->getId());\n if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) {\n $email = $this->customerUrl->getEmailConfirmationUrl($customer->getEmail());\n // @codingStandardsIgnoreStart\n $this->messageManager->addSuccess(\n __(\n 'You must confirm your account. Please check your email for the confirmation link or <a href=\"%1\">click here</a> for a new link.',\n $email\n )\n );\n // @codingStandardsIgnoreEnd\n $url = $this->urlModel->getUrl('*/*/index', ['_secure' => true]);\n $resultRedirect->setUrl($this->_redirect->success($url));\n } else {\n $this->session->setCustomerDataAsLoggedIn($customer);\n $this->messageManager->addSuccess($this->getSuccessMessage());\n $resultRedirect = $this->accountRedirect->getRedirect();\n }\n return $resultRedirect;\n } catch (StateException $e) {\n $url = $this->urlModel->getUrl('customer/account/forgotpassword');\n // @codingStandardsIgnoreStart\n $message = __(\n 'There is already an account with this email address. If you are sure that it is your email address, <a href=\"%1\">click here</a> to get your password and access your account.',\n $url\n );\n // @codingStandardsIgnoreEnd\n $this->messageManager->addError($message);\n } catch (InputException $e) {\n $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));\n foreach ($e->getErrors() as $error) {\n $this->messageManager->addError($this->escaper->escapeHtml($error->getMessage()));\n }\n } catch (\\Exception $e) {\n $this->messageManager->addException($e, __('We can\\'t save the customer.'));\n }\n\n $this->session->setCustomerFormData($this->getRequest()->getPostValue());\n $defaultUrl = $this->urlModel->getUrl('*/*/create', ['_secure' => true]);\n $resultRedirect->setUrl($this->_redirect->error($defaultUrl));\n return $resultRedirect;\n }",
"function user_make_account($first_name, $last_name, $email){\n\t\t$queryText = 'INSERT INTO user_accounts (first_name, last_name, email) VALUES (:first_name, :last_name, :email)';\n\t\t\n\t\t$query = $this->connection->prepare($queryText);\n\t\t$query->execute(array(':first_name'=>$first_name, ':last_name'=>$last_name, ':email'=>$email));\n\t\t\n\t\treturn array(\"uid\"=>strval($this->connection->lastInsertId()));\n\t}",
"public function getUser(): AccountInterface;",
"protected function createStripeCustomer()\n {\n return BaseCustomer::create([\n 'email' => $this->user->email\n ]);\n }",
"private function _serializeCustomer($record)\n {\n $customer = new Customer();\n $customer->CustomerID = $record['CustomerID'];\n $customer->CompanyName = $record['CompanyName'];\n $customer->ContactName = $record['ContactName'];\n $customer->ContactTitle = $record['ContactTitle'];\n $customer->Phone = $record['Phone'];\n $customer->Fax = $record['Fax']; \n $customer->Address = new Address();\n $customer->Address->StreetName = ($record['Address']);\n $customer->Address->City = $record['City'];\n $customer->Address->Region = $record['Region'];\n $customer->Address->PostalCode = $record['PostalCode'];\n $customer->Address->Country = $record['Country'];\n //Set alternate address\n $customer->Address->AltAddress = new Address();\n $customer->Address->AltAddress->StreetName = 'ALT_' . $customer->Address->StreetName;\n $customer->Address->AltAddress->City = 'ALT_' . $customer->Address->City;\n $customer->Address->AltAddress->Region = 'ALT_' . $customer->Address->Region;\n $customer->Address->AltAddress->PostalCode = 'ALT_' . $customer->Address->PostalCode;\n $customer->Address->AltAddress->Country = 'ALT_' . $customer->Address->Country;\n $customer->EmailAddresses = array();\n for ($i = 1; $i < 4; $i++) {\n $customer->EmailAddresses[] = $customer->CustomerID . $i . '@live.com'; \n }\n\n $customer->OtherAddresses = array();\n for ($i = 0; $i < 2; $i++) {\n $customer->OtherAddresses[$i] = new Address();\n $this->_copyAddress($customer->Address, $customer->OtherAddresses[$i], $i + 1);\n }\n\t\t\n return $customer;\n }",
"protected function _addCustomer($object) {\n\t\t$format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId());\n\t\t$customer = Mage::getModel('customer/customer');\n\t\t$customerCode = '';\n\t\t\n\t\tif($object->getCustomerId()) {\n\t\t\t$customer->load($object->getCustomerId());\n\t\t\t$taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode();\n \t$this->_request->setCustomerUsageType($taxClass);\n\t\t}\n\t\t\n\t\tswitch($format) {\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY:\n\t\t\t\tif($customer->getId()) {\n\t\t\t\t\t$customerCode = $customer->getName() . ' (' . $customer->getId() . ')';\n\t\t\t\t} else {\n $address = $object->getBillingAddress() ? $object->getBillingAddress() : $object;\n\t\t\t\t\t$customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL:\n\t\t\t\t$customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// New code by David Dzimianski - CSH 2013\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_MAS_ID:\n\t\t\t\t$customerCode = $object->getData('mas_id') ? '00' . $object->getData('mas_id') : '00' . $customer->getData('mas_id');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID:\n\t\t\tdefault:\n\t\t\t\t$customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->_request->setCustomerCode($customerCode);\n\t}",
"public function createFromRemote() {\n $edit = array(\n 'mail' => $this->email,\n 'name' => $this->email,\n 'pass' => $this->password,\n 'status' => 1,\n 'created' => REQUEST_TIME,\n );\n\n $dob = new DateObject($this->remote_account->DOB);\n $fields = array(\n 'birthdate' => $dob->format(DATE_FORMAT_DATE),\n 'first_name' => $this->remote_account->Name,\n 'country' => variable_get('dosomething_user_address_country'),\n 'user_registration_source' => DOSOMETHING_CANADA_USER_SOURCE,\n );\n dosomething_user_set_fields($edit, $fields);\n\n try {\n $account = user_save('', $edit);\n }\n catch (Exception $e) {\n watchdog_exception(DOSOMETHING_CANADA_WATCHDOG, $e);\n return FALSE;\n }\n\n $this->local_account = $account;\n return $this->local_account;\n }",
"private function createCustomer()\n {\n try {\n $createCustomer = \\Stripe\\Customer::create([\n \"description\" => \"Customer for\" . Auth::user()->email,\n \"email\" => Auth::user()->email\n ]);\n RecruiterProfile::updateCustomerId($createCustomer['id']);\n $this->response['success'] = true;\n $this->response['data'] = $createCustomer;\n $this->response['message'] = trans('messages.customer_created');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }",
"public function customer()\n {\n return $this->morphTo(__FUNCTION__, 'customer_type', 'customer_uuid')->withoutGlobalScopes();\n }",
"function createCustomerProfile($email)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create a Customer Profile Request\n // 1. (Optionally) create a Payment Profile\n // 2. (Optionally) create a Shipping Profile\n // 3. Create a Customer Profile (or specify an existing profile)\n // 4. Submit a CreateCustomerProfile Request\n // 5. Validate Profile ID returned\n\n\n // Create the payment object for a payment nonce\n $opaqueData = new AnetAPI\\OpaqueDataType();\n $opaqueData->setDataDescriptor($_POST['descriptor']);\n $opaqueData->setDataValue($_POST['value']);\n $paymentOpaque = new AnetAPI\\PaymentType();\n $paymentOpaque->setOpaqueData($opaqueData);\n\n\n // Create the Bill To info for new payment type\n $billTo = new AnetAPI\\CustomerAddressType();\n $billTo->setFirstName($_POST['firstName']);\n $billTo->setLastName($_POST['lastName']);\n $billTo->setCompany($_POST['company']);\n $billTo->setAddress($_POST['address']);\n $billTo->setCity($_POST['city']);\n $billTo->setState($_POST['state']);\n $billTo->setZip($_POST['zip']);\n $billTo->setCountry($_POST['country']);\n $billTo->setPhoneNumber($_POST['phone']);\n\n\n // Create a new CustomerPaymentProfile object\n $paymentProfile = new AnetAPI\\CustomerPaymentProfileType();\n $paymentProfile->setCustomerType('individual');\n $paymentProfile->setBillTo($billTo);\n $paymentProfile->setPayment($paymentOpaque);\n $paymentProfile->setDefaultpaymentProfile(true);\n $paymentProfiles[] = $paymentProfile;\n\n\n // Create a new CustomerProfileType and add the payment profile object\n $customerProfile = new AnetAPI\\CustomerProfileType();\n $customerProfile->setDescription(\"Customer 2 Test PHP\");\n $customerProfile->setEmail($email);\n $customerProfile->setpaymentProfiles($paymentProfiles);\n\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateCustomerProfileRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setProfile($customerProfile);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateCustomerProfileController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n echo \"Succesfully created customer profile : \" . $response->getCustomerProfileId() . \"<br>\";\n $paymentProfiles = $response->getCustomerPaymentProfileIdList();\n echo \"SUCCESS:<br>PAYMENT PROFILE ID : \" . $paymentProfiles[0] . \"<br>\";\n echo \"<br>Validating payment:<br>\";\n validateCustomerPaymentProfile($response->getCustomerProfileId(),$paymentProfiles[0]);\n }\n else\n {\n echo \"ERROR : Invalid response<br>\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"<br>\";\n }\n return $response;\n}",
"protected function create()\n {\n return $this->proxyStripeExceptions(function () {\n return Customer::create([\n 'email' => $this->user->email,\n 'metadata' => [\n 'first_name' => $this->user->first_name,\n 'last_name' => $this->user->last_name,\n ],\n ]);\n });\n }",
"protected function createUserAccount() {\n\t\treturn new UserAccount();\n\t}",
"function get_guest() {\n return get_complete_user_data('username', 'guest');\n}",
"function getCustomeruuid()\n {\n return $this->customer_uuid;\n }",
"public function getCustomerId();",
"public function getCustomerId();",
"public function getCustomerId();",
"public function convert()\n {\n if (isset($this->mapped[$this->index][$this->value])) {\n $account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);\n\n return $account;\n } else {\n if (strlen($this->value) > 0) {\n $account = $this->findAccount();\n if (!is_null($account)) {\n return $account;\n }\n }\n\n return $this->value;\n }\n }",
"public function customerProvider()\n {\n $existing = (new CustomerBuilder())\n ->withFirstName('Henry')\n ->withLastName('GanttSr')\n ->withEmailAddress(uniqid('dues').'@teamgantt.com')\n ->withPaymentMethod(new Nonce('fake-valid-nonce'))\n ->build();\n\n $new = (new CustomerBuilder())\n ->withFirstName('Henry')\n ->withLastName('GanttJr')\n ->withEmailAddress(uniqid('dues').'@teamgantt.com')\n ->withPaymentMethod(new Nonce('fake-valid-nonce'))\n ->build();\n\n return [\n 'existing customer' => [fn ($dues) => $dues->createCustomer($existing)],\n 'new customer' => [fn () => $new],\n ];\n }",
"protected function createCustomerProfile($_customer, $payment=null) {\r\n\t\tif( $this->_debug ) Mage::log('createCustomerProfile()', null, 'authnetcim.log');\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$email \t= $_customer->getEmail();\r\n\t\t\t$uid \t= $_customer->getEntityId();\r\n\r\n\t\t\t/**\r\n\t\t\t * If not logged in, we must be checking out as a guest--try to grab their info.\r\n\t\t\t */\r\n\t\t\tif( empty($email) || $uid < 2 ) {\r\n\t\t\t\t$sess = Mage::getSingleton('core/session')->getData();\r\n\r\n\t\t\t\tif( $payment != null && $payment->getQuote() != null ) {\r\n\t\t\t\t\t$email \t= $payment->getQuote()->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($payment->getQuote()->getCustomerId()) ? $payment->getQuote()->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\telseif( $payment != null && $payment->getOrder() != null ) {\r\n\t\t\t\t\t$email \t= $payment->getOrder()->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($payment->getOrder()->getCustomerId()) ? $payment->getOrder()->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\telseif( isset($sess['visitor_data']) && !empty($sess['visitor_data']['quote_id']) ) {\r\n\t\t\t\t\t$quote \t= Mage::getModel('sales/quote')->load( $sess['visitor_data']['quote_id'] );\r\n\r\n\t\t\t\t\t$email \t= $quote->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($quote->getCustomerId()) ? $quote->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$_customer->setEmail( $email );\r\n\t\t\t\t$_customer->setEntityId( $uid );\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Failsafe: We must have some email to go through here. The data might not\r\n\t\t\t * actually be available.\r\n\t\t\t */\r\n\t\t\tif( empty($email) ) {\r\n\t\t\t\tMage::log(\"No customer email found; can't create a CIM profile.\", null, 'authnetcim.log');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t$this->cim->setParameter( 'email', $email );\r\n\t\t\t$this->cim->setParameter( 'merchantCustomerId', $uid );\r\n\t\t\t$this->cim->createCustomerProfile();\r\n\t\t\t\r\n\t\t\t$profile_id = $this->cim->getProfileID();\r\n\t\t\t\r\n\t\t\t$this->checkCimErrors();\r\n\r\n\t\t\t/**\r\n\t\t\t * Handle 'duplicate' errors\r\n\t\t\t */\r\n\t\t\tif( strpos($this->cim->getResponse(), 'duplicate') !== false ) {\r\n\t\t\t\t$profile_id = preg_replace( '/[^0-9]/', '', $this->cim->getResponse() );\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t$_customer->setAuthnetcimProfileId( $profile_id );\r\n\t\t\tif( $_customer->getData('entity_id') > 0 ) {\r\n\t\t\t\t$_customer->save();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $profile_id;\r\n\t\t}\r\n\t\tcatch (AuthnetCIMException $e) {\r\n\t\t\tMage::log( $e->getMessage(), null, 'authnetcim.log', true );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function customer()\n {\n return $this->belongsTo('App\\Guest');\n }",
"public function getCustomerName();"
]
| [
"0.58083355",
"0.5459748",
"0.5429084",
"0.5285046",
"0.52352834",
"0.5162257",
"0.5152354",
"0.5134056",
"0.5104716",
"0.509612",
"0.5053748",
"0.5052017",
"0.5040172",
"0.5035832",
"0.5032828",
"0.5029079",
"0.50276136",
"0.5021984",
"0.5013735",
"0.5010318",
"0.4989265",
"0.49872112",
"0.49804467",
"0.49804467",
"0.49804467",
"0.49758163",
"0.49676985",
"0.49673277",
"0.49635476",
"0.49562147"
]
| 0.6598422 | 0 |
Required. Total number of shards. When any physical devices are selected, the number must be >= 1 and = 1 and int32 num_shards = 1; | public function getNumShards()
{
return $this->num_shards;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getShardsCount()\n {\n return $this->shards_count;\n }",
"public function getTotalShards()\n {\n return (int)$this->data['totalShards'];\n }",
"public function setNumShards($var)\n {\n GPBUtil::checkInt32($var);\n $this->num_shards = $var;\n\n return $this;\n }",
"public function shards(int $number): Fluent\n {\n return $this->settingCommand('number_of_shards', $number);\n }",
"public function setShardsCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->shards_count = $var;\n\n return $this;\n }",
"public function getNumShardsSkipped()\n {\n return (int)$this->data['numShardsSkipped'];\n }",
"protected function setShards()\n {\n // Clear shards first\n $this->shards = [];\n\n foreach ($this->getState()[ClusterState::SHARDS_PROP] as $shardName => $shardState) {\n $this->shards[$shardName] = new ShardState([$shardName => $shardState], $this->liveNodes);\n }\n }",
"public function getSmashIdxCount()\n {\n return $this->count(self::_SMASH_IDX);\n }",
"public function numDocs()\n {\n return $this->index->numDocs();\n }",
"public function findShards()\r\n\t{\r\n\t\t$result = $this -> connection -> setTable($this -> entity)\r\n\t\t\t\t\t\t\t\t\t -> fetch();\r\n\t\treturn $result;\r\n\t}",
"public function getCount() {\n return count($this->indices);\n }",
"public function setShardSize($shard_size)\n {\n return $this->setParam('shard_size', $shard_size);\n }",
"public function numberOfHostEntries()\n {\n return (int)$this->prepareRequest()->GetHostNumberOfEntries();\n }",
"public function getShelfCapacity() : int\n {\n return $this->shelfCapacity;\n }",
"private function checkForNumberOfHits()\n {\n // Get number of hits per page\n $hits = $this->app->request->getGet(\"hits\", 4);\n\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n $hits = 4;\n }\n return $hits;\n }",
"public function count(): int\n {\n return count($this->resources);\n }",
"public function getIncludeShardKeyBounds()\n {\n return $this->include_shard_key_bounds;\n }",
"function searchSize()\t{\n\t\treturn $this->getRandomSize();\n\t}",
"public function numNodes() {\r\n return $this->nodeCount;\r\n }",
"public function getNumberOfAvailableForGet()\n {\n return ($this->shelfs[0]->count() + $this->shelfs[1]->count() + $this->shelfs[2]->count());\n }",
"public function setNumCopies($numCopies) {}",
"public function getMinReplicas(): int {\n return $this->minReplicas;\n }",
"public function size()\n {\n $count = 0;\n foreach ($this->identityMap as $documentSet) {\n $count += count($documentSet);\n }\n return $count;\n }",
"final public function count(): int\n {\n return count($this->index);\n }",
"public function setNumberOfHMetrics($value) {}",
"public function count(): int\n {\n return $this->nodes->count();\n }",
"public function getMaxReplicas(): int {\n return $this->maxReplicas;\n }",
"public function isUsingShard()\n {\n return $this->currentShardId !== null;\n }",
"public function getWorkerCount(): int;",
"function NumQueries() {\n\t\t\treturn $this->querycount;\n\t\t}"
]
| [
"0.77530587",
"0.74255246",
"0.7311514",
"0.68055606",
"0.6617849",
"0.62268084",
"0.57737255",
"0.54278",
"0.5226933",
"0.51572603",
"0.513165",
"0.50968295",
"0.5050214",
"0.49984208",
"0.49721453",
"0.49708915",
"0.4936657",
"0.48678342",
"0.48409212",
"0.48269108",
"0.48212686",
"0.48081523",
"0.4796623",
"0.4782933",
"0.4781362",
"0.4774378",
"0.47710347",
"0.4763671",
"0.475518",
"0.47459573"
]
| 0.8122758 | 0 |
/ rate car independet service | public function give_rate_to_car(){
/* language changer */
$this->language = ($this->input->get('language') == "")?"english":$this->input->get('language');
$this->lang->load('master', "$this->language");
if($this->input->post()){
$request_para = array();
$rating_para['rating'] = $this->input->post('rating');
$rating_para['remarks'] = $this->input->post('remarks');
$rating_para['given_by'] = $this->input->post('car_renter_id');
$rating_para['car_id'] = $this->input->post('car_id');
$rating_para['booking_request_id'] = $this->input->post('booking_id');
$rating_para['date'] = date('Y-m-d H:i:s');
if($this->rating_model->rate_car($rating_para)){
$isSuccess = True;
$message = $this->lang->line('action_performed_successfully');
$data = array();
}else{
$isSuccess = False;
$message = $this->lang->line('not_able_to_perform_this_action');
$data = array();
}
}else{
$isSuccess = False;
$message = $this->lang->line('request_parameters_not_valid');
$data = array();
}
echo json_encode(array("isSuccess" => $isSuccess, "message" => $message, "Result" => $data));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AutoCar(WeappAutoCarRequest $request)\n {\n $IsProc = Cars::where('id', 1)->first();\n $name = $request->name;\n $password = $request->password;\n $State = 'true';\n\n if ('迟到的唐僧' == $name && 'Norman0%5138' == $password && '0' == $IsProc->explain)\n {\n $CarsCount = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->count();\n\n $CarsArray = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->get();\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'1']);\n\n for ($j=0; $j < $CarsCount; $j++)\n {\n $MoveToNext = false;\n $result = '';\n if ($CarsArray[$j]->id >= 1804)\n {\n $page = \"https://www.autohome.com.cn/\".$CarsArray[$j]->index_id;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $page);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_REFERER, $page);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n $result = iconv(\"gb2312\",\"UTF-8//IGNORE\",$result);\n\n if (false != strpos($result, '<!--在售 start-->'))\n {\n $result = str_before(str_after($result, '<!--在售 start-->'), '<!--在售 end-->');\n $MoveToNext = false;\n }\n else\n {\n $MoveToNext = true;\n }\n }\n else\n {\n $MoveToNext = true;\n }\n\n\n\n $ResultArray[] = '';\n $i = 0;\n $CommonFeature = '';\n $CarName[] = '';\n $Feature[] = '';\n $Price[] = '';\n\n while((false != strpos($result, '</dd>') && (false == $MoveToNext)))\n {\n $ResultArray[$i] = str_before($result, '</dd>');\n $result = str_after($result, '</dd>');\n if (false != strpos($ResultArray[$i], '<dl>'))\n {\n $CommonFeature = str_before(str_after($ResultArray[$i], '<span>'), '</span>');\n }\n\n $CarName[$i] = str_before(str_after($ResultArray[$i], 'class=\"name\">'), '</a>');\n\n if (false != strpos($ResultArray[$i], '<p class=\"guidance-price\">'))\n {\n $Price[$i] = str_before(str_after(str_after($ResultArray[$i], '<p class=\"guidance-price\">'), '<span>'), '</span>');\n }\n else\n {\n $Price[$i] = '价格未公布';\n }\n\n if (false != strpos($ResultArray[$i], '<span class=\"type-default\">'))\n {\n $Feature[$i] = str_before(str_after($ResultArray[$i], '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"type-default\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'), '</span>');\n }\n }\n\n $Feature[$i] = $Feature[$i].' '.$CommonFeature;\n\n }\n else\n {\n $Feature[$i] = '参数未公布';\n }\n //$ResultArray[$i] = $CarName[$i].' '.$Feature[$i].' '.$CommonFeature.' '.$Price[$i];\n\n $insert_bool = Auto::insert([\n 'Auto_ID'=>$CarsArray[$j]->index_id,\n 'Name'=>$CarName[$i],\n 'Feature'=>$Feature[$i],\n 'KeyWord'=>$CarsArray[$j]->name,\n 'MatchIndex'=>($i + 1),\n 'Price'=>$Price[$i],\n 'CreateTime'=>now(),\n 'CTUnix'=>time(),\n 'UpdateTime'=>now(),\n 'UTUnix'=>time(),\n 'SelectCount'=>0,\n 'IsOld'=>0]);\n\n if (false == $insert_bool)\n {\n $State = 'false';\n $j = 1000000;\n break;\n }\n\n $i++;\n }\n\n if ($CarsArray[$j]->id >= 1804)\n {\n sleep(2);\n }\n }\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'0']);\n return $State;\n }\n else\n {\n return '账号密码不对或者正在抓取';\n }\n }",
"public function rate()\n {\n\n }",
"public function show(VehicleRequest $request)\n {\n \n $input = $request->input();\n $cost = $request->input('purchase_cost');\n\n\n \n // depreciation\n $depreciation = new depreciationCost($cost);\n $depreciation_amount = $depreciation->depreciateCalc();\n\n\n // interest \n $carInterest = new interestCost($cost);\n $interest_amount = $carInterest->interestCalc();\n $hire_amount = $carInterest->hirePurchase();\n\n // interest total\n $interest_total = $interest_amount + $hire_amount;\n\n\n $carInsurance = new insuranceCost($cost);\n $insurance_amount = $carInsurance->insuranceCalc();\n\n \n $cat = $request->input('category');\n\n //subscription\n $subscription_cost =$request->input('subs');\n\n\n //parking default\n $parking_cost = 93500;\n\n //liscence default\n $liscence_cost = 0;\n //dd($liscence_cost);\n\n $fixed_cost = $liscence_cost + $parking_cost + $subscription_cost + $insurance_amount + $interest_total + $depreciation_amount;\n \n\n\n //fixed cost per km\n $fixed_costs_km = round ($fixed_cost / 30000, 2);\n \n \n\n \n \n //Operating Cost\n\n $oil_cost = $request->input('oils');\n $drive = $request->input('oils');\n $services_cost = $request->input('services');\n $repairs_cost = $request->input('repairs');\n $tyres_cost = $request->input('tyres');\n \n\n //get distance and fuel price\n $capacity_id = $request->input('capacity');\n $fuel_worth = $this->getFuels($capacity_id);\n $distance = $this->getDistance($capacity_id);\n \n\n $fuel_cost = new runningCost($fuel_worth, $distance,);\n $fuel = $fuel_cost->fuelCalc();\n\n\n \n $operating_costs = $oil_cost + $services_cost + $repairs_cost + $tyres_cost + $fuel;\n\n \n //Total Running Cost per KM\n\n \n $running_cost = $fixed_costs_km + $operating_costs;\n\n \n \n \n return view('frontend.costs')->with(compact('fixed_cost','operating_costs','parking_cost','liscence_cost','depreciation_amount','interest_total','subscription_cost','insurance_amount','parking_cost','oil_cost','services_cost','repairs_cost','tyres_cost','drive', 'fuel', 'fixed_costs_km', 'running_cost'));\n }",
"public function calculateAllNewCarValues(){\n $view= $this->view;\n $view->setNoRender();\n $carService = parent::getService('car','car');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $carService->calculateValuesForAllNewCars();\n echo \"good\";\n }",
"protected function calculatePrices()\n {\n }",
"public function getTotalInvoiced();",
"function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}",
"public function charges();",
"function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}",
"abstract function getPriceFromAPI($pair);",
"function interestRate($item_id){\n\t\treturn 0.1;\n\t}",
"public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\n }",
"public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }",
"public function getCost() {\n return 15 + $this->carService->getCost();\n }",
"public function getCountCarPrice(){\r\n\t\t$this->countPrice = getValue(\"SELECT active FROM tbl_user WHERE user_id=\".$this->getCarOwnerID());\r\n\t\treturn $this->countPrice;\r\n\t}",
"public function getDiscountInvoiced();",
"public function getPrices()\n {\n }",
"public function getTonicDiscount()\n {\n }",
"public function marketPricing(Request $request)\n {\n \t$market = CarbonPrice::where('active', 1)->first();\n\n \t// Return current prices in the market \n \treturn response([\n \t\t'price' => $market->value,\n \t\t'rate' => $market->credit_rate,\n \t], 200); \t\n }",
"function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}",
"function rateRecipe(){\n $id = $_REQUEST['id'];\n include(\"../model/recipe.php\");\n $obj=new recipe();\n\n if($obj->rateRecipe($id)) {\n echo '{\"result\":1}';\n }\n else {\n echo '{\"result\":0}';\n }\n }",
"public function getMyPriceForASIN($request);",
"function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }",
"public function index()\n {\n return VehicleRate::latest()->paginate(7);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }",
"public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }",
"public function rateForm(Car $car){\n \n return view ('viewCars.rateForm')->with('car',$car);\n }",
"public function index()\n {\n //\n ;//for specific price list\n }",
"public function resolvePrice();",
"public function cars(){\n \n $cars = array(\n 'ABARTH',\n 'ABT',\n 'AC',\n 'ACURA',\n 'AIXAM',\n 'ALFA ROMEO',\n 'ALPINA',\n 'ALPINE',\n 'ALVIS',\n 'AMG',\n 'ARASH',\n 'ARIEL',\n 'ARRINERA',\n 'ARTEGA',\n 'ASIA MOTORS',\n 'ASTON MARTIN',\n 'AUDI',\n 'AUSTIN',\n 'AUSTIN HEALEY',\n 'AXON',\n 'BAC',\n 'BAIC',\n 'BAOJUN',\n 'BEDFORD',\n 'BENTLEY',\n 'BERTONE',\n 'BHARATBENZ',\n 'BITTER',\n 'BMW',\n 'BORGWARD',\n 'BOWLER',\n 'BRABUS',\n 'BRAMMO',\n 'BRILLIANCE',\n 'BRISTOL',\n 'BROOKE',\n 'BUFORI',\n 'BUGATTI',\n 'BUICK',\n 'BYD',\n 'CADILLAC',\n 'CAPARO',\n 'CARLSSON',\n 'CATERHAM',\n 'CHANGAN',\n 'CHANGFEN',\n 'CHERY',\n 'CHEVROLET',\n 'CHRYSLER',\n 'CITROEN',\n 'CIZETA',\n 'CORVETTE',\n 'DACIA',\n 'DAEWOO',\n 'DAF',\n 'DAIHATSU',\n 'DAIMLER',\n 'DARTZ',\n 'DATSUN',\n 'DAVID BROWN',\n 'DE TOMASO',\n 'DELOREAN',\n 'DEVEL SIXTEEN',\n 'DINA',\n 'DMC',\n 'DODGE',\n 'DONGFENG',\n 'DONKERVOORT',\n 'DS AUTOMOBILES',\n 'ELFIN',\n 'EUNOS',\n 'EXCALIBUR',\n 'FERRARI',\n 'FIAT',\n 'FORD',\n 'FPV',\n 'GEELY',\n 'GMC',\n 'GOGGOMOBIL',\n 'GREAT WALL',\n 'HDT',\n 'HILLMAN',\n 'HINO',\n 'HOLDEN',\n 'HONDA',\n 'HSV',\n 'HUMMER',\n 'HYUNDAI',\n 'INFINITI',\n 'INTERNATIONAL',\n 'ISUZU',\n 'IVECO',\n 'JAGUAR',\n 'JBA',\n 'JEEP',\n 'JENSEN',\n 'KIA',\n 'LAMBORGHINI',\n 'LANCIA',\n 'LAND ROVER',\n 'LEXUS',\n 'LEYLAND',\n 'LINCOLN',\n 'LOTUS',\n 'MG',\n 'MACK',\n 'MAHINDRA',\n 'MASERATI',\n 'MAZDA',\n 'MERCEDES',\n 'MERCURY',\n 'MINI',\n 'MITSUBISHI',\n 'MORGAN',\n 'MORRIS',\n 'NISSAN',\n 'NISMO',\n 'OLDSMOBILE',\n 'PEUGEOT',\n 'PLYMOUTH',\n 'PONTIAC',\n 'PORSCHE',\n 'PROTON',\n 'RAMBLER',\n 'RENAULT',\n 'ROLLS ROYCE',\n 'ROVER',\n 'SAAB',\n 'SEAT',\n 'SKODA',\n 'SMART',\n 'SSANGYONG',\n 'STUDEBAKER',\n 'SUBARU',\n 'SUZUKI',\n 'TESLA',\n 'TOYOTA',\n 'TRD',\n 'TRIUMPH',\n 'TVR',\n 'UD',\n 'ULTIMA',\n 'VAUXHALL',\n 'VOLKSWAGEN',\n 'VOLVO',\n 'WESTFIELD',\n 'WILLYS',\n 'WOLSELEY'\n );\n\n return $cars;\n }",
"function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}"
]
| [
"0.5984275",
"0.58329827",
"0.5773014",
"0.57282686",
"0.57066685",
"0.56140524",
"0.56041324",
"0.55659014",
"0.551426",
"0.54991746",
"0.5498739",
"0.5445294",
"0.54193014",
"0.5415721",
"0.5404449",
"0.5404384",
"0.53993237",
"0.53804123",
"0.5376352",
"0.53747314",
"0.53744555",
"0.53416127",
"0.5330744",
"0.53131235",
"0.5312347",
"0.5312151",
"0.52967",
"0.52925396",
"0.5288136",
"0.52783036"
]
| 0.58416975 | 1 |
this report belongs to a particular vehicle | public function vehicle()
{
return $this->belongsTo('App\Models\Admin\Vehicle');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function vehicle()\n\t{\n\t\treturn $this->belongsTo('vehicle', 'vehicle_id');\n\t}",
"public function vehicle()\n {\n return $this->hasOne('App\\Models\\Vehicletype','id','vehicle_type_id');\n }",
"public function show(vehicle $vehicle)\n {\n //\n }",
"public function show(Drivervehicle $drivervehicle)\n {\n\n }",
"function VehicleDetails(){\n\t\tparent::getVehicleDetails();\n\t\t$this -> addVehicleDetails();\n\t}",
"public function show(Vehicle $vehicle)\n {\n //\n }",
"public function vehicule()\n {\n return $this->belongsTo(Vehicule::class, 'vehicule');\n }",
"public function show(Vehicle $vechile)\n {\n //\n }",
"public function vehicule()\n {\n return $this->belongsTo(Vehicule::class, 'vehicule');\n }",
"public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }",
"public function show(VehicleIn $vehicleIn)\n {\n //\n }",
"public function vehicle()\n {\n return $this->belongsToMany(Vehicle::class, 'nodeVehicle', 'relNodeId', 'relVehicleId')\n ->using(new class extends Pivot {\n use UuidModelTrait;\n });\n }",
"public function vehicles()\n {\n return $this->belongsToMany('App\\Vehicle');\n }",
"public function show(vehiclereport $vehiclereport)\n {\n //\n }",
"function check_own_vehicle($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\tif (empty($cid))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, $lang['No_vehicle_id_specified'], '', __LINE__, __FILE__);\n\t\t}\n\t\n\t\t$sql = \"SELECT g.member_id FROM \" . GARAGE_TABLE . \" AS g WHERE g.id = $cid \";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\t$vehicle = $db->sql_fetchrow($result); \n\t\t$db->sql_freeresult($result);\n\t\n\t\tif ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )\n\t\t{\n\t\t\t//Allow A Moderator Or Administrator Do What They Want....\n\t\t\treturn;\n\t\t}\n\t\telse if ( $vehicle['member_id'] != $userdata['user_id'] )\n\t\t{\n\t\t\t$message = $lang['Not_Vehicle_Owner'] . \"<br /><br />\" . sprintf($lang['Click_return_garage'], \"<a href=\\\"\" . append_sid(\"garage.$phpEx\") . \"\\\">\", \"</a>\") . \"<br /><br />\" . sprintf($lang['Click_return_index'], \"<a href=\\\"\" . append_sid(\"index.$phpEx\") . \"\\\">\", \"</a>\");\n\t\n\t\t\tmessage_die(GENERAL_MESSAGE, $message);\n\t\t}\n\t\n\t\treturn ;\n\t}",
"public function vehicle_details(){\n\t\t// $vehicle_id = $this->input->post('id');\n\t\t$vehicle_id = $this->input->post('id');\n\t\t// echo \"<pre>\";\n\t\t// print_r($vehicle_id);\n\t\t// exit;\n\t\t$data_array = array();\n\t\t//\n\t\t$parameters['join'] = array(\n\t\t\t'company' => 'company.company_id = vehicles.company'\n\t\t);\n\t\t$parameters['where'] = array('id' => $vehicle_id);\n\t\t$parameters['select'] = '*';\n\n\t\t$data = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t$company_id = explode(',',$data->company);\n\n\t\t$company_parameters['where_in'] = array('col' => 'company_id', 'value' => $company_id);\n\t\t$data_company = $this->MY_Model->getRows('company',$company_parameters);\n\n\t\t$data_array['vehicles'] = $data;\n\t\t$data_array['company'] = $data_company;\n\t\tjson($data_array);\n\n\t\t// $parameters['where'] = array('id' => $vehicle_id);\n\t\t// $data['view_edit'] = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t// // echo $this->db->last_query();\n\t\t// echo json_encode($data);\n\t}",
"function check_vehicle($conn, $id) {\n\t$sql = \"SELECT * FROM Vehicle WHERE Vehicle_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding vehicle\n\tif (mysqli_num_rows($result)== 1){\n\t\treturn True;\n\t}else {\n\t\treturn False; // no or multiple corrospondence\n\t}\n}",
"public function vehicle();",
"public function info($veh){\n $fonction = Auth::user()->fonction;\n if($fonction == 'admin') return redirect('/admin/dashboard');\n if($fonction == 'gest') return redirect('/gest/dashboard');\n //get the id of the vehicule to show it detail\n $vehi = $veh;\n //find the vehicule\n $vehicules['vehicules'] = \\App\\vehicule::find($vehi);\n return view(\"/vehiculeInfo/info\",$vehicules);\n }",
"public function assigned_vehicles() {\n return view('clients.client_vehicles');\n /*$user_id = Session::get('user_id');\n $vehicles = User::find($user_id)->vehicles->toArray();\n print_r($vehicles);*/\n }",
"public function getTypeOfVehicle();",
"public function created(Vehicle $vehicle)\n {\n //\n }",
"public function vehicles()\n {\n return $this->belongsToMany('ScreenTec\\Models\\Vehicle')->withTimestamps();\n }",
"public function unique_vehicle(){\n\t\t\t\n\t\t\t$type = $this->input->post('vehicle_type');\n\t\t\t$make = $this->input->post('vehicle_make');\n\t\t\t$model = $this->input->post('vehicle_model');\n\t\t\t$email = $this->input->post('trader_email');\n\t\t\t\n\t\t\t$where = array(\n\t\t\t\t'vehicle_type' => $this->input->post('vehicle_type'),\n\t\t\t\t'vehicle_make' => $this->input->post('vehicle_make'),\n\t\t\t\t'vehicle_model' => $this->input->post('vehicle_model'),\n\t\t\t\t'trader_email' => $this->input->post('trader_email'),\n\t\t\t);\n\t\t\t\n\t\t\tif (!$this->Vehicles->unique_vehicle($where))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('unique_vehicle', 'You already have this vehicle listed!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}",
"public function getCarid()\n {\n return $this->carid;\n }",
"public function vehicule()\n {\n return $this->hasMany(Vehicule::class);\n }",
"public function typevehicule()\n {\n return $this->belongsTo(TypeVehicule::class, 'typevehicule_id');\n }",
"public function getId() {return $this->id_travel;}",
"public function vehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 1)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}",
"public function getCarierReff()\n {\n return $this->hasOne(MsRefference::className(), ['id' => 'carier_reff_id']);\n }"
]
| [
"0.6562451",
"0.6223954",
"0.60183007",
"0.5919616",
"0.5905894",
"0.5781175",
"0.569876",
"0.5680754",
"0.5657009",
"0.5564112",
"0.55338395",
"0.54870284",
"0.53878796",
"0.5387476",
"0.5358703",
"0.5332681",
"0.53289884",
"0.5300689",
"0.52865624",
"0.52715313",
"0.5266619",
"0.5255265",
"0.52524936",
"0.52389693",
"0.52313006",
"0.5221872",
"0.5197457",
"0.51912457",
"0.5162138",
"0.51515174"
]
| 0.6405491 | 1 |
Get price suggestion optimized for participation | public function priceSuggestionsForParticipation(Participation $participation)
{
return $this->suggestionListForParticipation($participation, true, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resolvePrice();",
"protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}",
"abstract public function getPrice();",
"private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}",
"protected function calculatePrices()\n {\n }",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();",
"public function getPrice();",
"public function requestBestPrices() {\n\t\t/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */\n\t\t$productDataRequest = Mage::getModel ( 'meinpaketcommon/xml_request_dataRequest' );\n\t\t\n\t\t/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */\n\t\t$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );\n\t\t\n\t\ttry {\n\t\t\t/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */\n\t\t\t$collection = Mage::getModel ( 'catalog/product' )->getCollection ()->addStoreFilter ( Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStoreId () );\n\t\t\t\n\t\t\t$collection->addAttributeToFilter ( 'meinpaket_id', array (\n\t\t\t\t\t'neq' => '' \n\t\t\t) );\n\t\t\t$collection->addAttributeToFilter ( 'sync_with_dhl_mein_paket', array (\n\t\t\t\t\t'gt' => '0' \n\t\t\t) );\n\t\t\t\n\t\t\tforeach ( $collection as $productId ) {\n\t\t\t\t$productDataRequest->addBestPriceProduct ( $productId );\n\t\t\t}\n\t\t\treturn $response = $client->send ( $productDataRequest, true );\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }",
"public function getPricingRecommendations()\n {\n return $this->pricingRecommendations;\n }",
"public function getBestPrice() {\n\t\ttry {\n\t\t\treturn Mage::getSingleton ( 'meinpaket/service_productData_requestService' )->requestBestPrices ();\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\treturn null;\n\t}",
"private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }",
"public function getTaxedPrice();",
"abstract function getPriceFromAPI($pair);",
"private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }",
"public function getPrices()\n {\n }",
"static function getPrice($procent , $price){\n return $price - ( $price / 100 * $procent);\n }",
"public function get_price($q) {\n if (@$this->record->range1) {\n if ($q <= $this->record->range1) {\n return $this->record->price1;\n }\n if ($this->record->range2) {\n if ($q <= $this->record->range2) {\n return $this->record->price2;\n }\n if ($this->record->range3) {\n if ($q <= $this->record->range3) {\n return $this->record->price3;\n }\n if ($this->record->range4) {\n if ($q <= $this->record->range4) {\n return $this->record->price4;\n }\n if ($this->record->range4) {\n if ($q <= $this->record->range4) {\n return $this->record->price4;\n } else {\n return $this->record->price5;\n }\n } else {\n return $this->record->price4;\n }\n } else {\n return $this->record->price4;\n }\n } else {\n return $this->record->price3;\n }\n } else {\n return $this->record->price2;\n }\n } else {\n return @$this->record->price1;\n }\n }",
"public function getPrice(): string;",
"function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}",
"public function getPrice() {\n }",
"function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}",
"public function bestPriceProvider()\n {\n return [\n [0, 100.0, 50.0, 50.0],\n [0, 100.0, 150.0, 100.0],\n [1, 100.0, 50.0, 50.0],\n [1, 100.0, 150.0, 100.0],\n [2, 100.0, 50.0, 100.0],\n [2, 100.0, 150.0, 150.0],\n [3, 100.0, 50.0, 100.0],\n [3, 100.0, 150.0, 150.0],\n [4, 100.0, 50.0, 50.0],\n [4, 100.0, 150.0, 100.0],\n [5, 100.0, 50.0, 50.0],\n [5, 100.0, 150.0, 100.0],\n ];\n }",
"public function getPriceFromDatabase()\n {\n }",
"public function getCompetitivePricingForSKU($request);",
"function get_price($find){\n\t$books=array(\n\t\t\"paris-seoul\"=>599,\n\t\t\"paris-madrid\"=>400,\n\t\t\"paris-marseille\"=>387\n\t)\n\t;\n\n\tforeach ($books as $book => $price) {\n\t\tif($book==$find){\n\t\t\treturn $price;\n\t\t\tbreak;\n\t\t}\n\t}\n}",
"public function getPrice(): float;",
"public function getPrice(): float;"
]
| [
"0.66902405",
"0.6185576",
"0.6161479",
"0.61344796",
"0.61065596",
"0.6051913",
"0.6051913",
"0.6051913",
"0.6051913",
"0.60275596",
"0.60264635",
"0.6017558",
"0.600814",
"0.5970086",
"0.5939211",
"0.5832913",
"0.5831582",
"0.58068347",
"0.5799072",
"0.5784387",
"0.5749018",
"0.5742098",
"0.574145",
"0.5736232",
"0.569733",
"0.56906646",
"0.5676087",
"0.56732863",
"0.56725127",
"0.56725127"
]
| 0.64579344 | 1 |
Get payment suggestion optimized for participation | public function paymentSuggestionsForParticipation(Participation $participation)
{
$list = new PaymentSuggestionList();
$suggestionForParticipation = $this->suggestionsForParticipation($participation, false, true);
foreach ($suggestionForParticipation as $suggestionRaw) {
$suggestion = new PaymentSuggestion(
((int)$suggestionRaw['value'])*-1,
$suggestionRaw['description'],
(int)$suggestionRaw['count'],
['participation']
);
$list->add($suggestion);
}
return $list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function suggestionsForParticipation(Participation $participation, bool $isPriceSet, bool $isPayment)\n {\n $qb = $this->em->getConnection()->createQueryBuilder();\n $qb->select(['y.price_value AS value', 'y.description', 'MAX(y.created_at)'])\n ->from('participant_payment_event', 'y')\n ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid')\n ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid')\n ->andWhere($qb->expr()->eq('p.pid', ':pid'))\n ->setParameter('pid', $participation->getPid())\n ->andWhere('y.is_price_set = :is_price_set')\n ->setParameter('is_price_set', (int)$isPriceSet)\n ->andWhere('y.is_price_payment = :is_price_payment')\n ->setParameter('is_price_payment', (int)$isPayment)\n ->groupBy(['y.price_value', 'y.description']);\n $result = $qb->execute()->fetchAll();\n\n $suggestions = [];\n foreach ($result as $payment) {\n if (!isset($suggestions[$payment['value']])) {\n $suggestions[$payment['value']] = [];\n }\n if (!isset($suggestions[$payment['value']][$payment['description']])) {\n $suggestions[$payment['value']][$payment['description']] = 0;\n }\n ++$suggestions[$payment['value']][$payment['description']];\n }\n $suggestionsFlat = [];\n foreach ($suggestions as $value => $descriptions) {\n foreach ($descriptions as $description => $count) {\n $suggestionsFlat[] = [\n 'value' => $value,\n 'description' => $description,\n 'count' => $count,\n ];\n }\n }\n usort(\n $suggestionsFlat, function ($a, $b) {\n if ($a['count'] == $b['count']) {\n return 0;\n }\n return ($a['count'] < $b['count']) ? -1 : 1;\n }\n );\n\n return $suggestionsFlat;\n }",
"private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }",
"public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }",
"public function getPromoter($param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n //$endUseList,$loanType, $amount=null, $loanTenure = null, $companySharePledged= null, $bscNscCode = null,$loanId=null\n $endUseList = $param1;\n $loanType = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n $promotersGenerationType = MasterData::promoterGenrationType();\n $choosenCibil = null;\n $degreeType = MasterData::degreeTypes();\n $noOfFamilyTypes = MasterData::familyType();\n $cities = MasterData::cities();\n $states = MasterData::states();\n $loan = null;\n $model = null;\n $existingPropertyOwned = null;\n $existingLoansMortgageDetails = null;\n $setDisable = null;\n $existingPromoterKycCount = 0;\n $promoter_details = null;\n $isFunded = 0;\n $userProfile = Auth::getUser()->userProfile();\n $user = Auth::getUser();\n $isSME = $user->isSME();\n $setDisable = $this->getIsDisabled($user);\n $isRemoveMandatory = MasterData::removeMandatory();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n $validLoanHelper = new validLoanUrlhelper();\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'promoter_details');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $isFunded = $loan->com_venture_capital_funded;\n if ($isFunded == null) {\n $isFunded = 0;\n }\n $model = $loan->getPromoterDetails()->get()->first();\n if (isset($model)) {\n if ($model->fin_propertiesowned > 0 && $model->fin_propertiesowned != 'None') {\n $existingPropertyOwned = PromoterPropertyDetail::where('loan_id', '=', $loanId)->get()->toArray();\n }\n /* if(isset($existingPropertyOwned)){\n if (in_array($existingPropertyOwned->location_city, $cities)) {\n $existingPropertyOwned->location_city = $existingPropertyOwned->location_city;\n }else{\n $salesAreaDetails->city_name_other = $salesAreaDetails->city_name;\n $salesAreaDetails->city_name = 'Other';\n }\n}*/\n\nif (!isset($endUseList)) {\n $endUseList = $loan->end_use;\n}\nif (!isset($loanType)) {\n $loanType = $loan->type;\n}\nif (!isset($amount)) {\n $amount = $loan->loan_amount;\n}\nif (!isset($loanTenure)) {\n $loanTenure = $loan->loan_tenure;\n}\n}\n$existingPromoterKycDetails = PromoterKycDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanOverdraftDetails = LoanOverdraftKycDetails::where('loan_id', '=', $loanId)->get();\n$existingLoansMortgageDetails = LoansMortgageDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanVechicleDetails = LoanVechicleDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanCreditCardDetails = LoanCreditCardDetails::where('loan_id', '=', $loanId)->get();\n\n}\n\n\n//Promoter Array\nif (isset($existingPromoterKycDetails)) {\n $existingPromoterKycCount = count($existingPromoterKycDetails);\n}\n $maxPromoters = Config::get('constants.CONST_MAX_PROMOTER'); //5\n\n $temp_array = [];\n//$mortgagetemp_array = array();\n for ($i = 0; $i < 5; $i++) {\n if ($i < $existingPromoterKycCount) {\n array_push($temp_array, $existingPromoterKycDetails[$i]->toArray());\n } else {\n array_push($temp_array, \"\");\n }\n }\n\n//Overdraft array\n if (isset($existingLoanOverdraftDetails)) {\n $existingLoanOverdraftCount = count($existingLoanOverdraftDetails);\n }\n $maxoverdrafts = '3';\n\n $temp_array_overdr = [];\n for ($o = 0; $o < 3; $o++) {\n if ($o < $existingLoanOverdraftCount) {\n array_push($temp_array_overdr, $existingLoanOverdraftDetails[$o]->toArray());\n } else {\n array_push($temp_array_overdr, \"\");\n }\n }\n\n//Mortgage array\n if (isset($existingLoansMortgageDetails)) {\n $existingLoansMortgageCount = count($existingLoansMortgageDetails);\n }\n $maxmortgages = '3';\n\n $temp_array_mortgage = [];\n for ($mort = 0; $mort < 3; $mort++) {\n if ($mort < $existingLoansMortgageCount) {\n array_push($temp_array_mortgage, $existingLoansMortgageDetails[$mort]->toArray());\n } else {\n array_push($temp_array_mortgage, \"\");\n }\n }\n\n//Liblities Vechicle Loan\n\n if (isset($existingLoanVechicleDetails)) {\n $existingLoanVechicleCount = count($existingLoanVechicleDetails);\n }\n $maxvehicles = '3';\n $temp_array_vechicle = [];\n for ($vechicle = 0; $vechicle < 3; $vechicle++) {\n if ($vechicle < $existingLoanVechicleCount) {\n array_push($temp_array_vechicle, $existingLoanVechicleDetails[$vechicle]->toArray());\n } else {\n array_push($temp_array_vechicle, \"\");\n }\n\n }\n\n//Liblities Creditcard Loan\n\n if (isset($existingLoanCreditCardDetails)) {\n $existingCreditCardCount = count($existingLoanCreditCardDetails);\n }\n $maxCreditCards = '4';\n $temp_array_creditcard = [];\n for ($creditcard = 0; $creditcard < 3; $creditcard++) {\n if ($creditcard < $existingCreditCardCount) {\n array_push($temp_array_creditcard, $existingLoanCreditCardDetails[$creditcard]->toArray());\n } else {\n array_push($temp_array_creditcard, \"\");\n }\n\n }\n\n\n\n\n\n $deletedQuestionsLoan = $this->getDeletedQuestionLoan($loan, $loanType, $amount);\n $deletedQuestionHelper = new DeletedQuestionsHelper($deletedQuestionsLoan);\n//getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n if ($isSME != null) {\n // dd(Auth::getUser()->userProfile()->owner_email);\n //$owner_entity_type = Auth::getUser()->userProfile()->owner_entity_type;\n $owner_entity_type = Auth::getUser()->userProfile();\n }\n $subViewType = 'loans._promoter';\n $formaction = 'Loans\\LoansController@postPromoter';\n return view('loans.createedit', compact(\n 'formaction',\n 'subViewType',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'companySharePledged',\n 'bscNscCode',\n 'loan',\n 'cities',\n 'loanId',\n 'maxPromoters',\n 'maxCreditCards',\n 'maxmortgages',\n 'maxvehicles',\n 'maxoverdrafts',\n 'existingPromoterCreditCardCount',\n 'promotersGenerationType',\n 'degreeType',\n 'noOfFamilyTypes',\n 'temp_array',\n 'userProfile',\n 'states',\n 'setDisable',\n 'deletedQuestionHelper',\n 'existingPromoterKycCount',\n 'existingPropertyOwned',\n 'existingLoansMortgageDetails',\n 'model',\n 'validLoanHelper',\n 'owner_entity_type',\n 'removeMandatory',\n 'loanUserProfile',\n 'userProfileFirm',\n 'isFunded',\n 'isSME',\n 'existingLoanOverdraftCount',\n 'existingLoansMortgageCount',\n 'existingLoanOverdraftDetails',\n 'existingLoanVechicleDetails',\n 'temp_array_overdr',\n 'temp_array_mortgage',\n 'temp_array_vechicle',\n 'temp_array_creditcard',\n 'existingLoanVechicleCount',\n 'existingCreditCardCount'\n ));\n }",
"public function getRecommendations();",
"private function corporation($skill){\n $calculatedJobPoint=0;\n $parameterAvg=[];\n $index=0;\n $corporations=$skill->corporations();\n foreach($corporations->where('question_completed',1)->get() as $index=>$corporation){\n $parameters=$corporation->answers->lists('answer');\n $parameterCount=0;\n foreach($parameters as $key=>$parameter){\n if($parameter==1){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==2){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==3){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==4){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==5){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n }\n $parameterAvg[$index]=$parameterCount/($key+1); //avg point foreach corporation\n\n }\n $finalAvg=array_sum($parameterAvg)/($index+1)/20; //final avg point foreach skill between 1-5\n $finalCorporationPoint=$finalAvg*Config::get('rate')['corporation']['weight'];\n\n //checking the job num (corporation count)\n $corporationCount=$corporations->count();\n $jobPoint=$corporationCount*Config::get('rate')['job']['attributes']['corporation'];\n if($jobPoint>Config::get('rate')['job']['result'][5]){ //5 star job (corporation num)\n $calculatedJobPoint=5;\n }elseif($jobPoint>Config::get('rate')['job']['result'][4] && $jobPoint<=Config::get('rate')['job']['result'][5]){\n $calculatedJobPoint=4;\n }elseif($jobPoint>Config::get('rate')['job']['result'][3] && $jobPoint<=Config::get('rate')['job']['result'][4]){\n $calculatedJobPoint=3;\n }elseif($jobPoint>Config::get('rate')['job']['result'][2] && $jobPoint<=Config::get('rate')['job']['result'][3]){\n $calculatedJobPoint=2;\n }elseif($jobPoint>=Config::get('rate')['job']['result'][1] && $jobPoint<=Config::get('rate')['job']['result'][2]){\n $calculatedJobPoint=1;\n }\n $finalJobPoint=$calculatedJobPoint*Config::get('rate')['job']['weight'];\n\n return[\n 'finalCorporationPoint'=>$finalCorporationPoint,\n 'finalJobPoint'=>$finalJobPoint\n ];\n }",
"function getMarketResearchesDirectPayment($game_id,$round_number,$company_id){\r\n\t\t\t$market=new Model_DbTable_Decisions_MarketResearches();\r\n\t\t\t$param_marketresearches=new Model_DbTable_Games_Param_Markets_MarketResearches();\r\n\t\t\t//funcionando correctamente. Estudios de mercado solicitados y costes\r\n\t\t\t$marketresearches_solicited=$market->getMarketResearchesSolicited($game_id, $company_id, $round_number);\r\n\t\t\t$marketresearches_costs=$param_marketresearches->getMarketResearchesCosts($game_id);\r\n\t\t\t\r\n\t\t\t$research_number=1;\r\n\t\t\t$totalCost=0;\r\n\t\t\t\r\n\t\t\t$names[0]=array('value'=>1, 'descriptor'=>'channelResearch');\r\n\t\t\t$names[1]=array('value'=>2, 'descriptor'=>'pricesResearch');\r\n\t\t\t$names[2]=array('value'=>3, 'descriptor'=>'mktResearch');\r\n\t\t\t$names[3]=array('value'=>4, 'descriptor'=>'spectedResearch');\r\n\t\t\t$names[4]=array('value'=>5, 'descriptor'=>'accountResearch');\r\n\t\t\t\r\n\t\t\twhile(isset($marketresearches_costs['marketResearch_number_'.$research_number])) {\t\t\t\t\r\n\t\t\t\t$aux=$marketresearches_solicited[$names[$research_number-1]['descriptor']];\r\n\t\t\t\t$cost=$marketresearches_costs['marketResearch_number_'.$research_number];\r\n\t\t\t\t$totalCost=$totalCost+($aux*$cost);\r\n\t\t\t\t$research_number++;\r\n\t\t\t}\r\n\t\t\treturn $totalCost;\r\n\t\t}",
"public function get_deal_suggestion_detail($id,&$data){\n global $g_mc;\n $q = \"SELECT s.*, m.f_name,m.l_name,m.designation,w.name as work_company,t.takeover_name,'banks' as `banks`,'law_firms' as `law_firms` from \".TP.\"transaction_suggestions as s left join \".TP.\"member as m on(s.suggested_by=m.mem_id) left join \".TP.\"company as w on(m.company_id=w.company_id) left join \".TP.\"takeover_type_master as t on(s.takeover_id=t.takeover_id) where s.id='\".$id.\"'\";\n \n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n $data = mysql_fetch_assoc($res);\n //////////////////////////////////////////////////\n\t\t/*****************\n\t\tsng:17/jun/2011\n\t\tnow we get the is_sellside_advisor flag also\n\t\t***********************/\n //banks data\n $data['banks'] = array();\n\t\t\n $q_bank = \"select * from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"' AND partner_type='bank'\";\n $q_bank_res = mysql_query($q_bank);\n if(!$q_bank_res){\n return false;\n }\n ///////////////////////////\n $q_bank_res_count = mysql_num_rows($q_bank_res);\n for($bank_i=0;$bank_i<$q_bank_res_count;$bank_i++){\n $data['banks'][$bank_i] = mysql_fetch_assoc($q_bank_res);\n }\n //////////////////////////////////////////////////////////\n //law firm data\n $data['law_firms'] = array();\n\t\t\n\t\t$q_law = \"select * from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"' AND partner_type='law firm'\";\n $q_law_res = mysql_query($q_law);\n if(!$q_law_res){\n return false;\n }\n ///////////////////////////\n $q_law_res_count = mysql_num_rows($q_law_res);\n for($law_i=0;$law_i<$q_law_res_count;$law_i++){\n $data['law_firms'][$law_i] = mysql_fetch_assoc($q_law_res);\n }\n\t\t/***********************************************\n\t\tsng:1/sep/2011\n\t\tThere might be one or more files along with this new deal suggestion.\n\t\tNOTE: we only fetch those that are yet to be associated with a deal\n\t\t\n\t\tsng:22/feb/2012\n\t\twe now use method in transaction_doc to get the docs associated with a transaction suggestion\n\t\t**************************************************/\n\t\trequire_once(\"classes/class.transaction_doc.php\");\n\t\t$trans_doc = new transaction_doc();\n\t\t\n\t\t$data['docs'] = NULL;\n\t\t$temp_count = 0;\n\t\t\n\t\t$ok = $trans_doc->front_get_all_documents_for_deal_suggestion($id,$data['docs'],$temp_count);\n\t\tif(!$ok){\n\t\t\treturn false;\n\t\t}\n return true;\n }",
"public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }",
"public function getPaymentDescription();",
"public static function get_suggested_policy_text()\n {\n }",
"public function front_set_partners_for_deal($deal_id,$data,$suggestion_mem_id,$deal_add_date_time){\n\t\trequire_once(\"classes/class.company.php\");\n\t\t$comp = new company();\n\t\t/**************\n\t\tbank /law firm names and whether sellside advisor\n\t\t[\"banks\"]=> array(4) { \n\t\t[0]=> string(4) \"Citi\" (bank 1)\n\t\t[1]=> string(8) \"JPMorgan\" (bank 2 sellside)\n\t\t[2]=> string(11) \"BNP Paribas\" (bank 3)\n\t\t[3]=> string(13) \"Credit Suisse\" (bank 4 sellside)\n\t\t} \n\t\t[\"sellside_advisors_2\"]=> string(2) \"on\" \n\t\t[\"sellside_advisors_4\"]=> string(2) \"on\"\n\t\t\n\t\t['bank_is_insignificant_2\"]=>string(2)\t\"on\"\n\t\t['bank_role_id_1']\t6\n\t\t['bank_role_id_2']\t0 (no option selected)\n\t\t['bank_role_id_3']\t0\n\t\t\n\t\t[\"law_firms\"]=> array(4) { \n\t\t[0]=> string(20) \"Mello Jones & Martin\" (firm 1)\n\t\t[1]=> string(0) \"\" (firm 2)\n\t\t[2]=> string(0) \"\" (firm 3)\n\t\t[3]=> string(11) \"Bredin Prat\" (firm 4 sellside)\n\t\t} \n\t\t[\"law_sellside_advisors_4\"]=> string(2) \"on\"\n\t\t************************************************/\n\t\t/*************\n\t\tsng:6/apr/2012\n\t\t************/\n\t\t$suggestion_data_arr = array();\n\t\t\n\t\t$add_bank_validation_passed = false;\n\t\t$err_arr = array();\n\t\t$bank_count = count($data['banks']);\n\t\t$bank_found = false;\n\t\t$bank_id = 0;\n\t\tfor($bank_i=0;$bank_i<$bank_count;$bank_i++){\n\t\t\t//name can be blank so\n\t\t\tif($data['banks'][$bank_i]!=\"\"){\n\t\t\t\t$ok = company_id_from_name($data['banks'][$bank_i],'bank',$bank_id,$bank_found);\n\t\t\t\tif(!$ok){\n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tif(!$bank_found){\n\t\t\t\t\t\t//create it\n\t\t\t\t\t\t$ok = $comp->front_quick_create_company_blf($suggestion_mem_id,$data['banks'][$bank_i],'bank',$bank_id);\n\t\t\t\t\t\tif(!$ok){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//we have bank\n\t\t\t\t\t/****************************\n\t\t\t\t\tsng:14/mar/2012\n\t\t\t\t\twe need to check for sellside advisor flag\n\t\t\t\t\tfor bank[0] it will be sellside_advisors_1: on\n\t\t\t\t\tit may or may not be there\n\t\t\t\t\t\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe no longer need this sellside, since we now have role like 'Advisor, Sellside'\n\t\t\t\t\t\n\t\t\t\t\tsng:16/mar/2012\n\t\t\t\t\tditto for bank[1] bank_is_insignificant_2: on\n\t\t\t\t\tit may or may not be there\n\t\t\t\t\t\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe no longer need this insignificant since we now have role like 'Junior Advisor'\n\t\t\t\t\t\n\t\t\t\t\tfor bank[0] bank_role_id_1: is non zero if the corresponding dropdown is selected\n\t\t\t\t\t*************************/\n\t\t\t\t\t/****************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Advisor, Sellside', so we no longer require the\n\t\t\t\t\tsellside flag. We have removed that from the detailed deal submission\n\t\t\t\t\t*********************/\n\t\t\t\t\t/******************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Junior Advisor, so we no longer use the checkbox 'Not lead advisor'\n\t\t\t\t\tso let us remove the 'bank_is_insignificant_'\n\t\t\t\t\t*************************/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$record_arr = array();\n\t\t\t\t\t$record_arr['firm_name'] = $data['banks'][$bank_i];\n\t\t\t\t\t$record_arr['partner_id'] = $bank_id;\n\t\t\t\t\t$record_arr['transaction_id'] = $deal_id;\n\t\t\t\t\t/***********\n\t\t\t\t\twe no longer use is_sellside\n\t\t\t\t\tWe no longer use is_insignificant\n\t\t\t\t\t*************/\n\t\t\t\t\t$record_arr['role_id'] = $data['bank_role_id_'.($bank_i+1)];\n\t\t\t\t\t$this->add_partner($record_arr,'bank',$add_bank_validation_passed,$err_arr);\n\t\t\t\t\t/********************************************\n\t\t\t\t\tsng:6/apr/2012\n\t\t\t\t\tif the partners are added, we keep a record in the suggestion table.\n\t\t\t\t\tThis is part of suggestion tracking where we need to know the original partners submitted with the deal and their roles.\n\t\t\t\t\tJust prepare the array, do not add yet\n\t\t\t\t\t***************/\n\t\t\t\t\tif($add_bank_validation_passed){\n\t\t\t\t\t\t$suggestion_data_arr[] = array('partner_name'=>$data['banks'][$bank_i],'partner_type'=>'bank','role_id'=>$record_arr['role_id']);\n\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\t/*********************************************************/\n\t\t$add_law_firm_validation_passed = false;\n\t\t$err_arr = array();\n\t\t$law_firm_count = count($data['law_firms']);\n\t\t$law_firm_found = false;\n\t\t$law_firm_id = 0;\n\t\tfor($law_firm_i=0;$law_firm_i<$law_firm_count;$law_firm_i++){\n\t\t\tif($data['law_firms'][$law_firm_i]!=\"\"){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$ok = company_id_from_name($data['law_firms'][$law_firm_i],'law firm',$law_firm_id,$law_firm_found);\n\t\t\t\tif(!$ok){\n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tif(!$law_firm_found){\n\t\t\t\t\t\t//create it\n\t\t\t\t\t\t$ok = $comp->front_quick_create_company_blf($suggestion_mem_id,$data['law_firms'][$law_firm_i],'law firm',$law_firm_id);\n\t\t\t\t\t\tif(!$ok){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/****************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Advisor, Sellside', so we no longer require the\n\t\t\t\t\tsellside flag. We have removed that from the detailed deal submission\n\t\t\t\t\t*********************/\n\t\t\t\t\t\n\t\t\t\t\t$record_arr = array();\n\t\t\t\t\t$record_arr['firm_name'] = $data['law_firms'][$law_firm_i];\n\t\t\t\t\t$record_arr['partner_id'] = $law_firm_id;\n\t\t\t\t\t$record_arr['transaction_id'] = $deal_id;\n\t\t\t\t\t/******\n\t\t\t\t\twe no longer use sellside advisor checkbox\n\t\t\t\t\t*********/\n\t\t\t\t\t$record_arr['role_id'] = $data['law_firm_role_id_'.($law_firm_i+1)];\n\t\t\t\t\t$this->add_partner($record_arr,'law firm',$add_law_firm_validation_passed,$err_arr);\n\t\t\t\t\t/********************************************\n\t\t\t\t\tsng:6/apr/2012\n\t\t\t\t\tif the partners are added, we keep a record in the suggestion table.\n\t\t\t\t\tThis is part of suggestion tracking where we need to know the original partners submitted with the deal and their roles\n\t\t\t\t\t***************/\n\t\t\t\t\tif($add_law_firm_validation_passed){\n\t\t\t\t\t\t$suggestion_data_arr[] = array('partner_name'=>$data['law_firms'][$law_firm_i],'partner_type'=>'law firm','role_id'=>$record_arr['role_id']);\n\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\t/***********\n\t\t6/apr/2012\n\t\t**********/\n\t\trequire_once(\"classes/class.transaction_suggestion.php\");\n\t\t$trans_suggestion = new transaction_suggestion();\n\t\t$trans_suggestion->partners_added_via_deal_submission($deal_id,$suggestion_mem_id,$deal_add_date_time,$suggestion_data_arr);\n\t\t/************************************************************/\n\t\treturn true;\n\t}",
"public function priceSuggestionsForParticipation(Participation $participation)\n {\n return $this->suggestionListForParticipation($participation, true, false);\n }",
"public static function json_search_sumo_payment_plans() {\n ob_start() ;\n\n $term = ( string ) wc_clean( stripslashes( isset( $_GET[ 'term' ] ) ? $_GET[ 'term' ] : '' ) ) ;\n $exclude = array () ;\n\n if ( isset( $_GET[ 'exclude' ] ) && ! empty( $_GET[ 'exclude' ] ) ) {\n $exclude = array_map( 'intval' , explode( ',' , $_GET[ 'exclude' ] ) ) ;\n }\n\n $args = array (\n 'type' => 'sumo_payment_plans' ,\n 'status' => 'publish' ,\n 'return' => 'posts' ,\n 'order' => 'ASC' ,\n 'orderby' => 'parent title' ,\n 's' => $term ,\n 'exclude' => $exclude ,\n ) ;\n\n $posts = _sumo_pp()->query->get( $args ) ;\n $found_plans = array () ;\n\n if ( ! empty( $posts ) ) {\n foreach ( $posts as $post ) {\n $found_plans[ $post->ID ] = $post->post_title ;\n }\n }\n wp_send_json( $found_plans ) ;\n }",
"private function getPaymentOptions()\n {\n $this->setVersionStrings();\n\n $this->load->language('extension/payment/svea_partpayment');\n\n $this->load->model('extension/payment/svea_partpayment');\n $this->load->model('checkout/order');\n\n $order = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n $countryCode = $order['payment_iso_code_2'];\n\n $result = array();\n\n if ($this->config->get($this->paymentString . 'svea_partpayment_testmode_' . $countryCode) !== null) {\n $svea = $this->model_extension_payment_svea_partpayment->getPaymentPlanParams($countryCode);\n } else {\n $result = array(\"error\" => $this->responseCodes(40001, \"The country is not supported for this paymentmethod\"));\n\n return $result;\n }\n\n if (!isset($svea)) {\n $result = array(\"error\" => 'Svea error: '.$this->language->get('response_27000'));\n } else {\n $currency = $order['currency_code'];\n\n $this->load->model('localisation/currency');\n\n $currencies = $this->model_localisation_currency->getCurrencies();\n $decimals = \"\";\n\n foreach ($currencies as $key => $val) {\n if ($key == $currency) {\n if ($key == 'EUR') {\n $decimals = 2;\n } else {\n $decimals = 0;\n }\n }\n }\n\n $formattedPrice = round($this->currency->format(($order['total']), $currency, false, false), $decimals);\n\n try {\n $campaigns = PaymentPlanCalculator::getAllCalculationsFromCampaigns($formattedPrice, $svea->campaignCodes, false, $decimals);\n\n foreach ($campaigns as $campaign) {\n foreach ($svea->campaignCodes as $cc) {\n if ($campaign['campaignCode'] == $cc->campaignCode) {\n $result[] = array(\n \"campaignCode\" => $campaign['campaignCode'],\n \"description\" => $campaign['description'],\n \"monthlyAmountToPay\" => $campaign['monthlyAmountToPay'] . \" \" . $currency . \"/\" . $this->language->get('month'),\n \"paymentPlanType\" => $campaign['paymentPlanType'],\n \"contractLengthInMonths\" => $this->language->get('contractLengthInMonths') . \": \" . $campaign['contractLengthInMonths'] . \" \" . $this->language->get('unit'),\n \"monthlyAnnuityFactor\" => $campaign['monthlyAnnuityFactor'],\n \"initialFee\" => $this->language->get('initialFee') . \": \" . $campaign['initialFee'] . \" \" . $currency,\n \"notificationFee\" => $this->language->get('notificationFee') . \": \" . $campaign['notificationFee'] . \" \" . $currency,\n \"interestRatePercent\" => $this->language->get('interestRatePercent') . \": \" . $campaign['interestRatePercent'] . \"%\",\n \"numberOfInterestFreeMonths\" => $campaign['numberOfInterestFreeMonths'] != 0 ? $this->language->get('numberOfInterestFreeMonths') . \": \" . $campaign['numberOfInterestFreeMonths'] . \" \" . $this->language->get('unit') : 0,\n \"numberOfPaymentFreeMonths\" => $campaign['numberOfPaymentFreeMonths'] != 0 ? $this->language->get('numberOfPaymentFreeMonths') . \": \" . $campaign['numberOfPaymentFreeMonths'] . \" \" . $this->language->get('unit') : 0,\n \"totalAmountToPay\" => $this->language->get('totalAmountToPay') . \": \" . $campaign['totalAmountToPay'] . \" \" . $currency,\n \"effectiveInterestRate\" => $this->language->get('effectiveInterestRate') . \": \" . $campaign['effectiveInterestRate'] . \"%\"\n );\n break;\n }\n }\n }\n } catch (Exception $exception) {\n $this->log->write('Svea: Unable to fetch calculations for campaigns. Exception: ' . $exception->getMessage());\n }\n }\n return $result;\n }",
"public function calculatePayment()\n {\n }",
"private function suggestionsForEvent(Event $event, bool $isPriceSet, bool $isPayment)\n {\n $qb = $this->em->getConnection()->createQueryBuilder();\n $qb->select(['y.price_value AS value', 'y.description', 'COUNT(*) AS count'])\n ->from('participant_payment_event', 'y')\n ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid')\n ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid')\n ->andWhere($qb->expr()->eq('p.eid', ':eid'))\n ->setParameter('eid', $event->getEid())\n ->andWhere('y.is_price_set = :is_price_set')\n ->setParameter('is_price_set', (int)$isPriceSet)\n ->andWhere('y.is_price_payment = :is_price_payment')\n ->setParameter('is_price_payment', (int)$isPayment)\n ->groupBy(['y.price_value', 'y.description'])\n ->orderBy('count', 'DESC')\n ->setMaxResults(4);\n return $qb->execute()->fetchAll();\n }",
"public static function PaymentOptionList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'pyr'=>t(\"Pay On Delivery\"),\n \t 'pyp'=>t(\"paypal\"),\n \t 'stp'=>t(\"stripe\"),\n \t 'mcd'=>t(\"mercapado\"),\n \t 'ide'=>t(\"sisow\"),\n \t 'payu'=>t(\"payumoney\"),\n \t 'pys'=>t(\"paysera\"), \t \n \t 'bcy'=>t(\"Barclay\"),\n \t 'epy'=>t(\"EpayBg\"),\n \t 'atz'=>t(\"Authorize.net\"),\n \t 'obd'=>t(\"Offline Bank Deposit\"),\n \t 'btr' =>t(\"Braintree\")\n \t);\n }",
"public function getPaymentRequest(): string;",
"public static function get_payment_plan_search_field() {\n\n check_ajax_referer( 'sumo-pp-get-payment-plan-search-field' , 'security' ) ;\n\n wp_send_json( array (\n 'search_field' => _sumo_pp_wc_search_field( array (\n 'class' => 'wc-product-search' ,\n 'action' => '_sumo_pp_json_search_sumo_payment_plans' ,\n 'id' => isset( $_POST[ 'loop' ] ) ? \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}{$_POST[ 'loop' ]}\" : \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}\" ,\n 'name' => isset( $_POST[ 'loop' ] ) ? \"_sumo_pp_selected_plans[{$_POST[ 'loop' ]}][{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" : \"_sumo_pp_selected_plans[{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" ,\n 'type' => 'payment_plans' ,\n 'selected' => false ,\n 'multiple' => false ,\n 'placeholder' => __( 'Search for a payment plan…' , _sumo_pp()->text_domain ) ,\n ) , false ) ,\n ) ) ;\n }",
"abstract public function getPaymentMethod();",
"function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}",
"function needs_suggestions($obj)\n{\n\t$decision = FALSE;\n\t\n\tif($obj->session->userdata('trigger_suggestions') && $obj->session->userdata('conc_searchresults'))\n\t{\n\t\t$trigger_suggestions = $obj->session->userdata('trigger_suggestions');\n\t\t#Check that there is no confirmed result in the display results before suggesting\n\t\t$display_results = $obj->session->userdata('conc_searchresults');\n\t\t$no_conf = \"Y\";\n\t\tforeach($display_results AS $row)\n\t\t{\n\t\t\tif($row['percentage'] == 'CONF'){\n\t\t\t\t$no_conf = \"N\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($no_conf == 'Y' && !empty($trigger_suggestions))\n\t\t{\n\t\t\t$decision = TRUE;\n\t\t}\n\t}\n\t\n\treturn $decision;\n}",
"public function get_search_reward_point($reward_point,$limit, $start,$reward = 'pt'){\r\n\t\t$this->db->select(\"t_company.name as company, m_category.category_name as category,t_support.company_reward_id as company_reward_id\");\r\n\t\t$this->db->from(\"t_support\");\r\n\t\t$this->db->join(\"t_company\",\"t_company.cid = t_support.cid\");\r\n\t\t$this->db->join(\"m_category\",\"m_category.category_id = t_company.category_id\");\r\n\t\t$this->db->limit($limit, $start);\r\n\t\tif($reward == 'rate'){\r\n\t\t\t$this->db->where('t_support.reward_point_rate >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->db->where('t_support.reward_point >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\r\n\t\t}\r\n\t\t\r\n\t\t$this->db->where(\" t_support.delete_flg\",0);\r\n\t\t$this->db->where(\" t_support.active_flag\",1);\r\n\t\t$this->db->where(\" t_company.delete_flg\",0);\r\n\t\t// var_dump($this->db->get_compiled_select());exit();\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->num_rows() > 0 ? $query->result_object() : false;\r\n\t}",
"function field_collection_contributions_rules_complete_contribution($order) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items->getIterator() as $delta => $line_item_wrapper) {\n if (!isset($product_wrapper)) {\n isset($line_item_wrapper->commerce_product) ? $product_wrapper = $line_item_wrapper->commerce_product->value() : NULL;\n }\n }\n\n // Go over the price components to figure out donation and fee.\n foreach($order->commerce_order_total['und'][0]['data']['components'] as $delta => $component) {\n if($component['name'] === 'base_price') {\n $donation = $component['price']['amount'];\n }\n if ($component['name'] === 'fee') {\n $fee = $component['price']['amount'];\n }\n }\n\n\n // If the charity is paying the fee take that out of the donation.\n // @todo - Figure out how to automatically calculate the fee with and without the using paying it.\n if (!isset($fee)) {\n $fee = $donation * .1;\n $donation = $donation - $fee;\n }\n $donation = commerce_currency_amount_to_decimal($donation, commerce_default_currency());\n\n // get fields on the product\n // @todo - Ben - Figure out why the product wrapper can't access the field_collection values.\n $meter_item = field_get_items('commerce_product', $product_wrapper, 'field_donation_meter');\n $item_collection = field_collection_field_get_entity($meter_item[0]);\n $meter_wrapper = entity_metadata_wrapper('field_collection_item', $item_collection);\n\n // Add donation to total donations.\n // @todo - Ben - Get field_donation_current as an input from the rule setup.\n $current = $meter_wrapper->field_donation_current->value();\n\n // @todo - Ben - Get field_donation_goal as an input from the rule setup.\n $goal = $meter_wrapper->field_donation_goal->value();\n if (($current + $donation) > $goal) {\n $current = $goal;\n }\n else {\n $current += $donation;\n }\n $meter_wrapper->field_donation_current->set($current);\n $meter_wrapper->save();\n}",
"private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }",
"public function getPricingRecommendations()\n {\n return $this->pricingRecommendations;\n }",
"function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }",
"function getSuggestPosting() {\n return getAll(\"SELECT a.*,c.name \n FROM posting a \n INNER JOIN member_posting b ON a.id = b.posting_id\n INNER JOIN member c ON c.id = b.member_id\n LIMIT 5\");\n}",
"function getPromoList()\n {\n return array(array('reason'=>'test_discount','amount'=>3.5));\n }"
]
| [
"0.61106133",
"0.5704759",
"0.5695899",
"0.55570215",
"0.5483363",
"0.54832655",
"0.5447413",
"0.5440009",
"0.54122907",
"0.54100627",
"0.5348099",
"0.5339186",
"0.5336318",
"0.52937603",
"0.5281333",
"0.52307665",
"0.52134395",
"0.51516473",
"0.51454616",
"0.51399595",
"0.51362497",
"0.5131584",
"0.51253915",
"0.5105456",
"0.5093253",
"0.5085672",
"0.50806403",
"0.506962",
"0.50565994",
"0.5050455"
]
| 0.60723585 | 1 |
DEPEndency injection. StripeBilling class and this object are decoupled. This setup allows for Mock object to be sent | public function __construct(StripeBilling $stripe)
{
$this->_stripe = $stripe;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUp()\n {\n $this->_paypal = new Paypal();\n\n $this->_payment = new Payment($this->_paypal);\n }",
"public function setUp()\n {\n $this->purchase = new Purchase();\n }",
"public function __construct(ChargeBillingRepository $billingRepo)\n {\n $this->billingRepo = $billingRepo;\n }",
"public function __construct(BeaconBilling $beacon_billing) {\n $this->beaconBilling = $beacon_billing;\n }",
"private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_backend = new Billing_Backend_SupplyReceipt();\n\t\t$this->_modelName = 'Billing_Model_SupplyReceipt';\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_purgeRecords = FALSE;\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n\t}",
"public function setUp()\n {\n parent::setUp();\n $this->payoutService = $this->app->make(Payout::class);\n }",
"protected function setUp()\n {\n $this->object = new Currency();\n }",
"protected function setUp()\n {\n parent::setUp();\n $this->_payment = new Response\\Payment();\n }",
"private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_StockFlow();\n $this->_modelName = 'Billing_Model_StockFlow';\n $this->_articleSupplyController = Billing_Controller_ArticleSupply::getInstance();\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }",
"public function setUp(): void\n {\n parent::setUp();\n $this->api = new PaymentSecupayCreditcardsApi();\n }",
"public function setUp()\n {\n if ($this->validatePaymentClass()) {\n $this->getPaymentClass()->setUp();\n }\n\n parent::setUp();\n }",
"public function setUp() {\n parent::setUp();\n $this->user = factory(\\App\\User::class)->create();\n $this->client = factory(\\App\\Client::class)->create(['user_id' => $this->user->id]);\n $this->bill = factory(\\App\\Bill::class)->create([\n 'user_id' => $this->user->id,\n 'client_id' => $this->client->id,\n 'other_details' => str_repeat('random string', rand(5, 10))\n ]);\n $this->simpleBill = factory(\\App\\Bill::class)->create([\n 'user_id' => $this->user->id,\n 'client_id' => $this->client->id,\n 'other_details' => ''\n ]);\n }",
"protected function setUp() {\n\t\tinclude ('config.php');\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$this->apiConnector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->service = $this->apiConnector->getService('Invoice');\n\t\tif (!is_null(self::$invoiceId)) {\n\t\t\t$this->object = $this->service->getById(self::$invoiceId);\n\t\t}\n\t}",
"public function setUp()\n {\n $config = [\n 'host' => 'http://dev01.blogic.crcpress.local/',\n 'app_login' => 'www.crcpress.com',\n 'app_pass' => 'overlord',\n 'extra_config' => [\n 'user_agent' => 'CRC PHP Soap client 2.0',\n 'connection_timeout' => 6,\n 'cache_wsdl' => \\WSDL_CACHE_MEMORY,\n 'trace' => true,\n 'soap_version' => \\SOAP_1_1,\n 'encoding' => 'UTF-8'\n ],\n ];\n $ecommerceApi = new EcommerceAPI($config);\n $this->shopperService = $ecommerceApi->getService('Shopper');\n $this->invoiceService = $ecommerceApi->getService('InvoiceManager');\n }",
"public function setUp()\n {\n parent::setUp();\n $this->payoutTransactionBuilderService = $this->app->make(PayoutTransactionBuilder::class);\n $this->sourcePublicKey = 'GANCN4SEI56VVZLHAKFXUQBQEQZAJYWNPVU4I6PGQXKY2PVHAFL3MSH6';\n }",
"public function setUp()\n {\n $this->Receipt = new Receipt();\n }",
"private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_receiptController = Billing_Controller_Receipt::getInstance();\n\t\t$this->_supplyReceiptController = Billing_Controller_SupplyReceipt::getInstance();\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->setOutputType();\n\t}",
"public function __construct(UserBilling $userbilling)\n\t{\n\t\t$this->userbilling = $userbilling;\n\t}",
"public function testBillingSources()\n {\n }",
"protected function setUp()\n {\n $this->object = new Discount;\n }",
"public function testBillingInvoices()\n {\n }",
"public function setUp()\n {\n $this->application = new Application([\n 'donor' => [\n 'name' => [\n 'title' => 'Dr',\n 'first' => 'Ross',\n 'last' => 'Gellar',\n ],\n 'dob' => $this->dateTimeToString(new DateTime('1966-11-02')),\n ],\n 'attorney' => [\n 'name' => [\n 'title' => 'Miss',\n 'first' => 'Monica',\n 'last' => 'Gellar',\n ],\n 'dob' => $this->dateTimeToString(new DateTime('1964-06-15')),\n ],\n 'contact' => [\n 'email' => '[email protected]',\n 'mobile' => '07712 123456',\n ],\n 'verification' => [\n 'case-number' => '123456789',\n 'donor-postcode' => 'AB1 2CD',\n 'attorney-postcode' => 'WX9 8YZ',\n ],\n 'account' => [\n 'name' => 'DR R GELLAR',\n ],\n ]);\n\n $this->payment = new Payment([\n 'amount' => '',\n 'method' => '',\n 'added-date-time' => $this->dateTimeToString(new DateTime()),\n 'processed-date-time' => $this->dateTimeToString(new DateTime()),\n ]);\n }",
"public function __construct()\n {\n $this->url = Config::get('wazaar.API_URL');\n $this->payment = app()->make('Cocorium\\Payment\\PaymentInterface');\n }",
"public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n }",
"protected function setUp() {\n $this->object = new SMTP;\n }",
"public function setUp()\n {\n // Create a new Laravel container instance.\n $container = new Container;\n\n // Resolve the pricing calculator (and any type hinted dependencies)\n // and set to class attribute.\n $this->priceHolder = $container->make('PAMH\\\\PriceHolder');\n }",
"public function setUp()\n\t{\n\t\tparent::setUp();\n\t\t$this->object = new Applicant_Model_FeeBill;\n\t}",
"protected function setUp(): void {\n\t\trequire_once( dirname( __FILE__ ) . '/../vendor/aliasapi/frame/client/create_client.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestHelpers.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestParameters.php' );\n\n\t\tTestHelpers::prepareDatabaseConfigs();\n\t\tClient\\create_client( 'money' );\n\n\t\t$this->http_client = new GuzzleHttp\\Client( [ 'base_uri' => 'http://money/' ] );\n\t\t$this->process_tag = 'refund_purchase_from';\n\t\t$this->tag = 'refund_purchase_to';\n\t}",
"private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_SepaMandate();\n $this->_modelName = 'Billing_Model_SepaMandate';\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }"
]
| [
"0.6815441",
"0.6656416",
"0.6653331",
"0.6648101",
"0.6602994",
"0.6554967",
"0.65218765",
"0.64062667",
"0.63980705",
"0.6389277",
"0.6344419",
"0.63276976",
"0.6322218",
"0.63045365",
"0.6291064",
"0.6282035",
"0.6265328",
"0.6228656",
"0.6207399",
"0.61981505",
"0.61429495",
"0.61384916",
"0.6120302",
"0.6079359",
"0.60708696",
"0.6059052",
"0.60566163",
"0.60491705",
"0.604308",
"0.60280675"
]
| 0.7422001 | 0 |
Apply plugin modifications to composer See for more about $io Available tags are: [info|comment|question|error] | public function activate(
\Composer\Composer $composer,
\Composer\IO\IOInterface $io
) {
$this->composer = $composer;
$this->io = $io;
$extra = $composer->getPackage()->getExtra();
if (isset($extra[self::EXTRA_PARAM])) {
$files = $extra[self::EXTRA_PARAM];
/* parse configuration files */
if (!is_array($files)) {
$this->configFileNames = [$files];
} else {
$this->configFileNames = $files;
}
foreach ($this->configFileNames as $one) {
if (file_exists($one)) {
$config = new \Praxigento\Composer\Plugin\Templates\Config($one);
if ($config->hasData()) {
$io->write(__CLASS__ . ": <info>Configuration is read from '$one'.</info>", true);
if (is_null(self::$config)) {
self::$config = $config;
} else {
self::$config->merge($config);
}
} else {
$io->writeError(__CLASS__ . ": <error>Cannot read valid JSON from configuration file '$one'. Plugin will be disabled.</error>",
true);
self::$config = null;
break;
}
} else {
$io->writeError(__CLASS__ . ": <error>Cannot open configuration file '$one'. Plugin will be disabled.</error>",
true);
self::$config = null;
break;
}
}
} else {
$io->writeError(__CLASS__ . ": <error>Extra parameter '" . self::EXTRA_PARAM . "' is empty. Plugin is disabled.</error>",
true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function activate(Composer $composer, IOInterface $io): void\n {\n $this->composer = $composer;\n $this->io = $io;\n $this->executor = new ProcessExecutor($this->io);\n $this->patches = array();\n $this->installedPatches = array();\n $this->lockFile = new JsonFile(\n static::getPatchesLockFilePath(),\n null,\n $this->io\n );\n $this->locker = new Locker($this->lockFile);\n $this->configuration = [\n 'disable-resolvers' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'disable-downloaders' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'disable-patchers' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'default-patch-depth' => [\n 'type' => 'int',\n 'default' => 1,\n ],\n 'package-depths' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'patches-file' => [\n 'type' => 'string',\n 'default' => 'patches.json',\n ]\n ];\n $this->configure($this->composer->getPackage()->getExtra(), 'composer-patches');\n }",
"public function activate(Composer $composer, IOInterface $io);",
"public function activate(Composer $composer, IOInterface $io)\n {\n }",
"final public function activate(Composer $composer, IOInterface $io)\n {\n $this->composer = $composer;\n $this->io = $io;\n }",
"public function activate(Composer $composer, IOInterface $io) {\n $this->composer = $composer;\n\n $this->io = $io;\n $this->fileSystem = new Filesystem();\n $this->downloadManager = $composer->getDownloadManager();\n $this->installationManager = $composer->getInstallationManager();\n }",
"public function activate(Composer $composer, IOInterface $io)\n {\n // TODO: Implement activate() method.\n }",
"public function activate(Composer $composer, IOInterface $io) {\n $this->handler = new Handler($composer, $io);\n }",
"public function setIo(\\Composer\\IO\\IOInterface $io)\n {\n $this->io = $io;\n }",
"public function uninstall(Composer $composer, IOInterface $io)\n {\n }",
"protected function configure()\n {\n $name = 'add-plugin';\n $desc = '<warning>Downloads</warning> a <info>YOURLS plugin</info> and add it to your <comment>`user/composer.json`</comment>';\n $def = [ new InputArgument('plugins', InputArgument::IS_ARRAY, 'YOURLS plugin(s) to download') ];\n $help = <<<EOT\nExample: <comment>`composer add-plugin ozh/example-plugin`</comment>\nThis command downloads plugins in the appropriate subfolder of <comment>user/plugins/</comment>, adds them to\nyour <comment>user/composer.json</comment> file, and updates dependencies.\nRead more at https://github.com/yourls/composer-installer/\n\nEOT;\n\n $this->setName($name)\n ->setDescription($desc)\n ->setDefinition($def)\n ->setHelp($help);\n }",
"function install_plugin_information()\n {\n }",
"public function execute()\n {\n\t $composer = $this->composer;\n\n\t $composer->extra = isset($composer->extra) ? $composer->extra : array('fof' => new \\stdClass());\n\t $composer->extra->fof = isset($composer->extra->fof) ? $composer->extra->fof : new \\stdClass();\n\n\t $info = $composer->extra->fof;\n\n\t if (!is_object($info))\n\t {\n\t\t if (empty($info))\n\t\t {\n\t\t\t $info = new \\stdClass();\n\t\t }\n\t\t else\n\t\t {\n\t\t\t $info = (object) $info;\n\t\t }\n\t }\n\n\t\t// Component Name (default: what's already stored in composer / composer package name)\n\t\t$info->name = $this->getComponentName($composer);\n\n\t\t$files = array(\n\t\t\t'backend' => 'component/backend',\n\t\t\t'frontend' => 'component/frontend',\n\t\t\t'media' => 'component/media',\n\t\t\t'translationsbackend' => 'translations/component/backend',\n\t\t\t'translationsfrontend' => 'translations/component/frontend'\n\t\t);\n\n\t if (!isset($info->paths) || empty($info->paths) || is_null($info->paths))\n\t {\n\t\t $info->paths = array();\n\t }\n\n\t if (is_object($info->paths))\n\t {\n\t\t $info->paths = (array) $info->paths;\n\t }\n\n\t $files = array_merge($files, $info->paths);\n\n\t\tforeach ($files as $key => $default)\n {\n\t\t\t$info->paths[$key] = $this->getPath($composer, $key, $default);\n\t\t}\n\n\t\t// Now check for fof.xml file\n\t\t$fof_xml = getcwd() . '/' . $info->paths['backend'] . '/fof.xml';\n\n\t\tif (file_exists($fof_xml))\n {\n // @todo Read the XML?\n\t\t}\n\n\t // @todo Maybe ask for namespaces?\n\n\t\t// Store back the info into the composer.json file\n\t $composer->extra->fof = $info;\n\t \\JFile::write(getcwd() . '/composer.json', json_encode($composer, JSON_PRETTY_PRINT));\n\n\t\t$this->setDevServer(false);\n\t}",
"public function uninstall(Composer $composer, IOInterface $io);",
"protected static function writeAddRepository(IOInterface $io, $name)\n {\n if ($io->isVerbose()) {\n $io->write('Adding VCS repository <info>'.$name.'</info>');\n }\n }",
"public function add_dependencies(self ...$plugins): static;",
"function wp_default_packages_vendor($scripts)\n {\n }",
"function wp_update_plugin($plugin, $feedback = '')\n {\n }",
"public function configureIO(IO $io) : void;",
"protected static function updateComposer()\n {\n $packages = json_decode(file_get_contents(base_path('composer.json')), true);\n $packages['require'] = static::updateComposerArray($packages['require']);\n ksort($packages['require']);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }",
"public function activate(Composer $composer, IOInterface $io)\n {\n $this->composer = $composer;\n $this->io = $io;\n\n if ($this->isWorkspace()) {\n $workspaceRoot = $this->getWorkspaceRoot();\n\n $workspacePath = getcwd();\n\n $workspace = $workspaceRoot->resolveWorkspace($workspacePath);\n\n if ($workspace === null) {\n throw new RuntimeException('Could not resolve workspace for path \"' . $workspacePath . '\"');\n }\n\n $this->configureWorkspace($workspaceRoot, $workspace, $composer);\n }\n }",
"function install_plugins_upload()\n {\n }",
"private function refreshMetaData (SymfonyStyle $io)\n {\n $io->section(\"Refreshing the metadata\");\n\n foreach ($this->kernel->getBundles() as $bundle)\n {\n $bundleNamespacePrefix = \"{$bundle->getNamespace()}\\\\\";\n\n $searchItems = $this->metadataGenerator->rebuildMetadata([\n $bundleNamespacePrefix => $bundle->getPath(),\n ]);\n\n if (!empty($searchItems))\n {\n $io->writeln(sprintf(\n \"<fg=blue>%s</>\",\n $bundle->getName()\n ));\n\n foreach ($searchItems as $item)\n {\n $io->writeln(\" {$item->getFqcn()}\");\n }\n\n $io->newLine();\n }\n }\n\n $this->stepDone($io);\n }",
"function wp_cli_app_basic_composer( $args, $assoc_args ) {\n\n\t//Check Composer is installed in System\n\tif ( CLI::command_exists( \"composer\" ) === false ) {\n\t\tCLI::error( \"Composer Package Manager is not active in your system, read more : https://getcomposer.org/doc/00-intro.md\" );\n\t\treturn;\n\t}\n\n\t//Check Active Workspace\n\tWorkSpace::is_active_workspace();\n\t$workspace = WorkSpace::get_workspace();\n\n\t//Create Custom Composer Cli\n\t$arg = array();\n\tfor ( $x = 0; $x <= 3; $x ++ ) {\n\t\tif ( isset( $args[ $x ] ) and ! empty( $args[ $x ] ) ) {\n\t\t\t$arg[] = $args[ $x ];\n\t\t}\n\t}\n\n\t//Run command\n\tCLI::run_composer( $workspace['path'], $arg );\n}",
"function pmpro_setupAddonUpdateInfo() {\n\tadd_filter( 'plugins_api', 'pmpro_plugins_api', 10, 3 );\n\tadd_filter( 'pre_set_site_transient_update_plugins', 'pmpro_update_plugins_filter' );\n\tadd_filter( 'http_request_args', 'pmpro_http_request_args_for_addons', 10, 2 );\n\tadd_action( 'update_option_pmpro_license_key', 'pmpro_reset_update_plugins_cache', 10, 2 );\n}",
"public function generate(IOInterface $io, $base_dir) {\n // General information from drupal/drupal and drupal/core composer.json\n // and composer.lock files.\n $drupalCoreInfo = DrupalCoreComposer::createFromPath($base_dir);\n\n // Exit early if there is no composer.lock file.\n if (empty($drupalCoreInfo->composerLock())) {\n return;\n }\n\n // Run all of our available builders.\n $builders = $this->builders();\n $changed = FALSE;\n foreach ($builders as $builder_class) {\n $builder = new $builder_class($drupalCoreInfo);\n $changed |= $this->generateMetapackage($io, $builder);\n }\n\n // Remind the user not to miss files in a patch.\n if ($changed) {\n $io->write(\"If you make a patch, ensure that the files above are included.\");\n }\n }",
"function aione_register_required_plugins() {\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' => 'Oxo Core',\n\t\t\t'slug' => 'oxo-core',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/oxo-core.zip',\n\t\t\t'required' => true,\n\t\t\t'version' => '1.8.3',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/oxo_core.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'LayerSlider WP',\n\t\t\t'slug' => 'LayerSlider',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/LayerSlider.zip',\n\t\t\t'required' => false,\n\t\t\t'version' => '5.6.2',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/layer_slider.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Revolution Slider',\n\t\t\t'slug' => 'revslider',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/revslider.zip',\n\t\t\t'required' => false,\n\t\t\t'version' => '5.1.6',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/rev_slider.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'WooCommerce',\n\t\t\t'slug' => 'woocommerce',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/woocommerce.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'bbPress',\n\t\t\t'slug' => 'bbpress',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/bbpress.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'The Events Calendar',\n\t\t\t'slug' => 'the-events-calendar',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/the_events_calendar.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/contact_form_7.jpg',\n\t\t),\n\t);\n\n\t// Change this to your theme text domain, used for internationalising strings\n\t$theme_text_domain = 'Aione';\n\n\t/**\n\t * Array of configuration settings. Amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * leave the strings uncommented.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\n\t\t'domain' \t=> $theme_text_domain,\n\t\t'default_path' \t=> '',\n\t\t'parent_slug' \t\t=> 'themes.php',\n\t\t'menu' \t=> 'install-required-plugins',\n\t\t'has_notices' \t=> true,\n\t\t'is_automatic' \t=> true,\n\t\t'message' \t=> '',\n\t\t'strings' \t=> array(\n\t\t\t'page_title' => __( 'Install Required Plugins', 'Aione' ),\n\t\t\t'menu_title' => __( 'Install Plugins', 'Aione' ),\n\t\t\t'installing' => __( 'Installing Plugin: %s', 'Aione' ), // %1$s = plugin name\n\t\t\t'oops' => __( 'Something went wrong with the plugin API.', 'Aione' ),\n\t\t\t'notice_can_install_required' => _n_noop( 'This theme requires the following plugin installed or updated: %1$s.', 'This theme requires the following plugins installed or updated: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_install_recommended' => _n_noop( str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'This theme recommends the following plugin installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'This theme recommends the following plugins installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_recommended' => _n_noop( str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'The following recommended plugin is currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'The following recommended plugins are currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_ask_to_update' => _n_noop( '<span class=\"oxo-update-heading\" style=\"margin-top:-0.4em\">%1$s Update Required</span>The plugin needs to be updated to its latest version to ensure maximum compatibility with Aione.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'install_link' => _n_noop( 'Go Install Plugin', 'Go Install Plugins', 'Aione' ),\n\t\t\t'activate_link' => _n_noop( 'Go Activate Plugin', 'Go Activate Plugins', 'Aione' ),\n\t\t\t'return' => __( 'Return to Required Plugins Installer', 'Aione' ),\n\t\t\t'plugin_activated' => __( 'Plugin activated successfully.', 'Aione' ),\n\t\t\t'complete' => __( 'All plugins installed and activated successfully. %s', 'Aione' ), // %1$s = dashboard link\n\t\t\t'nag_type' => 'error' // Determines admin notice type - can only be 'updated' or 'error'\n\t\t)\n\t);\n\n\ttgmpa( $plugins, $config );\n}",
"function _maybe_update_plugins()\n {\n }",
"public function dependencies() {\n\t\tif ($customPath = $this->params['custom']) {\n\t\t\t$this->_paths = [$customPath];\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = [CakePlugin::path($this->params['plugin'])];\n\t\t} else {\n\t\t\t$this->_paths = [APP];\n\t\t}\n\n\t\t$this->_findFiles('php');\n\t\tforeach ($this->_files as $file) {\n\t\t\t$this->out(sprintf('Updating %s...', $file), 1, Shell::VERBOSE);\n\n\t\t\t$this->_correctFile($file);\n\n\t\t\t$this->out(sprintf('Done updating %s', $file), 1, Shell::VERBOSE);\n\t\t}\n\t}",
"public function installPlugins(){\n\n $listPlugin = $this->sanitizePluginsArray();\n\n foreach ($listPlugin as $Plugin) {\n $command = \"{$this->node} {$this->ltpm} install {$Plugin['filename']}\";\n\n exec($command,$output);\n\n Artisan::call('lt-plugin:update',['--vendor-name'=> $Plugin['vendor'].','.$Plugin['name'], '--silent' => true]);\n\n Artisan::call('lt-migration:up',['--vendor-name'=>$Plugin['vendor'].','.$Plugin['name'], '--silent' => true]);\n }\n }",
"protected function composerUpdate()\n {\n $this->runCommand(['composer', 'update'], getcwd(), $this->output);\n }"
]
| [
"0.6016796",
"0.58867455",
"0.58470553",
"0.5564594",
"0.55156046",
"0.54994",
"0.54526603",
"0.5429389",
"0.5371428",
"0.5239957",
"0.5219345",
"0.52148",
"0.52141",
"0.5208393",
"0.5157487",
"0.5116476",
"0.5105694",
"0.50939083",
"0.5063629",
"0.5048403",
"0.5044038",
"0.5025825",
"0.5008625",
"0.4999164",
"0.4993139",
"0.4988681",
"0.49434754",
"0.49356872",
"0.49343202",
"0.49146593"
]
| 0.5934165 | 1 |
/ close: sends a proper disconect, then closes the socket | function close(){
$this->disconnect();
stream_socket_shutdown($this->socket, STREAM_SHUT_WR);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function close() {\r\n\t\tfclose($this->socket);\r\n\t}",
"private function close_socket() {\n\t\tfclose($this->_socket);\n\t\tif ($this->_CBC) $this->_CBC->_openSRS_crypt();\t\t\t/* destructor */\n\t\t$this->_CBC\t\t\t\t= false;\n\t\t$this->_authenticated\t= false;\n\t\t$this->_socket\t\t\t= false;\n\t}",
"public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}",
"private function close()\n {\n socket_close($this->socket);\n }",
"protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}",
"public function close(): void\n\t{\n\t\tif ($this->socket) {\n\t\t\t$this->socket->close();\n\t\t\t$this->socket = null;\n\t\t}\n\t}",
"public function close() {\n\t\t$this->send('__internal__', 'close'); //server side closing can be an issue, let the client do it\n\t}",
"function close() {\n if ($this->ipcsock != NULL) { socket_close($this->ipcsock); }\n $this->ipcsock=NULL;\n }",
"private function close() {\n\t\t// Close socket connection if keep alive isn't supported\n\t\tif (!$this->canKeepAlive()) {\n\t\t\t$this->client->close();\n\t\t} else {\n\t\t\t// Read away socket data to prepare for next request\n\t\t\tif (!$this->isEmptyBody) {\n\t\t\t\twhile ($this->readChunk() !== \"\") {\n\t\t\t\t\t// Empty body\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function close() {\n\t\t$this->socketManager->removeSocketNotifier($this->notifier);\n\t\t$this->notifier = null;\n\t\tfclose($this->stream);\n\t}",
"public function __destruct()\r\n\t{\r\n\t\tif (is_resource($this->socket))\r\n\t\t{\r\n\t\t\tfclose($this->socket);\r\n\t\t}\r\n\t}",
"function Close() \r\n{ \r\n//** no open cobnnection is available. Set error appropriately. \r\n\r\nif(!$this->isOpen()) \r\n$this->LastError = \"No connection available to close\"; \r\n\r\n//** an open connection is available to close. Close underlying socket. \r\n\r\nelse \r\n{ \r\nfclose($this->Socket); //** clsoe the connection. \r\n$this->Socket = TcpClientNoConnection; //** no connection now. \r\n} \r\nreturn !$this->isOpen(); //** return the close operation success. \r\n}",
"function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}",
"public function __destruct() {\n\t\t\tsocket_close($this->socket);\n\t\t}",
"abstract function disconnect($socket);",
"public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }",
"public function __destruct()\n {\n if (is_resource($this->socket))\n {\n socket_shutdown($this->socket);\n socket_close($this->socket);\n }\n }",
"public function disconnect()\n {\n $this->client->close();\n }",
"public function Disconnect () {\n $this->sendString('QUIT');\n\n fclose($this->pop_conn);\n }",
"function shutdown() {\n\tsocket_close( $socket );\n}",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function disconnect();",
"public function close()\r\n {\r\n $this->channel->close();\r\n $this->connect->close();\r\n }",
"function smtp_disconnect() \n {\t\n \tif ($this->_connection_state) {\n \t\t$this->_connection_state = false; \n $this->smtp_command(\"QUIT\");\n \t} \n $this->disconnect(); \n $this->_socket = socket_create($this->_domain ,$this->_type ,$this->_protocol); \n $this->_sock_buff = \"\";\n\t}"
]
| [
"0.78487915",
"0.77117836",
"0.75866485",
"0.7518191",
"0.7445423",
"0.7444326",
"0.74267966",
"0.73898894",
"0.7356675",
"0.7116472",
"0.70132244",
"0.6956682",
"0.6915018",
"0.6881676",
"0.6872263",
"0.68588525",
"0.6843052",
"0.67003274",
"0.66555864",
"0.66485655",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66484255",
"0.66281813",
"0.661223"
]
| 0.7973738 | 0 |
Determine whether the user can create product groups. | public function create(User $user)
{
return $user->hasPermissions(['group_create']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }",
"public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }",
"public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }",
"private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"static public function canCreateGallery($context, $user)\r\n {\r\n if ( $user->getId() === null ) return false;\r\n\r\n self::_checkContext($context);\r\n self::_checkUser($user);\r\n\r\n /**\r\n * if context - user profile\r\n */\r\n if ( $context instanceof Warecorp_User ) {\r\n /**\r\n * user views own galleries\r\n */\r\n if ( $context->getId() == $user->getId() ) {\r\n return true;\r\n }\r\n /**\r\n * user views galleries of other user\r\n */\r\n else {\r\n return false;\r\n }\r\n }\r\n /**\r\n * if context - group\r\n */\r\n elseif ( $context instanceof Warecorp_Group_Base ) {\r\n /**\r\n * user is host of this group\r\n */\r\n if ($context->getMembers()->isHost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is cohost of this group\r\n */\r\n elseif ($context->getMembers()->isCohost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is member of this group\r\n */\r\n elseif ($context->getMembers()->isMemberExistsAndApproved($user->getId())) {\r\n \tif (Warecorp_Group_AccessManager::canUseVideos($context, $user)) return true;\r\n \t\telse return false;\r\n }\r\n /**\r\n * user isn't member of this group\r\n */\r\n else {\r\n\r\n }\r\n }\r\n return false;\r\n }",
"public function create(User $user)\n {\n return $user->canDo('filter.filter_group.create');\n }",
"public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}",
"public function isUserOrGroupSet() {}",
"public function create(User $user)\n {\n if ($user->hasPermissionTo('create crm product categories')) {\n return true;\n }\n }",
"public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }",
"function create()\r\n {\r\n $wdm = WeblcmsDataManager :: get_instance();\r\n $success = $wdm->create_course_group_user_relation($this);\r\n\r\n if (! $success)\r\n {\r\n return false;\r\n }\r\n return true;\r\n }",
"function CheckGroupCreation($data) {\n $name = $data['name'];\n \n $correct = array(\n 'name' => 0,\n );\n \n if(strlen($name)>0) {\n $correct['name'] = 1;\n }\n\n $c = count(array_unique($correct));\n if ($c == 1) {\n if ($correct['name'] == 1) {\n //TODO check if session.user_id was not manipulated\n $id = createGroup($name,$_SESSION['user_id']);\n return array(true,$id);\n }\n return array(false,-1);\n }\n \n return array(false,-1);\n}",
"public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }",
"public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function canCreate();",
"public function canCreate();",
"public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }",
"public function createGroup(GroupInterface $group): bool;",
"public function isGroup(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$arrChildren = UniteFunctionsWPUC::getPostChildren($this->post);\n\t\t\t\t\n\t\tif(!empty($arrChildren))\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}",
"private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}",
"function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }",
"public function customerGroupCheck()\r\n {\r\n if (Mage::app()->getStore()->isAdmin())\r\n $customer = Mage::getSingleton('adminhtml/session_quote')->getCustomer();\r\n else\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $customer_group = $customer->getGroupId();\r\n $group = Mage::getStoreConfig('customercredit/general/assign_credit');\r\n $group = explode(',', $group);\r\n if (in_array($customer_group, $group)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }",
"public function restrict_group_creation( $can_create, $restricted ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $can_create;\n\n\t\t\t// Check if user has enough to create a group\n\t\t\t$cost = abs( $this->prefs['create']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $can_create;\n\n\t\t}",
"public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }",
"public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }",
"public function create(User $user)\n {\n return $user->hasPermission('create-organization-composition');\n }",
"public function isAdmin()\n {\n return $this->group_id === 1;\n }"
]
| [
"0.75314003",
"0.6667685",
"0.66596156",
"0.6656765",
"0.6503588",
"0.64534134",
"0.6400284",
"0.6348728",
"0.63329154",
"0.6325974",
"0.63027555",
"0.6299878",
"0.6211796",
"0.6189139",
"0.61464685",
"0.61305034",
"0.61305034",
"0.6079144",
"0.6077826",
"0.60727835",
"0.60704345",
"0.6051933",
"0.6050826",
"0.60290647",
"0.6027306",
"0.59810054",
"0.5946752",
"0.5904996",
"0.59032416",
"0.5889043"
]
| 0.6866294 | 1 |
Determine whether the user can update the product group. | public function update(User $user, ProductGroup $productGroup)
{
if( $user->hasPermissions(['group_update'])) {
return true;
} else {
return $user->hasPermissions(['group_self'], $productGroup);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }",
"public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }",
"protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }",
"public function authorize()\n {\n return $this->user()->can('update_users');\n }",
"static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }",
"protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }",
"public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }",
"public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }",
"public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }",
"public function update(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }",
"public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }",
"public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }",
"private function validate()\r\n {\r\n if (!$this->user->hasPermission('modify', 'module/promotion')) {\r\n $this->error['warning'] = $this->language->get('error_permission');\r\n }\r\n\r\n if (!$this->error) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }",
"public function isAdmin()\n {\n return $this->group_id === 1;\n }",
"public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}",
"public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}",
"public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }",
"public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }",
"public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }"
]
| [
"0.7324108",
"0.7253346",
"0.69384354",
"0.6761679",
"0.67539275",
"0.67376304",
"0.66965413",
"0.6695225",
"0.66925734",
"0.6678436",
"0.6663989",
"0.66046226",
"0.6589469",
"0.6546452",
"0.6497894",
"0.6490996",
"0.64484113",
"0.64183354",
"0.6415692",
"0.63796216",
"0.6363141",
"0.636127",
"0.6358958",
"0.6358",
"0.63559276",
"0.6352293",
"0.6343564",
"0.63355094",
"0.631757",
"0.6262124"
]
| 0.7592381 | 0 |
Determine whether the user can delete the product group. | public function delete(User $user, ProductGroup $productGroup)
{
if( $user->hasPermissions(['group_remove'])) {
return true;
} else {
return $user->hasPermissions(['group_remove_self'], $productGroup);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"function delete()\r\n {\r\n $wdm = WeblcmsDataManager :: get_instance();\r\n $success = $wdm->delete_course_user_group_relation($this);\r\n if (! $success)\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }",
"public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }",
"function canDelete() {\n return true;\n }",
"public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}",
"public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }",
"public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }",
"public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }",
"function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }",
"public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }",
"protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }",
"public function canDelete()\n {\n return 1;\n }",
"public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }",
"public function isDeleteGranted($entity): bool;",
"public function authorize()\n {\n return $this->can('delete');\n }",
"public function canDelete()\n {\n return $this->canGet();\n }",
"public function checkIsValidForDelete() {\n $errors = false;\n if(strlen(trim($this->idGroup)) == 0){\n $errors = \"Group identifier is mandatory\";\n }else if(!preg_match('/^\\d+$/', $this->idGroup)){\n $errors = \"Group identifier format is invalid\";\n }else if($this->existsGroup() !== true) {\n $errors = \"Group doesn't exist\";\n }\n return $errors;\n }",
"public function canDelete()\n {\n return in_array('delete', $this->actions);\n }",
"function delete($group_id)\n {\n $success = false;\n\n //Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n //Delete permissions\n if ($this->db->delete('permissions', array('group_id' => $group_id)) && $this->db->delete('permissions_actions', array('group_id' => $group_id))) {\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', array('deleted' => 1));\n }\n $this->db->trans_complete();\n return $success;\n }",
"function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }",
"function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}",
"public function isDeletable() {\n\t\t$sql = \"SELECT COUNT(*) AS members FROM wcf\".WCF_N.\"_user_to_group_premium WHERE premiumGroupID = ?\"; \n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array($this->premiumGroupID));\n\t\t$row = $statement->fetchArray();\n\t\t\n\t\treturn ($row['members'] > 0) ? false : true; \n\t}",
"public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}",
"public function allowDeletion()\n {\n return $this->allowDeletion;\n }",
"public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }",
"public function delete()\n\t{\n\t\t// make sure a user id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tDB::connection(static::$db_instance)->pdo->beginTransaction();\n\n\t\t\t// delete users groups\n\t\t\t$delete_user_groups = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$join_table)\n\t\t\t\t->where(static::$group_identifier, '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\t// delete GROUP\n\t\t\t$delete_user = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$table)\n\t\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\tDB::connection(static::$db_instance)->pdo->commit();\n\t\t}\n\t\tcatch(\\Database_Exception $e) {\n\n\t\t\tDB::connection(static::$db_instance)->pdo->rollBack();\n\t\t\treturn false;\n\t\t}\n\n\t\t// update user to null\n\t\t$this->group = array();\n\t\treturn true;\n\n\t}"
]
| [
"0.71113217",
"0.704864",
"0.69743294",
"0.6826736",
"0.6806197",
"0.67630637",
"0.6749133",
"0.6731334",
"0.67216104",
"0.6687712",
"0.66781664",
"0.6665586",
"0.66583085",
"0.6583698",
"0.6568247",
"0.6564295",
"0.65443325",
"0.6534243",
"0.65043753",
"0.64999604",
"0.6455782",
"0.64407307",
"0.6419092",
"0.64125246",
"0.6409952",
"0.63910437",
"0.6346342",
"0.63213384",
"0.6313794",
"0.63059354"
]
| 0.7219402 | 0 |
Get first card id from customer cards If Customer has cards will return first one or zero | public function getFirstCardId(int $user_id): int
{
return $this->where('user_id', $user_id)->first()->id ?? 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCustomerCardId(): ?string\n {\n if (count($this->customerCardId) == 0) {\n return null;\n }\n return $this->customerCardId['value'];\n }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"function getStripeCustomerId(){\n\n $getCusId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n if($getCusId){\n return $getCusId->stripeCustomerId;\n }else{\n return FALSE;\n }\n\n }",
"public function getFirstId() {\n return $this->id[0];\n }",
"function get_by_id( $card_id )\n {\n $this->db->join('card_types', 'card_types.type_id=cards.type_id');\n $this->db->where('card_id', $card_id);\n $this->db->limit(1);\n return $this->db->get($this->table)->row();\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 getCidCard()\n {\n return $this->cid_card;\n }",
"function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }",
"public function getCardNumber() : ?string ;",
"public function getDefaultCardNumber() : ?string;",
"public static function getCardReference($response, $last_digits = null)\n {\n // $data = (array)static::getData($response);\n if ($response->offsetExists('object') && $response->offsetGet('object') === 'card') {\n return $response->offsetGet('id');\n }\n\n if ($response->offsetExists('object') && $response->offsetGet('object') === 'customer') {\n $cards = $response->offsetGet('cards');\n $total = $cards['total'];\n if (1 == $total) {\n return $cards['data'][0]['id'];\n } else {\n if (!$last_digits) {\n foreach ($cards['data'] as $key => $card) {\n if ($last_digits == $card['last_digits']) {\n return $card->offsetGet('id');\n break;\n }\n }\n }\n }\n return null;\n }\n\n return null;\n }",
"function getLastBookingIdByCustomerId($custId) {\n $query = \"SELECT `BookingId` FROM bookings WHERE CustomerId='$custId' ORDER BY BookingId DESC LIMIT 1\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }",
"public function getCardnumber()\n {\n return $this->cardnumber;\n }",
"static function first() {\n list($record) = self::collection(null, \"id LIMIT 1\");\n return isset($record) ? $record : null;\n }",
"public function getCardIdWithData(int $user_id, array $card_data)\n\t{\n\t\treturn $this->firstOrCreate(['user_id' => $user_id], $card_data)->id;\n\t}",
"function jpid_next_customer_id() {\n\treturn JPID()->db_customers->get_next_id();\n}",
"public function getFirst()\r\n {\r\n return $this->dao->select('*')->from(TABLE_COMPANY)->orderBy('id')->limit(1)->fetch();\r\n }",
"protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }",
"abstract public function getCard(int $card_id): ?array;",
"public function getCustomerId();",
"public function getCustomerId();",
"public function getCustomerId();",
"function InfGetCreditCard($inf_contact_id, $inf_card_id) {\n\t$object_type = \"CreditCard\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$object->removeRestrictedFields(); // Remove CreditCard and CVV\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('Id' => $inf_card_id, 'ContactId' => $inf_contact_id, 'Status' => 3));\n\n $cards_array = array();\n foreach ($objects as $i => $object) {\n $cards_array = $object->toArray();\n }\n\treturn $cards_array; // Should only be one card\n}",
"public function get_postcard_id() {\n return (int) $this->get_field( 'postcard' );\n }",
"public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }",
"public function getCustomerId(): ?string\n {\n if (count($this->customerId) == 0) {\n return null;\n }\n return $this->customerId['value'];\n }",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }",
"public function getCardanoSpecific()\n {\n return $this->cardano_specific;\n }",
"public function firstKey(): ?int;",
"public function get_first_item_id(): int {\n\t\t\treturn LP_Course_DB::getInstance()->get_first_item_id( $this->get_id() );\n\t\t}"
]
| [
"0.7004446",
"0.6583274",
"0.6259025",
"0.6205459",
"0.6143456",
"0.61394405",
"0.6013545",
"0.5980387",
"0.5968282",
"0.5800017",
"0.5797028",
"0.5795271",
"0.5794025",
"0.57341415",
"0.5709224",
"0.5704326",
"0.5697719",
"0.56567776",
"0.5654156",
"0.5653232",
"0.5653232",
"0.5653232",
"0.5647494",
"0.5646581",
"0.56442595",
"0.5642947",
"0.56305426",
"0.56248295",
"0.55987763",
"0.5582386"
]
| 0.6914502 | 1 |
Maintain the array checkLogQ as a FIFO buffer with length 4. When a new entry is added, remove oldest entry and shuffle. | function addCheckLog($message){
global $checkLogQ;
$length = 4;
// If checkLogQ size is smaller than 4 add the message
if(count($checkLogQ)<$length){
$checkLogQ[] = $message;
}
// If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one
else{
array_shift($checkLogQ);
$checkLogQ[] = $message;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printCheckLogQ(){\n global $checkLogQ;\n foreach($checkLogQ as $message){\n print($message);\n }\n $checkLogQ = array(); // reset a variable to an empty array\n }",
"function startQueue(){\n\n // Maintain the array checkLogQ as a FIFO buffer with length 4.\n // When a new entry is added, remove oldest entry and shuffle.\n function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }\n // Prints all checkLogQ messages to the console \n function printCheckLogQ(){\n global $checkLogQ;\n foreach($checkLogQ as $message){\n print($message);\n }\n $checkLogQ = array(); // reset a variable to an empty array\n }\n \n try{\n while(true){\n addCheckLog(date('Y/m/d H:i:s').\" Awaiting a message...\\n\");\n\n // Receive messages from queue, maximum waits for 20 seconds for message\n // receive_request - contain all the queue messages\n global $sqs;\n $receive_request = $sqs->receiveMessage(array(\n 'QueueUrl' => ds_config(\"QUEUE_URL\"),\n 'WaitTimeSeconds' => 20,\n 'MaxNumberOfMessages' => 10\n ));\n // Count the amount of messages received\n $msgCount = 0;\n if($receive_request->getPath('Messages') !== NULL){\n $msgCount = count($receive_request->getPath('Messages'));\n }\n addCheckLog(date('Y/m/d H:i:s').\" found $msgCount message(s)\\n\");\n // If at least one message has been received\n if ($msgCount!=0) {\n printCheckLogQ();\n foreach ($receive_request->getPath('Messages') as $msg) {\n messageHandle($msg, $receive_request);\n }\n }\n }\n }\n catch (Exception $e) {\n printCheckLogQ();\n print(date('Y/m/d H:i:s').\" Queue receive error: $e\");\n sleep(5);\n global $restart;\n $restart = true;\n }\n }",
"private function clear_log()\n {\n if ($this->_log && is_array($this->_log)) {\n $this->_log = array();\n }\n }",
"function queue_rotate(&$queue) { \n // Remove the first item and insert it at the rear. \n $queue[] = array_shift($queue); \n}",
"function queue_initialize() { \n // In this case, just return a new array \n $new = array(); \n return $new; \n}",
"private function clearLog() {\n $this -> log = array();\n $this -> log[\"success\"] = array();\n $this -> log[\"failure\"] = array();\n }",
"final public function purgeLog() {\n $this->log = array();\n }",
"public function clear()\n {\n $this->log = [];\n }",
"public function remove_old_log_events() {\n global $wpdb;\n\n $older_than = (time() - H5PEventBase::$log_time);\n\n $wpdb->query($wpdb->prepare(\"\n DELETE FROM {$wpdb->prefix}h5p_events\n\t\t WHERE created_at < %d\n \", $older_than));\n }",
"private function rotate_log_table() {\n\t\t\tif( $this->calls > 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$random_val = rand(0,1000);\n\t\t\tif($random_val == 500){\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$lock = rand();\n\t\t\t\t$sql = $wpdb->prepare(\"INSERT IGNORE INTO {$wpdb->prefix}options SET `option_name` = 'error_log_delete_lock', `option_value` = '$lock', `autoload` = 'no'\");\n\t\t\t\tif($wpdb->query($sql)){\n\t\t\t\t\t$sql = $wpdb->prepare(\"SELECT option_value FROM {$wpdb->prefix}options where option_name='error_log_delete_lock'\");\n\t\t\t\t\t$results = $wpdb->$results($sql);\n\t\t\t\t\tif ($results['key'] == $lock) {\n \t\t\t\t\t\t$sql = $wpdb->prepare( \"DELETE FROM {$this->table_name} WHERE time_stamp < (CURDATE() - INTERVAL %d DAY)\", Error_Logging::KEEP_DAYS );\n\t\t\t\t\t\t$return = $wpdb->query( $sql );\n\t\t\t\t\t\t$sql = $wpdb->prepare(\"DELETE FROM {$wpdb->prefix}options WHERE option_name='error_log_delete_lock'\");\t\n\t\t\t\t\t\t$return = $wpdb->query( $sql );\n\t\t\t\t\t}else {\n\t\t\t \t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\treturn $return;\n\t\t\t\t}else{\n\t\t\t \t\treturn 0;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t \treturn 0;\n\t\t\t}\n\t\t}",
"public function testOrderedQueueGC_consistent() {\n\t\t\t$this->oq[1] = new stdClass; $this->oq[7] = new stdClass;\n\t\t\t$this->oq[7] = new stdClass; $this->oq[4] = new stdClass;\n\n\t\t\t// run garbage collector...\n\t\t\t$this->oq->gc();\n\n\t\t\t// assertions\n\t\t\tfor($i=0;$i<4;$i++) $this->assertTrue(isset($this->oq[$i]));\n\t\t}",
"public function reset()\n {\n $this->values[self::_GUILD_LOG] = array();\n }",
"function check(){\n\techo \"Looking for jobs and adding to queue\\n\";\n\t\n\t$times = date('d-M-Y');\n\tif(DEBUG) $qlog = new snowytech\\stphplogger\\logWriter('../logs/check-queue-' . $times . '.txt');\n\t$check = new snowytech\\stphpschedule\\schedule();\n\t//Goes through whole Jobs table and checks interval!\t\n\t$db = db::getInstance();\n\t$sql = \"SELECT * FROM JOBS\";\n\t$stmt = $db->getData($sql);\n\n\t//Count the rows and send console message there are no jobs configured.\n\tif ( count($stmt) > 0) {\n\t\tforeach($stmt as $row){\n\t\t\t$id = $row['id'];\n\t\t\t$job_name = $row['name'];\n\t\t\t$path = $row['path'];\n\t\t\t$in_queue = $row['status_int'];\n\t\t\t$lastrun = $row['last_run'];\n\t\t\t$interval = $row['interval'];\n\t\t\t$global_hold = $row['global_hold'];\n\t\t\t\n\t\t\t$r = $check->interval($lastrun, $interval);\n\t\t\t\n\t\t\t//Dont run if global hold is set to 1\n\t\t\tif($global_hold !=1){\n\t\t\t\t//Dont run if $in_queue = 0 ( already in queue )\n\t\t\t\tif($in_queue != 0){\n\t\t\t\t\tif( $r ) {\n\t\t\t\t\t\techo \"Job hit the queue: \" . $job_name . \"\\n\";\n\t\t\t\t\t\t$count = time();\n\t\t\t\t\t\techo $count . \"\\n\";\n\t\t\t\t\t\tif(DEBUG) $qlog->info('Job hit the queue: ' . $job_name . \" : time: \" . $count);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//Now last update is updating in table. Need to add an entry to the QUE and update last run from there.\t\t\t\t\n\t\t\t\t\t\t$data = array(':jid' => $id, ':path' => $path, ':hold' => '1', ':time' => $count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add into QUEUE\n\t\t\t\t\t\t$sql= 'INSERT INTO QUEUE (job_id, path, hold, in_que_time) VALUES (:jid,:path,:hold,:time)';\n\t\t\t\t\t\t$db->execQuery($sql, $data);\n\n\t\t\t\t\t\t//update status_int, prevents multiple entries into queue\n\t\t\t\t\t\t$sql= \"UPDATE JOBS SET status_int = 0 WHERE id = '$id'\";\n\t\t\t\t\t\t$db->updateData($sql);\n\t\t\t\t\t}else{ \n\t\t\t\t\t\techo \"NOT ready to run - \" . $job_name . \"\\n\"; \n\t\t\t\t\t\t//Log that its intervnal is not ready\n\t\t\t\t\t\tif(DEBUG) $qlog->info('NOT RUN - interval is ' . $interval . \" minutes on JOB: \" . $job_name . \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else { \n\t\t\t\t\techo \"JOB \" . $job_name . \" - already in QUEUE!\\n\"; \n\t\t\t\t\tif(DEBUG) $qlog->info('JOB ' . $job_name . \" - already in QUEUE!\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\techo \"JOB \" . $job_name . \" is HELD globally!\\n\";\n\t\t\t\tif(DEBUG) $qlog->info(\"JOB \" . $job_name . \" is HELD globally!\\n\");\n\t\t\t}\n\t\t}\n\t} else { echo \"There are no JOBS configured!\"; }\n\t$db->closeDB();\n}",
"public function benchLpopConsecutive()\n {\n $messageList = [];\n for ($i = 0; $i < self::CONSUME_SIZE; $i++) {\n $messageList[] = RedisEnvelope::jsonDeserialize($this->client->lpop($this->queueName));\n }\n }",
"public function clearRecordedEvents()\n {\n $this->latestRecordedEvents = [];\n }",
"function insertLogDigestQueue($digest_insert)\n{\n\t$db = database();\n\n\t$db->insert('',\n\t\t'{db_prefix}log_digest',\n\t\t[\n\t\t\t'id_topic' => 'int', 'id_msg' => 'int', 'note_type' => 'string', 'exclude' => 'int',\n\t\t],\n\t\t$digest_insert,\n\t\t[]\n\t);\n}",
"public static function clear()\n {\n self::$actionList = new \\SplPriorityQueue();\n self::$errors = [];\n self::$warnings = [];\n }",
"function addSongsToQueue($accountId, $soundtrackId, $startSong, $startingSequence = 1)\n{\n \n $sql = \"SELECT * FROM soundtrack_playlist WHERE soundtrack_id = $soundtrackId\";\n \n $rows = mysql_query($sql);\n $songs = array();\n $songIds = array();\n\n if ($startSong)\n {\n $startSongId = intval($startSong['song_id']);\n $songIds[] = $startSongId;\n }\n\n while ($row = mysql_fetch_array($rows, MYSQL_ASSOC))\n {\n $playlistId = $row['playlist_id'];\n $weight = $row['weight'];\n\n // TODO: What if there aren't enough songs from this playlist?\n \n $sql = \"SELECT * FROM playlist_song JOIN song ON playlist_song.song_id = song.song_id WHERE playlist_id = $playlistId \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_queue WHERE account_id = $accountId)) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_song WHERE account_id = $accountId AND action = (-2))) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM account_song WHERE account_id = $accountId AND `timestamp` >= DATE_SUB(NOW(), INTERVAL 1 DAY))) \" .\n \"AND (playlist_song.song_id NOT IN (SELECT song_id FROM soundtrack_exclude_song WHERE soundtrack_id = $soundtrackId)) \";\n\n if (count($songIds) > 0)\n {\n $sql .= \"AND (playlist_song.song_id NOT IN (\" . implode(',', $songIds) . \")) \";\n } \n \n $sql .= \"AND playlist_song.status = 0 AND song.status = 0 ORDER BY RAND() LIMIT $weight\";\n \n //echo $sql;\n \n $songRows = mysql_query($sql);\n $songCount = 0;\n\n while ($row = mysql_fetch_array($songRows, MYSQL_ASSOC))\n {\n $songId = intval($row['song_id']);\n $songIds[] = $songId;\n\n $songs[] = $row;\n $songCount++;\n }\n }\n \n // Randomize the songs\n\n shuffle($songs);\n \n // Prepend the start song\n \n if ($startSong)\n {\n array_unshift($songs, $startSong);\n }\n \n // Try to make sure the same artist isn't too close to themselves\n // Some soundtracks don't want this\n\n $separateArtists = true; \n $sql = \"SELECT shuffle FROM soundtrack WHERE soundtrack_id = $soundtrackId\";\n $rows = mysql_query($sql);\n\n if ($row = mysql_fetch_array($rows, MYSQL_ASSOC))\n {\n $separateArtists = intval($row['shuffle']);\n }\n \n if ($separateArtists)\n {\n $songCount = count($songs);\n \n for ($i = 1; $i < ($songCount - 1); $i++)\n {\n $artistA = $songs[$i-1]['artist'];\n $artistB = $songs[$i]['artist'];\n \n if (strcmp(strtolower($artistA), strtolower($artistB)) == 0)\n {\n // Found a match\n // Just swap B with C\n \n $save = $songs[$i];\n $songs[$i] = $songs[$i+1];\n $songs[$i+1] = $save;\n }\n }\n }\n \n // Append to the queue\n \n $sequence = $startingSequence;\n \n foreach ($songs as $song)\n {\n $songId = $song['song_id'];\n $playlistId = $song['playlist_id'];\n \n mysql_query(\"INSERT INTO account_queue (account_id, soundtrack_id, playlist_id, song_id, sequence) VALUES ($accountId, $soundtrackId, $playlistId, $songId, $sequence)\");\n $sequence++;\n }\n \n \n}",
"public function benchLpopInternal()\n {\n $messageList = $this->queue->consume(self::CONSUME_SIZE);\n }",
"function clean_data_set($a1,$position,$trial_count){\n $a2 =array();\n for($i=0;$i<count($a1);$i++){\n if(!($i>=$position && $i<=$position+$trial_count)){\n array_push($a2,$a1[$i]);\n }\n \n }\n return $a2;\n}",
"public function cleanUpOldLog() {\n\t\t$timestamp = Utils::instance()->localToUtc( apply_filters( 'ip_lockout_logs_store_backward', '-' . Settings::instance()->storage_days . ' days' ) );\n\t\tLog_Model::deleteAll( array(\n\t\t\t'date' => array(\n\t\t\t\t'compare' => '<=',\n\t\t\t\t'value' => $timestamp\n\t\t\t),\n\t\t), '0,1000' );\n\t}",
"protected function _cleanClaimedPushes()\n {\n $readAdapter = $this->_getReadAdapter();\n $writeAdapter = $this->_getWriteAdapter();\n\n while (true) {\n $select = $readAdapter->select()\n ->from(\n array('push_queue' => $this->getTable('klarna_kcokred/push_queue'))\n )\n ->joinLeft(\n array('kco_order' => $this->getTable('klarna_kco/order')),\n 'push_queue.klarna_checkout_id = kco_order.klarna_checkout_id'\n )\n ->where('kco_order.is_acknowledged = ?', 1)\n ->limit(100);\n\n $pushQueueIds = $readAdapter->fetchCol($select);\n\n if (!$pushQueueIds) {\n break;\n }\n\n $condition = array('push_queue_id IN (?)' => $pushQueueIds);\n\n $writeAdapter->delete($this->getTable('klarna_kcokred/push_queue'), $condition);\n }\n\n return $this;\n }",
"public function autoPostOpenQueueItems()\n\t{\n\t\t$helper = Mage::helper('fw_queue');\n\t\tif($helper->isQueueEnabled())\n\t\t{\n\t\t\t$start = -microtime(true);\n\t\t\t$collection = Mage::getModel('fw_queue/queue')->getCollection();\n\t\t\t$collection->addFieldToSelect('*');\n\t\t\t$collection->addFieldToFilter('status', array(array('eq' => '1'),array('eq' => '4')));\n\t\t\tforeach($collection as $queue_item){\n\t\t\t\t$queue = Mage::getModel('fw_queue/queue')->load($queue_item->getId());\n\t\t\t\t$queue->process();\n\t\t\t}\n\t\t\t//CLEAN-UP AND STOP ERROR QUEUE ITEMS\n\t\t\t$expired = Mage::getModel('fw_queue/queue')->getCollection();\n\t\t\t$expired->addFieldToSelect('*');\n\t\t\t$expired->addFieldToFilter('status', array(array('eq' => '4')));\n\t\t\t$expired->addFieldToFilter('number_attempts', array(array('gteq' => '75')));\n\t\t\tforeach($expired as $expire_item){\n\t\t\t\t$queue = Mage::getModel('fw_queue/queue')->load($queue_item->getId());\n\t\t\t\t//STATUS_ABORTED_NOTIFIED = 5\n\t\t\t\t$queue->changeStatus('5');\n\t\t\t}\n\n\t\t\t//CLEAN-UP OLD ITEMS\n\t\t\t$date = date('Y-m-d H:i:s', time());\n\t\t\t$queueLastAttemptDate = strtotime ( '-90 day' , strtotime ( $date ) ) ;\n\t\t\t$queueLastAttemptDate = date ( 'Y-m-d H:i:s' , $queueLastAttemptDate );\n\n\t\t\ttry {\n\t\t\t\t$queueItems = Mage::getModel('fw_queue/queue')\n\t\t\t\t->getCollection()\n\t\t\t\t->addFieldToSelect('*')\n\t\t\t\t->addFieldToFilter('last_attempt', array('to' => $queueLastAttemptDate));\n\n\t\t\t\t$queueItems->getSelect()->limit(10000);\n\n\t\t\t\tforeach ($queueItems as $queueItem)\n\t\t\t\t{\n\t\t\t\t\t$queueItem->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e){\n\t\t\t\tMage::logException($e->getMessage());\n\t\t\t}\n\t\t\t$totalTime = microtime(true) + $start;\n\t\t\t$span = gmdate(\"H:i:s\",$totalTime);\n\t\t\t$micro = substr($totalTime - floor($totalTime),2);\n\t\t\t$logLine = \"Queue executed in {$span}.{$micro}\\r\\n\";\n\t\t\tMage::Log($logLine,null,'fw_queue.log');\n\n\t\t\t//Dispatch Event to let fw_orderpublish know when queue is done running\n\t\t\t$eventData = array('queue_complete' => 'true');\n\t\t\tMage::dispatchEvent('fw_queue_run_complete');\n\t\t}\n\n\t}",
"function apc_cache_write_log() {\n\tglobal $ydb;\n\t$updates = 0;\n\t// set up a lock so that another hit doesn't start writing too\n\tif(!apc_add(APC_CACHE_LOG_UPDATE_LOCK, 1, APC_CACHE_LOCK_TIMEOUT)) {\n\t\tapc_cache_debug(\"write_log: Could not lock the log index. Abandoning write\", true);\n\t\treturn $updates;\n\t}\n\tapc_cache_debug(\"write_log: Writing log to database\");\n\n\t$key = APC_CACHE_LOG_INDEX;\n\t$index = apc_fetch($key);\n\tif($index === false) {\n\t\tapc_cache_debug(\"write_log: key $key has disappeared. Abandoning write.\");\n\t\tapc_store(APC_CACHE_LOG_TIMER, time());\n\t\tapc_delete(APC_CACHE_LOG_UPDATE_LOCK);\n\t\treturn $updates;\n\t}\n\t$fetched = 0;\n\t$n = 0;\n\t$loop = true;\n\t$values = array();\n\t\n\t// Retrieve all items and reset the counter\n\twhile($loop) {\n\t\tfor($i = $fetched+1; $i <= $index; $i++) {\n\t\t\t$row = apc_fetch(apc_cache_get_logindex($i));\n\t\t\tif($row === false) {\n\t\t\t\tapc_cache_debug(\"write_log: log entry \" . apc_cache_get_logindex($i) . \" disappeared. Possible data loss!!\", true);\n\t\t\t} else {\n\t\t\t\t$values[] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$fetched = $index;\n\t\t$n++;\n\t\t\n\t\tif(apc_cas($key, $index, 0)) {\n\t\t\t$loop = false;\n\t\t} else {\n\t\t\tusleep(500);\n\t\t\t$index = apc_fetch($key);\n\t\t}\n\t}\n\tapc_cache_debug(\"write_log: $fetched log entries retrieved; index reset after $n tries\");\n\t// Insert all log message - we're assuming input filtering happened earlier\n\t$query = \"\";\n\n\tforeach($values as $value) {\n\t\tif(!is_array($value)) {\n\t\t apc_cache_debug(\"write_log: log row is not an array. Skipping\");\n\t\t continue;\n\t\t}\n\t\tif(strlen($query)) {\n\t\t\t$query .= \",\";\n\t\t}\n\t\t$row = \"('\" . \n\t\t\t$value[0] . \"', '\" . \n\t\t\t$value[1] . \"', '\" . \n\t\t\t$value[2] . \"', '\" . \n\t\t\t$value[3] . \"', '\" . \n\t\t\t$value[4] . \"', '\" . \n\t\t\t$value[5] . \"')\";\n\t\tapc_cache_debug(\"write_log: row: $row\");\n\t\t$query .= $row;\n\t\t$updates++;\n\t}\n\t$ydb->query( \"INSERT INTO `\" . YOURLS_DB_TABLE_LOG . \"` \n\t\t\t\t(click_time, shorturl, referrer, user_agent, ip_address, country_code)\n\t\t\t\tVALUES \" . $query);\n\tapc_store(APC_CACHE_LOG_TIMER, time());\n\tapc_delete(APC_CACHE_LOG_UPDATE_LOCK);\n\tapc_cache_debug(\"write_log: Added $updates entries to log\");\n\treturn $updates;\n\n}",
"public function deleteQueue();",
"protected function cleanHistory()\n {\n $createdAt = new \\DateTime();\n $logs = $this->instance->getLogs();\n foreach($logs as $log) {\n if(($createdAt->getTimestamp() - $log->getCreatedAt()->getTimestamp()) > $this->expiredTimestamp) {\n $this->instance->removeLog($log);\n }\n }\n }",
"function cleanDBonMarkDeleted() {\n\n if ((isset($this->input['_no_history']) && $this->input['_no_history'])\n || (!static::$logs_for_item_1\n && !static::$logs_for_item_2)) {\n return;\n }\n\n if ($this->useDeletedToLockIfDynamic()\n && $this->isDynamic()) {\n $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1);\n $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2);\n\n if (($item1 !== false)\n && ($item2 !== false)) {\n if ($item1->dohistory\n && static::$logs_for_item_1) {\n $changes[0] = '0';\n $changes[1] = addslashes($this->getHistoryNameForItem1($item2, 'lock'));\n $changes[2] = \"\";\n\n Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(),\n static::$log_history_1_lock);\n }\n\n if ($item2->dohistory\n && static::$logs_for_item_2) {\n $changes[0] = '0';\n $changes[1] = addslashes($this->getHistoryNameForItem2($item1, 'lock'));\n $changes[2] = \"\";\n Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(),\n static::$log_history_2_lock);\n }\n }\n\n }\n }",
"public function flushlogs()\n\t{\n\t\t$this->deleteAll(array('1 = 1'));\n\t}",
"protected function updateHistory() {\n self::$history[] = time();\n\n if ( 30 === count( self::$history ) ) {\n if ( reset( self::$history ) >= (time() - 30) ) {\n sleep( 2 );\n }\n\n array_shift( self::$history );\n }\n }",
"function insert_log( $log_data = array() ) {\n\t\n\t\t/* Get Log From Rule ID */\t\t\n\t\t$logs_array = Inbound_Logging_Automation::get_logs( $log_data['rule_id'] );\n\t\t\n\t\t/* Push log to front of array */\n\t\t$logs_array[] = $log_data;\n\t\t\n\t\t/* Trim logs array to X entries */\n\t\tif ( count($logs_array) > self::$log_limit ) {\n\t\t\t$trim = count($logs_array) - self::$log_limit;\n\t\t\t$logs_array = array_slice($logs_array, $trim);\n\t\t}\n\t\t\n\t\t/* Update logs meta */\n\t\tupdate_post_meta( $log_data['rule_id'] , '_automation_logs' , json_encode($logs_array) );\n\n\t}"
]
| [
"0.6110949",
"0.5961492",
"0.50874597",
"0.49682108",
"0.49598435",
"0.49430254",
"0.49205628",
"0.47151068",
"0.4712714",
"0.47123906",
"0.47057217",
"0.46693307",
"0.4647618",
"0.4619267",
"0.46137637",
"0.46044245",
"0.45768133",
"0.45693743",
"0.45657006",
"0.45527217",
"0.45475635",
"0.4532784",
"0.45127833",
"0.45089743",
"0.44883355",
"0.4480783",
"0.44806",
"0.44679716",
"0.439793",
"0.43920556"
]
| 0.6718232 | 0 |
Prints all checkLogQ messages to the console | function printCheckLogQ(){
global $checkLogQ;
foreach($checkLogQ as $message){
print($message);
}
$checkLogQ = array(); // reset a variable to an empty array
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function printErrorLog() {}",
"public static function print_log() {\n $line_break = PHP_SAPI != \"cli\" ? \"<hr/>\" : PHP_EOL; //If not cmd. EOL is a cross platform new line\n //generate a string and output\n foreach (self::$log_message as &$log) {\n $log = \"* \".$log;\n echo $log . $line_break;\n }\n //Create header with timestamp\n self::construct_header();\n array_unshift(self::$log_message,PHP_EOL);\n //Write and display\n self::write_to_file();\n self::clear_log();\n }",
"public function print_log() {\r\n if ($this->logger) {\r\n $this->logger->print_log();\r\n }\r\n }",
"protected function printLogMgm() {}",
"public function actionCheck()\n {\n $version = $this->module->version;\n $this->stdout(\"\\nPodium mail queue check v{$version}\\n\");\n $this->stdout(\"------------------------------\\n\");\n $this->stdout(\" EMAILS | COUNT\\n\");\n $this->stdout(\"------------------------------\\n\");\n \n $pending = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_PENDING])->count();\n $sent = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_SENT])->count();\n $gaveup = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_GAVEUP])->count();\n \n $showPending = $this->ansiFormat($pending, Console::FG_YELLOW);\n $showSent = $this->ansiFormat($sent, Console::FG_GREEN);\n $showGaveup = $this->ansiFormat($gaveup, Console::FG_RED);\n \n $this->stdout(\" pending | $showPending\\n\");\n $this->stdout(\" sent | $showSent\\n\");\n $this->stdout(\" stucked | $showGaveup\\n\");\n $this->stdout(\"------------------------------\\n\\n\");\n }",
"public function logs()\n {\n $this->_display('logs');\n }",
"public function printResults() {\n $assertions = $this->getAssertions();\n $failures = $this->getFailures();\n $errors = $this->getErrors();\n return \"Assertions: \" . $assertions . \", Failures: \" . $failures . \" and \" . $errors . \" errors.\";\n }",
"public function printTSlog() {}",
"public function printTSlog() {}",
"public function exec()\n {\n $report = $this->getReport();\n $this->msg = CheckMessage::report($report);\n }",
"function scaffold_log() {\n\t$args = func_get_args();\n\tforeach ($args as $arg) {\n\t\t$msg = print_r($arg, true);\n\t\terror_log($msg);\n\t}\n}",
"protected function _showFinalMessages()\n {\n if ($this->_errors) {\n $this->_output->writeln(\n \"<fg=red>There was some errors on setting configuration: \\n{$this->_errors}</fg=red>\"\n );\n }\n\n if ($this->_warnings) {\n $this->_output->writeln(\n \"<comment>There was some warnings on setting configuration: \\n{$this->_warnings}</comment>\"\n );\n }\n\n if ($this->_configurationCounter > 0) {\n $this->_output->writeln(\n \"<info>Configuration has been applied</info>\"\n );\n\n $this->_output->writeln(\n \"<info>Total changed configurations: {$this->_configurationCounter}</info>\"\n );\n } else {\n $this->_output->writeln(\n \"<error>There was no configuration applied.</error>\"\n );\n }\n }",
"public function printSuccessMessage()\n {\n printf('Successfully checked %d lines in %d files :)'. PHP_EOL, $this->lines, $this->files);\n }",
"function addCheckLog($message){\n global $checkLogQ;\n $length = 4;\n // If checkLogQ size is smaller than 4 add the message\n if(count($checkLogQ)<$length){\n $checkLogQ[] = $message;\n }\n // If checkLogQ size is bigger than 4 - Remove the oldest message and add the new one\n else{\n array_shift($checkLogQ);\n $checkLogQ[] = $message;\n }\n }",
"function getMessagesPrint(){\r\n foreach ($this->messages as $key => $value) {\r\n echo $this->messagePrefixForPrint.$value.\"<br>\\n\";\r\n }\r\n }",
"public function logResults() {\n\t\tforeach ( $this->records as $outcome) {\n\t\t\t$this->log($outcome);\n\t\t}\n\t}",
"public static function logging()\n {\n }",
"public function logResult() : void\n {\n $log = implode(' ', $this->logArray);\n $logger = new Logger('Results');\n $logger->pushHandler(new StreamHandler('file.log', Logger::DEBUG));\n $logger->addInfo($log);\n }",
"public function displayLogs() {\n global $mwAdminDB; // db connection \n\n return ($mwAdminDB->displayLogs());\n }",
"public static function log($msg, $nl = true) {\n\n if (!defined('CHECKOUT_DEBUG')) return;\n\n echo $msg . ($nl ? self::interfaceBr() : '');\n }",
"public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }",
"public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }",
"public function writeMessages()\n {\n /**\n * Messages so far have their own PHP_EOL at the end of them,\n * so I don't implode them using PHP_EOL.\n *\n */\n echo implode(\"\", $this->messages);\n }",
"protected\n function console_log( array $logs )\n {\n if ( count($logs) == 0 ) {\n return;\n }\n $lines = array();\n foreach ($logs as $data) {\n $json = json_encode((is_array($data) || is_object($data))\n ? $data\n : trim($data));\n $lines[] = \"window.console.log($json);\";\n }\n $lines = implode('', $lines);\n $output = \"<script>if(window.console){if(window.console.log){$lines}}</script>\";\n echo $output;\n }",
"function console() {\n\n\t\t$args = func_get_args();\n\t\t$message = '[' . date('m/d,H:i:s') . '] ' . call_user_func_array('formatText', $args) . CRLF;\n\t\techo $message;\n\t\tdoLog($message);\n\t\tflush();\n\t}",
"function console() {\n\t\t$args = func_get_args();\n\t\t$message = '['.date('m/d,H:i:s').'] '.call_user_func_array('formatText', $args) . CRLF;\n\t\techo $message;\n\t\t//doLog($message);\n\t\tflush();\n\t}",
"public static function getQueryLog()\n {\n }",
"public function printLogMessages($bPrintLogMessages = false)\n\t{\n\t\t$this->bPrintLogMessages = $bPrintLogMessages;\n\t}",
"public function logs() {\n\t\t$this->out('Deleting logs:');\n\t\tif (!empty($this->args)) {\n\t\t\tforeach ($this->args as $arg) {\n\t\t\t\tif (!is_dir(LOGS . $arg)) {\n\t\t\t\t\t$this->err('No log dir \\'' . $arg . '\\'');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->out('\\'' . $arg . '\\' emptied');\n\t\t\t\t$this->_empty(LOGS . $arg);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_empty(LOGS);\n\t\t\t$this->out('All log files deleted');\n\t\t}\n\t}",
"static public function logAll()\r\n\t{\r\n\t\t$db = false; $origin = __CLASS__.'::'.__FUNCTION__;\r\n\t\t$lines = func_get_args();\r\n\t\tif ($db) {\r\n\t\t\tvar_dump($origin, 'LINES', $lines, 'COUNT', count($lines) );\r\n\t\t}\r\n\t\tif (1 > count($lines) ) { // aucun argument !\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$tab = array();\r\n\t\t$last = count($lines)-1;\r\n\r\n\t\t$priorities = self::getPriorities();\r\n\t\t// var_dump('prio', $lines[$last]);\r\n\t\t$p = NULL; $priority = $lines[$last];\r\n\t\tif (self::isValidPriority($priority) ) {\r\n\t\t\t$p = $lines[$last];\r\n\t\t\tunset($lines[$last]);\r\n\t\t}\r\n\t\tforeach ($lines AS $v) {\r\n\t\t\tself::log($v, $p);\r\n\t\t}\r\n\t}"
]
| [
"0.6091366",
"0.60109645",
"0.59499514",
"0.5746436",
"0.5738425",
"0.55802876",
"0.5545277",
"0.55278695",
"0.55278695",
"0.5514166",
"0.54529333",
"0.539734",
"0.537468",
"0.5358286",
"0.53445065",
"0.53417164",
"0.53377724",
"0.5329484",
"0.5307096",
"0.5286817",
"0.5262608",
"0.52578264",
"0.52550375",
"0.5236914",
"0.52303356",
"0.5230028",
"0.52105504",
"0.5173236",
"0.51538706",
"0.5152276"
]
| 0.76650935 | 0 |
we want to mark migrated classes ,In order not to be migrate again this helper function write in migrated.json file. | public function setMigrationAsMigrated($migrationClassName): void
{
if ( ! file_exists($this->_dir)) {
$this->createFile();
}
$migrated = $this->getFileContent();
$migrated[$migrationClassName] = true;
$migrated = json_encode($migrated);
file_put_contents($this->_dir, $migrated);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function migrateUp($class)\n {\n if ($class === self::BASE_MIGRATION) {\n return true;\n }\n\n $this->stdout(\"*** applying $class\\n\", Console::FG_YELLOW);\n $start = microtime(true);\n $migration = parent::createMigration($class);\n if ($migration->up() !== false) {\n $time = microtime(true) - $start;\n $this->stdout(\"*** applied $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_GREEN);\n\n return true;\n } else {\n $time = microtime(true) - $start;\n $this->stdout(\"*** failed to apply $class (time: \" . sprintf('%.3f', $time) . \"s)\\n\\n\", Console::FG_RED);\n\n return false;\n }\n }",
"private function createNewMigration() {\n // $this->MigrationFieldCollection[$this->getModel()->getShortModelName()];\n $changes = []; //these fields are added or updated if the fieldnames is not in this array delete it.\n foreach ($this->getModel()->getFieldCollection() as $fieldName => $field) {\n //var_dump($this->checkFieldProperties($field)); --mark if the fieldsproperties are default or not\n $this->checkFieldProperties($field);\n var_dump($field);\n\n if (!empty($this->MigrationFieldCollection[$this->getModel()->getShortModelName()][$fieldName])) {\n $reflection = new \\ReflectionObject($field);\n $changes = [];\n $this->checkFieldProperties($field);\n\n foreach ($reflection->getProperties() as $fieldValues) {\n\n }\n //we want to update this field\n } else {\n\n //copy this field since we create\n }\n }\n foreach ($this->MigrationFieldCollection[$this->getModel()->getShortModelName()] as $migrationFieldName => $migrationField) {\n if (!in_array($migrationFieldName, $changes)) {\n $this->newMigrationLines[] = $this->modelFieldToMigrationString($migrationField['dataStructure'], 'delete');\n }\n }\n }",
"public function isMigratingUp();",
"public function migrate()\n\t{\n\t}",
"public function editableClasses()\n\t{\n\t\t//return array(\"Rgs\\CatalogModule\\Entity\\Article\");\n\t\t//return array(\"Article\");\n\t}",
"public static function migrate($theme_json)\n {\n }",
"protected function silentCacheFrameworkTableSchemaMigration() {}",
"public function migrate() {}",
"public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }",
"public function supportsMigrations();",
"function migrate()\r\n\t{\r\n\t\treturn '';\r\n\t}",
"public static function createMigration($generation){\n\n $dir = database_path().\"/migrations/\";\n $dir_entities = app_path().\"/\".$generation['head']['directory'];\n\n if (!file_exists($dir)){\n mkdir($dir, 0777, true);\n }\n \n if ($generation){\n \n $function = new Functions();\n $migration = new Migration();\n $sequence = 10;\n foreach($generation['schema']['class'] as $value){\n \n $nameFile = $value->table[\"name\"];\n \n $fullname = (@$generation['head']['namemodel'] == \"Y\") ? \"Y\" : \"N\";\n $nameClass = $function->getNameClass($nameFile,$fullname);\n \n if (!$function->fileExistsContent($dir, \"_create_\".strtolower($nameFile).\"_table\")){\n \n $str = \"\";\n $str .= \"<?php\\n\\n\";\n $str .= self::getHead();\n $str .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $str .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n\n if (str_contains($nameFile, \"_\")){\n $class_name = explode(\"_\",$nameFile);\n $nameClass = $function->getNameClassFirstUpperCase($class_name[0]).$function->getNameClassFirstUpperCase($class_name[1]);\n }\n \n $str .= \"class Create\".$function->getNameClassFirstUpperCase($nameFile).\"Table extends Migration\\n\";\n $str .= \"{\\n\";\n $str .= \"\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t* Run the migrations.\\n\";\n $str .= \"\\t*\\n\";\n $str .= \"\\t* @return void\\n\";\n $str .= \"\\t*/\\n\";\n $str .= \"\\tpublic function up()\\n\";\n $str .= \"\\t{\\n\";\n \n if (@$generation['head']['addcon'] == \"Y\"){\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n }\n $tmField = sizeof($value->table[\"fields\"]);\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n \n $addField = true;\n if (@sizeof($value->table[\"foreign\"]) > 0){\n foreach ($value->table[\"foreign\"] as $vl){\n if ($field->name == $vl->foreign){\n $addField = false;\n break;\n }\n unset($vl);\n }\n }\n if ($addField){\n $str .= \"\\t\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $str .= $migration->getMigrationForeign($chave);\n unset($chave);\n }\n }\n \n $str .= \"\\t\\t\\t\\t\\$table->timestamps();\\n\";\n }\n $str .= \"\\t\\t\\t});\\n\";\n $str .= \"\\t}\\n\";\n \n $str .= \"\\t\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t * Reverse the migrations.\\n\";\n $str .= \"\\t *\\n\";\n $str .= \"\\t * @return void\\n\";\n $str .= \"\\t */\\n\";\n $str .= \"\\tpublic function down()\\n\";\n $str .= \"\\t{\\n\";\n if ($generation['head']['connection'] != \"\") {\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::drop('\".$nameFile.\"');\\n\";\n }\n $str .= \"\\t}\\n\";\n \n $str .= \"\\n\\n}\";\n $micro = microtime();\n $micro = str_ireplace(\".\", \"\", $micro);\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_create_\".strtolower($nameFile).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.$file_name)){\n $fp4 = fopen($dir. $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $str);\n fclose($fp4);\n chmod($dir . $file_name,0777);\n }\n unset($value);\n\n } else {\n\n $name_search = $dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\";\n if (file_exists($name_search)){\n\n $nameclass_alter = date('Y').date('m').date('d').date('Hmisu');\n\n $strFileMigration = \"\";\n $strFileMigration .= \"<?php\\n\";\n $strFileMigration .= self::getHead();\n $strFileMigration .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $strFileMigration .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n $strFileMigration .= \"use Illuminate\\Support\\Facades\\Schema;\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"class AddField\".$nameclass_alter.$nameClass.\"Table extends Migration\\n\";\n $strFileMigration .= \"{\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"\\tpublic function up()\\n\";\n $strFileMigration .= \"\\t{\\n\";\n $strFileMigration .= \"\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->table('\".$nameFile.\"', function (\\$table) {\\n\";\n } else {\n $strFileMigration .= \"\\t\\tSchema::table('\".$nameFile.\"', function (\\$table) {\\n\";\n }\n\n $ponteiro = fopen ($dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\",\"r\");\n $stream = \"\";\n while (!feof ($ponteiro)) {\n $stream .= fgets($ponteiro,4096);\n }\n fclose ($ponteiro); \n\n $tmField = sizeof($value->table[\"fields\"]);\n $criaMigration = false;\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n $addField = false;\n if ($field->name != \"id\"){\n $one_search = \"'\".$field->name.\"'\";\n //$sec_search = \"'\".$field->name.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n //$find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false)) { //} && ($find2 == false)){\n $addField = true;\n }\n if ($addField){\n $criaMigration = true;\n $strFileMigration .= \"\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $one_search = \"'\".$chave->foreign.\"',\";\n $sec_search = \",'\".$chave->foreign.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n $find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false) && ($find2 == false)){\n $strFileMigration .= $migration->getMigrationForeign($chave);\n }\n unset($chave);\n }\n }\n } \n\n $strFileMigration .= \"\\t\\t});\\n\";\n $strFileMigration .= \"\\t}\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\tpublic function down(){Schema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');}\\n\";\n } else {\n $strFileMigration .= \"\\tpublic function down(){Schema::drop('\".$nameFile.\"');}\\n\";\n }\n \n $strFileMigration .= \"\\t}\\n\";\n\n if ($criaMigration){\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_addField\".$nameclass_alter.strtolower($nameClass).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.\"/\".$file_name)){\n $fp4 = fopen($dir. \"/\" . $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $strFileMigration);\n fclose($fp4);\n chmod($dir. \"/\" . $file_name,0777);\n }\n }\n\n }\n\n }\n \n\n }\n \n }\n\n\n }",
"protected function provideTableClassNameMap(): void\n {\n $list = $this->tempMerge('tca.meta.classNameMap', 'tca.classNameMap');\n if (is_array($list)) {\n NamingUtil::$tcaTableClassNameMap = array_merge(NamingUtil::$tcaTableClassNameMap, $list);\n }\n }",
"public function collectMigrations(): array;",
"private function create_migration(){\n $file = $this->path('migrations') . date('Y_m_d_His') . '_create_slender_table.php';\n $this->write_file($file, static::$migrationCode);\n }",
"protected function migrateLegacyImportRecords() {}",
"public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}",
"public function addClass($name, $admin_id){\n\t\t\t$sql = \"INSERT INTO clazz (id, name, admin_id, created_at) VALUES (NULL, '$name', '$admin_id', NULL)\";\n\t\t\t$this->connection()->exec($sql);\n\t\t\treturn true;\n\t\t}",
"public function getMigrationClass()\n {\n return $this->migrationClass;\n }",
"private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }",
"public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }",
"public function generateAction():void{\n new Migration();\n }",
"public function testInvalidMigrationClass(): void\n {\n // This test is designed to test/cover specific implementation rather than functionality and\n // needed to simulate very specific situation.\n\n /** @var Mock $inOut */\n $inOut = Mockery::mock(IoInterface::class);\n $inOut->shouldReceive('writeWarning')->once()->withAnyArgs()->andReturnSelf();\n\n /** @var IoInterface $inOut */\n\n $runner = Mockery::mock(BaseMigrationRunner::class);\n $runner->makePartial();\n\n $container = $this->createContainer();\n\n $method = new ReflectionMethod(BaseMigrationRunner::class, 'setIO');\n $method->setAccessible(true);\n $method->invoke($runner, $inOut);\n\n $method = new ReflectionMethod(BaseMigrationRunner::class, 'createMigration');\n $method->setAccessible(true);\n $nullMigration = $method->invoke($runner, 'non-existing-class', $container);\n\n $this->assertNull($nullMigration);\n }",
"public function createMigrationsTable(): void;",
"function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }",
"public function getMigrations()\n {\n return [\n CreateKeyPairTable::class,\n ];\n }",
"public function migrate() : void {\r\n\t\t\t$currentSettings = new ConfigContainer();\r\n\r\n\t\t\tif (file_exists($this->settingsFile)) {\r\n\t\t\t\t$currentSettings = new ConfigContainer(file_get_contents($this->settingsFile));\r\n\t\t\t}\r\n\r\n\t\t\tif (!$currentSettings->has('configVersion')) {\r\n\t\t\t\t$currentSettings->set('configVersion', 0, FieldTypes::INTEGER);\r\n\t\t\t}\r\n\r\n\t\t\t$filesToApply = array();\r\n\t\t\t$currentVersion = $currentSettings->get('configVersion');\r\n\r\n\t\t\tforeach ($this->files as $file) {\r\n\t\t\t\tif ($file->origVersion >= $currentVersion) {\r\n\t\t\t\t\t$filesToApply[] = $file;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($filesToApply as $file) {\r\n\t\t\t\tforeach ($file->actions as $action) {\r\n\t\t\t\t\tswitch ($action->operator->getValue()) {\r\n\t\t\t\t\t\tcase MigrationOperators::ADD:\r\n\t\t\t\t\t\t\tif (!$currentSettings->has($action->field)) {\r\n\t\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value, $action->type->getValue());\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::CHANGE:\r\n\t\t\t\t\t\t\t$currentSettings->set($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::REMOVE:\r\n\t\t\t\t\t\t\t$currentSettings->remove($action->field);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase MigrationOperators::RENAME:\r\n\t\t\t\t\t\t\t$currentSettings->rename($action->field, $action->value);\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreStart\r\n\t\t\t\t\t\tdefault:\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// @codeCoverageIgnoreEnd\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$currentSettings->set('configVersion', intval($file->destVersion));\r\n\t\t\t}\r\n\r\n\t\t\tfile_put_contents($this->settingsFile, json_encode($currentSettings, JSON_PRETTY_PRINT));\r\n\r\n\t\t\treturn;\r\n\t\t}",
"public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }",
"private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}",
"public function setMigratingUp($isMigratingUp);"
]
| [
"0.55805653",
"0.55301595",
"0.5500356",
"0.54755425",
"0.54607505",
"0.5327683",
"0.53254604",
"0.5309002",
"0.5305589",
"0.528958",
"0.5268564",
"0.52581084",
"0.5254144",
"0.5202",
"0.51881343",
"0.51690793",
"0.5153159",
"0.51367027",
"0.51362866",
"0.5134876",
"0.51163",
"0.5110606",
"0.509118",
"0.50572664",
"0.5045271",
"0.5041823",
"0.50416994",
"0.5037232",
"0.50328463",
"0.50215983"
]
| 0.6055214 | 0 |
Return a list of tabs that will go inside the metabox. | public function metabox_tabs() {
$tabs = array(
'vpn-general' => array(
'label' => 'General',
'icon' => 'dashicons-text',
),
'vpn-scripts' => array(
'label' => 'Scripts',
'icon' => 'dashicons-format-aside',
),
'vpn-promotions' => array(
'label' => 'Promotions',
'icon' => 'dashicons-testimonial',
),
);
return $tabs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function get_tabs() {\n return array(\n 'general' => array(\n 'title' => __( 'General', 'jpid' ),\n 'group' => 'jpid_general_settings'\n ),\n 'delivery' => array(\n 'title' => __( 'Delivery', 'jpid' ),\n 'group' => 'jpid_delivery_settings'\n ),\n 'payment' => array(\n 'title' => __( 'Payment', 'jpid' ),\n 'group' => 'jpid_payment_settings'\n )\n );\n }",
"public function get_tabs() {\n return $this->_tabs;\n }",
"public static function getTabs() {\r\n\t\treturn self::getModulesForUser(Config::$sis_tab_folder);\r\n\t}",
"public function getTabs(): array\n {\n return $this->tabs;\n }",
"private static function options_page_tabs() {\n $tabs = array(\n 'general' => __('Allgemein', 'fau-cris'),\n 'layout' => __('Darstellung', 'fau-cris'),\n 'sync' => __('Synchronisierung', 'fau-cris')\n );\n return $tabs;\n }",
"public function getTabs()\n {\n // so we need to set current handler object for rendering. \n $tabs = static::$tabs;\n foreach ($tabs as $tab) {\n $tab->setHandler($this);\n }\n return $tabs;\n }",
"public function getMyTabs() {\n $aMyTabsByForm = [];\n\n # Build Query to get User Based Columns\n $oTabsSel = new Select(CoreEntityModel::$aEntityTables['user-form-tabs']->getTable());\n $oTabsSel->join(['core_tab'=>'core_form_tab'],'core_tab.Tab_ID = user_form_tab.tab_idfs');\n $oTabsSel->where(['user_idfs'=>$this->getID()]);\n\n # Get My Tabs from Database\n $oMyTabsDB = CoreEntityModel::$aEntityTables['user-form-tabs']->selectWith($oTabsSel);\n\n foreach($oMyTabsDB as $oTab) {\n # Order By Form\n if(!array_key_exists($oTab->form,$aMyTabsByForm)) {\n $aMyTabsByForm[$oTab->form] = [];\n }\n $aMyTabsByForm[$oTab->form][$oTab->Tab_ID] = $oTab;\n }\n\n return $aMyTabsByForm;\n }",
"public function getMyTabs()\n {\n $aMyTabsByForm = [];\n\n # Build Query to get User Based Columns\n $oTabsSel = new Select(CoreEntityModel::$aEntityTables['user-form-tabs']->getTable());\n $oTabsSel->join(['core_tab' => 'core_form_tab'], 'core_tab.Tab_ID = user_form_tab.tab_idfs');\n $oTabsSel->where(['user_idfs' => $this->getID()]);\n\n # Get My Tabs from Database\n $oMyTabsDB = CoreEntityModel::$aEntityTables['user-form-tabs']->selectWith($oTabsSel);\n\n foreach ($oMyTabsDB as $oTab) {\n # Order By Form\n if (! array_key_exists($oTab->form, $aMyTabsByForm)) {\n $aMyTabsByForm[$oTab->form] = [];\n }\n $aMyTabsByForm[$oTab->form][$oTab->Tab_ID] = $oTab;\n }\n\n return $aMyTabsByForm;\n }",
"public static function getAll() {\r\n $result = db_select(\"{md_megamenu_tabs}\", \"mt\")\r\n ->fields(\"mt\")\r\n ->execute()\r\n ->fetchAll(PDO::FETCH_CLASS, \"MDMegaTab\");\r\n\r\n foreach ($result as &$tab) {\r\n if ($tab instanceof stdClass)\r\n $tab = _megamenu_recast(\"MDMegaTab\", $tab);\r\n $tab->initialize();\r\n }\r\n\r\n return $result;\r\n }",
"protected function getTabs()\n {\n return $this->_tabs;\n }",
"public function getTabs()\n\t\t{\n\t\t\treturn $this->_tabs;\n\t\t}",
"public function getMetaboxes()\n\t{\n\t\treturn $this->_metaboxes;\n\t}",
"public function tabs()\r\n\t{\r\n\t\tif(!$this->tabs instanceof \\Zbase\\Models\\Ui\\Tabs)\r\n\t\t{\r\n\t\t\t$className = zbase_model_name('ui.tabs', null, '\\Zbase\\Models\\Ui\\Tabs');\r\n\t\t\t$this->tabs = new $className;\r\n\t\t}\r\n\t\treturn $this->tabs;\r\n\t}",
"public function tabsAction()\n {\n\t\treturn array();\n }",
"protected function get_tabs_for_filter_dialog() {\n\t\treturn array();\n\t}",
"public function getTabPageNames()\n {\n return $this->getChildren()->getTypedControlNames(true, \"TabPage\");\n }",
"protected function _getNavigationTabs()\n {\n return array(\n 'bible' => array(\n 'title' => new XenForo_Phrase('th_bible_bible'),\n 'href' => XenForo_Link::buildPublicLink('bible'),\n 'position' => 'middle',\n 'linksTemplate' => 'th_navigation_tabs_bible'\n )\n );\n }",
"public function get_envira_tab_nav() {\n\n $tabs = array(\n 'images' => __( 'Images', 'envira-gallery' ),\n 'config' => __( 'Config', 'envira-gallery' ),\n 'lightbox' => __( 'Lightbox', 'envira-gallery' ),\n 'mobile' => __( 'Mobile', 'envira-gallery' ),\n );\n $tabs = apply_filters( 'envira_gallery_tab_nav', $tabs );\n\n // \"Misc\" tab is required.\n $tabs['misc'] = __( 'Misc', 'envira-gallery' );\n\n return $tabs;\n\n }",
"private function metabox_style_tabs() {\n $help_sidebar = $this->get_sidebar();\n\n $help_class = '';\n if ( ! $help_sidebar ) :\n $help_class .= ' no-sidebar';\n endif;\n\n // Time to render!\n ?>\n\n <div class=\"tabbed\">\n <div class=\"tabbed-sections\">\n <ul class=\"tr-tabs alignleft\">\n <?php\n $class = ' class=\"active\"';\n $tabs = $this->get_tabs();\n foreach ( $tabs as $tab ) :\n $link_id = \"tab-link-{$tab['id']}\";\n $panel_id = (!empty($tab['url'])) ? $tab['url'] : \"#tab-panel-{$tab['id']}\";\n ?>\n <li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n <a href=\"<?php echo esc_url( \"$panel_id\" ); ?>\">\n <?php echo esc_html( $tab['title'] ); ?>\n </a>\n </li>\n <?php\n $class = '';\n endforeach;\n ?>\n </ul>\n </div>\n\n <?php if ( $help_sidebar ) : ?>\n <div class=\"tabbed-sidebar\">\n <?php echo $help_sidebar; ?>\n </div>\n <?php endif; ?>\n\n <div class=\"tr-sections clearfix\">\n <?php\n $classes = 'tab-section active';\n foreach ( $tabs as $tab ):\n $panel_id = \"tab-panel-{$tab['id']}\";\n ?>\n\n <div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"<?php echo $classes; ?>\">\n <?php\n // Print tab content.\n echo $tab['content'];\n\n // If it exists, fire tab callback.\n if ( ! empty( $tab['callback'] ) )\n call_user_func_array( $tab['callback'], array( $this, $tab ) );\n ?>\n </div>\n <?php\n $classes = 'tab-section';\n endforeach;\n ?>\n </div>\n </div>\n <?php\n }",
"public static function getAllPortalTabs()\n {\n\n $tabs = array('Home');\n\n $browser = new SugarPortalBrowser();\n $browser->loadModules();\n foreach ($browser->modules as $moduleName => $sugarPortalModule) {\n if (!empty($sugarPortalModule->views['list.php'])) {\n $tabs[] = $moduleName;\n }\n }\n\n return $tabs;\n }",
"public function metaboxes()\n\t{\n\t\t$this->admin()->metaboxes();\n\t}",
"public function get_settings_tabs() {\n\t\t// Sort by order, where higher number means earlier output.\n\t\tusort(\n\t\t\t$this->arr_settings_tabs,\n\t\t\tfunction( $a, $b ) {\n\t\t\t\t$a_order = $a['order'] ?? 0;\n\t\t\t\t$b_order = $b['order'] ?? 0;\n\t\t\t\treturn $b_order <=> $a_order;\n\t\t\t}\n\t\t);\n\n\t\treturn $this->arr_settings_tabs;\n\t}",
"abstract protected function tabs();",
"protected function getTabOptions() {\n $options = [\n 'members' => $this->t('Members'),\n 'admins' => $this->t('Administrators'),\n ];\n if (($this->currentUser->hasPermission('manage circle spaces') &&\n $this->moduleHandler->moduleExists('living_spaces_circles')) ||\n $this->moduleHandler->moduleExists('living_spaces_subgroup')\n ) {\n $options['inherit'] = $this->t('Inherited');\n }\n return $options;\n }",
"public function get_help_tabs()\n {\n }",
"public static function getPortalTabs()\n {\n $modules = array();\n $administration = BeanFactory::newBean('Administration');\n // TODO: Refactor this to use the method provided to select `portal`\n // settings.\n $q = \"SELECT value FROM config WHERE category='MySettings' AND name = 'tab' AND platform = 'portal'\";\n $row = $administration->db->query($q);\n $MySettings_tab = $administration->db->fetchByAssoc($row, false);\n if (!empty($MySettings_tab['value'])) {\n $modules = json_decode($MySettings_tab['value']);\n } else {\n $modules = self::getAllPortalTabs();\n self::setPortalTabs($modules);\n }\n\n return $modules;\n }",
"public function metabox(){\n\t\tif ($this->options('use_metabox')){\n\t\t\treturn array(\n\t\t\t\t'id' => $this->options('name').'_metabox',\n\t\t\t\t'title' => __($this->options('singular_name').' Fields'),\n\t\t\t\t'page' => $this->options('name'),\n\t\t\t\t'context' => 'normal',\n\t\t\t\t'priority' => 'high',\n\t\t\t\t'fields' => $this->fields(),\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}",
"function getTabs($action) \n { \n if (isset($this->m_results[\"getTabs\"])) \n return $this->m_results[\"getTabs\"]; \n return parent::getTabs($action);\n }",
"public function menu_local_tabs()\n {\n return menu_local_tabs();\n }",
"public function getBoxes()\n\t{\n\t\t$boxes = array();\n\t\tforeach($this->getData() as $data){\n\t\t\tif($this->idAllowed($data['id'])){\n\t\t\t\t$boxes[] = array(\n\t\t\t\t\t'class' => sprintf('Webwijs\\Admin\\Metabox\\%s', $data['type']), \n\t\t\t\t\t'settings' => array('id' => $this->getMetaboxId($data['id']), 'title' => $data['title'])\n\t\t\t\t);\t\n\t\t\t}\n\t\t};\n\t\treturn $boxes;\n\t}"
]
| [
"0.7050983",
"0.7008031",
"0.690626",
"0.6795968",
"0.674689",
"0.67398816",
"0.6668108",
"0.6623027",
"0.65878767",
"0.65535724",
"0.65348864",
"0.6534217",
"0.6385173",
"0.63541055",
"0.632926",
"0.62576264",
"0.6234833",
"0.6197593",
"0.61965984",
"0.61478937",
"0.61330837",
"0.6103112",
"0.60866266",
"0.5984418",
"0.59585977",
"0.59401834",
"0.58926594",
"0.5867581",
"0.5863615",
"0.5830513"
]
| 0.80395633 | 0 |
Return an array that combines all fields that will go on all tabs. | public function all_fields() {
$general_fields = $this->general_fields();
$promo_fields = $this->promotional_fields();
$script_fields = $this->scripts_fields();
$all_fields = array_merge( $general_fields, $promo_fields, $script_fields );
return $all_fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _getFields()\n {\n return array(\n 'xf_tab_name' => array(\n 'tab_name_id' => array(\n 'type' => self::TYPE_UINT,\n 'autoIncrement' => true\n ), /* END 'tab_name_id' */\n 'display_order' => array(\n 'type' => self::TYPE_UINT,\n 'default' => 0\n ), /* END 'display_order' */\n )\n );\n }",
"public function getMyTabs() {\n $aMyTabsByForm = [];\n\n # Build Query to get User Based Columns\n $oTabsSel = new Select(CoreEntityModel::$aEntityTables['user-form-tabs']->getTable());\n $oTabsSel->join(['core_tab'=>'core_form_tab'],'core_tab.Tab_ID = user_form_tab.tab_idfs');\n $oTabsSel->where(['user_idfs'=>$this->getID()]);\n\n # Get My Tabs from Database\n $oMyTabsDB = CoreEntityModel::$aEntityTables['user-form-tabs']->selectWith($oTabsSel);\n\n foreach($oMyTabsDB as $oTab) {\n # Order By Form\n if(!array_key_exists($oTab->form,$aMyTabsByForm)) {\n $aMyTabsByForm[$oTab->form] = [];\n }\n $aMyTabsByForm[$oTab->form][$oTab->Tab_ID] = $oTab;\n }\n\n return $aMyTabsByForm;\n }",
"public function getMyTabs()\n {\n $aMyTabsByForm = [];\n\n # Build Query to get User Based Columns\n $oTabsSel = new Select(CoreEntityModel::$aEntityTables['user-form-tabs']->getTable());\n $oTabsSel->join(['core_tab' => 'core_form_tab'], 'core_tab.Tab_ID = user_form_tab.tab_idfs');\n $oTabsSel->where(['user_idfs' => $this->getID()]);\n\n # Get My Tabs from Database\n $oMyTabsDB = CoreEntityModel::$aEntityTables['user-form-tabs']->selectWith($oTabsSel);\n\n foreach ($oMyTabsDB as $oTab) {\n # Order By Form\n if (! array_key_exists($oTab->form, $aMyTabsByForm)) {\n $aMyTabsByForm[$oTab->form] = [];\n }\n $aMyTabsByForm[$oTab->form][$oTab->Tab_ID] = $oTab;\n }\n\n return $aMyTabsByForm;\n }",
"public function all_fields()\n {\n $allfields = array();\n foreach (array_values($this->CLASS_CONTAINER) as $val){\n $allfields = array_merge($allfields, $this->{$val});\n }\n foreach (array_values($this->singular_fields) as $val){\n if($this->{$val}) {\n $allfields[] = $this->{$val};\n }\n }\n\n return $allfields;\n }",
"private function get_tabs() {\n return array(\n 'general' => array(\n 'title' => __( 'General', 'jpid' ),\n 'group' => 'jpid_general_settings'\n ),\n 'delivery' => array(\n 'title' => __( 'Delivery', 'jpid' ),\n 'group' => 'jpid_delivery_settings'\n ),\n 'payment' => array(\n 'title' => __( 'Payment', 'jpid' ),\n 'group' => 'jpid_payment_settings'\n )\n );\n }",
"function getTableFields(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t $sql = \"SELECT field_name, field_label\n\t\t FROM export_tabs_fields\n\t\t WHERE source_id = '\".$this->penelopeTabID.\"' ORDER BY field_num ; \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$tableFields = array();\n\t\t\t\t$tableFields[] = self::primaryKeyFieldLabel; //always start with the primary key\n\t\t\t\t\n\t\t\t\t$tableFieldsTemp = array();\n\t\t\t\t$tableFieldsTemp[self::primaryKeyField] = self::primaryKeyFieldLabel; //always start with the primary key\n\t\t \n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $tableFields[] = $row[\"field_label\"];\n\t\t\t\t\t $tableFieldsTemp[$row[\"field_name\"]] = $row[\"field_label\"];\n\t\t\t\t}\n\t\t\t\t$this->tableFieldsTemp = $tableFieldsTemp;\n\t\t\t\t$this->tableFields = $tableFields;\n\t\t }\n\t\t else{\n\t\t\t\treturn false;\n\t\t }\n\t\t \n\t }",
"private function get_main_tabs_array() {\n\t\treturn apply_filters(\n\t\t\t'updraftplus_main_tabs',\n\t\t\tarray(\n\t\t\t\t'backups' => __('Backup / Restore', 'updraftplus'),\n\t\t\t\t'migrate' => __('Migrate / Clone', 'updraftplus'),\n\t\t\t\t'settings' => __('Settings', 'updraftplus'),\n\t\t\t\t'expert' => __('Advanced Tools', 'updraftplus'),\n\t\t\t\t'addons' => __('Premium / Extensions', 'updraftplus'),\n\t\t\t)\n\t\t);\n\t}",
"final public function getAllFields()\r\n {\r\n return array($this->_field);\r\n }",
"function acf_get_combined_field_group_settings_tabs() {\n\t$default_field_group_settings_tabs = array(\n\t\t'location_rules' => __( 'Location Rules', 'acf' ),\n\t\t'presentation' => __( 'Presentation', 'acf' ),\n\t\t'group_settings' => __( 'Group Settings', 'acf' ),\n\t);\n\n\t$field_group_settings_tabs = (array) apply_filters( 'acf/field_group/additional_group_settings_tabs', array() );\n\n\t// remove any default tab values from the filter tabs.\n\tforeach ( $field_group_settings_tabs as $key => $tab ) {\n\t\tif ( isset( $default_field_group_settings_tabs[ $key ] ) ) {\n\t\t\tunset( $field_group_settings_tabs[ $key ] );\n\t\t}\n\t}\n\n\t$combined_field_group_settings_tabs = array_merge( $default_field_group_settings_tabs, $field_group_settings_tabs );\n\n\treturn $combined_field_group_settings_tabs;\n}",
"private function getTabsThatUseAssignmentFilters() {\n $result = array();\n\n $assignment_filter_tabs = DB::execute(\"SELECT id, raw_additional_properties FROM \" . TABLE_PREFIX . \"homescreen_tabs WHERE type = 'AssignmentFiltersHomescreenTab'\");\n if($assignment_filter_tabs) {\n foreach($assignment_filter_tabs as $assignment_filter_tab) {\n $tab_properties = $assignment_filter_tab['raw_additional_properties'] ? unserialize($assignment_filter_tab['raw_additional_properties']) : null;\n\n $tab_filter_id = $tab_properties && isset($tab_properties['assignment_filter_id']) && $tab_properties['assignment_filter_id'] ? (integer) $tab_properties['assignment_filter_id'] : 0;\n\n if($tab_filter_id) {\n if(array_key_exists($tab_filter_id, $result)) {\n $result[$tab_filter_id][] = (integer) $assignment_filter_tab['id'];\n } else {\n $result[$tab_filter_id] = array((integer) $assignment_filter_tab['id']);\n } // if\n } // if\n } // foreach\n } // if\n\n return $result;\n }",
"function dw_index_tab_fields($cf)\n{\n global $post;\n $tab_num = get_post_meta($post->ID, 'guidance_tabs', true);\n if (is_numeric($tab_num)) {\n for ($t = 0; $t < $tab_num; $t++) {\n $cf[] = 'guidance_tabs_' . $t . '_tab_title';\n\n $section_num = get_post_meta($post->ID, 'guidance_tabs_'.$t.'_sections', true);\n\n if (is_numeric($section_num)) {\n for ($s = 0; $s < $section_num; $s++) {\n $cf[] = 'guidance_tabs_' . $t . '_sections_' . $s . '_section_title';\n $cf[] = 'guidance_tabs_' . $t . '_sections_' . $s . '_section_html_content';\n }\n }\n\n $links_num = get_post_meta($post->ID, 'guidance_tabs_'.$t.'_links', true);\n\n if (is_numeric($links_num)) {\n for ($l = 0; $l < $links_num; $l++) {\n $cf[] = 'guidance_tabs_' . $t . '_links_' . $l . '_link_title';\n }\n }\n }\n }\n\n return $cf;\n}",
"public function getTabs(): array\n {\n return $this->tabs;\n }",
"private static function options_page_tabs() {\n $tabs = array(\n 'general' => __('Allgemein', 'fau-cris'),\n 'layout' => __('Darstellung', 'fau-cris'),\n 'sync' => __('Synchronisierung', 'fau-cris')\n );\n return $tabs;\n }",
"public function fields(){\n\t\treturn array();\n\t}",
"private function set_fields() {\r\n\r\n\t\t$fields = array();\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_billing' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_shipping' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\t$temp_fields = get_option( 'wc_fields_additional' );\r\n\r\n\t\tif ( $temp_fields !== false ) {\r\n\t\t\t$fields = array_merge( $fields, $temp_fields );\r\n\t\t}\r\n\r\n\t\treturn $fields;\r\n\t}",
"public function getUniqueActiveFields(): array\n {\n return ['field', 'otherfield'];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"public function fields()\n {\n return [];\n }",
"protected function get_tabs_for_filter_dialog() {\n\t\treturn array();\n\t}",
"public function getFields(): array\n {\n $group = [\n 'id' => $this->id,\n 'name' => $this->name,\n 'status' => $this->status,\n 'owner_id' => $this->owner_id,\n 'rejected_at' => $this->rejected_at,\n 'deleted_at' => $this->deleted_at\n ];\n\n if (get_class($this->owner) !== Reference::class) {\n $group['owner'] = $this->owner->getFields();\n }\n\n return $group;\n }",
"public static function getDataHtmlFields(): array\n {\n $data = [];\n\n if ($records = PqrHtmlField::findAllByAttributes([\n 'active' => 1\n ])) {\n foreach ($records as $PqrHtmlField) {\n $data[] = $PqrHtmlField->getDataAttributes();\n }\n }\n\n return $data;\n }",
"public function fields()\n {\n return [ \n ];\n }",
"public function getFields()\n\t{\n\t\treturn [];\n\t}",
"public function getFieldsArray() {\n\t\t\treturn $this->fields_array;\n\t\t}",
"private function getFields()\n {\n return [\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"first_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"text\",\n \"field_name\" => \"last_name\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"happy\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n [\n \"field_type\" => \"select\",\n \"field_name\" => \"character\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => [\n [\"value\" => \"biff\", \"label\" => \"Biff\"],\n [\"value\" => \"marty\", \"label\" => \"Marty\"],\n [\"value\" => \"doc\", \"label\" => \"Doc Brown\"],\n [\"value\" => \"jennifer\", \"label\" => \"Jennifer\"],\n [\"value\" => \"needles\", \"label\" => \"Needles\"],\n ]\n ],\n [\n \"field_type\" => \"checkbox\",\n \"field_name\" => \"kids\",\n \"field_editable\" => rand(0,1000) % 2 === 0 ? true : false,\n \"field_values\" => null,\n ],\n ];\n }",
"public function get_fields()\n {\n return [\n \"isys_catg_shares_list__title\" => \"LC__CMDB__CATG__SHARES__SHARE_NAME\",\n \"object\" => \"LC__POPUP__BROWSER__SELECTED_OBJECT\",\n \"isys_catg_share_access_list__mountpoint\" => \"LC__CMDB__CATG__SHARE_ACCESS__MOUNTPOINT\"\n ];\n }",
"public function getFields() : array\n {\n return get_object_vars($this);\n }"
]
| [
"0.69516116",
"0.6815694",
"0.6688871",
"0.6645328",
"0.6579256",
"0.6473842",
"0.6402275",
"0.63490415",
"0.62971205",
"0.6265576",
"0.6220663",
"0.6211978",
"0.6190917",
"0.61830825",
"0.6142174",
"0.6137402",
"0.6132245",
"0.6132245",
"0.6132245",
"0.6132245",
"0.6132245",
"0.61277026",
"0.6117392",
"0.6081117",
"0.6078286",
"0.6064902",
"0.6061031",
"0.6056961",
"0.60436624",
"0.60368294"
]
| 0.6840257 | 1 |
Creates a form to delete a indicateur entity. | private function createDeleteForm(Indicateur $indicateur) {
return $this->createFormBuilder()
->setAction($this->generateUrl('indicateur_delete', array('id' => $indicateur->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}",
"private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}",
"private function createDeleteForm(Plateformes $plateforme)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administration_plateformes_delete', array('id' => $plateforme->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(Fratura $fratura)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('fratura_delete', array('id' => $fratura->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }",
"private function createDeleteForm(voyageur $voyageur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('voyageur_delete', array('id' => $voyageur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"private function createDeleteForm ( Maileguak $maileguak )\n {\n return $this->createFormBuilder()\n ->setAction( $this->generateUrl( 'maileguak_delete', array ('id' => $maileguak->getId()) ) )\n ->setMethod( 'DELETE' )\n ->getForm();\n }",
"private function createDeleteForm(Nomenclature $nomenclature)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_delete', array('id' => $nomenclature->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Contabilizar $contabilizar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('contabilizar_delete', array('id' => $contabilizar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Personnage $personnage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnage_delete', array('id' => $personnage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Dependencia $dependencium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dependencia_delete', array('id' => $dependencium->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}",
"public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Tipoanuncio $tipoanuncio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoanuncio_delete', array('id' => $tipoanuncio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Acteur $acteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acteur_delete_homepage', array('id' => $acteur->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private\n function createAnnonceeDeleteForm(Annonce $annonce)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('annoncee_delete', array('id' => $annonce->getAnnonceId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Nature $nature)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nature_delete', array('id' => $nature->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Acte $acte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('acte_delete', array('id' => $acte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Estancia $estancium)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estancia_delete', array('id' => $estancium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }"
]
| [
"0.74257165",
"0.7380462",
"0.7135961",
"0.71214646",
"0.70854574",
"0.70659864",
"0.7058775",
"0.70453566",
"0.703772",
"0.6994962",
"0.6994265",
"0.6990275",
"0.6985689",
"0.6983248",
"0.6962638",
"0.6957569",
"0.6957144",
"0.69505435",
"0.6947112",
"0.6944443",
"0.6932215",
"0.6906107",
"0.6887165",
"0.6879681",
"0.68785244",
"0.686696",
"0.6865125",
"0.68620855",
"0.6855595",
"0.6853067"
]
| 0.7885548 | 0 |
The 404 action for the application. | public function action_404()
{
return Response::forge(Presenter::forge('welcome/404'), 404);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionNotfound()\n {\n $this->actionSlug = 'notfound';\n $this->actionParams = [];\n $this->breadcrumbs=[];\n $this->beforeAction();\n $this->breadcrumbs[] = ['title' => 404];\n header(\"HTTP/1.x 404 Not Found\");\n header(\"Status: 404 Not Found\");\n echo $this->render('404');\n exit;\n }",
"public function action_404()\n\t{\n\t\t//return Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}",
"public function action_404()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\n\t}",
"public function action_404()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/404'), 404);\r\n\t}",
"public function action_404()\n\t{\n\t\treturn Response::forge(ViewModel::forge('welcome/404'), 404);\n\t}",
"public function action_404()\n\t{\n\t\t$this->template->title = '404 Not Found';\n\t\t$this->template->header_title = site_title($this->template->title);\n\t\t$this->template->content = View::forge('error/404');\n\t\t$this->response->status = 404;\n\t}",
"public function error404Action() \n {\n return '404 Page not found';\n }",
"protected function do_404() {\n header('HTTP/1.1 404 Not Found');\n \n $actionsPath = $this->config->get_key('paths', 'actions');\n $action = $actionsPath.'/page-not-found.php';\n \n if (file_exists($action)) {\n require($action);\n \n if (class_exists('PageNotFound')) {\n PageNotFound::get_instance($this->options);\n }\n \n exit;\n } else {\n throw new HaploActionNotFoundException('No default 404 action found. Add a file named page-not-found.php to '.$actionsPath.' to suppress this message.');\n }\n }",
"public function indexAction(){\n $this->view->render('404');\n\t}",
"public function error404Action()\n\t{\n\t\t$method = '_notFound' . ENVIRONMENT;\n\n\t\t// Try to call the internal method for the environment\n\t\tif (method_exists($this, $method))\n\t\t{\n\t\t\treturn $this->$method();\n\t\t}\n\n\t\t// If the method for the current environment does not exist\n\t\t// We just output the 404 production view :)\n\t\t$this->setViewFileName('Error/404-production');\n\t}",
"function notfound() {\n\t\t$this->fw->render('404');\n\t}",
"public function action_404(){\n\t\t$this->template->title = 'けんさく';\n\t\t$this->template->content = View::forge('util/404');\n\t\t$this->template->breadcrumb = array(array(\"url\" => \"/util/404\", \"name\" => \"404 Not Found\"));\n\t}",
"public function show404();",
"protected function actionNotFound()\n\t{\n\t\tzf::halt(\"You can't call this function \\\"actionNotFound\\\" directly. You must redefine it in your controller.\");\n\t}",
"public function error404() {\n\t\t$this->render('error400');\n\t}",
"public function NotFound() {\r\n\t\t$this->PrepareController();\r\n\t\t$this->View = 'notfound';\r\n\t\t$this->Render();\r\n }",
"public function action_404() {\n $this->template->content = View :: factory('error/404');\n }",
"public function notFound()\n {\n Controller::getController('PageNotFoundController')->run();\n }",
"public function actionnotfound()\n {\n $this->render('notfound');\n }",
"public function error404()\n {\n $this->whenError();\n $viewData['status'] = 404;\n $viewData['title'] = 'Not Found';\n $viewData['msg'] = 'Sorry but the page you are looking for does not exist, have been removed.';\n\n $this->pageError($viewData);\n }",
"public function routenotfoundAction()\n {\n return $this->createResponse('Route Not Found', 404);\n }",
"private function route_not_found() {\r\n\t\t\t// Also when in debug mode - show comprehensive messages\r\n\t\t\tdie(\"404 Page not found\");\r\n\t\t}",
"public function notfoundAction()\n {\n $this->render('error/notfound');\n }",
"public static function http404() {\n\t\tself::$global['CONTEXT']=$_SERVER['REQUEST_URI'];\n\t\tself::error(\n\t\t\tself::resolve(self::TEXT_NotFound),404,debug_backtrace(FALSE)\n\t\t);\n\t}",
"public function handle_404()\n {\n }",
"function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }",
"public static function _notFound() {\n self::response(false)\n ->status(404)\n ->write(\n '<h1>404 Not Found</h1>'.\n '<h3>The page you have requested could not be found.</h3>'.\n str_repeat(' ', 512)\n )\n ->send();\n }",
"public function notFound() {\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\t$this->render('error/404.twig.html');\n\t\t}",
"public function notFound()\n {\n http_response_code(404);\n error_log('404 page not found: '.$this->getRequest());\n kodexy()->loadView('system/notFound');\n $this->completeRequest();\n }",
"public function actionError()\n\t{\n\t\tif($error = Yii::app()->errorHandler->error)\n\t\t{\n if($error['code']==404)\n\t\t\t$this->render('pages/404');\n else\n $this->redirect('/');\n\t\t}\n\t}"
]
| [
"0.83854896",
"0.8346812",
"0.8331481",
"0.8298381",
"0.8273531",
"0.81195784",
"0.80202264",
"0.79965556",
"0.7932431",
"0.79038256",
"0.7851581",
"0.77753454",
"0.77365446",
"0.772436",
"0.76887536",
"0.76787484",
"0.766104",
"0.7632863",
"0.76249707",
"0.76194775",
"0.7613492",
"0.75731343",
"0.7547283",
"0.7532768",
"0.7516929",
"0.7462328",
"0.7448283",
"0.7420755",
"0.74183637",
"0.74065083"
]
| 0.8368956 | 1 |
Return custom javascript needed to ensure persistency of virtual rule while playing with the preview grid | protected function _getPreviewPersistenceJavascript()
{
$javascript = "";
if ($rule = $this->getRequest()->getParam('rule', false)) {
$jsonRule = Mage::helper("core")->jsonEncode($rule);
$javascript = <<<JAVASCRIPT
if ({$this->getJsObjectName()}.reloadParams == false) {
{$this->getJsObjectName()}.reloadParams = { rule : Object.toJSON({$jsonRule}) };
} else {
{$this->getJsObjectName()}.reloadParams.rule = Object.toJSON({$jsonRule});
}
JAVASCRIPT;
}
return $javascript;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function generateJavascript() {}",
"protected function generateJavascript() {}",
"function getJavascriptFire() {\n\t\treturn \"new SUGAR.forms.SetPanelVisibilityAction('{$this->targetPanel}','{$this->expression}')\";\n\t}",
"protected function generateJavascript()\n\t{\n\t}",
"protected function renderAsJavascript() {}",
"static function getJavascriptClass() {\n\t\treturn <<<'EOQ'\n/**\n * Completely hide or show a panel\n */\nSUGAR.forms.SetPanelVisibilityAction = function(target, expr)\n{\n this.afterRender = true;\n\n if (_.isObject(target)){\n expr = target.value;\n target = target.target;\n }\n //BWC\n if (_.isString(target) && _.isUndefined(SUGAR.App)) {\n var parents = $('#' + target).parents('div');\n if(parents.length) {\n target = parents.attr('id');\n }\n }\n\n this.target = target;\n this.expr = 'cond(' + expr + ', \"\", \"none\")';\n}\n\n\n/**\n * Triggers this dependency to be re-evaluated again.\n */\nSUGAR.util.extend(SUGAR.forms.SetPanelVisibilityAction, SUGAR.forms.AbstractAction, {\n hideChildren: function() {\n if (typeof(SUGAR.forms.SetPanelVisibilityAction.hiddenFields) == \"undefined\")\n {\n this.createFieldBin();\n }\n var target = document.getElementById(this.target);\n var field_table = target.getElementsByTagName('table')[0];\n if (field_table != null) \n {\n field_table.id = this.target + \"_tbl\";\n SUGAR.forms.SetPanelVisibilityAction.hiddenFields.appendChild(field_table);\n }\n },\n \n showChildren: function() {\n var target = document.getElementById(this.target);\n var field_table = document.getElementById(this.target + \"_tbl\");\n if (field_table != null)\n target.appendChild(field_table);\n },\n \n createFieldBin: function() {\n var tmpElem = document.createElement('div');\n tmpElem.id = 'panelHiddenFields';\n tmpElem.style.display = 'none';\n document.body.appendChild(tmpElem);\n SUGAR.forms.SetPanelVisibilityAction.hiddenFields = tmpElem;\n },\n \n /**\n * Triggers the style dependencies.\n */\n exec: function(context)\n {\n if (typeof(context) == 'undefined')\n context = this.context;\n\n if (context.view)\n return this.sidecarExec(context);\n try {\n var visibility = this.evalExpression(this.expr, context);\n var target = document.getElementById(this.target);\n if (target != null) { \n if (target.style.display != 'none')\n SUGAR.forms.animation.sizes[this.target] = target.clientHeight;\n \n if (SUGAR.forms.AssignmentHandler.ANIMATE) {\n if (visibility == 'none' && target.style.display != 'none') {\n SUGAR.forms.animation.Collapse(this.target, this.hideChildren, this);\n return;\n } \n else if (visibility != 'none' && target.style.display == 'none') \n {\n this.showChildren();\n SUGAR.forms.animation.Expand(this.target);\n return;\n }\n }\n \n if (visibility == 'none')\n this.hideChildren();\n else\n this.showChildren();\n target.style.display = visibility;\n }\n } catch (e) {if (console && console.log) console.log(e);}\n },\n sidecarExec : function(context) {\n var hide = (this.evalExpression(this.expr, context) === 'none'),\n tab = context.view.$(\".tab.\" + this.target),\n panel = context.view.$(\"div.record-panel[data-panelname='\" + this.target + \"']\"),\n isActive = tab && tab.hasClass(\"active\");\n\n //If we can't find a tab, just look for a panel\n if (!tab || !tab.length) {\n //Hide/show a panel (No need to worry about the active tab)\n if (panel.length > 0) {\n if (hide) {\n panel.hide();\n } else {\n panel.show();\n }\n this.triggerFieldsVisibility(context, this.target, hide);\n } else {\n //If we got here it means the panel name/id was probably invalid.\n console.log(\"unable to find panel \" + this.target);\n }\n } else {\n //Hide/show tabs\n if (hide) {\n tab.hide();\n //If we are hiding the active tab, show the first visible tab instead.\n if (isActive) {\n var tabs = context.view.$(\"li.tab:visible\");\n if (tabs.length > 0 && context.view.setActiveTab) {\n //setActiveTab currently expects an event. This may change in the future\n context.view.setActiveTab({currentTarget:tabs[0].children[0]});\n context.view.handleActiveTab();\n }\n }\n } else {\n tab.show();\n }\n this.triggerFieldsVisibility(context, this.target, hide);\n }\n\n },\n triggerFieldsVisibility : function(context, target, hide) {\n\n _.each(this.getPanelFieldNames(context, target), function(fieldName) {\n var field = context.view.getField(fieldName);\n if (field && _.isUndefined(field.wasRequired)) {\n field.wasRequired = field.def.required;\n }\n context.setFieldDisabled(fieldName, hide);\n if (field.wasRequired === true)\n context.setFieldRequired(fieldName, !hide);\n\n });\n\n },\n getPanelFieldNames : function(context, panelName) {\n var panel = _.find(context.view.meta.panels, function(panel) {\n return panel.name === panelName;\n });\n\n return _.pluck(panel.fields, 'name');\n }\n});\n\nSUGAR.forms.animation.sizes = { };\n\nSUGAR.forms.animation.Collapse = function(target, callback, scope)\n{\n var t = document.getElementById(target);\n if (t == null) return;\n \n SUGAR.forms.animation.sizes[target] = t.clientHeight;\n t.style.overflow = \"hidden\";\n \n // Create a new ColorAnim instance\n var collapseAnim = new YAHOO.util.Anim(target, { height: { to: 0 } }, 0.5, YAHOO.util.Easing.easeBoth);\n collapseAnim.onComplete.subscribe(function () {\n t.style.display = 'none';\n callback.call(scope);\n });\n collapseAnim.animate();\n};\n\nSUGAR.forms.animation.Expand = function(target)\n{\n var t = document.getElementById(target);\n if (t == null) return;\n \n \n t.style.overflow = \"hidden\";\n t.style.height = \"0px\";\n t.style.display = \"\";\n \n var expandAnim = new YAHOO.util.Anim(target, { height: { to: SUGAR.forms.animation.sizes[target] } },\n 0.5, YAHOO.util.Easing.easeBoth);\n \n expandAnim.onComplete.subscribe(function () {\n t.style.height = 'auto';\n });\n \n expandAnim.animate();\n};\nEOQ;\n\n }",
"public function js_template() {\n\t\t?>\n <script id=\"js-builderius-setting-<?php echo $this->setting_key; ?>-tmpl\" type=\"text/template\">\n <div class=\"uni-modal-row uni-clear uni-uni-modal-row-for-builder\">\n\t\t\t\t<?php echo $this->generate_field_label_html(); ?>\n <div class=\"uni-field-conditional-rules-content-field-wrapper\">\n <div class=\"uni-query-builder-wrapper\">\n <div id=\"cpo-field-rule-builder\" class=\"cpo-query-rule-builder-single\"></div>\n <input class=\"js-uni-fetch-scheme uni-cpo-settings-btn uni-cpo-settings-saved\" type=\"button\"\n value=\"<?php esc_attr_e( 'Fetch the rule', 'uni-cpo' ) ?>\"/>\n </div>\n <input id=\"uni_cpo_field_rule_scheme\" type=\"hidden\" name=\"cpo_fc_scheme\" value=\"{{- data }}\"\n class=\"builderius-setting-field\"/>\n </div>\n </div>\n </script>\n\t\t<?php\n\t}",
"public function getJavaScript() {}",
"function pagecreate()\r\n {\r\n $result = parent::pagecreate();\r\n\r\n $result .= $this->_paintJS();\r\n return $result;\r\n }",
"public function get_form_editor_inline_script_on_page_render() {\n\n\t\t// set the default field label for the simple type field\n\t\t$script = sprintf( \"function SetDefaultValues_simple(field) {field.label = '%s';}\", $this->get_form_editor_field_title() ) . PHP_EOL;\n\n\t\t// initialize the fields custom settings\n\t\t$script .= \"jQuery(document).bind('gform_load_field_settings', function (event, field, form) {\" .\n\t\t \"var inputClass = field.inputClass == undefined ? '' : field.inputClass;\" .\n\t\t \"jQuery('#input_class_setting').val(inputClass);\" .\n\t\t \"});\" . PHP_EOL;\n\n\t\t// saving the simple setting\n\t\t$script .= \"function SetInputClassSetting(value) {SetFieldProperty('inputClass', value);}\" . PHP_EOL;\n\n\t\treturn $script;\n\t}",
"function pagecreate()\r\n {\r\n $result = parent::pagecreate();\r\n $result .= $this->_paintJS();\r\n return $result;\r\n }",
"public function livePreviewMainScript() {\r\n\t\t?>\r\n\t\t<script>\r\n\t\twindow.tf_refresh_css = function() {\r\n\t\t\tif ( typeof localStorage !== 'undefined' ) {\r\n\r\n\t\t\t\t// Using localStorage directly as an object-value dictionary doesn't work in FF, create a new object\r\n\t\t\t\tvar localStorageData = {}, keys = Object.keys( localStorage );\r\n\t\t\t\tfor ( var i in keys ) {\r\n\t\t\t localStorageData[ keys[ i ] ] = localStorage.getItem( keys[ i ] );\r\n\t\t\t }\r\n\r\n\t\t\t\twp.ajax.send( 'tf_generate_customizer_css', {\r\n\t\t\t\t success: function( data ) {\r\n\r\n\t\t\t\t\t\t// Add the modified CSS Titan has generated from the preview values.\r\n\t\t\t\t\t\tvar style = document.querySelector('style#tf_live_preview');\r\n\t\t\t\t\t\tif ( ! style ) {\r\n\t\t\t\t\t\t\tvar style = document.createElement('STYLE');\r\n\t\t\t\t\t\t\tstyle.setAttribute( 'id', 'tf_live_preview' );\r\n\t\t\t\t\t\t\tstyle.innerHTML = data.css;\r\n\t\t\t\t\t\t\tdocument.head.appendChild( style );\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tstyle.innerHTML = data.css;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Render additional Javascript code for handling different data received for\r\n\t\t\t\t\t\t * live previewing\r\n\t\t\t\t\t\t *\r\n\t\t\t\t\t\t * @since 1.9.2\r\n\t\t\t\t\t\t *\r\n\t\t\t\t\t\t * @see $this->ajaxGenerateCustomizerCSS()\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tdo_action( 'tf_generate_customizer_preview_js' );\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t },\r\n\t\t\t\t\tdata: localStorageData\r\n\t\t\t\t });\r\n\r\n\t\t\t}\r\n\t\t};\r\n\t\t</script>\r\n\t\t<?php\r\n\t}",
"private function initJS(){\r\n\t\t$canEdit;\r\n\t\t$context = get_context_instance(CONTEXT_COURSE, $this->courseId);\r\n\t\tif (has_capability('moodle/course:manageactivities', $context)) {\r\n\t\t\t$canEdit = 'true';\r\n\t\t}else{\r\n\t\t\t$canEdit = 'false';\r\n\t\t}\t\t\r\n\t\t$markup='<div id=\"mashup-content\"></div>';\r\n\t\t// call the js handlers\r\n\t\t$markup.='\r\n\t\t<script>\r\n\t\t\t$(function(){ //DOM Ready\r\n\t\t\t\tmashup_properties.canEdit='.$canEdit.';\r\n\t\t\t\tmashup_properties.courseId='.$this->courseId.';\r\n\t\t\t\tMashupEngine.init(mashup_properties);\r\n\t\t\t});\r\n\t\t</script>\r\n\t\t'.PHP_EOL; \r\n\t\t\r\n\t\treturn $markup;\t\t\r\n\t}",
"private function displayJavascript() {\n $this->javascript_is_displayed = TRUE ;\n }",
"public static function getJS()\n {\n $js =\n\"<script>\n\t// Hide or show detail fields of languages\n\tfunction toggleClangDetailsView(clang_id) {\n\t\tif ($(\\\"select[name='form[lang][\\\" + clang_id + \\\"][translation_needs_update]']\\\").val() === 'delete') {\n\t\t\t$('#details_clang_' + clang_id).slideUp();\n\t\t}\n\t\telse {\n\t\t\t$('#details_clang_' + clang_id).slideDown();\n\t\t};\n\t}\n\n\t// slide fieldsets\n\tjQuery(document).ready(function($) {\n\t\t$('legend').click(function(e) {\n\t\t\t$(this).toggleClass('open');\n\t\t\t$(this).next('.panel-body-wrapper.slide').slideToggle();\n\t\t});\n\t});\n\t// Open all fieldsets when save was clicked for being able to focus required fields\n\t$('button[type=submit]').click(function() {\n\t\t$('legend').each(function() {\n\t\t\tif(!$(this).hasClass('open')) {\n\t\t\t\t$(this).addClass('open');\n\t\t\t\t$(this).next('.panel-body-wrapper.slide').slideToggle();\n\t\t\t}\n\t\t});\n\t\treturn true;\n\t});\n</script>\";\n return $js;\n }",
"protected function addJavascriptToBackend() {\n\t\t$this->backendReference->addJavascriptFile(t3lib_extMgm::extRelPath($this->extkey) . 'mod_role/newspaper_role.js');\n\t}",
"public function js()\n {\n }",
"public function admin_js() {\n\t\t\t$js = parent::admin_js();\n\t\t\t$js .= '\n\t\t\t\tcfct_builder.addModuleLoadCallback(\"'.$this->id_base.'\", function() {\n\t\t\t\t\t$(\"input[name='.$this->get_field_name('hero_alignment').']\").click(function() {\n\t\t\t\t\t\t$(\"#'.$this->id_base.'-selected-alignment\").html($(this).val().replace(\"-\", \"/\"));\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t';\n\t\t\treturn $js;\n\t\t}",
"protected function addCustomJS()\n\t{\n\t\t\n\t}",
"private function registerClientScript(){\n// $originalImage = $this->model->{$this->attribute};\n $view = $this->getView();\n $view->registerJs(<<<JS\n {$this->javascriptVariableName} = new ImageCropper({\n cropImageId : '{$this->cropImageId}',\n thumbnailId : '{$this->hiddenInputId}',\n objectVariableName: '{$this->javascriptVariableName}',\n url: '{$this->url}',\n thumbnailPreviewId: '{$this->previewId}',\n notificationAreaId: '{$this->notificationId}',\n cropWidth : {$this->cropWidth},\n cropHeight : {$this->cropHeight}\n });\nJS\n );\n ImageCropperAsset::register($view);\n }",
"public function getValidationRulesJs()\n {\n $rules = $this->Model->validationRulesJS;\n // Hook Filter modifyValidationRulesJS\n $rules = $this->doFilter(\"modifyValidationRulesJS\", $rules);\n return $rules;\n }",
"protected function _getInlineJavaScript()\n {\n return '';\n }",
"public function addJs(){\r\n\t\treturn '<script type=\"text/javascript\" src=\"'.Mage::getBaseUrl('js').'interaktingslider/interaktingslider.js\"></script>';\r\n\r\n\t}",
"public function javascript_validation() {\n return false;\n }",
"public function layoutDesignerJavaScript()\n {\n return 'embedded-designer-javascript';\n }",
"protected function renderJavascript(){\n \n return sprintf(\n '<script type=\"text/javascript\" src=\"%s\"></script>',\n $this->getField('url')\n );\n \n }",
"public function getJavascriptCode() {}",
"function article_js() {\n return Registry::prop('article', 'js');\n}",
"protected function _getEndJs()\n\t{\n\t\t$js = parent::_getEndJs();\n\t\t$js .= \"pageJs.setPreData(\" . json_encode(array()) . \");\";\n\t\t$js .= \"pageJs._containerIds=\" . json_encode(array(\n\t\t\t\t'title' => 'title_div'\n\t\t\t\t,'authorName' => 'authorName_div'\n\t\t\t\t,'author' => 'author_div'\n\t\t\t\t,'content' => 'content_div'\n\t\t\t\t,'topicsUnits' => 'topics_units_div'\n\t\t\t\t,'comments' => 'comments_div'\n\t\t\t\t,'newAnswer' => 'new_answers_btn_div'\n\t\t\t\t,'answers' => 'answers_div'\n\t\t\t\t,'saveBtn' => 'save_btn'\n\t\t)) . \";\";\n\t\t$js .= \"pageJs.load();\";\n\t\t$js .= \"pageJs.bindAllEventNObjects();\";\n\t\tif(!AccessControl::canEditQuestionDetailsPage(Core::getRole()))\n\t\t\t$js .= \"pageJs.readOnlyMode();\";\n\t\treturn $js;\n\t}",
"public function CachingRelatedJavascript()\n {\n if ($this->ProductGroupListAreAjaxified()) {\n Requirements::customScript(\n \"\n if(typeof EcomCartOptions === 'undefined') {\n var EcomCartOptions = {};\n }\n EcomCartOptions.ajaxifyProductList = true;\n EcomCartOptions.ajaxifiedListHolderSelector = '#\" . $this->AjaxDefinitions()->ProductListHolderID() . \"';\n EcomCartOptions.ajaxifiedListAdjusterSelectors = '.\" . $this->AjaxDefinitions()->ProductListAjaxifiedLinkClassName() . \"';\n EcomCartOptions.hiddenPageTitleID = '#\" . $this->AjaxDefinitions()->HiddenPageTitleID() . \"';\n \",\n 'cachingRelatedJavascript_AJAXlist'\n );\n } else {\n Requirements::customScript(\n \"\n if(typeof EcomCartOptions === 'undefined') {\n var EcomCartOptions = {};\n }\n EcomCartOptions.ajaxifyProductList = false;\n \",\n 'cachingRelatedJavascript_AJAXlist'\n );\n }\n $currentOrder = ShoppingCart::current_order();\n if ($currentOrder->TotalItems(true)) {\n $responseClass = EcommerceConfig::get(ShoppingCart::class, 'response_class');\n $obj = new $responseClass();\n $obj->setIncludeHeaders(false);\n $json = $obj->ReturnCartData();\n Requirements::customScript(\n \"\n if(typeof EcomCartOptions === 'undefined') {\n var EcomCartOptions = {};\n }\n EcomCartOptions.initialData= \" . $json . ';\n ',\n 'cachingRelatedJavascript_JSON'\n );\n }\n }"
]
| [
"0.6497548",
"0.64963424",
"0.63479286",
"0.6284777",
"0.60817856",
"0.6036589",
"0.5894851",
"0.5854491",
"0.57311904",
"0.5695847",
"0.56899685",
"0.5689848",
"0.56778765",
"0.5631239",
"0.56055886",
"0.5568557",
"0.5560437",
"0.55327666",
"0.5532317",
"0.5499723",
"0.5489551",
"0.5471285",
"0.5456323",
"0.5445542",
"0.54273796",
"0.54140127",
"0.54043764",
"0.5389188",
"0.5387556",
"0.5383199"
]
| 0.7521728 | 0 |
Prepare the product collection Collection is the matched products for the current query | protected function _prepareCollection()
{
$baseQuery = $this->_getBaseSearchQuery();
$productIds = $this->_getProductIdsFromSearchQuery($baseQuery);
if (empty($productIds)) {
$productIds = array(0);
}
$attributes = Mage::getModel('catalog/config')->getProductCollectionAttributes();
/** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
$collection = Mage::getResourceModel('catalog/product_collection')
->addIdFilter($productIds)
->addAttributeToSelect($attributes);
$storeIds = implode(",", array_unique(array_map("intval", array(Mage_Core_Model_App::ADMIN_STORE_ID, $this->getStoreId()))));
if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {
$collection->setStoreId($this->getStoreId());
$joinCond = "category_id = " . (int) $this->getCategory()->getId() . " AND store_id = {$this->getStoreId()}";
} else {
$joinCond = "category_id = " . (int) $this->getCategory()->getId() . " AND store_id IN ({$storeIds})";
}
$collection->joinField(
'position',
'smile_virtualcategories/category_product_position',
'position',
'product_id = entity_id',
$joinCond,
'left'
);
$collection->getSelect()->order(
new Zend_Db_Expr("- position DESC") // mimic a "SORT BY #field NULL LAST
);
$entityIds = implode(",", $productIds);
$collection->getSelect()->order(
new Zend_Db_Expr("FIELD(e.entity_id, {$entityIds})") // restore sort order given by ES
);
$this->setCollection($collection);
return parent::_prepareCollection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _prepareCollection() {\n $collection = Mage::getModel('vidtest/video')\n ->getCollection()\n ->addProductFilter($this->getProduct()->getId())\n ;\n\n if ($storeId = $this->getProduct()->getStoreId()) {\n $collection->addStoreFilter($storeId);\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection() {\n /**\n * Get the Collection of Manage Subscription\n */\n $manageSubscription = Mage::getModel ( 'airhotels/managesubscriptions' )->getCollection ();\n \n /**\n * Get the Table Prefix Value\n */\n $tablePrefix = Mage::getConfig ()->getTablePrefix ();\n $manageSubscription->getSelect ()->group ( 'main_table.product_id' )->joinLeft ( $tablePrefix . 'apptha_productsubscriptions', 'main_table.product_id =' . $tablePrefix . 'apptha_productsubscriptions.product_id AND ' . $tablePrefix . 'apptha_productsubscriptions.is_delete = 0', array (\n 'main_table.id as id',\n 'main_table.product_name as product_name',\n $tablePrefix . 'apptha_productsubscriptions.subscription_type as subscription_type' \n ) )->where ( 'main_table.is_subscription_only = ?', 1 );\n \n $collection = $manageSubscription;\n $this->setCollection ( $collection );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareCollection ();\n }",
"protected function _prepareCollection()\n {\t\t \n\t\t\n $collection = Mage::getModel('catalog/product')\n \t->getCollection()\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('price')\n \t->addAttributeToSelect('special_price')\n \t->addAttributeToSelect('name')\n \t->addAttributeToSelect('manufacturer')\n \t->addFieldToFilter('type_id', array('in' => array(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL)))\n ->joinField('qty',\n 'cataloginventory/stock_item',\n 'qty',\n 'product_id=entity_id',\n '{{table}}.stock_id=1',\n 'left');\n \t;\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _initProductCollection()\n {\n $client = Mage::helper('catalogsearch')->getEngine()->getClient();\n $baseQuery = $this->_getBaseSearchQuery();\n $optimizedQuery = $this->_getOptimizedQuery($baseQuery);\n $baseProductIds = $this->_getProductIdsFromSearchQuery($baseQuery);\n $optimizeProductIds = $this->_getProductIdsFromSearchQuery($optimizedQuery);\n\n $this->setBaseProductIds($baseProductIds);\n $this->setOptimizedProductIds($optimizeProductIds);\n\n $allIds = array_merge($baseProductIds, $optimizeProductIds);\n\n if (empty($allIds)) {\n $allIds = array(0);\n }\n\n $attributes = Mage::getModel('catalog/config')->getProductCollectionAttributes();\n $collection = Mage::getResourceModel('catalog/product_collection')\n ->setStoreId($this->getStoreId())\n ->addIdFilter($allIds)\n ->addAttributeToSelect($attributes)\n ->load();\n\n $this->setProductCollection($collection);\n\n return $this;\n }",
"protected function _prepareCollection()\n {\n\n\t\t\n\t\t$collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('sku')\n ->addAttributeToSelect('name');\n\t\t\t\n\t\t$collection->addAttributeToSelect('thumbnail');\n\t\t\n\t\t$collection->addAttributeToFilter('image', array('eq' => 'no_selection'));\n \n\t\t//$collection->joinAttribute('image', 'catalog_product/image', 'entity_id', null, 'left');\n\n\t\t$this->setCollection($collection);\n\t\treturn parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n /** @var \\Mage_Catalog_Model_Resource_Product_Attribute_Collection $collection */\n $collection = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addVisibleFilter();\n\n $store = $this->_getStore();\n// $prefix = Mage::getConfig()->getTablePrefix()->__toString();\n// $jobAttributeQuery = 'select a.`version`, a.`attribute_id` from `'.$prefix.'straker_job_attribute` as a\n// left join `'.$prefix.'straker_job` as b on a.`job_id`=b.`id`\n// where b.`store_id` ='.$store->getId().' and a.`version` =1\n// GROUP BY a.`attribute_id`';\n//\n// //join straker job product table to get version for each product\n// $collection->getSelect()->joinLeft(\n//\n// new Zend_Db_Expr('('.$jobAttributeQuery.')'),\n// 'main_table.attribute_id = t.attribute_id',\n// array('version')\n//\n// );\n /** @var StrakerTranslations_EasyTranslationPlatform_Model_Resource_Job_Attribute_Collection $strakerJobProductCollection */\n $strakerJobAttributeCollection = Mage::getModel('strakertranslations_easytranslationplatform/job_attribute')->getCollection();\n $strakerJobAttributeCollection->getSelect()\n ->reset(Zend_Db_Select::COLUMNS)\n ->joinLeft(\n ['b' => $strakerJobAttributeCollection->getTable('strakertranslations_easytranslationplatform/job')],\n '`main_table`.`job_id` = `b`.`id`',\n []\n )->where(\n '`b`.`store_id` = ?', $store->getId()\n )->where(\n '`main_table`.`version` = ?', 1\n )->group(\n 'main_table.attribute_id'\n )->columns(\n ['version' => 'version', 'attribute_id' => 'attribute_id']\n );\n\n $jobAttributeQuery = $strakerJobAttributeCollection->getSelect();\n\n $collection->getSelect()->joinLeft(\n $jobAttributeQuery,\n 'main_table.attribute_id = t.attribute_id',\n array('version')\n );\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('type')\n ->addAttributeToSelect('status')\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('sku');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection() {\r\n $store = $this->_getStore();\r\n $collection = Mage::getModel('catalog/product')->getCollection()\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('attribute_set_id')\r\n ->addAttributeToSelect('type_id');\r\n\r\n if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory')) {\r\n $collection->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');\r\n }\r\n if ($store->getId()) {\r\n $adminStore = Mage_Core_Model_App::ADMIN_STORE_ID;\r\n $collection->addStoreFilter($store);\r\n $collection->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner', $adminStore);\r\n $collection->joinAttribute('custom_name', 'catalog_product/name', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner', $store->getId());\r\n $collection->joinAttribute('price', 'catalog_product/price', 'entity_id', null, 'left', $store->getId());\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n } else {\r\n $collection->addAttributeToSelect('price');\r\n $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');\r\n $collection->joinAttribute('reqcoupon_status', 'catalog_product/reqcoupon_status', 'entity_id', null, 'left');\r\n }\r\n\r\n $this->setCollection($collection);\r\n\r\n parent::_prepareCollection();\r\n $this->getCollection()->addWebsiteNamesToResult();\r\n return $this;\r\n }",
"protected function _prepareCollection() {\r\n $collection = Mage::getResourceModel('zozoconcepts_brands/brand_collection');\r\n if ($this->getProduct()->getId()){\r\n $constraint = 'related.product_id='.$this->getProduct()->getId();\r\n }\r\n else{\r\n $constraint = 'related.product_id=0';\r\n }\r\n $collection->getSelect()->joinLeft(\r\n array('related'=>$collection->getTable('zozoconcepts_brands/brand_product')),\r\n 'related.brand_id=main_table.entity_id AND '.$constraint,\r\n array('position')\r\n );\r\n $this->setCollection($collection);\r\n parent::_prepareCollection();\r\n return $this;\r\n }",
"public function prepareCollection()\n {\n $this->_reset();\n\n $this->addAttributeToSelect('*');\n\n // Select cart items\n $this->joinTable(\n array('qi' => 'sales/quote_item'),\n 'product_id = entity_id',\n array(\n 'product_name' => 'name',\n 'counts' => 'COUNT(1)',\n 'sum_qty' => \"SUM(CASE WHEN qip.product_type IN ('configurable', 'bundle') THEN qip.qty * qi.qty ELSE qi.qty END)\",\n 'total' => \"SUM(CASE WHEN qip.product_type='configurable' THEN qip.base_row_total ELSE qi.base_row_total END)\",\n 'product_type',\n 'quote_id' => 'quote_id',\n 'parent_item_id' => 'parent_item_id',\n 'item_created_at' => 'created_at'\n )\n );\n $this->addFilterToMap('parent_item_id', 'qi.parent_item_id');\n $this->addFilterToMap('product_type', 'qi.product_type');\n $this->addFilterToMap('item_created_at', 'item_created_at');\n\n // Retrieve base currency code from parent quote\n $this->joinTable(\n array('q' => 'sales/quote'),\n 'entity_id = quote_id',\n array('currency_code' => 'base_currency_code', 'store_id' => 'store_id')\n );\n\n // Select only cart items attached to a subscription\n $this->joinTable(\n array('s' => 'sheep_subscription/subscription'),\n 'quote_id = quote_id',\n array('subscription_created_at' => 'created_at',)\n );\n\n // re-join sales_flat_quote_item to retrieve parent info (if available)\n $this->joinTable(\n array('qip' => 'sales/quote_item'),\n 'item_id = parent_item_id',\n array('parent_product_type' => 'product_type', 'parent_qty' => 'qty'),\n null,\n 'left'\n );\n $this->addFilterToMap('parent_product_type', 'qip.product_type');\n $this->addFilterToMap('parent_qty', 'qip.qty');\n\n // Filter only cart items created during specified period\n $this->addFieldToFilter('item_created_at', array(\n 'from' => $this->_from,\n 'to' => $this->_to,\n 'datetime' => true\n ));\n\n $this->getSelect()->where(\n \"(qi.parent_item_id is null and qi.product_type NOT IN ('bundle', 'configurable')) OR\" .\n \"(qi.parent_item_id is not null and qip.product_type IN ('bundle', 'configurable'))\"\n );\n\n $this->getSelect()\n ->group('e.entity_id')\n ->order('counts ' . self::SORT_ORDER_DESC)\n ->having('COUNT(qi.product_id) > ?', 0);\n\n\n // Filter only quotes that were created in specified stores\n if ($this->_storeIds) {\n $this->addFieldToFilter('store_id', array('in' => $this->_storeIds));\n }\n }",
"protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"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 }",
"protected function _getProductCollection()\n {\n $collection = parent::_getProductCollection();\n\t\t$helper = Mage::helper('catalogMembersonly/productsFilter');\n\t\t$collection = $helper->filterProductCollection($collection);\n\n return $collection;\t\t\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getModel('solutionpartner/partner')->getCollection();\n $collection->getSelect()->joinLeft(\n array('order' => $collection->getTable('sales/order')),\n 'main_table.email = order.customer_email AND order.status = \"complete\"',\n array(\n 'order_id' => 'entity_id',\n 'order_status' => 'order.status',\n 'number_qtys' => 'count(order.entity_id)'\n ))\n ->group('main_table.solutionpartner_id');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\r\n {\r\n\t\tif($this->getRequest()->getParam('store')){\r\n\t\t\t$store_id = $this->getRequest()->getParam('store');\r\n\t\t} else {\r\n\t\t\t$store_id = Mage::helper('items')-> getMlDefaultStoreId();\r\n\t\t}\r\n\t\t$attribute_id = '';\r\n\t\tif($this->getRequest()->getParam('attribute_id')!=''){\r\n\t\t\t$attribute_id = $this->getRequest()->getParam('attribute_id');\r\n\t\t} \r\n\t\t\r\n\t\t$category_id = 0;\r\n\t\tif($this->getRequest()->getParam('category_id')){\r\n\t\t\t$category_id = $this->getRequest()->getParam('category_id');\r\n\t\t}\r\n\t\t\r\n\t\t$collection = Mage::getModel('eav/entity_attribute_option')\r\n\t\t\t\t\t-> getCollection()\r\n\t\t\t\t\t-> setStoreFilter($store_id)\r\n\t\t\t\t\t-> join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code')\r\n\t\t\t\t\t-> addFieldToFilter('attribute.attribute_id',$attribute_id)\r\n\t\t\t\t\t-> addFieldToFilter('tsv.value', array('neq' => 'NULL' ));\t\t\t\r\n\t\t\t\t\t\r\n $collection -> getSelect()\r\n\t\t\t\t -> joinleft(array('mavm'=>'mercadolibre_attribute_value_mapping'), \" main_table.option_id = mavm.mage_attribute_option_id AND mavm.sort_order = '0' AND mavm.category_id = '\".$category_id.\"' AND mavm.store_id = '\".$store_id.\"'\",array('mavm.*'));\r\n\t\t \r\n\t\t\t\t \r\n\t\t\t\t \t\t\t\t\t\t\t\t\r\n\t $this->setCollection($collection);\r\n return parent::_prepareCollection();\r\n }",
"protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}",
"protected function _prepareCollection()\n {\n $collection = $this->_collectionFactory->create()->addVisibleFilter();\n $vendor_attrs = [];\n $vendor_id = $this->customerSession->getVendorId();\n if ($vendor_id) {\n $attr_model = $this->attribute->getProductAttributes($vendor_id)->getData();\n foreach ($attr_model as $key => $attr_id) {\n $vendor_attrs[] = $attr_id['attribute_id'];\n }\n $collection->addFieldToFilter('main_table.attribute_id', ['in' => $vendor_attrs]);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }\n return $this;\n }",
"protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel('bs_docwise/docwisement_collection');\n\n if ($this->getExam()->getId()) {\n $constraint = 'related.exam_id='.$this->getExam()->getId();\n } else {\n $constraint = 'related.exam_id=0';\n }\n $collection->getSelect()->joinLeft(\n array('related' => $collection->getTable('bs_docwise/exam_docwisement')),\n 'related.docwisement_id = main_table.entity_id AND '.$constraint,\n array('position')\n );\n\n\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }",
"protected function _prepareCollection()\r\n {\r\n $this->setCollection(Mage::getModel('dynamic_brand/brand')->getCollection());\r\n return parent::_prepareCollection();\r\n }",
"protected function _setCollection(){\n $storeId = Mage::app()->getStore()->getId();\n $products = Mage::getResourceModel('reports/product_collection')\n ->addOrderedQty()\n ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description'))\n ->setStoreId($storeId)\n ->addStoreFilter($storeId)\n ->setPageSize($this->getProductsCount())\n ->setOrder('ordered_qty', 'desc');\n\n Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);\n Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);\n\n $this->_topsellerCollection = $products;\n }",
"protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $userId = Mage::getSingleton('admin/session')->getUser()->getId();\n\n /* var $collection Gri_Cms_Model_Mysql4_Version_Collection */\n $collection = Mage::getModel('gri_cms/page_version')->getCollection()\n ->addPageFilter($this->getPage())\n ->addVisibilityFilter($userId,\n Mage::getSingleton('gri_cms/config')->getAllowedAccessLevel())\n ->addUserColumn()\n ->addUserNameColumn();\n\n if (!$this->getParam($this->getVarNameSort())) {\n $collection->addNumberSort();\n }\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getModel('oggetto_oneclick/order')->getResourceCollection();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"public function createCollection()\n\t{\n\t\t/** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection */\n\t\t$collection = $this->productCollectionFactory->create();\n\t\t$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());\n\n\t\t$collection = $this->_addProductAttributesAndPrices($collection)\n\t\t\t->addStoreFilter()\n\t\t\t->setPageSize($this->getPageSize())\n\t\t\t->setCurPage($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1));\n\n\t\t$conditions = $this->getConditions();\n\t\t$conditions->collectValidatedAttributes($collection);\n\t\t$this->sqlBuilder->attachConditionToCollection($collection, $conditions);\n\n\t\treturn $collection;\n\t}",
"protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getModel('sales/order_shipment')->getCollection();\n $tableName = Mage::getSingleton('core/resource')->getTableName('sales_flat_order');\n\n $collection->getSelect()->joinLeft(array('o'=>$tableName), 'main_table.order_id=o.entity_id', array(\n 'order_increment_id'=>'o.increment_id',\n 'order_created_date'=>'o.created_at',\n 'o.shipping_description'));\n\n $collection->addFieldToFilter('o.shipping_description', array('like'=>'%canpar%'));\n $tableName = Mage::getSingleton('core/resource')->getTableName('ch_canpar_shipment');\n\n $collection->getSelect()->joinLeft(array('ch_shipment'=>$tableName), 'main_table.entity_id=ch_shipment.magento_shipment_id',array(\n 'canpar_shipment_id'=>'shipment_id',\n 'manifest_id'=>'manifest_id'));\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection() {\n $collection = Mage::helper('ProductReturn/SupplierReturn')->getProductsPending();\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }",
"protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->getSelect()->joinLeft(\n array('sfo' => 'sales_flat_order'),\n 'main_table.order_id = sfo.entity_id',\n array('increment_id')\n );\n\t\t$this->setCollection($collection);\n\n\t\treturn parent::_prepareCollection();\n\t}"
]
| [
"0.72974336",
"0.724351",
"0.7235491",
"0.7202871",
"0.7117323",
"0.7069229",
"0.7041912",
"0.6981756",
"0.6904291",
"0.6857724",
"0.68023556",
"0.67710334",
"0.6748615",
"0.6631792",
"0.65536547",
"0.6537255",
"0.6535089",
"0.6517021",
"0.6493775",
"0.6492051",
"0.6488541",
"0.64649796",
"0.64551216",
"0.6445846",
"0.64407617",
"0.6422732",
"0.63847804",
"0.63684034",
"0.63353926",
"0.6315601"
]
| 0.772621 | 0 |
Retrieve the ES raw query string for a given rule | protected function _getQueryStringFromRule(Smile_VirtualCategories_Model_Rule $rule)
{
// Do not call directly getSearchQuery() on rule because it would load from cache instead of recalculate
$rule->addUsedCategoryIds($this->getCategory()->getId());
$rule->getConditions()->setRule($rule);
$queryString = $rule->getConditions()->getSearchQuery();
// Append the root category query string if needed
if ($rootCategory = $this->_getVirtualRootCategory($this->getCategory())) {
$rootCategoryQuery = $this->_getVirtualRule($rootCategory)->getSearchQuery($this->getCategory()->getId());
if ($queryString) {
$queryString = "(" . $queryString . " AND (" . $rootCategoryQuery . "))";
} else {
$queryString = "(" . $rootCategoryQuery . ")";
}
}
return $queryString;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryAsString();",
"public function getQuery(): string\n {\n return (string) $this->query;\n }",
"protected function getQuery(): string\n {\n return http_build_query($this->query);\n }",
"public function getQuery(): string\r\n {\r\n return $this->query;\r\n }",
"abstract protected function buildQuery(): string;",
"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 }",
"private function getQueryString()\n {\n return \\apply_filters('swiftype_search_query_string', stripslashes(\\get_search_query(false)));;\n }",
"public function getQueryString()\n {\n return parse_str($this->partials['query']);\n }",
"private function getQueryString() : string\n {\n return http_build_query($this->parameters);\n }",
"public static function queryString(): string\n\t{\n\t\treturn static::$queryString;\n\t}",
"public function getQueryString():string;",
"private function getSumoQuery() {\n $query = file_get_contents(__DIR__ . '/query.txt');\n $query = strtr($query, [\n '[site_realm]' => $this->profile->getSiteRealm(),\n '[site_short_name]' => $this->profile->getSiteShortName()\n ]);\n $query = trim(preg_replace('/\\s\\s+/', ' ', $query));\n $query = str_replace([\"\\n\", \"\\r\"], ' ', $query);\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Sumologic query: {$query}\");\n }\n return $query;\n }",
"public function getQueryString() {\n\t\t\n\t}",
"public function getFulltextQuery()\n {\n return $this->getRequest()->getParam('query');\n }",
"public function query(): string;",
"public function queryString()\n\t{\n\t\treturn substr($this->fullUri(), strpos($this->fullUri(), '?'), strlen($this->fullUri()) - 1);\n\t}",
"public function __toString(){\r\n\t\treturn $this->queryString();\r\n\t}",
"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 }",
"public function getQueryString()\n\t{\n\t\treturn $this->queryString;\n\t}",
"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}",
"public function getQueryString()\n {\n return $this->getRequest()->getQueryString();\n }",
"public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\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 getQueryString()\n {\n return $this->query_string;\n }",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();",
"public function getQuery();"
]
| [
"0.6525287",
"0.605407",
"0.5891286",
"0.5842957",
"0.58400124",
"0.58265656",
"0.58265656",
"0.58265656",
"0.5801091",
"0.5770238",
"0.57324594",
"0.5731913",
"0.5715294",
"0.5678404",
"0.56288165",
"0.55913246",
"0.5572216",
"0.555764",
"0.5529608",
"0.550066",
"0.5500531",
"0.54854584",
"0.5480591",
"0.546303",
"0.5450849",
"0.5445712",
"0.54441595",
"0.54441595",
"0.54441595",
"0.54441595"
]
| 0.6264304 | 1 |
Get the virtual "root category" to apply for a virtual category, if any. | protected function _getVirtualRootCategory($category)
{
return Mage::helper('smile_virtualcategories')->getVirtualRootCategory($category);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_virtual_root()\n\t{\n\t\tglobal $DBPrefix, $db;\n\t\t// Virtual root element as parent.\n\t\t$query = \"SELECT right_id FROM \" . $DBPrefix . \"categories ORDER BY right_id DESC LIMIT 1\";\n\t\t$db->direct_query($query);\n\t\t$row = $db->result();\n\t\t$root = array('left_id' => 1, 'right_id' => $row['right_id'], 'level' => -1);\n\t\treturn $root;\n\t}",
"function lb_get_root_category($product_id) {\n $prod_terms = get_the_terms( $product_id, 'product_cat' );\n \n foreach ($prod_terms as $prod_term) {\n // gets product cat id\n $product_cat_id = $prod_term->term_id;\n\n // gets an array of all parent category levels\n $product_parent_categories_all_hierachy = get_ancestors( $product_cat_id, 'product_cat' ); \n \n // This cuts the array and extracts the last set in the array\n $last_parent_cat = array_slice($product_parent_categories_all_hierachy, -1, 1, true);\n \n foreach($last_parent_cat as $last_parent_cat_value){\n // $last_parent_cat_value is the id of the most top level category, can be use whichever one like\n }\n }\n \n $category = &get_category((int)$last_parent_cat_value);\n \n if(isset($category->slug)) {\n return $category->slug;\n } else {\n return '';\n } \n}",
"public function getRootCategory()\n {\n $value = $this->_config->get('category_settings/root_category');\n\n if ($value === null) {\n $value = 2;\n }\n\n return (int)$value;\n }",
"public function getMainCategoryAttribute()\n {\n $mainCategory = 'Uncategorized';\n\n if (! empty($this->terms)) {\n $taxonomies = array_values($this->terms);\n\n if (! empty($taxonomies[0])) {\n $terms = array_values($taxonomies[0]);\n\n $mainCategory = $terms[0];\n }\n }\n\n return $mainCategory;\n }",
"function GetRootCategoryid($categoryid)\n{\n global $DB, $pages_md_arr, $pages_parents_md_arr;\n\n if(!empty($pages_parents_md_arr))\n {\n $root_categoryid = 0;\n while(true)\n {\n if(!empty($pages_md_arr[$categoryid]['parentid']))\n {\n $root_categoryid = $categoryid = $pages_md_arr[$categoryid]['parentid'];\n }\n else\n {\n break;\n }\n }\n return $root_categoryid;\n }\n\n if($category_arr = $DB->query_first('SELECT categoryid, parentid FROM {categories} WHERE categoryid = %d',$categoryid))\n {\n if($category_arr['parentid'])\n {\n $root_categoryid = GetRootCategoryid($category_arr['parentid']);\n }\n else\n {\n return $category_arr['categoryid'];\n }\n }\n else\n {\n return 1; // return home category if category not found\n }\n\n return $root_categoryid;\n\n}",
"private function getClassCategory($root) {\n\t\treturn \"Science\";\n\t}",
"private function getCatParent() {\r\n $rCat = new Read;\r\n $rCat->ExeRead(\"ml_categories\", \"WHERE category_id = :id\", \"id={$this->Data['post_category']}\");\r\n if ($rCat->getResult()):\r\n return $rCat->getResult()[0]['category_parent'];\r\n else:\r\n return null;\r\n endif;\r\n }",
"public function getCurrentCategory()\n {\n return $this->category;\n }",
"public function get_default_category() {\n return $this->defaultcategory;\n }",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"public static function getRootCategories()\n {\n $app = App::getInstance();\n\n $sql = $app['safesql']->query(\n \"SELECT\n\t\t\t\t`id`\n\t\t\tFROM `category`\n\t\t\tWHERE hidden = 0\n\t\t\tAND id > 0\n\t\t\tAND parent IS NULL\n\t\t\tAND deleted = 0\n\t\t\tORDER BY `order` ASC\",\n array());\n $results = $app['db']->get_results($sql);\n $cats = array();\n\n if (!is_null($results)) {\n foreach ($results as $cat) {\n $cats[] = new Category($cat->id);\n }\n }\n return $cats;\n }",
"public function getTree() {\n return $this->_buildBranch($this->root_category_id);\n }",
"public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }",
"public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }",
"public function get_category()\n {\n return $this->primary_category();\n }",
"public static function getCategoryTree() {\n $catModel = new \\App\\Category();\n $catTree = $catModel->getCategoryTree();\n return $catTree;\n }",
"public static function getCategoryTopLevel() {\n\t\t\t$db = Db::getInstance();\n\t\t\t// Regex that grabs all top-level categories using location\n\t\t\t$regexForTopLevel = \"^[0-9]+$\";\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description \n\t\t\t\t\t\t\t\t\t\t\t FROM categories \n\t\t\t\t\t\t\t\t\t\t\tWHERE location REGEXP :regex\n\t\t\t\t\t\t\t\t\t\t ORDER BY location'\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t$categoryQuery->execute(array('regex' => $regexForTopLevel));\n\t\t\t$allTopCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allTopCategories;\n\t\t}",
"public function getViewedCategory();",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"function get_primary_category($id = 0) {\n\t\n\t$category = get_the_terms($id, 'category');\t\t\n\t$parent_cat = \"\";\n\t\n\tforeach((array) $category as $term) {\n\t\tif($term->slug == \"featured\" || $term->slug == \"spotlight-featured\" || $term->slug == \"spotlight-left\" || $term->slug == \"spotlight-right\") { continue; }\n\t\t\n\t\t// if the first term is parent, return it\n\t\tif($term->parent == 0) {\n\t\t\t$parent_cat = $term;\n\t\t\tbreak;\n\t\t} else {\n\t\t\t// if the category isn't the parent, find the parent\n\t\t\t$parent_cat = get_parent_of_category($term->term_id); \n\t\t}\n\t}\n\t\t\n\treturn $parent_cat;\t\t\n}",
"private function getDefaultCategoryId()\n {\n if (null === $this->defaultParentCategoryId) {\n $this->defaultParentCategoryId = $this->storeManager->getStore()->getRootCategoryId();\n }\n return $this->defaultParentCategoryId;\n }",
"public function getCategory(){\r\n return Mage::registry('current_category');\r\n }",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }",
"protected function getRootId()\n {\n return $this->getParam(self::PARAM_USE_NODE)\n ? intval(\\XLite\\Core\\Request::getInstance()->category_id)\n : $this->getParam(self::PARAM_ROOT_ID);\n }",
"function getRoot() { return($this->_root); }",
"private function _getFirstCategoryLevel()\n\t{\n\t\tif (!$this->_firstCategoryLevel) {\n\t\t\t$this->_firstCategoryLevel = intval($this->getVar('category_first_level', 1));\n\t\t}\n\t\treturn $this->_firstCategoryLevel;\n\t}",
"public function getCurrentCat()\n {\n if (empty($this->multifilterSession->getTopCategory()) && empty($this->multifilterSession->getCategories())) {\n $currentCat = $this->coreRegistry->registry('current_category');\n return $currentCat->getId();\n } else {\n return $this->multifilterSession->getTopCategory();\n }\n }",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }"
]
| [
"0.71716315",
"0.64109856",
"0.62641716",
"0.59453493",
"0.59206754",
"0.5819011",
"0.57703555",
"0.56866693",
"0.5681122",
"0.56720895",
"0.5649985",
"0.5642178",
"0.5627867",
"0.56274354",
"0.562678",
"0.5600032",
"0.5512124",
"0.5505646",
"0.550227",
"0.55016357",
"0.5488388",
"0.54729855",
"0.54691297",
"0.54589987",
"0.5457847",
"0.54407954",
"0.542746",
"0.53837955",
"0.53708935",
"0.53568494"
]
| 0.71236855 | 1 |
Displays a form to edit an existing country entity. | public function editAction(Request $request, Country $country) {
$deleteForm = $this->createDeleteForm($country);
$editForm = $this->createForm('B2bBundle\Form\CountryType', $country);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('backoffice_country_edit', array('id' => $country->getId()));
}
return $this->render('country/edit.html.twig', array(
'country' => $country,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Country $country)\n {\n \n }",
"public function edit(Country $country)\n {\n $langs=Lang::lists('language','id');\n return view('backend.countries.edit')->with('country',$country)->with('langs',$langs);\n }",
"public function edit(Country $country)\n {\n return view('system.country.edit', compact('country'));\n }",
"function edit($country_code)\n { \n // check if the country exists before trying to edit it\n $data['country'] = $this->Country_model->get_country($country_code);\n $data['authLevel'] = 1;\n $this->load->view('templates/loginAuth', $data);\n if(isset($data['country']['country_code']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('country_name','Country Name','required|max_length[30]');\n\t\t\t$this->form_validation->set_rules('country_abbreviation','Country Abbreviation','required|max_length[5]');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'country_name' => $this->input->post('country_name'),\n\t\t\t\t\t'country_abbreviation' => $this->input->post('country_abbreviation'),\n );\n\n $this->Country_model->update_country($country_code,$params); \n redirect('country/index');\n }\n else\n {\n $data['_view'] = 'country/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The country you are trying to edit does not exist.');\n }",
"public function edit(Country $country)\n {\n return view('countries::countries.edit', compact('country'));\n }",
"public function edit($id)\n {\n $country = Country::find($id);\n return view('admin.countries.edit',['country'=>$country,'title'=>trans('admin.edit_country')]);\n }",
"public function edit($countryId)\n {\n $country=$this->countryRepository->getCountryById($countryId);\n return view('backend.constants.countries.country',compact('country'));\n }",
"public function edit(Country $country)\n {\n return view('dashboard.countries.edit', compact('country'));\n }",
"public function edit($id)\n {\n $country = country::findOrFail($id);\n return view('admin.countries.edit',['title'=> trans('admin.edit_country') ,'country'=>$country]);\n }",
"public function edit($id){\n $where=array(\n 'id'=>$id\n );\n $country=$this->Mdl_country->getRecord($where);\n $data=array(\n 'country'=>$country\n );\n $this->load->view('countries/edit',$data);\n }",
"public function edit($id)\n {\n $country=Country::find($id);\n return view('admin.countries.edit',compact('country'));\n }",
"public function edit($id)\n {\n $country = Country::findOrFail($id);\n\n return view('admin.countries.edit')->with([\n 'country' => $country\n ]);\n }",
"public function show(Country $country)\n {\n return view('system.country.edit', compact('country'));\n }",
"public function edit($id)\n {\n $country = Country::findOrFail($id);\n $association = Association::pluck('name','id');\n \n return view('country.edit', compact('country','association'));\n }",
"function editCountry()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->library('form_validation');\n \n $countryId = $this->input->post('id');\n \n $this->form_validation->set_rules('name','Name','trim|required|max_length[128]');\n \n if($this->form_validation->run() == FALSE)\n {\n $this->editOld($countryId);\n }\n else\n {\n $name = ucwords(strtolower($this->input->post('name')));\n \n $countryInfo = array();\n \n $countryInfo = array('name'=>$name, 'updated_by'=>$this->vendorId, 'update_time'=>date('Y-m-d H:i:s'));\n \n $result = $this->country_model->editCountry($countryInfo, $countryId);\n \n if($result == true)\n {\n $this->session->set_flashdata('success', 'country updated successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Country updation failed');\n }\n \n redirect('admin/country/countryListing');\n }\n }\n }",
"private function createEditForm(Country $entity)\n {\n $form = $this->createForm(new CountryType($this->get('doctrine.orm.entity_manager')->getRepository('OrkestroLocaleBundle:Locale')), $entity, array(\n 'action' => $this->generateUrl('orkestro_backend_country_update', array('iso_code' => $entity->getIsoCode())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(Country $country)\n {\n $country = Country::find($country->id);\n return view('dashboard.countries.edit', compact('country'));\n }",
"public function editcountry($id){\n if($this->session->user) {\n $data['user'] = $this->session->user;\n } else {\n $data['user'] = null;\n }\n //Check and load user session data\n if($this->session->user['u_email'] === '[email protected]') {\n $data['user'] = $this->session->user;\n } else {\n $data['user'] = null;\n redirect('/');\n }\n $data['country'] = $this->admin_model->editcountry($id);\n $this->load->view('includes/head');\n $this->load->view('includes/nav_admin', $data);\n $this->load->view('includes/side_admin', $data);\n $this->load->view('includes/admin/edit/country', $data);\n $this->load->view('includes/admin/footer');\n $this->load->view('includes/functions');\n }",
"public function getEdit($countryId)\n {\n $dataCountry = TfCountry::find($countryId);\n if (count($dataCountry) > 0) {\n return view('manage.content.system.country.edit', compact('dataCountry'));\n }\n }",
"function editOld($countryId = NULL)\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n if($countryId == null)\n {\n redirect('admin/country/countryListing');\n }\n \n \n $data['countryInfo'] = $this->country_model->getCountryInfo($countryId);\n \n $this->global['pageTitle'] = 'Touba : Edit Country';\n \n $this->loadViews(\"admin/country/editOld\", $this->global, $data, NULL);\n }\n }",
"public function getEdit($id = null)\n {\n $country = $this->countryRepo->byId($id);\n if ( is_null($id) || is_null($country) )\n {\n return Redirect::route('admin.countries.create');\n }\n else\n {\n return View::make('admin.countries.edit',array('country' => $country, \"status_list\" => $this->statusList));\n }\n }",
"public function edit($id)\n {\n $country = $this->countryRepository->findWithoutFail($id);\n\n if (empty($country)) {\n Log::error('Pais, Edit, No se encuentra el pais: ' . $id);\n Flash::error('Country not found');\n\n return redirect(route('admin.countries.index'));\n }else if($country->nativo){\n Log::error('Pais, Edit, El pais' . $id . ' no se puede editar ya que es un registro nativo.');\n Flash::error('El pais no se puede editar ya que es un registro nativo.');\n\n return redirect(route('admin.countries.show', [$country->id]));\n }\n\n return view('admin.countries.edit')->with('country', $country);\n }",
"public function showAction(Country $country) {\n $deleteForm = $this->createDeleteForm($country);\n\n return $this->render('country/show.html.twig', array(\n 'country' => $country,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit(Country $country, $id)\n {\n $country = Country::find($id);\n return view('country.edit', ['country' => $country]);\n }",
"public function showEditForm($country,$town)\n {\n $countries = Country::where('name','!=',$country)->orderBy('name','asc')->get();\n\n //fetch the specific town info to obtain id\n $db_town = Town::where('name',$town)->first();\n $data=array(\n 'town'=>$town,\n 'town_id'=>$db_town->id,\n 'country'=>$country,\n 'country_id'=>$db_town->country_id,\n 'countries'=>$countries\n );\n return view('admin.pages.edit_town')->with($data); \n \n }",
"public function show(Country $country)\n {\n //\n }",
"public function show(Country $country)\n {\n //\n }",
"public function edit($id)\n {\n $country = $this->countryRepository->findWithoutFail($id);\n\n if (empty($country)) {\n Log::error('Pais, Edit, No se encuentra el pais: ' . $id);\n Flash::error('Country not found');\n\n return redirect(route('countries.index'));\n }else if($country->nativo){\n Log::error('Pais, Edit, El pais' . $id . ' no se puede editar ya que es un registro nativo.');\n Flash::error('El pais no se puede editar ya que es un registro nativo.');\n\n return redirect(route('countries.show', [$country->id]));\n }\n\n return view('countries.edit')->with('country', $country);\n }",
"public function edit($id)\n {\n $country=LandingCountry::where('id',$id)->first();\n // return $currency;\n return view('admin.country.edit',compact('country'));\n }",
"public function edit($id)\n {\n $countries = Country::find($id);\n // Redirect to taxon list if updating taxon wasn't existed\n if ($countries == null || count($countries) == 0) {\n return redirect()->intended('/country');\n }\n\n return view('countries/edit', ['countries' => $countries]);\n }"
]
| [
"0.80439985",
"0.7284132",
"0.7261045",
"0.71348256",
"0.7056613",
"0.7039055",
"0.702156",
"0.70039463",
"0.6965901",
"0.69474655",
"0.6923719",
"0.68681324",
"0.68593884",
"0.68550175",
"0.68486136",
"0.6833688",
"0.6806311",
"0.6760938",
"0.6758943",
"0.673473",
"0.6678252",
"0.6635705",
"0.6622006",
"0.6604068",
"0.65896064",
"0.6580736",
"0.6580736",
"0.6535923",
"0.6530578",
"0.65251243"
]
| 0.74504596 | 1 |
Deletes a country entity. | public function deleteAction(Request $request, Country $country) {
$form = $this->createDeleteForm($country);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
try {
$em->remove($country);
$em->flush();
} catch (DBALException $e) {
return $this->render('error-delete.html.twig', array('error' => $e->getMessage()));
}
}
return $this->redirectToRoute('backoffice_country_index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleted(Country $country)\n {\n\n }",
"public function destroy(Country $country)\n {\n //\n }",
"public function delete(model $country) {\n\n // Delete record\n return parent::_delete($country);\n }",
"public function forceDeleted(Country $country)\n {\n //\n }",
"public function destroy(Country $country)\n {\n \n $pathold=$country->path;\n if($pathold != null)\n {\n unlink(public_path('images\\\\countries\\\\'.$pathold));\n\n }\n $country->delete();\n Flash::success('El país '.$country->name.' se ha eliminado satisfactoriamente')->important();\n return redirect()->route('shoes.country.index');\n }",
"public function delete_country(Request $request,$enc_id)\n\t{\t\n\t\t$country_id = base64_decode($enc_id);\n\n\t\t$obj_delete = $this->BaseModel->where('id',$country_id)->delete();\n\n\t\tif($obj_delete){\n\t\t\tSession::flash('success', 'Country deleted successfully.');\n\t\t\treturn redirect($this->module_url_path);\n \t}else{\n \t\tSession::flash('error', 'Something went wrong.');\n\t\t\treturn redirect($this->module_url_path);\n \t}\n\t}",
"public function destroy(Country $country)\n {\n $this->repository->delete($country);\n\n flash(trans('accounts::countries.messages.deleted'));\n\n return redirect()->route('dashboard.countries.index');\n }",
"public function destroy(Country $country)\n {\n $country->delete();\n return redirect()->route('countries.index')->with('success', 'Country deleted successfully.');\n }",
"public function destroy(Country $country, $id)\n {\n $country = Country::findOrFail($id);\n $company = Company::where('country_id', '=', $country->id)->first();\n\n if ($company)\n return Redirect::route('countries')->with('danger', 'Country has companies linked to it');\n else {\n $country->delete();\n return Redirect::route('countries')->with('success', 'Country successfully deleted!');\n }\n }",
"public function destroy(Request $request, Country $country)\n {\n $response = $this->countryService->delete($country, $request);\n if (!$response['status']) {\n return redirect()->back()\n ->with('response', $response);\n }\n\n return redirect()->route('system.countries.index')\n ->with('response', $response);\n }",
"public function destroy(Country $country)\n {\n $country->delete();\n\n flash(trans('countries.messages.deleted'));\n\n return redirect()->route('dashboard.countries.index');\n }",
"public function destroy($id)\n {\n $country = LandingCountry::find($id);\n if($country){\n $country->delete();\n }\n return redirect('admin/country');\n }",
"function deleteCountry()\n {\n \n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n \n }\n else\n {\n $id = $this->input->post('id');\n $data = array('deleted'=>1,'updated_by'=>$this->vendorId, 'update_time'=>date('Y-m-d H:i:s'));\n \n $result = $this->country_model->deleteCountry($id, $data);\n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }",
"public function delete($id = null) \r\n\t{\r\n\t\tif ($id == null) \r\n\t\t{\r\n\t\t\tshow_error('No identifier provided', 500);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$this->country->remove($id);\r\n\t\t\t// Set flash data \r\n\t\t\t$this->session->set_flashdata('message', '<div style=\"text-align:center; color:#4C8C18\">Successfully deleted the country information!</div>');\r\n\t\t\tredirect('country/listing'); // back to the listing\r\n\t\t}\r\n\t}",
"public function delete($countryId)\n {\n $this->countryRepository->deleteCountryById($countryId);\n return redirect()->route('getAllCountries');\n }",
"public function deleteDelete(Request $request){\n $delete_id = $request->input('delete_id');\n try {\n //Delete country from database, throw exception if not deleted and\n //return country's list view with success notice if\n //country is deleted.\n $delete_flag = $this->country_model->deleteCountry($delete_id);\n if($delete_flag == false):\n throw new Exception('Could not delete requested country. Please try again.');\n endif;\n $deleted_notice = \"Selected country has been deleted successfully.\";\n $countries = $this->country_model->allCountries();\n return view('countries.list_view', compact('countries', 'deleted_notice'));\n } catch (\\Exception $e) {\n return response()->json(['exc' => utf8_encode($e->getMessage()), 'custom_message' => 'Could not delete this country because it is being used by other modules.']);\n }//End try-catch\n }",
"public function destroy($id)\n {\n $country = Country::find($id);\n Storage::delete($country->flag);\n $country->delete();\n session()->flash('success',trans('admin.country_delete_success'));\n return redirect(aurl('countries'));\n }",
"public function destroy(Request $request, $id)\n {\n $country = Country::findOrFail($id);\n\n $country->delete();\n\n $request->session()->flash('danger', 'Country deleted from the database.');\n\n return redirect()->route('admin.countries.index');\n }",
"public function actionDelete($city_id, $country_id)\n {\n $this->findModel($city_id, $country_id)->delete();\n\n //delete all customer address\n CustomerAddress::deleteAll(['city_id' => $city_id]);\n\n //delete customer cart - area_id\n CustomerCart::deleteAll('area_id in (select area_id from {{%location}}\n where city_id = \"'.$city_id.'\")');\n\n //delete all location - city_id\n Location::deleteAll(['city_id' => $city_id]);\n\n //delete all vendor location - city_id\n VendorLocation::deleteAll(['city_id' => $city_id]);\n\n Yii::$app->session->setFlash('success', 'Governorate deleted successfully!');\n return $this->redirect(['index']);\n\n }",
"private function createDeleteForm(Country $country) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('backoffice_country_delete', array('id' => $country->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function destroy($id)\n {\n $country = country::findOrFail($id);\n Storage::delete($country->logo);\n $country->delete();\n return redirect(aurl('countries'));\n }",
"public function destroy($id)\n {\n $country = Country::findOrFail($id);\n $country->delete();\n return $country;\n }",
"public function delete($entity);",
"public function delete(User $user, Country $country)\n {\n return $this->userRoleCan($user, 'country-delete');\n }",
"public function destroy($id)\n {\n Country::where('id', $id)->delete();\n return redirect()->route('country.index');\n }",
"public function destroy($id)\n {\n $country = $this->countryRepository->findWithoutFail($id);\n $countryWithStates = $this->countryRepository->related_states($id);\n\n if (empty($country)) {\n Log::error('Pais, Destroy, No se encuentra el pais: ' . $id); \n Flash::error('Country not found');\n\n return redirect(route('admin.countries.index'));\n }else if($country->nativo){\n Log::error('Pais, Destroy, El pais ' . $id . ' no se puede eliminar ya que es un registro nativo.'); \n Flash::error('El pais no se puede eliminar ya que es un registro nativo.');\n\n return redirect(route('admin.countries.show', [$country->id]));\n }else if($countryWithStates){\n Log::error('Pais, Destroy, El pais ' . $id . ' no se puede eliminar ya que posee departamentos relacionados.'); \n Flash::error('El pais no se puede eliminar ya que posee departamentos relacionados.');\n\n return redirect(route('admin.countries.show', [$country->id]));\n }\n\n $this->countryRepository->delete($id);\n\n Log::info('Pais, Destroy, Se eliminó el pais: ' . $id);\n Flash::success('Country deleted successfully.');\n\n return redirect(route('admin.countries.index'));\n }",
"public function destroy($id)\n {\n $country = $this->countryRepository->findWithoutFail($id);\n $countryWithStates = $this->countryRepository->related_states($id);\n\n if (empty($country)) {\n Log::error('Pais, Destroy, No se encuentra el pais: ' . $id); \n Flash::error('Country not found');\n\n return redirect(route('countries.index'));\n }else if($country->nativo){\n Log::error('Pais, Destroy, El pais ' . $id . ' no se puede eliminar ya que es un registro nativo.'); \n Flash::error('El pais no se puede eliminar ya que es un registro nativo.');\n\n return redirect(route('countries.show', [$country->id]));\n }else if($countryWithStates){\n Log::error('Pais, Destroy, El pais ' . $id . ' no se puede eliminar ya que posee departamentos relacionados.'); \n Flash::error('El pais no se puede eliminar ya que posee departamentos relacionados.');\n\n return redirect(route('countries.show', [$country->id]));\n }\n\n $this->countryRepository->delete($id);\n\n Log::info('Pais, Destroy, Se eliminó el pais: ' . $id);\n Flash::success('Country deleted successfully.');\n\n return redirect(route('countries.index'));\n }",
"public function destroy($id)\n {\n Country::find($id)->delete();\n return response()->json(['success'=>'Country deleted successfully.']);\n }",
"public function destroy($id)\n {\n $this->authorize('canControlEverything');\n\n $country = Country::findOrFail($id);\n $country->delete();\n\n return response([\n 'message' => 'success'\n ], 200);\n }",
"public function destroy($id)\n {\n //\n dd($id);\n Country::destroy($id);\n session()->flash('message','Country Deleted Successfully');\n return redirect()->back();\n }"
]
| [
"0.77608955",
"0.75083005",
"0.73672235",
"0.7008719",
"0.69454926",
"0.6882619",
"0.6823106",
"0.676254",
"0.6692958",
"0.66703093",
"0.6583386",
"0.633823",
"0.63282317",
"0.63191706",
"0.63134205",
"0.6209367",
"0.6169588",
"0.6141337",
"0.6126107",
"0.609844",
"0.6029929",
"0.59970057",
"0.59070814",
"0.5869394",
"0.5860489",
"0.5777964",
"0.5735327",
"0.5713604",
"0.5706402",
"0.56907266"
]
| 0.7818393 | 0 |
Creates a form to delete a country entity. | private function createDeleteForm(Country $country) {
return $this->createFormBuilder()
->setAction($this->generateUrl('backoffice_country_delete', array('id' => $country->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm($iso_code)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('orkestro_backend_country_delete', array('iso_code' => $iso_code)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"public function deleteAction(Request $request, Country $country) {\n $form = $this->createDeleteForm($country);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n try {\n $em->remove($country);\n $em->flush();\n } catch (DBALException $e) {\n return $this->render('error-delete.html.twig', array('error' => $e->getMessage()));\n }\n }\n\n return $this->redirectToRoute('backoffice_country_index');\n }",
"public function destroy(Country $country)\n {\n //\n }",
"public function deleted(Country $country)\n {\n\n }",
"public function delete(model $country) {\n\n // Delete record\n return parent::_delete($country);\n }",
"public function create(){\n return view('admin.countries.create' , ['title'=>trans('admin.create_new_country')]);\n }",
"function travel_delete_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Show confirm dialog.\n $entity_uri = entity_uri('travel', $entity);\n $message = t('Are you sure you want to delete entity %title?', array('%title' => entity_label('travel', $entity)));\n return confirm_form(\n $form,\n $message,\n $entity_uri['path'],\n t('This action cannot be undone.'),\n t('Delete'),\n t('Cancel')\n );\n}",
"public function create()\n {\n return view('backend.constants.countries.add_country');\n }",
"public function destroy(Country $country)\n {\n \n $pathold=$country->path;\n if($pathold != null)\n {\n unlink(public_path('images\\\\countries\\\\'.$pathold));\n\n }\n $country->delete();\n Flash::success('El país '.$country->name.' se ha eliminado satisfactoriamente')->important();\n return redirect()->route('shoes.country.index');\n }",
"private function createCreateForm(Country $entity)\n {\n $form = $this->createForm(new CountryType($this->get('doctrine.orm.entity_manager')->getRepository('OrkestroLocaleBundle:Locale')), $entity, array(\n 'action' => $this->generateUrl('orkestro_backend_country_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"protected function addCountry($form, $country = null) {\n $form->add('country', 'entity', array(\n 'class' => 'DaVinci\\TaxiBundle\\Entity\\Admin\\CountryCity',\n 'property' => 'country',\n 'empty_value' => 'form.please_select',\n 'translation_domain' => 'FOSUserBundle',\n //'property_path' => 'country',\n 'mapped' => false,\n 'data' => $country, \n 'query_builder' => function(EntityRepository $er) use ($country){\n \n if($country) \n {\n //use passed to post country\n $cc = $country->getCountryCode();\n $ci = $country->getId();\n \n return $er->createQueryBuilder('c')->select('c')->where('c.status = 1')->andWhere('(c.countryCode != ?1 OR c.id = ?2)')->groupBy('c.countryCode')->orderBy('c.countryCode', 'ASC')->setParameters(array(1 => $cc, 2 => $ci));\n }\n else\n return $er->createQueryBuilder('c')->select('c')->where('c.status = 1')->groupBy('c.countryCode')->orderBy('c.countryCode', 'ASC');\n }));\n }",
"public function delete_country(Request $request,$enc_id)\n\t{\t\n\t\t$country_id = base64_decode($enc_id);\n\n\t\t$obj_delete = $this->BaseModel->where('id',$country_id)->delete();\n\n\t\tif($obj_delete){\n\t\t\tSession::flash('success', 'Country deleted successfully.');\n\t\t\treturn redirect($this->module_url_path);\n \t}else{\n \t\tSession::flash('error', 'Something went wrong.');\n\t\t\treturn redirect($this->module_url_path);\n \t}\n\t}",
"public function create()\n {\n return view('admin.country.create');\n }",
"public function destroy($id)\n {\n $country = LandingCountry::find($id);\n if($country){\n $country->delete();\n }\n return redirect('admin/country');\n }",
"public function deleteDelete(Request $request){\n $delete_id = $request->input('delete_id');\n try {\n //Delete country from database, throw exception if not deleted and\n //return country's list view with success notice if\n //country is deleted.\n $delete_flag = $this->country_model->deleteCountry($delete_id);\n if($delete_flag == false):\n throw new Exception('Could not delete requested country. Please try again.');\n endif;\n $deleted_notice = \"Selected country has been deleted successfully.\";\n $countries = $this->country_model->allCountries();\n return view('countries.list_view', compact('countries', 'deleted_notice'));\n } catch (\\Exception $e) {\n return response()->json(['exc' => utf8_encode($e->getMessage()), 'custom_message' => 'Could not delete this country because it is being used by other modules.']);\n }//End try-catch\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('city_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar'))\n ->getForm()\n ;\n }",
"public function destroy(Country $country)\n {\n $this->repository->delete($country);\n\n flash(trans('accounts::countries.messages.deleted'));\n\n return redirect()->route('dashboard.countries.index');\n }",
"public function delete($id = null) \r\n\t{\r\n\t\tif ($id == null) \r\n\t\t{\r\n\t\t\tshow_error('No identifier provided', 500);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$this->country->remove($id);\r\n\t\t\t// Set flash data \r\n\t\t\t$this->session->set_flashdata('message', '<div style=\"text-align:center; color:#4C8C18\">Successfully deleted the country information!</div>');\r\n\t\t\tredirect('country/listing'); // back to the listing\r\n\t\t}\r\n\t}",
"public function destroy(Request $request, Country $country)\n {\n $response = $this->countryService->delete($country, $request);\n if (!$response['status']) {\n return redirect()->back()\n ->with('response', $response);\n }\n\n return redirect()->route('system.countries.index')\n ->with('response', $response);\n }",
"public function destroy(Country $country)\n {\n $country->delete();\n return redirect()->route('countries.index')->with('success', 'Country deleted successfully.');\n }",
"public function create()\n {\n return view('admin.countries.create',['title'=> trans('admin.create_new_country')]);\n }",
"function observation_delete_form($form, &$form_state, $observationdata = NULL) {\n\tassert(!empty($observationdata));\n\tdrupal_set_title(\n\t\tt(\n\t\t\t'Delete Observation @observation_organism from @observation_date.',\n\t\t\tarray('@observation_organism' => $observationdata['organism']['name_lang'] . '('\n\t\t\t\t\t\t\t. $observationdata['organism']['name_lat'] . ')',\n\t\t\t\t\t'@observation_date' => date('d.m.Y', $observationdata['observation']['date'])\n\t\t\t)));\n\n\t$question = t(\n\t\t'Are you sure that you want to delete this observation «@observation_organism»?',\n\t\tarray('@observation_organism' => $observationdata['organism']['name_lang'] . '('\n\t\t\t\t\t\t. $observationdata['organism']['name_lat'] . ')'\n\t\t));\n\t/* create a fieldset for the tabular data */\n\t$form['question'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => \"<p>$question</p>\"\n\t);\n\n\t$form['button'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Delete')\n\t);\n\treturn $form;\n}",
"public function delete($id, Request $request)\n {\n $country=country::find($id);\n if($request->ajax())\n return view('Countries.ajax.delete-confirm')->withcountry($country);\n \n return view('Countries.http.delete-confirm')->withcountry($country);\n }",
"function deleteCountry()\n {\n \n if($this->isAdmin() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n \n }\n else\n {\n $id = $this->input->post('id');\n $data = array('deleted'=>1,'updated_by'=>$this->vendorId, 'update_time'=>date('Y-m-d H:i:s'));\n \n $result = $this->country_model->deleteCountry($id, $data);\n if ($result > 0) { echo(json_encode(array('status'=>TRUE))); }\n else { echo(json_encode(array('status'=>FALSE))); }\n }\n }",
"public function create()\n {\n return view('admin.countries.create');\n\n }",
"private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function create()\n {\n return view('admin.countries.create');\n }",
"public function destroy($id)\n {\n $country = Country::find($id);\n Storage::delete($country->flag);\n $country->delete();\n session()->flash('success',trans('admin.country_delete_success'));\n return redirect(aurl('countries'));\n }",
"public function newAction(Request $request) {\n $country = new Country();\n $form = $this->createForm('B2bBundle\\Form\\CountryType', $country);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($country);\n $em->flush();\n\n return $this->redirectToRoute('backoffice_country_show', array('id' => $country->getId()));\n }\n\n return $this->render('country/new.html.twig', array(\n 'country' => $country,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n\n return view('backend.country.create');\n }"
]
| [
"0.7399725",
"0.71989477",
"0.65310997",
"0.65064156",
"0.6375539",
"0.61514044",
"0.6146466",
"0.61418074",
"0.6138512",
"0.61199176",
"0.6112619",
"0.61109596",
"0.6090369",
"0.60847354",
"0.6069296",
"0.6047175",
"0.6046414",
"0.6015595",
"0.60115665",
"0.5987653",
"0.59843695",
"0.59682447",
"0.59654117",
"0.59646904",
"0.59482807",
"0.5944021",
"0.59213305",
"0.59151226",
"0.5905105",
"0.5902828"
]
| 0.78188384 | 0 |
Form Fields short code For generating a form from short code values Example: [contactus new_line="," delimiter="|" questions="Your Name,Your Email|email" headings="A title prior to Your Name Field|yourname" inputs="yourname|name"]This is the form description[/contactus] In this example: The tag is "contactus", which will be in the "tag" key for the view The questions csv has a new line character of "," and a delimiter of "|" so if this was a csv file/string it would look like this: "Your Name", "Your Email"|"email", The first column is the field label and used as the field name run through slugify These values get parsed add applied to the "questions" key There's a title of "A title prior to Your Name Field" that gets applied prior to the "yourname" field The actual name of the input for "yourname" (slugify the label) will be "name" set in the inputs | public function formFieldsShortCode($attributes, $content, $tag)
{
/** @var string $questions */
/** @var string $special_questions */
/** @var string $new_line */
/** @var string $delimiter */
/** @var string $inputs */
/** @var string $headings */
$defaults = array(
"name" => $tag,
"questions" => "",
"new_line" => ",",
"delimiter" => "|",
"inputs" => "",
"headings" => "",
"ids" => "",
"special_questions" => ""
);
$attr = shortcode_atts($defaults, $attributes);
extract($attr);
/** @var string $special_questions */
$special_questions = $attr['special_questions'];
/** @var string $delimiter */
$delimiter = $attr['delimiter'];
/** @var string $new_line */
$new_line = $attr['new_line'];
/** @var string $name */
$name = $attr['name'];
/** @var string $questions */
$questions = $attr['questions'];
$context = self::get_context();
foreach (array_keys($defaults) as $default) {
switch ($default) {
case ('new_line'):
case ('delimiter'):
case ('legend'):
break;
case ('special_questions'):
$context[$default] = strpos($special_questions, $delimiter) !== false ? explode($delimiter,
$special_questions) : [$special_questions];
break;
default:
$this->parseCsv($context, $$default, $default, $delimiter, $new_line);
break;
}
}
$autoVersion = new AutoVersion;
// add styles ass needed
if (stripos($questions, 'range') !== false) {
wp_enqueue_style(
'bootstrap-slider',
'/../' . $autoVersion->file('/bower_components/seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css')
);
}
if (stripos($questions, 'boolean') !== false) {
wp_enqueue_style(
'bootstrap-switch',
'/../' . $autoVersion->file('/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css')
);
}
$context['name'] = $name;
$context['new_line'] = $new_line;
$context['delimiter'] = $delimiter;
$context['action'] = '/app/' . $name;
$context['method'] = 'POST';
$context['content'] = $content;
$context['legend'] = Strings::formatForTitle(str_replace('-', ' ', $name));
$context['tag'] = $tag;
$context['submitId'] = 'doFormSubmit';
return Timber::compile(['forms/form-template.twig'], $context);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function formShort()\n {\n $form = new Form(new Category);\n\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n return $form;\n }",
"public function getTemplateExample()\n\t{\n\t\t// start form\n\t\t$value = \"\\n\";\n\t\t$value .= '{form:' . $this->getName() . \"}\\n\";\n\n\t\t/**\n\t\t * At first all the hidden fields need to be added to this form, since\n\t\t * they're not shown and are best to be put right beneath the start of the form tag.\n\t\t */\n\t\tforeach($this->getFields() as $object)\n\t\t{\n\t\t\t// is a hidden field\n\t\t\tif(($object instanceof SpoonFormHidden) && $object->getName() != 'form')\n\t\t\t{\n\t\t\t\t$value .= \"\\t\" . '{$hid' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . \"}\\n\";\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add all the objects that are NOT hidden fields. Based on the existance of some methods\n\t\t * errors will or will not be shown.\n\t\t */\n\t\tforeach($this->getFields() as $object)\n\t\t{\n\t\t\t// NOT a hidden field\n\t\t\tif(!($object instanceof SpoonFormHidden))\n\t\t\t{\n\t\t\t\t// buttons\n\t\t\t\tif($object instanceof SpoonFormButton)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$btn' . SpoonFilter::toCamelCase($object->getName()) . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// single checkboxes\n\t\t\t\telseif($object instanceof SpoonFormCheckbox)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$chk' . SpoonFilter::toCamelCase($object->getName()) . '} {$chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// multi checkboxes\n\t\t\t\telseif($object instanceof SpoonFormMultiCheckbox)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<div{option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<p class=\"label\">' . SpoonFilter::toCamelCase($object->getName()) . '</p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<ul class=\"inputList\">' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\\t\" . '<li><label for=\"{$' . $object->getName() . '.id}\">{$' . $object->getName() . '.chk' . SpoonFilter::toCamelCase($object->getName()) . '} {$' . $object->getName() . '.label}</label></li>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{/iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '</ul>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</div>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// dropdowns\n\t\t\t\telseif($object instanceof SpoonFormDropdown)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error} class=\"errorArea\"{/option:ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . '} {$ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// imagefields\n\t\t\t\telseif($object instanceof SpoonFormImage)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$file' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpImageField}</span> {$file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// filefields\n\t\t\t\telseif($object instanceof SpoonFormFile)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$file' . SpoonFilter::toCamelCase($object->getName()) . '} {$file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// radiobuttons\n\t\t\t\telseif($object instanceof SpoonFormRadiobutton)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<div{option:rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<p class=\"label\">' . SpoonFilter::toCamelCase($object->getName()) . '</p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<ul class=\"inputList\">' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\\t\" . '<li><label for=\"{$' . $object->getName() . '.id}\">{$' . $object->getName() . '.rbt' . SpoonFilter::toCamelCase($object->getName()) . '} {$' . $object->getName() . '.label}</label></li>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{/iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '</ul>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</div>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// datefields\n\t\t\t\telseif($object instanceof SpoonFormDate)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpDateField}</span> {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// timefields\n\t\t\t\telseif($object instanceof SpoonFormTime)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpTimeField}</span> {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// textfields\n\t\t\t\telseif(($object instanceof SpoonFormPassword) || ($object instanceof SpoonFormTextarea) || ($object instanceof SpoonFormText))\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $value . '{/form:' . $this->getName() . '}';\n\t}",
"function form_shortcode( $atts ) {\n \n if ( isset( $atts['form'] ) ) {\n \n $form_id_or_key = $atts['form'];\n unset( $atts['form'] );\n \n ob_start();\n \n $this->render( $form_id_or_key, $atts );\n \n $output = ob_get_clean();\n \n return $output;\n \n }\n \n }",
"function add_shortcode() {\n\t\tadd_shortcode( 'contact-form', array( 'Grunion_Contact_Form', 'parse' ) );\n\t\tadd_shortcode( 'contact-field', array( 'Grunion_Contact_Form', 'parse_contact_field' ) );\n\t}",
"function ctools_export_form($form, &$form_state, $code, $title = '') {\r\n $lines = substr_count($code, \"\\n\");\r\n $form['code'] = array(\r\n '#type' => 'textarea',\r\n '#title' => $title,\r\n '#default_value' => $code,\r\n '#rows' => $lines,\r\n );\r\n\r\n return $form;\r\n}",
"function shortcode_field() {\n\n\t\t$shortcode = '[file id=\"' . get_the_ID() . '\" ]';\n\n\t\t?>\n\t\t<div class=\"misc-pub-section\">\n\t\t\t<label for=\"attachment_url\"><?php _e( 'File Shortcode:' ); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat urlfield\" readonly=\"readonly\" name=\"attachment_url\" value=\"<?php echo esc_attr($shortcode); ?>\" />\n\t\t</div>\n\t\t<?php\n\t}",
"function wpcf7dtx_tag_generator($contact_form, $options = '')\r\n{\r\n $options = wp_parse_args($options);\r\n global $wpcf7_dynamic_fields_config;\r\n $type = $options['id'];\r\n $input_type = str_replace('dynamic_', '', $type);\r\n $utm_source = urlencode(home_url());\r\n $description = sprintf(\r\n __('Generate a form-tag for %s with a dynamic default value. For more details, see %s fields in the %s.', 'contact-form-7-dynamic-text-extension'),\r\n esc_html($wpcf7_dynamic_fields_config[$type]['description']), // dynamic description\r\n // Link to specific form-tag documentation\r\n sprintf(\r\n '<a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/%s?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" title=\"%s\" target=\"_blank\" rel=\"noopener\">%s</a>',\r\n esc_attr(str_replace('_', '-', $type)), // URL component\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_attr__('View this form-tag on the DTX Documentation website', 'contact-form-7-dynamic-text-extension'), // Link title\r\n esc_html(ucwords(str_replace('_', ' ', $type))) // Link label\r\n ),\r\n // Link to general DTX documentation\r\n sprintf(\r\n '<a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" title=\"%s\" target=\"_blank\" rel=\"noopener\">%s</a>',\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_attr__('Go to DTX Documentation website', 'contact-form-7-dynamic-text-extension'),\r\n esc_html__('DTX knowledge base', 'contact-form-7-dynamic-text-extension')\r\n )\r\n );\r\n\r\n // Open Form-Tag Generator\r\n printf(\r\n '<div class=\"control-box dtx-taggen\"><fieldset><legend>%s</legend><table class=\"form-table\"><tbody>',\r\n wp_kses($description, array('a' => array('href' => array(), 'target' => array(), 'rel' => array(), 'title' => array()))) //Tag generator description\r\n );\r\n\r\n // Input field - Required checkbox (not available for some fields)\r\n if (!in_array($input_type, array('hidden', 'quiz', 'submit', 'reset'))) {\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-required'), // field id\r\n esc_html__('Field type', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'required',\r\n 'id' => $options['content'] . '-required'\r\n )),\r\n esc_html__('Required field', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n }\r\n\r\n // Input field - Field Name (not available for some fields)\r\n if (!in_array($input_type, array('submit', 'reset'))) {\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><input %s /></td></tr>',\r\n esc_attr($options['content'] . '-name'), // field id\r\n esc_html__('Name', 'contact-form-7-dynamic-text-extension'), // field label\r\n wpcf7_format_atts(array(\r\n 'type' => 'text',\r\n 'name' => 'name',\r\n 'id' => $options['content'] . '-name',\r\n 'class' => 'tg-name oneline',\r\n 'autocomplete' => 'off'\r\n ))\r\n );\r\n }\r\n\r\n // Input field - Dynamic value/options\r\n $value_name = __('Dynamic value', 'contact-form-7-dynamic-text-extension');\r\n $value_description = __('Can be static text or a shortcode.', 'contact-form-7-dynamic-text-extension');\r\n $value_placeholder = \"CF7_GET key='foo'\";\r\n $value_input_type = '<input %s />';\r\n switch ($input_type) {\r\n case 'textarea':\r\n $value_placeholder = \"CF7_get_post_var key='post_excerpt'\";\r\n $value_input_type = '<textarea %s></textarea>';\r\n break;\r\n case 'select':\r\n $value_name = __('Dynamic options', 'contact-form-7-dynamic-text-extension');\r\n $value_description .= ' ' . __('If static text, use one option per line. Can define static key/value pairs using pipes.', 'contact-form-7-dynamic-text-extension');\r\n $value_description .= ' ' . __('If shortcode, it must return only option or optgroup HTML and can override the first option and select default settings here.', 'contact-form-7-dynamic-text-extension');\r\n $value_placeholder = \"hello-world | Hello World\" . PHP_EOL . \"Foo\";\r\n $value_input_type = '<textarea %s></textarea>';\r\n break;\r\n case 'checkbox':\r\n case 'radio':\r\n $value_name = __('Dynamic options', 'contact-form-7-dynamic-text-extension');\r\n $value_description .= ' ' . __('If static text, use one option per line. Can define static key/value pairs using pipes.', 'contact-form-7-dynamic-text-extension');\r\n $value_description .= ' ' . __('If shortcode, it must return only option or optgroup HTML.', 'contact-form-7-dynamic-text-extension');\r\n $value_placeholder = \"hello-world | Hello World\" . PHP_EOL . \"Foo\";\r\n $value_input_type = '<textarea %s></textarea>';\r\n break;\r\n default: // All other text fields\r\n break;\r\n }\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td>' . $value_input_type . '<br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-values'), // field id\r\n esc_html($value_name), // field label\r\n wpcf7_format_atts(array(\r\n 'name' => 'values',\r\n 'id' => $options['content'] . '-values',\r\n 'class' => 'multiline',\r\n 'placeholder' => $value_placeholder,\r\n 'list' => 'dtx-shortcodes'\r\n )),\r\n esc_html($value_description),\r\n esc_attr($utm_source), // UTM source\r\n esc_attr($type), // UTM content\r\n esc_html__('View DTX shortcode syntax documentation', 'contact-form-7-dynamic-text-extension') // Link label\r\n );\r\n\r\n if ($input_type == 'select') {\r\n // Input field - Multiple selections checkbox\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-multiple'), // field id\r\n esc_html__('Multiple Options', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'multiple',\r\n 'id' => $options['content'] . '-multiple',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Allow user to select multiple options', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n\r\n // Input field - Include blank checkbox\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-include_blank'), // field id\r\n esc_html__('First Option', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'include_blank',\r\n 'id' => $options['content'] . '-include_blank',\r\n 'class' => 'include_blankvalue option'\r\n )),\r\n esc_html__('Insert a blank item as the first option', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n }\r\n\r\n // Input field - Dynamic placeholder (not available for some fields)\r\n if (!in_array($input_type, array('hidden', 'radio', 'checkbox', 'quiz', 'submit', 'reset'))) {\r\n $placeholder_description = '';\r\n if (in_array($input_type, array('select', 'checkbox', 'radio'))) {\r\n $placeholder_label = __('First Option Label', 'contact-form-7-dynamic-text-extension');\r\n $placeholder_description .= __('Optionally define a label for the first option.', 'contact-form-7-dynamic-text-extension') . ' ';\r\n } else {\r\n $placeholder_label = __('Dynamic placeholder', 'contact-form-7-dynamic-text-extension');\r\n }\r\n $placeholder_description .= __('Can be static text or a shortcode.', 'contact-form-7-dynamic-text-extension');\r\n $placeholder_input_type = $input_type == 'textarea' ? $value_input_type : '<input %s />';\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><input %s />' . $placeholder_input_type . '<br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-attribute-placeholder/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-placeholder'), // field id\r\n esc_html($placeholder_label), // field label\r\n wpcf7_format_atts(array(\r\n 'type' => 'hidden',\r\n 'name' => 'placeholder',\r\n 'class' => 'option'\r\n )),\r\n wpcf7_format_atts(array(\r\n 'name' => 'dtx-placeholder',\r\n 'id' => $options['content'] . '-placeholder', // field id\r\n 'class' => 'multiline dtx-option',\r\n 'placeholder' => \"CF7_get_post_var key='post_title'\",\r\n 'list' => 'dtx-shortcodes'\r\n )),\r\n esc_html($placeholder_description), // Small note below input\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_html__('View DTX placeholder documentation', 'contact-form-7-dynamic-text-extension') //Link label\r\n );\r\n }\r\n\r\n // Additional fields for select regarding placeholder options\r\n if ($input_type == 'select') {\r\n\r\n // Input field - Hide Blank Option\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label><br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-dtx_hide_blank'), // field id\r\n esc_html__('Hide First Option', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'dtx_hide_blank',\r\n 'id' => $options['content'] . '-dtx_hide_blank',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Hide the first blank option from being visible in the drop-down', 'contact-form-7-dynamic-text-extension'), // checkbox label\r\n esc_html__('Optional. Only works if \"First Option\" is checked.', 'contact-form-7-dynamic-text-extension'), // Small note below input\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_html__('View Dynamic Select documentation', 'contact-form-7-dynamic-text-extension') //Link label\r\n );\r\n\r\n // Input field - Disable Blank Option\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label><br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-dtx_disable_blank'), // field id\r\n esc_html__('Disable First Option', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'dtx_disable_blank',\r\n 'id' => $options['content'] . '-dtx_disable_blank',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Disable the first blank option from being selectable in the drop-down', 'contact-form-7-dynamic-text-extension'), // checkbox label\r\n esc_html__('Optional. Only works if \"First Option\" is checked.', 'contact-form-7-dynamic-text-extension'), // Small note below input\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_html__('View Dynamic Select documentation', 'contact-form-7-dynamic-text-extension') //Link label\r\n\r\n );\r\n } elseif (in_array($input_type, array('checkbox', 'radio'))) {\r\n // Additional fields for checkboxes and radio buttons\r\n\r\n // Input field - Checkbox Layout Reverse Option\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-label_first'), // field id\r\n esc_html__('Reverse', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'label_first',\r\n 'id' => $options['content'] . '-label_first',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Put a label first, an input last', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n\r\n // Input field - Label UI\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-use_label_element'), // field id\r\n esc_html__('Label', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'use_label_element',\r\n 'id' => $options['content'] . '-use_label_element',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Wrap each item with label element', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n\r\n // Input field - Exclusive Checkbox\r\n if ($input_type == 'checkbox') {\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-exclusive'), // field id\r\n esc_html__('Exclusive', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'exclusive',\r\n 'id' => $options['content'] . '-exclusive',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Make checkboxes exclusive', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n }\r\n }\r\n\r\n // Input field - Dynamic default value (not available for some fields)\r\n if (in_array($input_type, array('select'))) {\r\n $default_input_type = '<input %s />';\r\n $default_placeholder = '';\r\n if ($input_type == 'checkbox') {\r\n $default_input_type = '<textarea %s></textarea>';\r\n $default_description = __('Optionally define the default on/off status of the checkboxes by putting a 1 (checked) or 0 (not checked) on each line that corresponds with the options.', 'contact-form-7-dynamic-text-extension') . ' ';\r\n $default_placeholder = '0' . PHP_EOL . '1';\r\n } else {\r\n $default_description = __('Optionally define the option that is selected by default. This can be different than the first [blank] option. If options use key/value pairs, only define the key here.', 'contact-form-7-dynamic-text-extension') . ' ';\r\n }\r\n $default_description .= __('Can be static text or a shortcode.', 'contact-form-7-dynamic-text-extension');\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><input %s />' . $default_input_type . '<br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-default'), // field id\r\n esc_html__('Selected Default'), // field label\r\n wpcf7_format_atts(array(\r\n 'type' => 'hidden',\r\n 'name' => 'default',\r\n 'class' => 'option'\r\n )),\r\n wpcf7_format_atts(array(\r\n 'name' => 'dtx-default',\r\n 'id' => $options['content'] . '-default', // field id\r\n 'class' => 'oneline dtx-option',\r\n 'placeholder' => $default_placeholder,\r\n 'list' => 'dtx-shortcodes'\r\n )),\r\n esc_html($default_description), // Small note below input\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_html__('View Dynamic Select documentation', 'contact-form-7-dynamic-text-extension') //Link label\r\n );\r\n }\r\n\r\n //Input field - ID attribute\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><input %s /></td></tr>',\r\n esc_attr($options['content'] . '-id'), // field id\r\n esc_html__('Id attribute', 'contact-form-7-dynamic-text-extension'), // field label\r\n wpcf7_format_atts(array(\r\n 'type' => 'text',\r\n 'name' => 'id',\r\n 'id' => $options['content'] . '-id', // field id\r\n 'class' => 'idvalue oneline option'\r\n ))\r\n );\r\n\r\n //Input field - Class attribute\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><input %s /></td></tr>',\r\n esc_attr($options['content'] . '-class'), // field id\r\n esc_html__('Class attribute', 'contact-form-7-dynamic-text-extension'), // field label\r\n wpcf7_format_atts(array(\r\n 'type' => 'text',\r\n 'name' => 'class',\r\n 'id' => $options['content'] . '-class', // field id\r\n 'class' => 'classvalue oneline option'\r\n ))\r\n );\r\n\r\n //Input field - Readonly attribute (not available for hidden, submit, or quiz fields)\r\n if (!in_array($input_type, array('hidden', 'submit', 'quiz'))) {\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-readonly'), // field id\r\n esc_html__('Read only attribute', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'readonly',\r\n 'id' => $options['content'] . '-readonly',\r\n 'class' => 'readonlyvalue option'\r\n )),\r\n esc_html__('Do not let users edit this field', 'contact-form-7-dynamic-text-extension') // checkbox label\r\n );\r\n }\r\n\r\n // Input field - Page load data attribute (triggers the loading of a frontend script)\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label><br /><small>%s <a href=\"https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tag-attribute-after-page-load/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=form-tag-generator-%s\" target=\"_blank\" rel=\"noopener\">%s</a></small></td></tr>',\r\n esc_attr($options['content'] . '-dtx_pageload'), // field id\r\n esc_html__('Cache Compatible', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'dtx_pageload',\r\n 'id' => $options['content'] . '-dtx_pageload',\r\n 'class' => 'option'\r\n )),\r\n esc_html__('Get the dynamic value after the page has loaded', 'contact-form-7-dynamic-text-extension'), // checkbox label\r\n esc_html__('May impact page performance.', 'contact-form-7-dynamic-text-extension'), // Small note below input\r\n esc_attr($utm_source), //UTM source\r\n esc_attr($type), //UTM content\r\n esc_html__('View DTX page load documentation', 'contact-form-7-dynamic-text-extension') //Link label\r\n\r\n );\r\n\r\n // Input field - Akismet module (only available for text, email, and url fields)\r\n if (in_array($input_type, array('text', 'email', 'url'))) {\r\n switch ($input_type) {\r\n case 'email':\r\n $akismet_name = 'author_email';\r\n $akismet_desc = __(\"This field requires author's email address\", 'contact-form-7-dynamic-text-extension');\r\n break;\r\n case 'url':\r\n $akismet_name = 'author_url';\r\n $akismet_desc = __(\"This field requires author's URL\", 'contact-form-7-dynamic-text-extension');\r\n break;\r\n default:\r\n $akismet_name = 'author';\r\n $akismet_desc = __(\"This field requires author's name\", 'contact-form-7-dynamic-text-extension');\r\n break;\r\n }\r\n printf(\r\n '<tr><th scope=\"row\"><label for=\"%s\">%s</label></th><td><label><input %s />%s</label></td></tr>',\r\n esc_attr($options['content'] . '-readonly'), // field id\r\n esc_html__('Akismet', 'contact-form-7-dynamic-text-extension'), // field Label\r\n wpcf7_format_atts(array(\r\n 'type' => 'checkbox',\r\n 'name' => 'akismet:' . $akismet_name,\r\n 'id' => $options['content'] . '-akismet-' . $akismet_name,\r\n 'class' => 'akismetvalue option'\r\n )),\r\n esc_html($akismet_desc) // checkbox label\r\n );\r\n }\r\n\r\n //Close Form-Tag Generator\r\n printf(\r\n '</tbody></table></fieldset></div><div class=\"insert-box\"><input type=\"text\" name=\"%s\" class=\"tag code\" readonly=\"readonly\" onfocus=\"this.select()\" /><div class=\"submitbox\"><input type=\"button\" class=\"button button-primary insert-tag\" value=\"%s\" /></div><br class=\"clear\" /></div>',\r\n esc_attr($type),\r\n esc_html__('Insert Tag', 'contact-form-7-dynamic-text-extension')\r\n );\r\n}",
"function sc_shortcode_form() {\r\n\tglobal $sc_url;\r\n\t$fields = get_option('sc_form');\r\n\t$settings = get_option('sc_settings');\r\n\r\n\t$form = '';\r\n\t$form .= '<div id=\"sc_form\">';\r\n\t$form .= '<div class=\"mess\"></div>';\r\n\t$form .= '<form method=\"post\" action=\"\" onsubmit=\"return scCheckForm2()\">';\r\n\t\r\n\tif( $fields!='' ): for($i=0; $i<count($fields); $i++):\r\n\t\t\r\n\t\tif( $fields[$i]['req']==1 ){ $mend = 'mendatory '; $ast = '* '; }\r\n\t\telse { $mend = ''; $ast = ''; }\r\n\t\t\r\n\t\tif( $fields[$i]['mail']==1 ) $mail = 'sc_mail';\r\n\t\telse $mail = '';\r\n\t\t\r\n\t\t$lbl = '<label class=\"'. $mend. $mail .'\" for=\"field_'. $i .'_sc\">'. $ast . $fields[$i]['label'] .'</label>';\r\n\t\t$hid = '<input name=\"field_name[]\" value=\"'. $fields[$i]['label'] .'\" type=\"hidden\" style=\"display:none;\" />';\r\n\t\t\r\n\t\tif( $fields[$i]['type']=='textbox' )\r\n\t\t\t$in = '<input class=\"drwr-txtInp-sc\" name=\"field_val[]\" id=\"field_'. $i .'_sc\" type=\"text\" />';\r\n\t\telse\r\n\t\t\t$in = '<textarea class=\"drwr-txtArea-sc\" rows=\"5\" cols=\"5\" name=\"field_val[]\" id=\"field_'. $i .'_sc\"></textarea>';\r\n\t\t\r\n\t\t$form .= \"\\n\\n<p>\".$hid;\r\n\t\t$form .= \"\\n\".$lbl;\r\n\t\t$form .= \"\\n\".$in.\"</p>\";\r\n\t\r\n\tendfor; endif;\r\n\t\r\n\t\r\n\t//add captcha code starts \r\n\tif( $settings['sc_captcha']==1 ){\r\n\t\t\r\n\t\t$form .= '<p><label>Security Code</label>';\r\n\t\t$form .= '<img src=\"'. $sc_url .'/includes/captcha/securimage_show.php?sid='. md5(uniqid(time())) .'\" alt=\"Security Code\" id=\"sc_image_sc\" style=\"float:left\" />';\r\n\t\t\r\n\t\t$form .= '<a href=\"#\" onclick=\"document.getElementById(\\'sc_image_sc\\').src = \\''. $sc_url .'/includes/captcha/securimage_show.php?sid=\\' + Math.random(); return false\"><img src=\"'. $sc_url .'/includes/captcha/images/refresh.png\" alt=\"Reload Image\" title=\"Reload Image\" style=\"float:left;padding-left:10px;\" /></a></p>';\r\n\t\t\r\n\t\t$form .= '<p><label for=\"sc_code_sc\" class=\"mendatory\">* Verify Code</label>';\r\n\t\t$form .= '<input name=\"sc_code\" id=\"sc_code_sc\" type=\"text\" style=\"text-align:center;\" /></p>';\r\n\t\r\n\t}\r\n\t//add captcha code ends\r\n\t\r\n\t\r\n\t\t$form .= '<p><label>*required fields</label><input value=\"Submit\" type=\"submit\" id=\"sc_submit_sc\" /></p>';\r\n\t$form .= '</form>';\r\n\t$form .= '</div>';\r\n\r\n\t$form .= '<div id=\"sc_thanku_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_thanku'] .'</div></div>';\r\n\t$form .= '<div id=\"sc_error_sc\" style=\"display:none\"><div class=\"mess\">'. $settings['sc_error'] .'</div></div>';\r\n\r\n\treturn $form;\r\n}",
"function shorten_keys_form() {\n $form = drupal_get_form('shorten_keys');\n return drupal_render($form);\n}",
"public function meta_box_display_forms() {\n\t?>\n\t\t<p><?php _e( 'Add forms to your Posts or Pages by locating the <strong>Add Form</strong> button in the area above your post/page editor.', 'visual-form-builder-pro' ); ?></p>\n \t<p><?php _e( 'You may also manually insert the shortcode into a post/page or the template tag into a template file.', 'visual-form-builder-pro' ); ?></p>\n \t<p>\n \t\t<?php _e( 'Shortcode', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"[vfb id='<?php echo (int) $_REQUEST['form']; ?>']\" readonly=\"readonly\" />\n \t</p>\n \t<p>\n \t\t<?php _e( 'Template Tag', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"<?php vfb_pro( 'id=<?php echo (int) $_REQUEST['form']; ?>' ); ?>\" readonly=\"readonly\"/>\n \t</p>\n\t<?php\n\t}",
"function mk_customizerForm($cName, $cGen, $str = ''){\n\t$str='<h4><a href=\"#\">Customize Descriptions</a></h4>\n\t\t<p>Enter characters name to personalize each & every descriptions on this page to your character.</p>';\n\t\t\t$str .='<form action=\"' . htmlspecialchars(THIS_PAGE) . '\" method=\"get\">\n\t\t\t\t<input type=\"text\" name=\"codeName\"\n\t\t\t\t\tvalue=\"' . $cName . '\" placeholder=\"Alias / Codename?\"><br>\n\t\t\t\t\t<input type=\"radio\" name=\"gender\"';\n\n\t\t\t\t\tif ((isset($cGen)) && ($cGen==\"female\")){ $str .= \"checked\"; }\n\n\t\t\t\t\t$str .='value=\"female\"> Female <input type=\"radio\" name=\"gender\"';\n\n\t\t\t\t\tif ((isset($cGen)) && ($cGen==\"male\")){ $str .= \"checked\"; }\n\n\t\t\t\t\t$str .='value=\"male\"> Male\n\t\t\t\t\t<br /><br/>';\n\n\t\t\t\t$str .='<input type=\"hidden\" name=\"CharID\" value=\"0\">\n\t\t\t\t<input type=\"submit\" value=\"Submit\">\n\t\t\t</form>\n\t\t<hr />';\n\n\treturn $str;\n}",
"function contact_fields() {\n\t\n?>\t<div class=\"contact-address two-fifths first\" >\n\n\t<?php\n\techo do_shortcode('[contact-card]');//}\n\t ?>\n\t\t\n\t\t</div> \n\t\t\n\t\t<div class=\"three-fifths\"> <?php\tif( get_field('contact_page_message') ): \n\t\t\t the_field('contact_page_message'); \n\t\tendif; \n\t\t\t\n\t\t\n\t\techo do_shortcode('[contact]' );?>\n\t\t\n\t\t</div><?php\n\t\n\t\t\n\t\t}",
"function mango_wpcf7_text_shortcode_handler ( $tag ) {\n $tag = new WPCF7_Shortcode( $tag );\n if ( empty( $tag->name ) )\n\t\treturn '';\n\t\n $validation_error = wpcf7_get_validation_error ( $tag->name );\n $class = wpcf7_form_controls_class ( $tag->type, 'wpcf7-text' );\n\n if ( in_array ( $tag->basetype, array ( 'email', 'url', 'tel' ) ) )\n\t\t$class .= ' wpcf7-validates-as-' . $tag->basetype;\n\n if ( $validation_error )\n\t\t$class .= ' wpcf7-not-valid';\n\t\t$atts = array ();\n\t\t$atts_id = '';\n\t\t$atts[ 'size' ] = $tag->get_size_option ( '40' );\n\t\t$atts[ 'maxlength' ] = $tag->get_maxlength_option ();\n\t\t$atts[ 'minlength' ] = $tag->get_minlength_option ();\n\n if ( $atts[ 'maxlength' ] && $atts[ 'minlength' ] && $atts[ 'maxlength' ] < $atts[ 'minlength' ] ) {\n\t\tunset( $atts[ 'maxlength' ], $atts[ 'minlength' ] );\n }\n\t\n $atts[ 'class' ] = $tag->get_class_option ( $class );\n $atts[ 'id' ] = $tag->get_id_option ();\n $atts_id = $atts[ 'id' ];\n $atts[ 'tabindex' ] = $tag->get_option ( 'tabindex', 'int', true );\n\n if ( $tag->has_option ( 'readonly' ) )\n\t\t$atts[ 'readonly' ] = 'readonly';\n\n if ( $tag->is_required () )\n\t\t$atts[ 'aria-required' ] = 'true';\n\t\t$atts[ 'aria-invalid' ] = $validation_error ? 'true' : 'false';\n\t\t$value = (string)reset ( $tag->values );\n\n if ( $tag->has_option ( 'placeholder' ) || $tag->has_option ( 'watermark' ) ) {\n\t\t$atts[ 'placeholder' ] = $value;\n\t\t$value = '';\n }\n\t\n $value = $tag->get_default_option ( $value );\n $value = wpcf7_get_hangover ( $tag->name, $value );\n $atts[ 'value' ] = $value;\n\n if ( wpcf7_support_html5 () ) {\n\t\t$atts[ 'type' ] = $tag->basetype;\t\n\t}\n\telse {\n\t\t$atts[ 'type' ] = 'text';\n }\n $atts[ 'name' ] = $tag->name;\n $atts = wpcf7_format_atts ( $atts );\n\t\n if ( $atts_id == 'disabledInput' )\n $html = sprintf (\n '<input %1$s disabled />%2$s', $atts, $validation_error );\n else\n $html = sprintf (\n '<input %1$s />%2$s', $atts, $validation_error );\n\t\treturn $html;\n\t}",
"function hgr_minimal_input($atts,$content = null) {\n\t\t\t$output = $label_text = $input_type = $input_type_front = $hgr_question_id = $input_validate = '';\n\t\t\t\n\t\t\t/*\n\t\t\t\tWordPress function to extract shortcodes attributes\n\t\t\t\tRefference: http://codex.wordpress.org/Function_Reference/shortcode_atts\n\t\t\t*/\n\t\t\textract(shortcode_atts(array(\n\t\t\t\t'label_text'\t\t\t=>\t'',\n\t\t\t\t'input_type'\t\t\t=>\t''\n\t\t\t), $atts));\n\t\t\t\n\t\t\t/*\n\t\t\t\tShortcode content output\n\t\t\t*/\n\t\t\tswitch($input_type){\n\t\t\t\tcase 'text':\n\t\t\t\t\t$input_type_front = 'text';\n\t\t\t\t\t$input_validate = 'data-validate=\"none\"';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'e-mail':\n\t\t\t\t\t$input_type_front = 'email';\n\t\t\t\t\t$input_validate = 'data-validate=\"email\"';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'telephone':\n\t\t\t\t\t$input_type_front = 'tel';\n\t\t\t\t\t$input_validate = 'data-validate=\"none\"';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$hgr_question_id = \"q-\".uniqid();\n\n\t\t\t$output .= '<li>';\n\t\t\t\t$output .= '<span><label for=\"'.$hgr_question_id.'\"><h2 '.$GLOBALS[\"hgr_label_style\"].'>'.$label_text.'</h2></label></span>';\n\t\t\t\t$output .= '<input id=\"'.$hgr_question_id.'\" name=\"'.$hgr_question_id.'\" type=\"'.$input_type_front.'\" '.$GLOBALS[\"hgr_input_text_style\"].' '.$input_validate.' data-question=\"'.$label_text.'\"/>';\n\t\t\t$output .= '</li>';\n\t\t\t\n\t\t\t/*\n\t\t\t\tReturn the output\n\t\t\t*/\n\t\t\treturn $output;\n\t\t}",
"function short_code_func(){\n\t\t$opt_val = get_option( 'wpCertifications_configData' );\n\n\t\t$savedData = json_decode($opt_val);\n\n\t\t$view_bag['list_id'] = $savedData->list_id;\n\t\t$view_bag['api_key'] = $savedData->api_key;\n\n\t\t$sc = new wpCertifications();\n\t\t$content = $sc->get_render( 'form.php', $view_bag );\n return $content;\n\t}",
"public function fields()\n\t{\n\t\t$fields = array(\n\t\t\t'tag_manager_head'\t=> array(\n\t\t\t\t'label'\t\t\t=> __( 'Tag Manager Head code', 'purple' ),\n\t\t\t\t'option'\t\t=> 'tag_manager_head',\n\t\t\t\t'type'\t\t\t=> 'textarea',\n\t\t\t),\n\t\t\t'tag_manager_body'\t=> array(\n\t\t\t\t'label'\t\t\t=> __( 'Tag Manager Body code', 'purple' ),\n\t\t\t\t'option'\t\t=> 'tag_manager_body',\n\t\t\t\t'type'\t\t\t=> 'textarea',\n\t\t\t),\n\t\t\t'analytics'\t=> array(\n\t\t\t\t'label'\t\t\t=> __( 'Analytics code', 'purple' ),\n\t\t\t\t'option'\t\t=> 'analytics',\n\t\t\t\t'type'\t\t\t=> 'textarea',\n\t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filters the Google Tracking Options fields\n\t\t * @param array $fields\n\t\t *\n\t\t * @since Purple 1.0.0\n\t\t */\n\t\treturn apply_filters( 'purple_google_tracking_fields', $fields );\n\t}",
"public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }",
"function my_shortcode() {\n\n$options = get_option('foodrecipecptplugin_settings');\nreturn \"<p>Recipe Name:\" . $options['foodrecipecptplugin_text_field_0'] . \"</p>\".\"<p>Category: \" . $options['foodrecipecptplugin_text_field_1'].\"</p>\".\"<p>Ingredients: \". $options['foodrecipecptplugin_text_field_2'].\"</p>\".\"<p>Recipe Instructions: \" . $options['foodrecipecptplugin_text_field_3'] . \"</p>\";\n}",
"public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' <>;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' <>;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' <>;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }",
"function form($atts)\n{\n $prenom = \"\";\n $nom = \"\";\n $mail = \"\";\n $sujet = \"\";\n $msg = \"\";\n\n extract(shortcode_atts(\n array(\n 'firstname' => 'true',\n 'lastname' => 'true',\n 'email' => 'true',\n 'subject' => 'true',\n 'message' => 'true',\n\n ), $atts));\n\n if ($firstname == \"true\") {\n $prenom = '<label>First name:</label><input type=\"text\" name=\"fname\" required>';\n }\n\n if ($lastname == \"true\") {\n $nom = '<label>Last name:</label><input type=\"text\" name=\"lname\" required>';\n }\n\n if ($email == \"true\") {\n $mail = '<label>Email:</label><input type=\"email\" name=\"email\" required>';\n }\n if ($subject == \"true\") {\n $sujet = '<label>Subject:</label><input type=\"text\" name=\"subject\" required>';\n }\n\n if ($message == \"true\") {\n $msg = '<label>Message:</label><textarea name=\"msg\"></textarea>';\n }\n\n echo '<form method=\"POST\" >' . $prenom . $nom . $mail . $sujet . $msg . '<input style=\"margin-top : 20px;\" value=\"Send\" type=\"submit\" name=\"send\"></form>';\n}",
"function describefield($field, $html = true)\n{\n\t$res = \"\";\n\tif($html)\n\t\t$res.= \"<b>\".htmlspecialchars($field[3]).\"</b>: \";\n\telse\n\t\t$res.= htmlspecialchars($field[3]).\": \";\n\n\t$atnybble = \"at nybble \".htmlspecialchars($field[1]);\n\tswitch ($field[0])\n\t{\n\t\tcase 'checkbox':\n\t\t\t$res .= \"checkbox $atnybble with mask \".htmlspecialchars($field[2]);\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\t$res .= \"value $atnybble\";\n\t\t\tbreak;\n\t\tcase 'signedvalue':\n\t\t\t$res .= \"signed value $atnybble\";\n\t\t\tbreak;\n\t\tcase 'index':\n\t\t\t$res .= \"index at $atnybble\";\n\t\t\tbreak;\n\t\tcase 'binary':\n\t\t\t$res .= \"binary editor $atnybble\";\n\t\t\tbreak;\n\t\tcase 'list':\n\t\t\t$listentries = str_replace(\"\\n\", ', ', rtrim($field[2]));\n\t\t\t$res .= \"list $atnybble: \".htmlspecialchars($listentries).\"\";\n\t\tbreak;\n\t}\n\n\tif ($field[4] != '') $res.= \". \".htmlspecialchars($field[4]).\"\";\n\t\n\treturn $res;\n}",
"public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}",
"public static function generate($fields) {\n $form=\"\";\n $extraOptions=[];\n // wildCard will be applied all inputs\n $wildCard=isset($fields[\"*\"]) ? $fields[\"*\"]:[];\n // exclude given elements\n if(isset($fields[\"_exclude\"])) {\n foreach ($fields[\"_exclude\"] as $value) {\n unset($fields[$value]);\n }\n }\n foreach ($fields as $key => $val) {\n if($key==\"*\"||$key==\"_exclude\") continue;\n if(!empty($wildCard)) {\n $val=array_replace_recursive($val,$wildCard);\n }\n $inputOptions=isset($val[\"options\"]) ? $val[\"options\"] : [];\n \n $placeholder=isset($val[\"placeholder\"]) ? $val[\"placeholder\"] : null;\n switch ($val[\"type\"]) {\n case 'select':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"data\"],$inputOptions);\n break;\n case 'password':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n break;\n case 'checkbox':\n case 'radio':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"value\"],null); // removed $val[\"checked\"] for unwanted results\n break;\n case 'color':\n case 'number':\n case 'file';\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$inputOptions);\n break;\n // other elements share the same parameters.\n default:\n try {\n\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n }catch(\\Exception $err) {\n if(config('app.debug')==false) { // only show error on debug\n dump(\"Error on generating form\",$err,$key,$val);\n }\n }\n break;\n }\n }\n return $form;\n }",
"function cjpopups_shortcode_form($options){\n\tinclude(sprintf('%s/shortcode_form.php', cjpopups_item_path('includes_dir')));\n\treturn implode(\"\\n\", $display);\n}",
"function htheme_contact_shortcode( $atts ) {\r\n\r\n\t\t#SETUP CONTENT CLASS\r\n\t\t$htheme_data = $this->htheme_content->htheme_get_contact_form($atts);\r\n\r\n\t\t#RETURN DATA/HTML\r\n\t\treturn $htheme_data;\r\n\r\n\t}",
"function shortcode_input( $atts ){\n\n $a = shortcode_atts( [\n 'placeholder' => 'Please Fill Out',\n 'name' => '',\n 'for' => '',\n 'id' => '',\n 'label_name' => 'Label',\n 'label_class' => '',\n 'input_class' => '',\n 'display' => 'block'\n ],\n $atts);\n\n return \"<label style='display:{$a['display']};' class='{$a['label_class']}' for='{$a['for']}'>{$a['label_name']}:</label>\n <input class='{$a['input_class']}' placeholder='{$a['placeholder']}' name='{$a['name']}' id='{$a['id']}'/>\n \";\n\n}",
"abstract public function getFormDesc();",
"function speakerbureau_form($atts, $content=null) {\n\n $atts = shortcode_atts(\n array(),\n $atts,\n 'contact_form'\n );\n\n // return HTML\n ob_start();\n include 'templates/contact-form.php';\n\n return ob_get_clean();\n}",
"function pgm_register_shortcodes(){\n add_shortcode('pgm_form','pgm_form_shortcode');\n}",
"function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}"
]
| [
"0.64892805",
"0.6223353",
"0.6174602",
"0.6160791",
"0.6129121",
"0.59559196",
"0.5926511",
"0.5884824",
"0.5873213",
"0.5849319",
"0.58040047",
"0.574726",
"0.5735506",
"0.57145536",
"0.5705095",
"0.5690671",
"0.56738734",
"0.56662333",
"0.56560475",
"0.5653904",
"0.5645139",
"0.5644849",
"0.56391424",
"0.5638557",
"0.56382567",
"0.5601514",
"0.55866045",
"0.55727655",
"0.5568778",
"0.5557376"
]
| 0.7102121 | 0 |
Gets query for [[Semester1Students]]. | public function getSemester1Students()
{
return $this->hasMany(Semester1Students::className(), ['semester' => 'semester_id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_students_list(){\n return $this->n->get_list_from_db();\n }",
"private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}",
"public function semesterOnePage() {\n return \\view('admin.students.one-results', [\n 'ones' => SemesterOne::query()->whereIn('user_id', User::query()->where('program_verified', true)->get())->paginate(config('mv-notification.paginate')),\n ]);\n }",
"public function getStudentsQueryForGroup($group_id) {\n\t\treturn SQLQuery::create()->select(\"StudentGroup\")->whereValue(\"StudentGroup\",\"group\",$group_id);\n\t}",
"public function getStudentsAssignment()\n {\n $where = [];\n foreach ($this->request->getQuery() as $key => $value) {\n if(!empty($value))\n $where[$key] = $value;\n }\n $response=$this->StudentHealths->StudentInfos->find()\n ->select(['name'=>'Students.name','id'=>'Students.id'])\n ->contain(['Students'])\n ->where($where) \n ->where(['is_deleted'=>'N'])\n ->where(['StudentInfos.session_year_id'=>$this->Auth->user('session_year_id')]);\n foreach ($response as $key => $value) {\n $option[$value->id]=$value->name;\n } \n if(!empty($option)){\n foreach ($option as $key => $value) {\n echo \"<option value='\".$key.\"'>\".$value.\"</option>\";\n }\n }\n exit;\n \n }",
"public function getAllStudents(){\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_StudentDAO->getAllStudents();\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in StudentDAO.getAllStudents()\");\t\t\n\n\t\treturn $Result;\n\t}",
"public function getStudentsByClass() {\n\t\t$students_by_class = Student::GetInstance()->getStudentsByClass( $_POST['class_id'] );\n\n\t\treturn jsonResult( $students_by_class );\n\n\t}",
"public function getStudent(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}",
"public function getStudents($params = array())\n {\n $sql = 'select * from engine4_users where user_id in (\n SELECT item_id FROM `engine4_user_fields_values` where field_id=1 and value=4\n )';\n \n $table = Engine_Api::_()->getDbtable('users', 'user')->getAdapter();\n $select = $table->query($sql)->fetchAll(); \n\n return $select;\n }",
"public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}",
"public function listOfStudents($skola) {\n\t\t\t$this->db->where('skolaId',$skola);\n\t\t\t $query = $this->db->get(\"predmet\");\n\t\t return $query;\n\t\t}",
"public static function getStudents() {\n\t\t$idm = PSU::get('idmobject');\n\n\t\t$search = array(\n\t\t\tarray('pa.attribute' => 'els_student'),\n\t\t\tarray('pa.type_id' => '2')\n\t\t);\n\n\t\t$return = 'i.pid,i.psu_id,i.username,i.first_name,i.last_name,l.start_date,l.end_date';\n\n\t\t$students = $idm->getUsersByAttribute( $search, 'AND', $return );\n\n\t\tarray_walk( $students, array('ELS', 'dates2timestamp') );\n\t\tarray_walk( $students, array('ELS', 'load_psuperson') );\n\t\t\n\t\tusort( $students, array('ELS', 'student_sort') );\n\n\t\treturn $students;\n\t}",
"public function getSemester2Students()\n {\n return $this->hasMany(Semester2Students::className(), ['semester' => 'semester_id']);\n }",
"public function mysearch()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\tif(Yii::app()->user->getState('stud_id'))\n\t\t{\n\t\t$criteria->condition = 'student_docs_trans_user_id = :student_user_id';\n\t $criteria->params = array(':student_user_id' => Yii::app()->user->getState('stud_id'));\n\t\t}\n\t\telse\n\t\t{\n\t\t$criteria->condition = 'student_docs_trans_user_id = :student_user_id';\n\t $criteria->params = array(':student_user_id' => $_REQUEST['id']);\n\t\t}\n\t\t$criteria->compare('student_docs_trans_id',$this->student_docs_trans_id);\n\t\t$criteria->compare('student_docs_trans_user_id',$this->student_docs_trans_user_id,true);\n\t\t$criteria->compare('student_docs_trans_stud_docs_id',$this->student_docs_trans_stud_docs_id,true);\n\t\t\n\t\t$student_docs = new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t$_SESSION['student_docs']=$student_docs;\n\t\treturn $student_docs;\n\t}",
"function getAllStudents($classId) {\r\n $this->db->select('u.*');\r\n $this->db->from('subscription s');\r\n $this->db->from('user u');\r\n $this->db->where('u.id = s.subscriptionUser');\r\n $this->db->where('s.subscriptionClass', $classId);\r\n $this->db->where('s.subscriptionStartDate <= CURRENT_DATE()');\r\n $this->db->where('s.subscriptionEndDate >= CURRENT_DATE()');\r\n $this->db->group_by('u.id');\r\n return $this->db->get()->result();\r\n }",
"public function findStudent()\n {\n //$search = '%'.$search.'%';\n $dql = \"SELECT ae FROM ABCIsystemBundle:AbcMembers ae WHERE ae.idCard like'__02%' and ae.status='active'\";\t\n $repositorio = $this->getEntityManager()->createQuery($dql);\n return $repositorio->getResult();\t\n }",
"public function findStudentsByCourse(CourseInterface $course);",
"public function get_session_wise_student() {\n\t\t$checker = array(\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\treturn $this->db->get_where('enrols', $checker);\n\t}",
"public function getStudents()\n {\n return $this->hasMany(Student::className(), ['student_previous_qualification_id' => 'previousqualification_id']);\n }",
"public function getAllStudents() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) { \n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $students = $student->getAllStudents();\n \n $model = array(\n 'user_data' => $user_data,\n 'students' => $students\n );\n BaseController::display(self::$controller . '/students.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }",
"public function getAllStudentsResults() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $results = $student->getAllStudentsResults();\n \n $model = array(\n 'user_data' => $user_data,\n 'results' => $results\n );\n BaseController::display(self::$controller . '/student-results.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }",
"function show_students(){\n\t$query = $this->db->get('students');\n\t$query_result = $query->result();\n\treturn $query_result;\n\t}",
"public function getStudents(): array\n {\n \n return $this->students;\n }",
"public function getGrdStudents( $grdID, $sessionID ){\r\n\t\t$this->DDB = $this->load->database(\"default\",TRUE);\r\n\t\t\r\n\t\t$where = array(\"grade_id\" => $grdID, \"std_status_category\"=>\"Student\");\r\n\t\t$this->DDB->select(\"`id`,`official_name`,`abridged_name`, `gender`, `gs_id`,`section_dname` AS `section`,`student_status_name` AS `status`\");\r\n\t\t$this->DDB->from(\"`class_list`\");\r\n\t\t$this->DDB->where( $where );\r\n\t\t//$this->DDB->where(\"(std_status_category='Student' OR std_status_category='Fence')\", NULL, FALSE);\r\n\t\t$this->DDB->order_by(\"section_id\", \"ASC\");\r\n\t\t$this->DDB->order_by(\"call_name\", \"ASC\"); \r\n\t\t$query = $this->DDB->get();\r\n\t\tif( $query->num_rows() > 0 ){\r\n\t\t\t$results = $query->result_array();\r\n\t\t\treturn $results;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t\t\r\n\t}",
"public function getStudents($univid) { //$univid is formal Argument\r\n\t\t//2. Build The Query\r\n\t\t\r\n $this->db->select('student_name,stu_enroll_no')->from('students');\r\n \r\n $this->db->where('university_id', $univid);\r\n \r\n\t\t//3. Execute the query\r\n $query = $this->db->get();\r\n\t\t\r\n\t\t//4. Return the result\r\n return $query->result_array(); \r\n }",
"public function get_course_students($params) {\n global $DB, $PAGE;\n\n if(isset($params['report_params'])) {\n $reportparams = json_decode($params['report_params'], true);\n } else {\n $reportparams = [];\n }\n\n $limit = 0;\n $offset = 0;\n\n /** Limit and offset */\n if(isset($reportparams['limit'])) {\n $limit = $reportparams['limit'];\n }\n\n if(isset($reportparams['offset'])) {\n $offset = $reportparams['offset'];\n }\n\n $where = \"cx.contextlevel = :courselvl AND cx.instanceid > 1\";\n $sqlparams = ['courselvl' => CONTEXT_COURSE];\n\n if (!empty($reportparams['courses'])) {\n $coursesfilter = new in_filter($reportparams['courses'], \"crsc\");\n $where .= ' AND cx.instanceid ' . $coursesfilter->get_sql();\n $sqlparams = array_merge($coursesfilter->get_params(), $sqlparams);\n }\n\n if ($reportparams['inactive_users'] == 0) {\n $enroljoin = 'JOIN {enrol} e ON e.courseid = c.id\n JOIN {user_enrolments} ue ON ue.userid = u.id AND ue.enrolid = e.id';\n $sqlenrolfilter = 'AND ue.status = 0';\n } else {\n $enroljoin = $sqlenrolfilter = '';\n }\n\n $rolefilter = new in_filter($this->get_student_roles(), \"srole\");\n list($sql, $sqlparams) = $this->buildSqlRequest(\n \"SELECT CONCAT(u.id, '_', c.id) AS unique_f, u.*, c.id AS course_id,\n c.shortname AS course_short_name, c.fullname AS course_full_name, gg.finalgrade AS grade, gi.grademax AS grademax\n FROM {context} cx\n JOIN {role_assignments} ra ON ra.contextid = cx.id AND\n ra.roleid \" . $rolefilter->get_sql() . \"\n JOIN {user} u ON u.id = ra.userid\n JOIN {course} c ON c.id = cx.instanceid\n {$enroljoin}\n LEFT JOIN {grade_items} gi ON gi.courseid = c.id AND gi.itemtype = 'course'\n LEFT JOIN {grade_grades} gg ON gg.itemid = gi.id AND gg.userid = u.id\n WHERE {$where} {$sqlenrolfilter}\n GROUP BY u.id, c.id, gg.finalgrade, gi.grademax\",\n array_merge($sqlparams, $rolefilter->get_params()),\n $reportparams\n );\n\n $students = $DB->get_records_sql($sql, $sqlparams, $offset, $limit);\n\n foreach($students as &$student) {\n $user_picture = new user_picture($student);\n $user_picture->size = 100;\n $student->picture = $user_picture->get_url($PAGE)->out();\n }\n\n return $students;\n }",
"public function newStudentsInRisk(){\n return Aluriesgo::studentsInRiskQuery()->\n andWhere([\n 'codfac'=>$this->codfac,\n 'codperiodo'=>$this->codperiodo\n ])->\n andWhere(['not in',\n 'codalu', ArrayHelper::getColumn($this->studentsInRiskForThis(),'codalu')\n ])->all();\n \n }",
"public function getstudent($txtStartDate,$txtEndDate,$txtSubject,$txtYear)\n\t{\n\t\tif($txtYear==\"1st\"){\n\t\t\t$this->db->where('payment_admission', 1);\n\t\t\t// $this->db->where('gen_type', $txtSubject);\n\t\t\t$this->db->where('gen_type', $txtSubject);\n\t\t\t$this->db->where('admission_payment_date >=', $txtStartDate);\n\t\t\t$this->db->where('admission_payment_date <=', $txtEndDate);\n\t\t\t$this->db->where('trsnfer_flag', 0);\n\t\t\t$this->db->where('cancel', 0);\n\t\t\t$this->db->order_by('college_roll', 'asc');\n\t\t\t$query=$this->db->get('admission_erp');\n\t\t\treturn $query->result();\n\t\t}\n\t\telse{\n\t\t\t$this->db->where('sub_honours', $txtSubject);\n\t\t\t$this->db->where('pay_status_part2', 1);\n\t\t\t$this->db->where('payment_date_2 >=', $txtStartDate);\n\t\t\t$this->db->where('payment_date_2 <=', $txtEndDate);\n\t\t\t$this->db->where('trsnfer_flag', 0);\n\t\t\t$this->db->where('cancel_flag', 0);\n\t\t\t$query=$this->db->get('student_dtl');\n\t\t\treturn $query->result();\n\t\t}\n\t}",
"public function getStudentsByClassIdAndSubGen($lastSeasonId,$classe){\n // $this->db->select('students.*,points.subject,points.sc,points.te');\n $this->db->select('students.*');\n $this->db->join('classes','students.classe=classes.id');\n // $this->db->join('points','points.student=students.id');\n // $this->db->where('students.classe',$classeId);\n $filter = array(\n 'students.season'=>$lastSeasonId,\n 'classes.id'=>$classe\n // 'points.subject'=>$sub\n );\n $this->db->where($filter);\n // $this->db->where_in('points.subject',$ids);\n return $this->db->get('students')->result();\n }",
"public function getStudents(int $id)\n {\n try {\n $students = Classroom::findOrFail($id)\n ->students()\n ->when(['student', $this->orderBy], Closure::fromCallable([$this, 'queryOrderBy']))\n ->when($this->limit, Closure::fromCallable([$this, 'queryLimit']));\n\n return StudentResource::collection($students);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n 'code' => 404,\n 'message' => 'Not Found',\n 'description' => 'Department ' . $id . ' not found.'\n ], 404);\n }\n }"
]
| [
"0.62867033",
"0.6280684",
"0.6278451",
"0.61720765",
"0.61219054",
"0.6096722",
"0.6049759",
"0.6027512",
"0.59634036",
"0.59612",
"0.59146976",
"0.5894346",
"0.5893825",
"0.58521855",
"0.58391875",
"0.5798891",
"0.5762266",
"0.57482725",
"0.574648",
"0.56992376",
"0.56860495",
"0.56789017",
"0.56286573",
"0.56277674",
"0.56060743",
"0.56035197",
"0.56001925",
"0.55952924",
"0.5590763",
"0.5570782"
]
| 0.7380451 | 0 |
Gets query for [[Semester2Students]]. | public function getSemester2Students()
{
return $this->hasMany(Semester2Students::className(), ['semester' => 'semester_id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_students_list(){\n return $this->n->get_list_from_db();\n }",
"public function getSemester1Students()\n {\n return $this->hasMany(Semester1Students::className(), ['semester' => 'semester_id']);\n }",
"public function getStudentsQueryForGroup($group_id) {\n\t\treturn SQLQuery::create()->select(\"StudentGroup\")->whereValue(\"StudentGroup\",\"group\",$group_id);\n\t}",
"public function get_session_wise_student() {\n\t\t$checker = array(\n\t\t\t'session' => $this->active_session,\n\t\t\t'school_id' => $this->school_id\n\t\t);\n\t\treturn $this->db->get_where('enrols', $checker);\n\t}",
"private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}",
"public function getStudentsAssignment()\n {\n $where = [];\n foreach ($this->request->getQuery() as $key => $value) {\n if(!empty($value))\n $where[$key] = $value;\n }\n $response=$this->StudentHealths->StudentInfos->find()\n ->select(['name'=>'Students.name','id'=>'Students.id'])\n ->contain(['Students'])\n ->where($where) \n ->where(['is_deleted'=>'N'])\n ->where(['StudentInfos.session_year_id'=>$this->Auth->user('session_year_id')]);\n foreach ($response as $key => $value) {\n $option[$value->id]=$value->name;\n } \n if(!empty($option)){\n foreach ($option as $key => $value) {\n echo \"<option value='\".$key.\"'>\".$value.\"</option>\";\n }\n }\n exit;\n \n }",
"public static function getStudents() {\n\t\t$idm = PSU::get('idmobject');\n\n\t\t$search = array(\n\t\t\tarray('pa.attribute' => 'els_student'),\n\t\t\tarray('pa.type_id' => '2')\n\t\t);\n\n\t\t$return = 'i.pid,i.psu_id,i.username,i.first_name,i.last_name,l.start_date,l.end_date';\n\n\t\t$students = $idm->getUsersByAttribute( $search, 'AND', $return );\n\n\t\tarray_walk( $students, array('ELS', 'dates2timestamp') );\n\t\tarray_walk( $students, array('ELS', 'load_psuperson') );\n\t\t\n\t\tusort( $students, array('ELS', 'student_sort') );\n\n\t\treturn $students;\n\t}",
"public function semesterTwoPage() {\n return \\view('admin.students.two-results', [\n 'twos' => SemesterTwo::query()->whereIn('user_id', User::query()->where('program_verified', true)->get())->paginate(config('mv-notification.paginate')),\n ]);\n }",
"public function getAllStudents(){\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_StudentDAO->getAllStudents();\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in StudentDAO.getAllStudents()\");\t\t\n\n\t\treturn $Result;\n\t}",
"public function getStudents($params = array())\n {\n $sql = 'select * from engine4_users where user_id in (\n SELECT item_id FROM `engine4_user_fields_values` where field_id=1 and value=4\n )';\n \n $table = Engine_Api::_()->getDbtable('users', 'user')->getAdapter();\n $select = $table->query($sql)->fetchAll(); \n\n return $select;\n }",
"public function getStudentsByClass() {\n\t\t$students_by_class = Student::GetInstance()->getStudentsByClass( $_POST['class_id'] );\n\n\t\treturn jsonResult( $students_by_class );\n\n\t}",
"public function getStudent(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}",
"public function findStudent()\n {\n //$search = '%'.$search.'%';\n $dql = \"SELECT ae FROM ABCIsystemBundle:AbcMembers ae WHERE ae.idCard like'__02%' and ae.status='active'\";\t\n $repositorio = $this->getEntityManager()->createQuery($dql);\n return $repositorio->getResult();\t\n }",
"function getSemesterDetails()\n\t{\n\t\t$query = $this->db->get(\"semester\");\n\t\t//print_r($query->result_array());\n\t\treturn $query->result_array();\n\t}",
"public function get_course_students($params) {\n global $DB, $PAGE;\n\n if(isset($params['report_params'])) {\n $reportparams = json_decode($params['report_params'], true);\n } else {\n $reportparams = [];\n }\n\n $limit = 0;\n $offset = 0;\n\n /** Limit and offset */\n if(isset($reportparams['limit'])) {\n $limit = $reportparams['limit'];\n }\n\n if(isset($reportparams['offset'])) {\n $offset = $reportparams['offset'];\n }\n\n $where = \"cx.contextlevel = :courselvl AND cx.instanceid > 1\";\n $sqlparams = ['courselvl' => CONTEXT_COURSE];\n\n if (!empty($reportparams['courses'])) {\n $coursesfilter = new in_filter($reportparams['courses'], \"crsc\");\n $where .= ' AND cx.instanceid ' . $coursesfilter->get_sql();\n $sqlparams = array_merge($coursesfilter->get_params(), $sqlparams);\n }\n\n if ($reportparams['inactive_users'] == 0) {\n $enroljoin = 'JOIN {enrol} e ON e.courseid = c.id\n JOIN {user_enrolments} ue ON ue.userid = u.id AND ue.enrolid = e.id';\n $sqlenrolfilter = 'AND ue.status = 0';\n } else {\n $enroljoin = $sqlenrolfilter = '';\n }\n\n $rolefilter = new in_filter($this->get_student_roles(), \"srole\");\n list($sql, $sqlparams) = $this->buildSqlRequest(\n \"SELECT CONCAT(u.id, '_', c.id) AS unique_f, u.*, c.id AS course_id,\n c.shortname AS course_short_name, c.fullname AS course_full_name, gg.finalgrade AS grade, gi.grademax AS grademax\n FROM {context} cx\n JOIN {role_assignments} ra ON ra.contextid = cx.id AND\n ra.roleid \" . $rolefilter->get_sql() . \"\n JOIN {user} u ON u.id = ra.userid\n JOIN {course} c ON c.id = cx.instanceid\n {$enroljoin}\n LEFT JOIN {grade_items} gi ON gi.courseid = c.id AND gi.itemtype = 'course'\n LEFT JOIN {grade_grades} gg ON gg.itemid = gi.id AND gg.userid = u.id\n WHERE {$where} {$sqlenrolfilter}\n GROUP BY u.id, c.id, gg.finalgrade, gi.grademax\",\n array_merge($sqlparams, $rolefilter->get_params()),\n $reportparams\n );\n\n $students = $DB->get_records_sql($sql, $sqlparams, $offset, $limit);\n\n foreach($students as &$student) {\n $user_picture = new user_picture($student);\n $user_picture->size = 100;\n $student->picture = $user_picture->get_url($PAGE)->out();\n }\n\n return $students;\n }",
"public function getStudents()\n {\n return $this->hasMany(Student::className(), ['student_previous_qualification_id' => 'previousqualification_id']);\n }",
"public function mysearch()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\tif(Yii::app()->user->getState('stud_id'))\n\t\t{\n\t\t$criteria->condition = 'student_docs_trans_user_id = :student_user_id';\n\t $criteria->params = array(':student_user_id' => Yii::app()->user->getState('stud_id'));\n\t\t}\n\t\telse\n\t\t{\n\t\t$criteria->condition = 'student_docs_trans_user_id = :student_user_id';\n\t $criteria->params = array(':student_user_id' => $_REQUEST['id']);\n\t\t}\n\t\t$criteria->compare('student_docs_trans_id',$this->student_docs_trans_id);\n\t\t$criteria->compare('student_docs_trans_user_id',$this->student_docs_trans_user_id,true);\n\t\t$criteria->compare('student_docs_trans_stud_docs_id',$this->student_docs_trans_stud_docs_id,true);\n\t\t\n\t\t$student_docs = new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t$_SESSION['student_docs']=$student_docs;\n\t\treturn $student_docs;\n\t}",
"public function getStudents(): array\n {\n \n return $this->students;\n }",
"function show_students(){\n\t$query = $this->db->get('students');\n\t$query_result = $query->result();\n\treturn $query_result;\n\t}",
"public function findStudentsByCourse(CourseInterface $course);",
"public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}",
"public function semester($semester)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria=new CDbCriteria;\n\t\t$sms=Yii::app()->session->get('sms');\n\t\t$sSmt=Yii::app()->session->get('smt');\n\t\t\n\t\t$criteria->compare('id_kls',$this->id_kls,true);\n\t\t$criteria->compare('id_sms',$this->id_sms,true);\n\t\t$criteria->compare('id_smt',$this->id_smt,true);\n\t\t$criteria->compare('id_mk',$this->id_mk,true);\n\t\t$criteria->compare('nm_kls',$this->nm_kls,true);\n\t\t/*\n\t\t$criteria->compare('sks_mk',$this->sks_mk,true);\n\t\t$criteria->compare('sks_tm',$this->sks_tm,true);\n\t\t$criteria->compare('sks_prak',$this->sks_prak,true);\n\t\t$criteria->compare('sks_prak_lap',$this->sks_prak_lap,true);\n\t\t$criteria->compare('sks_sim',$this->sks_sim,true);\n\t\t$criteria->compare('bahasan_case',$this->bahasan_case,true);\n\t\t$criteria->compare('tgl_mulai_koas',$this->tgl_mulai_koas,true);\n\t\t$criteria->compare('tgl_selesai_koas',$this->tgl_selesai_koas,true);\n\t\t$criteria->compare('id_mou',$this->id_mou,true);\n\t\t$criteria->compare('a_selenggara_pditt',$this->a_selenggara_pditt,true);\n\t\t$criteria->compare('kuota_pditt',$this->kuota_pditt,true);\n\t\t$criteria->compare('a_pengguna_pditt',$this->a_pengguna_pditt,true);\n\t\t$criteria->compare('id_kls_pditt',$this->id_kls_pditt,true);\n\t\t*/\n\t\t$criteria->select=\"mk.kode_mk,mk.nm_mk,mk.sks_mk,mk.id_mk,t.id_kls,t.nm_kls\";\n\t\t$criteria->join='JOIN akt_ajar_dosen as dosen ON dosen.id_kls=t.id_kls';\n\t\t$criteria->join = \"JOIN matkul as mk ON mk.id_mk=t.id_mk\";\n\t\t$criteria->condition = \"t.id_sms = :id_sms AND mk.semester= :semester AND t.id_smt= :id_smt\";\n\t\t\n\t\t$criteria->params = array (\t\n\t\t':id_sms' => $sms,\n\t\t':semester' => $semester,\n\t\t':id_smt' => $sSmt,\n\t\t);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>false,\n\t\t));\n\t}",
"public function getStudent()\r\n {\r\n $sql=\"SELECT * FROM users WHERE role_id=2\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }",
"function emarking_get_enroled_students_sql()\n{\n $query = 'SELECT u.*\n\t\t\tFROM {user_enrolments} ue\n\t\t\tJOIN {enrol} e ON (e.id = ue.enrolid AND e.courseid = ?)\n\t\t\tJOIN {context} c ON (c.contextlevel = 50 AND c.instanceid = e.courseid)\n\t\t\tJOIN {role_assignments} ra ON (ra.contextid = c.id AND ra.roleid = 5 AND ra.userid = ue.userid)\n\t\t\tJOIN {user} u ON (ue.userid = u.id)\n\t\t\tGROUP BY u.id';\n \n return $query;\n}",
"public function listOfStudents($skola) {\n\t\t\t$this->db->where('skolaId',$skola);\n\t\t\t $query = $this->db->get(\"predmet\");\n\t\t return $query;\n\t\t}",
"function ForEveningGetSelectedStudent($admission_session_id,$shift_id,$session_id,$prog_type_id,$test_id){\n\n $this->legacy_db->select(\"sl.*\");\n $this->legacy_db->from('selection_list AS sl');\n $this->legacy_db->join('program_list AS pl', ' sl.`PROG_LIST_ID` = pl.`PROG_LIST_ID`');\n $this->legacy_db->join('category AS cat', 'sl.`CATEGORY_ID` = cat.`CATEGORY_ID`');\n $this->legacy_db->join('admission_session AS ass', 'sl.`ADMISSION_SESSION_ID` = ass.`ADMISSION_SESSION_ID`');\n $this->legacy_db->join('applications AS app', 'sl.`APPLICATION_ID` = app.`APPLICATION_ID`');\n \n $this->legacy_db->join('admission_list AS al', 'sl.`ADMISSION_LIST_ID` = al.`ADMISSION_LIST_ID`');\n $this->legacy_db->where('ass.ADMISSION_SESSION_ID', $admission_session_id);\n $this->legacy_db->where('sl.SHIFT_ID', $shift_id);\n $this->legacy_db->where('ass.SESSION_ID', $session_id);\n $this->legacy_db->where('pl.PROGRAM_TYPE_ID', $prog_type_id);\n $this->legacy_db->where('sl.TEST_ID', $test_id);\n $this->legacy_db->where('sl.ACTIVE > 0 ');\n $this->legacy_db->where(\"sl.IS_PROVISIONAL = 'N' \");\n $this->legacy_db->where(\"sl.CATEGORY_ID \",SELF_FINANCE_EVENING_CATEGORY_ID );\n\n \n\n $this->legacy_db->order_by(\"al.LIST_NO\",\"DESC\");\n $result = $this->legacy_db->get()->result_array();\n echo $this->legacy_db->last_query();\n $key_array = array();\n foreach ($result as $row){\n\n if(!isset($key_array[$row['APPLICATION_ID']])){\n $key_array[$row['APPLICATION_ID']] = array(\"SELF\"=>null,\"MERIT\"=>null);\n }\n\n if(($row['CATEGORY_ID']==SELF_FINANCE_EVENING_CATEGORY_ID &&$key_array[$row['APPLICATION_ID']]['SELF']==null)){\n $key_array[$row['APPLICATION_ID']]['SELF'] = $row;\n }\n // array_push($key_array[$row['APPLICATION_ID']],$row);\n }\n return $key_array;\n }",
"public function students() {\n return $this->_students;\n }",
"public function getAllStudentsResults() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $results = $student->getAllStudentsResults();\n \n $model = array(\n 'user_data' => $user_data,\n 'results' => $results\n );\n BaseController::display(self::$controller . '/student-results.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }",
"public function getStudentsByClassIdAndSubGen($lastSeasonId,$classe){\n // $this->db->select('students.*,points.subject,points.sc,points.te');\n $this->db->select('students.*');\n $this->db->join('classes','students.classe=classes.id');\n // $this->db->join('points','points.student=students.id');\n // $this->db->where('students.classe',$classeId);\n $filter = array(\n 'students.season'=>$lastSeasonId,\n 'classes.id'=>$classe\n // 'points.subject'=>$sub\n );\n $this->db->where($filter);\n // $this->db->where_in('points.subject',$ids);\n return $this->db->get('students')->result();\n }",
"public function getFilteredStudentPicklistAction()\n {\n $params = $this->getAllParams();\n\n // construct the filters array based on the given parameters\n $filters = array();\n if ($params['graduationYear']) {\n $filters['graduationYear'] = $params['graduationYear'];\n }\n if ($params['graduationMonth']) {\n $filters['graduationMonth'] = $params['graduationMonth'];\n }\n if ($params['section']) {\n $filters['section'] = $params['section'];\n }\n if ($params['certificationLevels']) {\n $filters['certificationLevels'] = array();\n foreach ($params['certificationLevels'] as $certLevel) {\n $filters['certificationLevels'][] = $certLevel;\n }\n }\n if ($params['graduationStatus']) {\n $filters['graduationStatus'] = array();\n foreach ($params['graduationStatus'] as $gradStatus) {\n $filters['graduationStatus'][] = $gradStatus;\n }\n }\n\n // save the filters to the session, if applicable\n if (isset($params['sessionNamespace'])) {\n $session = new \\Zend_Session_Namespace($params['sessionNamespace']);\n $session->selectedCertifications = $filters['certificationLevels'];\n $session->selectedStatus = $filters['graduationStatus'];\n $session->selectedGradMonth = $filters['graduationMonth'];\n $session->selectedGradYear = $filters['graduationYear'];\n $session->selectedSection = $filters['section'];\n\n // set the flag so we know this namespace has been written to at least once\n $session->activated = true;\n }\n\n $students = \\Fisdap\\EntityUtils::getRepository('User')->getAllStudentsByProgram(\\Fisdap\\Entity\\User::getLoggedInUser()->getProgramId(), $filters);\n\n $list = array();\n foreach ($students as $student) {\n $label = $student['first_name'] . ' ' . $student['last_name'];\n if ($params['longLabel']) {\n $label .= \", \" . $student['cert_description'] . \": \" . $student['graduation_month'] . \"/\" . $student['graduation_year'];\n }\n $list[$student['id']] = $label;\n }\n\n $this->_helper->json($list);\n }"
]
| [
"0.6541426",
"0.6454452",
"0.6315013",
"0.626638",
"0.6251841",
"0.6160394",
"0.615403",
"0.6152344",
"0.60128516",
"0.59953856",
"0.5966813",
"0.5947472",
"0.59391993",
"0.58563966",
"0.5846611",
"0.58049464",
"0.5768089",
"0.57642883",
"0.5752834",
"0.57449186",
"0.5744714",
"0.5714816",
"0.5692843",
"0.566966",
"0.56469434",
"0.56393045",
"0.56336665",
"0.559206",
"0.5561713",
"0.5552306"
]
| 0.7215253 | 0 |
Renders the disabled state of the previous page. | public function previousDisabled(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function previousEnabled(int $page): string;",
"protected function renderBackButton() {}",
"public function previousPage()\n\t{\n\t\treturn $this->getIsPreviousPageAvailable() ? parent::previousPage() : false;\n\t}",
"abstract protected function setPreviousPage();",
"public function PrevPage()\n {\n if ($this->m_CurrentPage <= 1)\n $this->m_CurrentPage = 1;\n else \n $this->m_CurrentPage--;\n return $this->ReRender();\n }",
"private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\"><</a></li>';\n }\n }",
"public function previousPage()\n {\n return$this->currentPage - 1;\n }",
"function prevPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n\t\n\t$root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the prev button should be inactive\n\tif( $currentView == 'home' ) {\n\t\treturn false;\n\t}\n\t// If we're on the credits page, the prev button should point to the last article\n\telse if( $currentView == 'credits' ) {\n\t\treturn $root . getArrayLastIndex( $activePages );\n\t}\n\n\tif( empty(nextPrevArticleName('prev')) && $currentArticlePage == '1' ){\n\t\treturn $root;\n\t} elseif( $currentArticlePage == '1' ) {\n\t\treturn $root . nextPrevArticleName('prev') . '/' . $activePages[nextPrevArticleName('prev')]['numberOfPages'];\n\t} elseif($activePages[$currentArticle]['numberOfPages'] >= $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage-1);\n\t} else {\n\t\treturn $root . $currentArticle;\t\t\n\t}\n}",
"protected function _processPrevious()\n\t{\n\t\t$step = (int) $this->Session->read('Wizard.step');\n\t\t\n\t\tif( ! empty($step)){\n\t\t\t$step--;\n\t\t\t$this->_write($step);\n\t\t\t\n\t\t\t$this->redirect();\n\t\t}\t\t\n\t}",
"function prevPage($text='prev')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif ( !empty($this->_pageDetails['previousPage']) )\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['previousPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['previousPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['previousPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}",
"protected function getPreviousButton()\n {\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledLink($this->previousButtonText);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');\n }",
"protected function renderPageNextPrev()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n\n $buttons = [];\n $currentPage = $this->pagination->getPage();\n\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n return Html::tag('ul', implode(\"\\n\", $buttons), $this->options);\n }",
"function previousPage()\n\t\t{\n\t\t\tif(!$this->hasPrevious())\n\t\t\t\tthrow new Exception(\"Page out of bounds\");\n\t\t\t\t\n\t\t\t$this->currentPage--;\n\t\t}",
"public function previousPageUrl()\n {\n $this->resetQuery();\n\n if ($this->currentPage() > 2) {\n $this->appends('end', session()->get('accountant.api.end'));\n }\n\n return parent::previousPageUrl();\n }",
"public function previousAction()\n {\n $this->pageAction('goToPreviousPage');\n }",
"private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }",
"private function previous()\n {\n $this->m--;\n $this->init();\n }",
"public function genPrevLink()\n\t{\n\t\t$this->pagination['prevLink'] = \"\";\t\n\t\tif($this->page > 1)\n\t\t{\n\t\t\t$page = $this->page-1;\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_prev',$this->prepend.$page.$this->append, '<'),\n\t\t\t\t\t\t\t\t$item);\n\t\t\t$this->pagination['prevLink'] = $item;\n\t\t}\n\t}",
"public function has_previous_page()\n {\n }",
"protected function previousStep()\r\n {\r\n $index = array_search($this->_currentStep, array_values($this->_steps)) - 1;\r\n $this->redirect(array_values($this->_steps)[($index > 0 ? $index : 0)]);\r\n }",
"function redirect_back_field()\n {\n return new HtmlString('<input type=\"hidden\" name=\"_redirect_back\" value=\"'.old('_redirect_back', back()->getTargetUrl()).'\">');\n }",
"function renderPrev($tag = '<<') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}",
"public static function previous()\n {\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n exit;\n }",
"public function getPreviousPage();",
"public function hasPreviousPage();",
"public function getPreviousButton($text = '<i class=\"left arrow icon\"></i>')\n {\n // If the current page is less than or equal to one, it means we can't go any\n // further back in the pages, so we will render a disabled previous button\n // when that is the case. Otherwise, we will give it an active \"status\".\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledTextWrapper($text);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPageLinkWrapper($url, $text, 'prev');\n }",
"protected function renderDisabled()\n {\n return '';\n }",
"function link_with_disabled_back_button($url, $linktext){\n print \"<a href=\\\"$url\\\"\";\n print \"ONCLICK=\\\"location.replace(this.href);return false;\\\">\";\n print $linktext . \"</a>\";\n}",
"private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'‹'\n\t\t);\n\t}",
"public function previous_step() {\r\n\t\t$this->step --;\r\n\t}"
]
| [
"0.68244255",
"0.64455944",
"0.63269436",
"0.62881595",
"0.62689936",
"0.6242096",
"0.62346256",
"0.60750604",
"0.6068533",
"0.60115576",
"0.6002718",
"0.5973086",
"0.5953988",
"0.5897109",
"0.58629537",
"0.5842836",
"0.58339876",
"0.58276683",
"0.58224434",
"0.57360744",
"0.5730352",
"0.5719249",
"0.5705061",
"0.57043993",
"0.57015723",
"0.5695855",
"0.567826",
"0.5676007",
"0.56517214",
"0.5644079"
]
| 0.67590404 | 1 |
Renders the enabled state of the previous page. | public function previousEnabled(int $page): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function previousDisabled(): string;",
"public function previousPage()\n\t{\n\t\treturn $this->getIsPreviousPageAvailable() ? parent::previousPage() : false;\n\t}",
"protected function renderBackButton() {}",
"abstract protected function setPreviousPage();",
"public function has_previous_page()\n {\n }",
"private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\"><</a></li>';\n }\n }",
"function prevPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n\t\n\t$root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the prev button should be inactive\n\tif( $currentView == 'home' ) {\n\t\treturn false;\n\t}\n\t// If we're on the credits page, the prev button should point to the last article\n\telse if( $currentView == 'credits' ) {\n\t\treturn $root . getArrayLastIndex( $activePages );\n\t}\n\n\tif( empty(nextPrevArticleName('prev')) && $currentArticlePage == '1' ){\n\t\treturn $root;\n\t} elseif( $currentArticlePage == '1' ) {\n\t\treturn $root . nextPrevArticleName('prev') . '/' . $activePages[nextPrevArticleName('prev')]['numberOfPages'];\n\t} elseif($activePages[$currentArticle]['numberOfPages'] >= $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage-1);\n\t} else {\n\t\treturn $root . $currentArticle;\t\t\n\t}\n}",
"public function PrevPage()\n {\n if ($this->m_CurrentPage <= 1)\n $this->m_CurrentPage = 1;\n else \n $this->m_CurrentPage--;\n return $this->ReRender();\n }",
"public function hasPreviousPage();",
"function hasPrevious()\n\t\t{\n\t\t\tif($this->currentPage > 1)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}",
"public function previousPage()\n {\n return$this->currentPage - 1;\n }",
"function prevPage($text='prev')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif ( !empty($this->_pageDetails['previousPage']) )\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['previousPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['previousPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['previousPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}",
"public function hasPreviousPage() {\n return 1 < $this->page_;\n }",
"private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }",
"protected function _processPrevious()\n\t{\n\t\t$step = (int) $this->Session->read('Wizard.step');\n\t\t\n\t\tif( ! empty($step)){\n\t\t\t$step--;\n\t\t\t$this->_write($step);\n\t\t\t\n\t\t\t$this->redirect();\n\t\t}\t\t\n\t}",
"public function hasPrevious() {\n return false;\n }",
"public function hasPrevious()\n {\n return $this->curPage > 1;\n }",
"public function previousAction()\n {\n $this->pageAction('goToPreviousPage');\n }",
"private function print_previous_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( max( 1, $this->current_page - 1 ) ),\n\t\t\t__( 'Go to the previous page', 'multilingual-press' ),\n\t\t\t'prev-page' . $this->disable_first,\n\t\t\t'‹'\n\t\t);\n\t}",
"public function has_previous_page() {\n\t\t\treturn $this->page > 1;\n\t\t}",
"private function setPreviousUrl()\n {\n // Via the global helper...\n session(['previousUrl' => URL::previous()]);\n return true;\n }",
"public function hasPrevious()\n {\n if ($this->currentPage === 1) {\n return false;\n }\n\n return true;\n }",
"protected function getPreviousButton()\n {\n if ($this->paginator->currentPage() <= 1) {\n return $this->getDisabledLink($this->previousButtonText);\n }\n\n $url = $this->paginator->url(\n $this->paginator->currentPage() - 1\n );\n\n return $this->getPrevNextPageLinkWrapper($url, $this->previousButtonText, 'prev');\n }",
"public function has_prevpage() {\n return $this->prevpage() >= 1 ? true : false;\n }",
"private function previous()\n {\n $this->m--;\n $this->init();\n }",
"public function has_prev()\n\t{\n\t\treturn $this->get_cur_page() > 1;\n\t}",
"public function previousPageUrl()\n {\n $this->resetQuery();\n\n if ($this->currentPage() > 2) {\n $this->appends('end', session()->get('accountant.api.end'));\n }\n\n return parent::previousPageUrl();\n }",
"function renderPrev($tag = '<<') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}",
"protected function renderPageNextPrev()\n {\n $pageCount = $this->pagination->getPageCount();\n if ($pageCount < 2 && $this->hideOnSinglePage) {\n return '';\n }\n\n $buttons = [];\n $currentPage = $this->pagination->getPage();\n\n // first page\n $firstPageLabel = $this->firstPageLabel === true ? '1' : $this->firstPageLabel;\n if ($firstPageLabel !== false) {\n $buttons[] = $this->renderPageButton($firstPageLabel, 0, $this->firstPageCssClass, $currentPage <= 0, false);\n }\n\n // prev page\n if ($this->prevPageLabel !== false) {\n if (($page = $currentPage - 1) < 0) {\n $page = 0;\n }\n $buttons[] = $this->renderPageButton($this->prevPageLabel, $page, $this->prevPageCssClass, $currentPage <= 0, false);\n }\n\n // next page\n if ($this->nextPageLabel !== false) {\n if (($page = $currentPage + 1) >= $pageCount - 1) {\n $page = $pageCount - 1;\n }\n $buttons[] = $this->renderPageButton($this->nextPageLabel, $page, $this->nextPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n // last page\n $lastPageLabel = $this->lastPageLabel === true ? $pageCount : $this->lastPageLabel;\n if ($lastPageLabel !== false) {\n $buttons[] = $this->renderPageButton($lastPageLabel, $pageCount - 1, $this->lastPageCssClass, $currentPage >= $pageCount - 1, false);\n }\n\n return Html::tag('ul', implode(\"\\n\", $buttons), $this->options);\n }",
"function hasPrevPage() {\n\t\treturn $this->hasPage($this->p - 1);\n\t}"
]
| [
"0.6558906",
"0.6551128",
"0.64167285",
"0.64136356",
"0.6360696",
"0.6314765",
"0.625042",
"0.62221706",
"0.62114924",
"0.6027289",
"0.6026325",
"0.60040456",
"0.5959689",
"0.5958086",
"0.593562",
"0.5927574",
"0.58857656",
"0.5863499",
"0.58373964",
"0.5833628",
"0.583297",
"0.5824738",
"0.5767599",
"0.5750725",
"0.5748243",
"0.57323515",
"0.5731764",
"0.5712204",
"0.5685599",
"0.56779224"
]
| 0.72105694 | 0 |
Renders the disabled state of the next page. | public function nextDisabled(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function nextEnabled(int $page): string;",
"protected function renderDisabled()\n {\n return '';\n }",
"function disabled($disabled, $current = \\true, $display = \\true)\n {\n }",
"public function override_next_page() {\n return false;\n }",
"private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">></a></li>';\n }\n }",
"public function shouldRenderNextButton() {}",
"private function generateRightButton($page, $isDisabled = false)\n {\n if (!$isDisabled) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">»</a></li>', $this->url, $page + 1));\n } else {\n $this->appendData(sprintf('<li class=\"disabled\"><a href=\"#\">»</a></li>', $this->url, $page + 1));\n }\n }",
"public function disable(): void\n {\n $this->disabled = true;\n }",
"public function disableRendering($disable = true);",
"public function setDisabled($disabled);",
"public function setDisabled($disabled = true);",
"public function is_disabled()\n {\n }",
"public function disabled();",
"public function disabled();",
"private function ending()\n {\n if ($this->current_page + 1 <= $this->total_pages) {\n return '<li><a href=\"' . ($this->current_page + 1) . '\">»</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">»</a></li>';\n }\n }",
"private function generateLeftButton($page, $isDisabled = false)\n {\n if (!$isDisabled) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">«</a></li>', $this->url, $page - 1));\n } else {\n $this->appendData(sprintf('<li class=\"disabled\"><a href=\"#\">«</a></li>', $this->url, $page - 1));\n }\n }",
"public function nextPage()\n\t{\n\t\treturn $this->getIsNextPageAvailable() ? parent::nextPage() : false;\n\t}",
"public static function disable(){\n self::$disabled = true; \n self::$enabled = false;\n }",
"function renderNext($tag = '>>') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}",
"function wpvideocoach_hide_dashboard_slider_disable_fields()\r\n{\r\n\tglobal $wpvideocoach_dashboard_slider;\r\n\tif($wpvideocoach_dashboard_slider == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}",
"private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }",
"public function disableAction()\n {\n $session = Mage::getSingleton('core/session');\n $session->setInlineTranslationEnabled(false);\n\n $this->_redirectUrl(Mage::getBaseUrl());\n }",
"function isDisabled()\n {\n return false;\n }",
"public function actionDisable()\n\t{\n\t\t// can be requested over GET, so check for the token manually\n\t\t$this->_checkCsrfFromToken($this->_input->filterSingle('_xfToken', XenForo_Input::STRING));\n\t\n\t\t$fieldId = $this->_input->filterSingle('field_id', XenForo_Input::UINT);\n\t\treturn $this->_switchFormActiveStateAndGetResponse($fieldId, 0);\n\t}",
"function nextPage($text='next')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif (!empty($this->_pageDetails['nextPage']))\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['nextPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['nextPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['nextPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}",
"public function disableButtons()\n\t{\n\t}",
"function wpvideocoach_hide_introduction_disable_fields()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}",
"function wpvideocoach_hide_toolbar_disable_field()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif($wpvideocoach_toolbar_link == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}",
"public function disable_step($old_state);",
"public function setDisabledYes()\n\t{\n\t\t$this->setAttribute( \"disabled\");\n\t}"
]
| [
"0.61242867",
"0.6116207",
"0.6025298",
"0.5923537",
"0.5874592",
"0.58318937",
"0.5762266",
"0.57410985",
"0.569656",
"0.56649756",
"0.56623626",
"0.56557107",
"0.56520367",
"0.56520367",
"0.5645975",
"0.56258917",
"0.5554265",
"0.552206",
"0.5459254",
"0.53737366",
"0.5359584",
"0.5349715",
"0.532885",
"0.5300636",
"0.5285822",
"0.5270864",
"0.52361494",
"0.52244294",
"0.5209346",
"0.5206046"
]
| 0.63642573 | 0 |
Renders the enabled state of the next page. | public function nextEnabled(int $page): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function shouldRenderNextButton() {}",
"private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">></a></li>';\n }\n }",
"public function nextPage()\n\t{\n\t\treturn $this->getIsNextPageAvailable() ? parent::nextPage() : false;\n\t}",
"public function nextDisabled(): string;",
"public function has_next_page()\n {\n }",
"public function override_next_page() {\n return false;\n }",
"function renderNext($tag = '>>') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}",
"function nextPage() {\n\tglobal $activePages, $currentView, $currentArticle, $currentArticlePage;\n $root = '/' . $_GET['language'] . '/';\n\t\n\t// If we're on the home page, the next button should point to the first article\n\tif( $currentView == 'home' ) {\n\t\treturn $root . getArrayFirstIndex( $activePages );\n\t}\n\t// If we're on the credits page, the next button should be inactive\n\telse if( $currentView == 'credits' ) {\n\t\treturn false;\n\t}\n\t// If we're on the last page, send to credits\n\telse if( $currentArticle == 'theend' ) {\n\t\treturn $root . 'credits';\n\t}\n\t// If we're on a regular article page get the next one\n\tif($activePages[$currentArticle]['numberOfPages'] == $currentArticlePage) {\n\t\tif( !$activePages[nextPrevArticleName('next')]['active'] ) return $root . 'theend';\n\t\treturn $root . nextPrevArticleName('next');\n\t} elseif($activePages[$currentArticle]['numberOfPages'] > $currentArticlePage) {\n\t\treturn $root . $currentArticle . '/' . (string)($currentArticlePage+1);\n\t}\n}",
"private function isNextPage() {\n return isset($this->pages[$this->currentPageNumber + 1]);\n }",
"private function print_next_page_link() {\n\n\t\t$this->print_anchor(\n\t\t\t$this->get_paged_url( min( $this->total_pages, $this->current_page + 1 ) ),\n\t\t\t__( 'Go to the next page', 'multilingual-press' ),\n\t\t\t'next-page' . $this->disable_last,\n\t\t\t'›'\n\t\t);\n\t}",
"private function pageEnabled() {\r\n\t\t//Check if the plugin is valid and exits \t\r\n\t\tif (isset ( $_POST ['enable_module'] ) || strlen ( $_POST ['enable_module'] ) < 1 || ! ereg ( \"[a-zA-Z]+\", $_POST ['enable_module'] )) {\r\n\t\t\tthrow new Exception ( \"Invalid plugin name {$_POST['enable_module']}\" );\r\n\t\t}\r\n\t\t\r\n\t\t$plugin = $this->data->xpath ( \"plugin[@name='{$_POST ['enable_module']}']\" );\r\n\t\t\r\n\t\t//Check if there where any plugins found with that name\r\n\t\tif (! is_array ( $plugin ) || empty ( $plugin [0] )) {\r\n\t\t\tthrow new Exception ( \"The plugin {$_POST['enable_module']} could not be found.\" );\r\n\t\t}\r\n\t\t\r\n\t\tLogger::getRootLogger ()->info ( \"Changing status of module {$_POST ['enable_module']} to {$_POST ['enable']}\" );\r\n\t\t\r\n\t\t//Enable/disbale the plugin in XML\r\n\t\tif ($_POST ['enable'] == 'true' || $_POST ['enable'] == '1') {\r\n\t\t\t$plugin [0] ['enabled'] = \"true\";\r\n\t\t} elseif ($_POST ['enable'] == 'false' || $_POST ['enable'] == '0') {\r\n\t\t\t\r\n\t\t\t//Try to stop the plugin, when going from enabled to disabled.\r\n\t\t\t$plugin_object = $this->framework->getPlugin ( ( string ) $plugin [0] ['name'] );\r\n\t\t\tif (isset ( $plugin_object ) && $plugin_object->isService () && ( string ) $plugin [0] ['enabled'] == \"true\") {\r\n\t\t\t\t$plugin_object->stop ();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$plugin [0] ['enabled'] = \"false\";\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"Invalid status option for a plugin. Did not disable/enable {$_POST ['enable_module']}.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Save config and print the changed plugin\r\n\t\tif ($this->config->saveConfig ()) {\r\n\t\t\techo \"<reply action=\\\"ok\\\"><plugin\";\r\n\t\t\tforeach ( $plugin [0]->attributes () as $name => $value ) {\r\n\t\t\t\techo \" $name = \\\"$value\\\"\";\r\n\t\t\t}\r\n\t\t\techo \"/></reply>\";\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"Error, could not save configuration file.\" );\r\n\t\t}\r\n\t}",
"public function has_next()\n\t{\n\t\treturn $this->get_cur_page() < $this->get_total_pages();\n\t}",
"function cpl_print_button_pages($numArticle, $buttonSelected){\r\n if($numArticle != 0) {\r\n echo '<section>',\r\n '<p>Pages : </p>';\r\n for ($i=0; $i < $numArticle/4; $i++) {\r\n if($i+1 == $buttonSelected) {\r\n echo '<a id=\"linkDown\">',$i+1,'</a>';\r\n } else {\r\n echo '<a href=\"actus.php?buttonPage=',cp_encrypt_url([$i+1]),'\">',$i+1,'</a>';\r\n }\r\n }\r\n echo '</section>';\r\n }\r\n }",
"private function generateRightButton($page, $isDisabled = false)\n {\n if (!$isDisabled) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">»</a></li>', $this->url, $page + 1));\n } else {\n $this->appendData(sprintf('<li class=\"disabled\"><a href=\"#\">»</a></li>', $this->url, $page + 1));\n }\n }",
"public function NextPage()\n {\n if ($this->m_CurrentPage >= $this->m_TotalPages)\n $this->m_CurrentPage = $this->m_TotalPages;\n else\n $this->m_CurrentPage++;\n return $this->ReRender();\n }",
"function nextPage($text='next')\n\t{\n\t\tif (empty($this->_pageDetails)) { return false; }\n\t\tif (!empty($this->_pageDetails['nextPage']))\n\t\t{\n\t\t\tif($this->style == 'ajax')\n\t\t\t{\t\n\t\t\t\t//$t = $this->Ajax->linkToRemote($text, array(\"fallback\"=>$this->action.\"#\",\"url\" => $this->link.$this->_pageDetails['nextPage'],\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t$t = $this->Ajax->link($text, $this->link.$this->_pageDetails['nextPage'],array(\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$t = $this->Html->link('<strong>' . $text . '</strong>',$this->link.$this->_pageDetails['nextPage'], false, false, false);\n\t\t\t}\n\t\t\treturn $t;\n\t\t}\t\n\t\t//return '<span><strong>' . $text . '</strong></span>';\n\t\treturn false;\n\t}",
"public static function enable(){\n self::$enabled = true; \n self::$disabled=false;\n }",
"public function next()\n {\n do {\n ++$this->pointer;\n } while ($this->valid() && !$this->current()->isEnabled());\n }",
"public function displayLinks()\n {\n return (bool)$this->_scopeConfig->getValue(\n 'mfblog/post_view/nextprev/enabled',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }",
"public function add_two_step_next_btn() {\n\n\t\t\t$button_title = astra_get_option( 'two-step-checkout-modern-button-text' );\n\t\t\t$button_sub_title = astra_get_option( 'two-step-checkout-modern-button-sub-text' );\n\n\t\t\t$two_step_next_btn_html = '';\n\n\t\t\t$two_step_next_btn_html .= '<div class=\"ast-embed-checkout-form-nav-btns\">';\n\n\t\t\t\t$two_step_next_btn_html .= '<a href=\"#ast-order-wrap\" class=\"button ast-next-button\" >';\n\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-next-button-content\">';\n\n\t\t\tif ( '' != $button_title ) {\n\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-next-button-icon-wrap\">';\n\t\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"dashicons dashicons-arrow-right-alt\"></span>';\n\t\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-button-text\">' . esc_html( $button_title ) . '</span>';\n\t\t\t\t\t\t$two_step_next_btn_html .= '</span>';\n\t\t\t}\n\n\t\t\tif ( '' != $button_sub_title ) {\n\t\t\t\t\t\t$two_step_next_btn_html .= '<span class=\"ast-button-sub-text\">' . esc_html( $button_sub_title ) . '</span>';\n\t\t\t}\n\t\t\t\t\t$two_step_next_btn_html .= '</span>';\n\t\t\t\t$two_step_next_btn_html .= '</a>';\n\n\t\t\t$two_step_next_btn_html .= '</div>';\n\n\t\t\techo $two_step_next_btn_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t}",
"public function setNextPage($nextPage);",
"private function generateLeftButton($page, $isDisabled = false)\n {\n if (!$isDisabled) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">«</a></li>', $this->url, $page - 1));\n } else {\n $this->appendData(sprintf('<li class=\"disabled\"><a href=\"#\">«</a></li>', $this->url, $page - 1));\n }\n }",
"private function ending()\n {\n if ($this->current_page + 1 <= $this->total_pages) {\n return '<li><a href=\"' . ($this->current_page + 1) . '\">»</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">»</a></li>';\n }\n }",
"public function nextAction()\n {\n $this->pageAction('goToNextPage');\n }",
"public function toggleStatus()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->update(\n $this->module->table_name,\n ['active' => !$this->module->getHTMLPageStatus($pageId)],\n 'id_page = ' . $pageId\n );\n }",
"public function next()\n {\n $pageSize = $this->getDataProvider()->getPagination()->pageSize;\n $this->currentIndex++;\n if ($this->currentIndex >= $pageSize) {\n $this->currentPage++;\n $this->currentIndex = 0;\n $this->loadPage();\n }\n }",
"public function enable()\n {\n $this->enabled = true;\n }",
"protected function enabled()\n {\n }",
"public function genNextLink()\n\t{\n\t\t$this->pagination['nextLink'] = \"\";\t\n\t\tif($this->page < $this->numofpages)\n\t\t{\n\t\t\t$page = $this->page+1;\t\t\t\t\n\t\t\t$item = $this->itemTpl;\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray('page page_next',$this->prepend.$page.$this->append, '>'),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\t\t\n\t\t\t$this->pagination['nextLink'] = $item;\n\t\t}\n\t}",
"public function statusAction() {\n $status = $this->_getParam('status');\n $infoId = $this->_getParam('id');\n if (empty($status)) {\n $this->view->title = $this->view->translate(\"Disable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to disable this page? After being disabled this will not be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Disable\");\n } else {\n $this->view->title = $this->view->translate(\"Enable Page?\");\n $this->view->discription = $this->view->translate(\"Are you sure that you want to enable this page? After being enabled this will be shown to users.\");\n $this->view->bouttonLink = $this->view->translate(\"Enable\");\n }\n // Check post\n if ($this->getRequest()->isPost()) {\n $pagesettingsTable = Engine_Api::_()->getDbTable('startuppages', 'sitestoreproduct');\n $pagesettingsTable->update(array('status' => $status), array('startuppages_id =?' => $infoId));\n\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('Successfully done.')\n ));\n }\n }"
]
| [
"0.6432452",
"0.63233167",
"0.616049",
"0.5757782",
"0.5720771",
"0.56275195",
"0.56198066",
"0.5576079",
"0.5574223",
"0.55279475",
"0.5456375",
"0.5435921",
"0.54349506",
"0.5426101",
"0.5402528",
"0.5389232",
"0.53891844",
"0.5380763",
"0.53385174",
"0.533479",
"0.5329211",
"0.53068495",
"0.52991694",
"0.52979904",
"0.5287873",
"0.528505",
"0.5274743",
"0.524427",
"0.5223704",
"0.517869"
]
| 0.67516303 | 0 |
__construct Create a new Powerstack\Plugins\Memcached object Configuration: app/config.yml: plugins: memcached: servers: [Memcached servers (host:port[,host:port])] | function __construct() {
$conf = config('plugins');
if (!isset($conf->memcached)) {
$this->conf = (object) array(
'servers' => '127.0.0.1:11211',
);
} else {
$this->conf = $conf->memcached;
}
$this->memcached = new \Memcached();
if (strpos($this->conf->servers, ',')) {
$servers = explode(',', $this->conf->servers);
} else {
$servers = array($this->conf->servers);
}
foreach ($servers as $server) {
$parts = explode(':', $server);
$this->addServer($parts[0], $parts[1]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct() {\n include Config::create()->load('cache');\n $this->config = $cache;\n $this->mc = new Memcached();\n foreach ($this->config['server'] as $s) {\n $this->mc->addServer($s['host'], $s['port']);\n }\n }",
"public function __construct() {\n $memcached = new Memcached();\n $memcached->addServer('localhost', 11211);\n\n $this->engine = new MemcachedCache();\n $this->engine->setMemcached($memcached);\n }",
"public function __construct($options)\n\t{\n\t\t$this->memcached = new \\Memcached();\n\n\t\tif (isset($options['servers'])) {\n\t\t\t$servers = array();\n\t\t\tforeach ($options['servers'] as $server) {\n\t\t\t\t$defaults = array(\n\t\t\t\t\t'weight' => 1,\n\t\t\t\t\t'port' => self::DEFAULT_PORT,\n\t\t\t\t);\n\t\t\t\t$server = parse_url($server[0]) + $server + $defaults;\n\t\t\t\tif (!isset($server['host'])) {\n\t\t\t\t\t$server['host'] = $server['path'];\n\t\t\t\t\tunset($server['path']);\n\t\t\t\t}\n\t\t\t\t$servers[] = array(\n\t\t\t\t\t$server['host'],\n\t\t\t\t\t$server['port'],\n\t\t\t\t\t$server['weight']\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->memcached->addServers($servers);\n\t\t} else {\n\t\t\t$options['port'] = isset($options['port']) ? $options['port'] : self::DEFAULT_PORT;\n\t\t\t$this->memcached->addServer($options['host'],$options['port']);\n\t\t}\n\n\t\tif (isset($options['options'])) {\n\t\t\tforeach ($options['options'] as $option => $value) {\n\t\t\t\t$this->memcached->setOption($option, $value);\n\t\t\t}\n\t\t}\n\t}",
"function __construct() {\n $this->mem = new Memcache();\n //$this->mem->connect('118.178.182.224','18392'); //写入缓存地址,端口\n// $this->mem->addServer('118.178.182.224','18392');\n $this->mem->addServer('localhost','3306');\n }",
"public function __construct (Memcached $memcached) {\n $this->memcached = $memcached;\n }",
"public function __construct($params = array()) {\n\n $defaults = array(\n 'host' => 'localhost',\n 'port' => 11211, \n 'prefix' => null,\n );\n\n $this->options = array_merge($defaults, (array)$params);\n $this->connection = new \\Memcached();\n $this->connection->addServer($this->options['host'], $this->options['port']);\n\n }",
"public function __construct() {\r\n $this->cache = new MemCacheInterface(self::$CACHE_HOST, self::$CACHE_PORT, self::$CACHE_PREFIX, self::$CACHE_GROUP);\r\n }",
"public function __construct($options) {\n\t\t$this -> conn = memcache_pconnect($options['host'], $options['port']);\n\t}",
"protected function getConfiguredMemcachedServers() {}",
"public function __construct(array $APCOptions = null, array $MemcacheOptions = null)\n\t\t{\n\t\t\tif ($APCOptions && !empty($APCOptions['Enabled']) && (!ini_get('apc.enabled') || !function_exists('apc_store')))\n\t\t\t{\n\t\t\t\tthrow new Exception('APC not available');\n\t\t\t}\n\t\t\telseif ($APCOptions)\n\t\t\t{\n\t\t\t\tself::$APCOptions = array_merge(self::$DefaultAPCOptions, $APCOptions);\n\t\t\t\tself::$APCOn = !empty(self::$APCOptions['Enabled']);\n\t\t\t}\n\n\t\t\tif ($MemcacheOptions && !empty($MemcacheOptions['Enabled']) && !class_exists('Memcached'))\n\t\t\t{\n\t\t\t\tthrow new Exception('Memcached not available (Memcached extension, not Memcache)');\n\t\t\t}\n\t\t\telseif ($MemcacheOptions)\n\t\t\t{\n\t\t\t\tself::$MemcacheOptions = array_merge(self::$DefaultMemcacheOptions, $MemcacheOptions);\n\t\t\t\tself::$MemcacheOn = !empty(self::$MemcacheOptions['Enabled']);\n\n\t\t\t\tself::$Memcache = new Memcached;\n\n\t\t\t\tif (!empty(self::$MemcacheOptions['Consistent']))\n\t\t\t\t{\n\t\t\t\t\tself::$Memcache -> setOptions(array(\n \t\t\t\t\t\tMemcached::OPT_CONNECT_TIMEOUT => 20,\n\t\t\t\t\t\tMemcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,\n\t\t\t\t\t\tMemcached::OPT_SERVER_FAILURE_LIMIT => 5,\n\t\t\t\t\t\tMemcached::OPT_REMOVE_FAILED_SERVERS => true,\n\t\t\t\t\t\tMemcached::OPT_RETRY_TIMEOUT => 1,\n\t\t\t\t\t\tMemcached::OPT_LIBKETAMA_COMPATIBLE => true\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$MemcacheServers = self::ParseMemcacheServers(self::$MemcacheOptions['Servers']);\n\t\t\t\tself::$Memcache -> addServers($MemcacheServers);\n\t\t\t}\n\t\t}",
"public function connect() {\n// $m->addServer('localhost', 11211);\n// $v = $m->get('counter');\n// $m->set('counter', $v + 1);\n//\n// $md = new Memcached();\n// $md->addServer('localhost', 11211);\n// $v = $md->get('counter', null, $token);\n// $v = $md->set('counter', null,1, $token);\n \n \n $_debugMicrotime = microtime(true);\n \n $memcachedClass = 'Memcached';\n if(!auto::autoload($memcachedClass)){\n throw new exception_cache('class not exist for '.$memcachedClass.', check your php extensions~', exception_cache::type_memcache_not_exist);\n }\n \n $this->_memcached = new $memcachedClass();\n $servers = $this->_confs['servers'];\n foreach ($servers as $server) {\n $this->_memcached->addServer($server['host'], $server['port'], $server['weight']);\n }\n ($timeCost = microtime(true) - $_debugMicrotime) && performance::add(__METHOD__, $timeCost, array('alias'=>$this->_alias));\n\n //return $this->_memcached;\n return $this;\n }",
"public static function load (array $config) : self {\n if (!extension_loaded('memcached')) {\n if (extension_loaded('memcache')) {\n throw new CacheException(\"Can't initialize Memcached cache engine: PHP extension memcached not loaded. This class uses the Memcached extension AND NOT the Memcache extension (this one is loaded).</strong>\");\n } else {\n throw new CacheException(\"Can't initialize Memcached cache engine: PHP extension memcached not loaded.\");\n }\n }\n\n $memcached = new Memcached;\n $memcached->addServer(\n $config[\"server\"] ?? self::DEFAULT_SERVER,\n $config[\"port\"] ?? self::DEFAULT_PORT,\n );\n\n // SASL authentication\n if (array_key_exists(\"sasl_username\", $config)) {\n $memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);\n $memcached->setSaslAuthData(\n $config[\"sasl_username\"],\n $config[\"sasl_password\"] ?? \"\",\n );\n }\n\n return new self($memcached);\n }",
"public function __construct($serversString=\"\") {\n if ($serversString != \"\") {\n $this->con = new Memcache;\n $tmp = explode(\";\", $serversString);\n foreach ($tmp as $s) {\n $hostInfo = explode(\":\",$s);\n // Assume default port\n if (count($hostInfo) == 1)\n $hostInfo[] = 11211;\n\n $this->con->addServer($hostInfo[0], $hostInfo[1], true, 1);\n }\n }\n else {\n // Fall back to file cache or whatbnot ?\n }\n }",
"public static function instance()\n\t{\n\t\tif (is_null(static::$instance))\n\t\t{\n\t\t\t// -----------------------------------------------------\n\t\t\t// Verify that the Memcache extension is installed.\n\t\t\t// -----------------------------------------------------\n\t\t\tif ( ! class_exists('Memcache'))\n\t\t\t{\n\t\t\t\tthrow new \\Exception('Attempting to use Memcached, but the Memcached PHP extension is not installed on this server.');\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------\n\t\t\t// Instantiate the Memcache class.\n\t\t\t// -----------------------------------------------------\n\t\t\t$memcache = new \\Memcache;\n\n\t\t\t// -----------------------------------------------------\n\t\t\t// Configure the Memcache servers.\n\t\t\t// -----------------------------------------------------\n\t\t\tforeach (Config::get('cache.servers') as $server)\n\t\t\t{\n\t\t\t\t$memcache->addServer($server['host'], $server['port'], true, $server['weight']);\n\t\t\t}\n\n\t\t\t// -----------------------------------------------------\n\t\t\t// Verify Memcache was configured successfully.\n\t\t\t// -----------------------------------------------------\n\t\t\tif ($memcache->getVersion() === false)\n\t\t\t{\n\t\t\t\tthrow new \\Exception('Memcached is configured. However, no connections could be made. Please verify your memcached configuration.');\n\t\t\t}\n\n\t\t\tstatic::$instance = $memcache;\n\t\t}\n\n\t\treturn static::$instance;\n\t}",
"public function __construct($servers = array())\n {\n if (!empty($servers))\n {\n $this->servers = $servers;\n $this->_connect();\n }\n /**\n * задержка для Memcached\n */\n define('MEMQ_TTL', 0);\n }",
"private function __construct() {\n\t\t$this->memcache = new Memcache();\n\t\t$connectResult = $this->memcache->connect('localhost','11211');\n\t\tif ($connectResult === FALSE) {\n\t\t\t$this->memcache = NULL;\n\t\t}\n\t}",
"private function instance()\n\t{\n\t\tif (!$this->instance) {\n\t\t\t$this->instance = new \\Memcache();\n\t\t\t\n\t\t\tforeach ($this->servers as $server) {\n\t\t\t\t$this->instance->addServer(\n\t\t\t\t\t$server->host(),\n\t\t\t\t\t$server->port(),\n\t\t\t\t\t$server->isPersistent(),\n\t\t\t\t\t$server->weight(),\n\t\t\t\t\t$server->timeout(),\n\t\t\t\t\t$server->retryInterval()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->instance;\n\t}",
"private function memcacheConnect() {\n \n $config = new Cfe_Config_Ini(APPLICATION_CONFIG_PATH . '/application.ini',Cfe_Utils::getPlatform());\n $config = $config->memcache;\n \n $options = $config->frontendOptions->toArray();\n $options['logging'] = $this->logging;\n $options['logger'] = $this->logger;\n $options['lifetime'] = $this->lifetime;\n $this->_memcacheInstance = Zend_Cache::factory($config->frontend,\n $config->backend,\n $options,\n $config->backendOptions->toArray(),\n false,\n false);\n //TODO\n //$this->_memcacheInstance->clean();\n return $this->_memcacheInstance;\n }",
"private function _createMemcachedDriver(array $config)\n {\n $defaultServer = array(\n 'host' => 'localhost',\n 'port' => 11211,\n );\n\n $memcached = new \\Memcached();\n\n if (isset($config['servers']) === true) {\n foreach ($config['servers'] as $server) {\n $server = array_replace_recursive($defaultServer, $server);\n $memcached->addServer(\n $server['host'],\n $server['port']\n );\n }\n } else {\n $memcached->addserver(\n $defaultServer['host'],\n $defaultServer['port']\n );\n }\n\n return $memcached;\n }",
"static function load () {\n //Checks extension is okay\n if (!extension_loaded('memcached')) {\n if (extension_loaded('memcache')) {\n message_die(GENERAL_ERROR, \"Can't initialize $engine cache engine.<br />PHP extension memcached not loaded.<br /><strong>!!! This class uses the Memcached extension AND NOT the Memcache extension (this one is loaded) !!!</strong>\", 'Cache');\n } else {\n message_die(GENERAL_ERROR, \"Can't initialize $engine cache engine.<br />PHP extension memcached not loaded.\", 'Cache');\n }\n }\n\n //Creates the Memcached object if needed\n if (self::$instance === null) {\n global $Config;\n\n self::$instance = new CacheMemcached();\n self::$instance->memcached = new Memcached();\n self::$instance->memcached->addServer(\n $Config['cache']['server'],\n $Config['cache']['port']\n );\n }\n\n return self::$instance;\n }",
"function __construct($dbhost, $dbuser, $dbpassword, $db, $memcachedhost, $memcachedport, $exp = 10){\n\n\t\t# connect to memcached, set cache expiry time\t\n\t\t$this->cache = new Memcached();\n\t\t$this->cache->addServer($memcachedhost, $memcachedport);\n\t\t$this->exp = $exp ;\n\n\t\t# connect to mySQL\n\t\tparent::__construct(\"mysql:host=$dbhost;dbname=$db;charset=utf8\", $dbuser, $dbpassword);\n\n\t}",
"protected function init()\n {\n $this->memcache = new MemcacheDB();\n $driverConfig = $this->config->get('cache.memcache');\n $this->memcache->connect(\n $driverConfig['host'],\n $driverConfig['port']\n );\n }",
"abstract public function installMemcached();",
"function getMemcachedClient(): \\Memcached\n{\n static $client;\n if (!$client) {\n $client = new \\Memcached();\n $client->addServer('memcached', 11211);\n }\n\n return $client;\n}",
"function __construct(Memcached $cacher) {\n\t\t$this->cacher = $cacher;\n\t}",
"public function init($settings = array()) {\n\t\tif (!class_exists('Memcached')) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!isset($settings['prefix'])) {\n\t\t\t$settings['prefix'] = Inflector::slug(APP_DIR) . '_';\n\t\t}\n\n\t\tif (defined('Memcached::HAVE_MSGPACK') && Memcached::HAVE_MSGPACK) {\n\t\t\t$this->_serializers['msgpack'] = Memcached::SERIALIZER_MSGPACK;\n\t\t}\n\n\t\t$settings += array(\n\t\t\t'engine' => 'Memcached',\n\t\t\t'servers' => array('127.0.0.1'),\n\t\t\t'compress' => false,\n\t\t\t'persistent' => false,\n\t\t\t'login' => null,\n\t\t\t'password' => null,\n\t\t\t'serialize' => 'php',\n\t\t\t'options' => array()\n\t\t);\n\t\tparent::init($settings);\n\n\t\tif (!is_array($this->settings['servers'])) {\n\t\t\t$this->settings['servers'] = array($this->settings['servers']);\n\t\t}\n\n\t\tif (isset($this->_Memcached)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!$this->settings['persistent']) {\n\t\t\t$this->_Memcached = new Memcached();\n\t\t} else {\n\t\t\t$this->_Memcached = new Memcached((string)$this->settings['persistent']);\n\t\t}\n\t\t$this->_setOptions();\n\n\t\tif (count($this->_Memcached->getServerList())) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$servers = array();\n\t\tforeach ($this->settings['servers'] as $server) {\n\t\t\t$servers[] = $this->_parseServerString($server);\n\t\t}\n\n\t\tif (!$this->_Memcached->addServers($servers)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->settings['login'] !== null && $this->settings['password'] !== null) {\n\t\t\tif (!method_exists($this->_Memcached, 'setSaslAuthData')) {\n\t\t\t\tthrow new CacheException(\n\t\t\t\t\t__d('cake_dev', 'Memcached extension is not build with SASL support')\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->_Memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, true);\n\t\t\t$this->_Memcached->setSaslAuthData($this->settings['login'], $this->settings['password']);\n\t\t}\n\t\tif (is_array($this->settings['options'])) {\n\t\t\tforeach ($this->settings['options'] as $opt => $value) {\n\t\t\t\t$this->_Memcached->setOption($opt, $value);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function __construct($host = 'localhost', $port = 11211, $timeout = 1)\n\t{\n\t\t//argument test\n\t\t$error = Argument::i()\n\t\t\t//Argument 1 must be a string\n\t\t\t->test(1, 'string')\n\t\t\t//Argument 2 must be an integer\n\t\t\t->test(2, 'int')\n\t\t\t//Argument 3 must be an integer\n\t\t\t->test(3, 'int');\n\t\t\t\n\t\t//if memcache is not a class\n\t\tif(!class_exists('Memcached')) {\n\t\t\t//throw exception\n\t\t\tException::i()->setMessage(Exception::NOT_INSTALLED)->trigger();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$this->memcache = new \\Memcached;\n\t\t} catch(Exception $e) {\n\t\t\t//throw exception\n\t\t\tException::i()->setMessage(Exception::NOT_INSTALLED)->trigger();\n\t\t}\n\t\t\n\t\t$this->memcache->connect($host, $port, $timeout);\n\t\t\n\t\treturn $this;\n\t}",
"protected function prepare()\n {\n $this->memcached = new \\Memcached();\n $this->memcached->addServer('127.0.0.1', 11211);\n }",
"public function connect()\n {\n $this->connection = new \\Memcached('chopra_sso');\n $serverList = $this->connection->getServerList();\n\n $serverExists = false;\n foreach ($serverList as $server) {\n if ($server['host'] === $this->memcachedHost && $server['port'] === (int)$this->memcachedPort) {\n $serverExists = true;\n }\n }\n\n if (!$serverExists) {\n $this->connection->resetServerList();\n $res = $this->connection->addServer($this->memcachedHost, $this->memcachedPort);\n if (!$res) {\n throw new \\MemcachedException('Can\\'t connect to memcache server.');\n }\n }\n $this->connection->setOption(\\Memcached::OPT_SERIALIZER, \\Memcached::SERIALIZER_PHP);\n }",
"public function __construct(){\n parent::__construct();\n\t\t$this->load->library('Memcached_library');\n }"
]
| [
"0.76066124",
"0.7481707",
"0.73881114",
"0.72546834",
"0.71594465",
"0.6974043",
"0.68793637",
"0.6800693",
"0.6755339",
"0.6690749",
"0.66044253",
"0.6602064",
"0.65051615",
"0.64911413",
"0.64596003",
"0.6456763",
"0.64005554",
"0.63803977",
"0.6373554",
"0.6355627",
"0.63500506",
"0.63310874",
"0.6330051",
"0.6270804",
"0.6261069",
"0.6243652",
"0.6196735",
"0.6188752",
"0.61358273",
"0.6125483"
]
| 0.8377457 | 0 |
Add Servers Add multiple servers to the pool | function addServers($servers) {
return $this->memcached->addServers();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addServers(Array $servers) {\n\t\t\n\t\t/* go through each server */\n\t\tforeach ($servers as $server) {\n\t\t\t\n\t\t\t/* skip if address is missing */\n\t\t\tif (!isset($server[0])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* add this server */\n\t\t\t$this->addServer($server[0], isset($server[1]) ? $server[1] : self::DEFAULT_PORT_SERVER, isset($server[2]) ? $server[2] : self::DEFAULT_VERSION);\n\t\t}\n\t}",
"function addMasterservers(Array $servers) {\n\t\t\n\t\t/* go through each server */\n\t\tforeach ($servers as $server) {\n\t\t\t\n\t\t\t/* skip if address is missing */\n\t\t\tif (!isset($server[0])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t/* add this server */\n\t\t\t$this->addMasterserver($server[0], isset($server[1]) ? $server[1] : self::DEFAULT_PORT_MASTER);\n\t\t}\n\t}",
"protected function registerServers()\n {\n $this->container['server.lighttpd'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Server\\Lighttpd($c['dispatcher']);\n });\n\n $this->container['server.nginx'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\Server\\Nginx($c['dispatcher']);\n });\n }",
"abstract protected function setupServers();",
"public function getServers() {}",
"protected function setupServers()\n\t{\n\t\t// Create a server definition\n\t\t$testFolder = realpath(__DIR__ . '/../../../test');\n\t\t$port = 8094;\n\t\t$server = new Server($testFolder . '/browser/docroot', 'http://127.0.0.1:' . $port);\n\n\t\t// Device to ensure the two clashing server classes use different PID files\n\t\t$suffix = $this->getSuffix();\n\t\t$server->setServerPidPath(\"/tmp/spiderling-phantom-{$port}-{$suffix}.server.pid\");\n\n\t\t// Delete any existing error notifications\n\t\t@unlink($this->getErrorPathName());\n\n\t\t// Add the server to the list of servers to start\n\t\t$this->addServer($server);\n\t}",
"protected function setupServers()\n\t{\n\t\t$docRoot = realpath(__DIR__ . '/..') . '/web';\n $serverPort = self::choosePort(\n self::URL_SERVER_PORT_MIN,\n self::URL_SERVER_PORT_MAX\n );\n self::$webServerUrl = self::URL_SERVER_BASE . ':' . $serverPort;\n\t\t$server = new Server($docRoot, self::$webServerUrl);\n\n\t\t// Wait for an alive response\n $integrationRoot = realpath(__DIR__ . '/..');\n\t\t$server->setRouterScriptPath($integrationRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}",
"public function addServers(array $servers)\n {\n $this->memcached->addServers($servers);\n\n return $this;\n }",
"public function __construct( $expiration = 3600 , array $servers )\n {\n $this->expiration = $expiration;\n\n foreach ($servers as $server)\n {\n $this->addserver( $server['host'] , $server['port']);\n }\n }",
"public function setServers($servers)\n {\n if (!is_array($servers)) {\n return $this->setServers(explode(',', $servers));\n }\n\n $this->servers = array();\n foreach ($servers as $server) {\n // default values\n $host = null;\n $port = 8888;\n $weight = 1;\n $type = self::TYPE_SLAVE;\n\n if (!is_array($server) && !is_string($server)) {\n throw new Exception\\InvalidArgumentException('Invalid server specification provided; must be an array or string');\n }\n\n // parse a single server from an array\n if (is_array($server)) {\n if (!isset($server[0]) && !isset($server['host'])) {\n throw new Exception\\InvalidArgumentException(\"Invalid list of servers given\");\n }\n\n // array(array(<host>[, <port>[, <weight>]])[, ...])\n if (isset($server[0])) {\n $host = (string) $server[0];\n $port = isset($server[1]) ? (int) $server[1] : $port;\n $weight = isset($server[2]) ? (int) $server[2] : $weight;\n $type = isset($server[3]) ? $server[3] : $type;\n }\n\n // array(array('host' => <host>[, 'port' => <port>[, 'weight' => <weight>]])[, ...])\n if (!isset($server[0]) && isset($server['host'])) {\n $host = (string)$server['host'];\n $port = isset($server['port']) ? (int) $server['port'] : $port;\n $weight = isset($server['weight']) ? (int) $server['weight'] : $weight;\n $type = isset($server['type']) ? $server['type'] : $type;\n }\n }\n\n // parse a single server from a string\n if (!is_array($server)) {\n $server = trim($server);\n if (strpos($server, '://') === false) {\n $server = 'tcp://' . $server;\n }\n\n $server = parse_url($server);\n if (!$server) {\n throw new Exception\\InvalidArgumentException(\"Invalid list of servers given\");\n }\n\n $host = $server['host'];\n $port = isset($server['port']) ? (int)$server['port'] : $port;\n\n if (isset($server['query'])) {\n $query = null;\n parse_str($server['query'], $query);\n if (isset($query['weight'])) {\n $weight = (int)$query['weight'];\n }\n if (isset($query['type'])) {\n $type = (string)$query['type'];\n }\n }\n }\n\n if (!$host) {\n throw new Exception\\InvalidArgumentException('The list of servers must contain a host value.');\n }\n\n $this->addServer($host, $port, $weight, $type);\n }\n\n if (!count($this->getMasterServers())) {\n throw new Exception\\InvalidArgumentException('No master found in provided definition');\n }\n return $this;\n }",
"public function getServers();",
"public function setNameserversForAdding(array $nameservers = [])\n {\n $this->nameserversForAdding = $nameservers;\n\n return $this;\n }",
"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 setupServers()\n\t{\n\t\t$browserTestsRoot = realpath(__DIR__ . '/../../..') . '/browser';\n\t\t$server = new \\halfer\\SpiderlingUtils\\Server($browserTestsRoot . '/docroot');\n\n\t\t// Re-use the Spiderling routing script (it contains the check-alive response)\n\t\t$server->setRouterScriptPath($browserTestsRoot . '/scripts/router.php');\n\t\t$server->setCheckAliveUri('/server-check');\n\n\t\t$this->addServer($server);\n\t}",
"private function setupServers()\n {\n if (!$this->serverTypes || !$this->products) {\n throw new \\LogicException('Products and Server Types must be setup in order to set up the servers.');\n }\n\n $servers = [];\n\n foreach ($this->products as $product) {\n if ($product instanceof Product) {\n foreach ($this->serverTypes as $type) {\n if ($type instanceof ServerType) {\n $serverName = $product->getName() . '-' . $type->getName();\n\n $servers[] = [\n 'name' => $serverName,\n 'ip' => long2ip(rand(0, 42949672)),\n 'product' => $product,\n 'type' => $type\n ];\n }\n }\n }\n }\n\n $container = $this->setupData($servers, Server::class);\n\n $this->servers = $container;\n }",
"public function setGearmanServers(array $servers) {\n\t\t$this->servers = $servers;\n\t}",
"function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\n\t\t$data_city \t\t= ((in_array(strtolower($this->params['data_city']), $this->dataservers)) ? strtolower($this->params['data_city']) : 'remote');\n\t\t\n\t\t$this->dbConIro \t\t= $db[$data_city]['iro']['master'];\n\t\t$this->dbConDjds \t\t= $db[$data_city]['d_jds']['master'];\n\t\t$this->dbConDjds_slave\t= $db[$data_city]['d_jds']['master'];\n\t\t$this->dbContme\t\t\t= $db[$data_city]['tme_jds']['master'];\n\t\t//$this->dbConIro_slave\t= $db[$data_city]['iro']['slave'];\n\t\t$this->dbConIdc \t\t= $db[$data_city]['idc']['master'];\t\t\n\t\t$this->dbConbudget \t= $db[$data_city]['db_budgeting']['master'];\n\t\tif((in_array($this->ucode, json_decode(MONGOUSER)) || ALLUSER == 1)){\n\t\t\t$this->mongo_flag = 1;\n\t\t}\n\t\tif((in_array($this->ucode, json_decode(TME_MONGOUSER)) || TME_ALLUSER_MONGO == 1) && in_array(strtolower($data_city), json_decode(MONGOCITY))){\t\n\t\t\t$this->mongo_tme = 1;\n\t\t}\n\t}",
"function loadServersFromMasterservers($versions = self::DEFAULT_VERSION) {\n\t\t\n\t\t/* if given, select all versions */\n\t\tif ($versions === self::ALL_VERSIONS) {\n\t\t\t$versions = $this->versions;\n\t\t}\n\t\t\n\t\t/* check versions */\n\t\t$versions = (array)$versions;\n\t\tforeach ($versions as $k => $version) {\n\t\t\tif (!in_array($version, $this->versions)) {\n\t\t\t\tunset($versions[$k]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* if none version, set to default */\n\t\tif (!count($versions)) {\n\t\t\t$versions = array(self::DEFAULT_VERSION);\n\t\t}\n\t\t\n\t\t/* plan connections */\n\t\t$connectionStack = array();\n\t\tforeach ($this->masterservers as &$masterserver) {\n\t\t\tforeach ((array)$versions as $version) {\n\t\t\t\t$connectionStack[] = array(&$masterserver, $version);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* define variables */\n\t\t$connections = array(); // to store the active connections\n\t\t$numConnections = 0; // number of connections (number of elements in $connections)\n\t\t$curConn = 0; // next position in the connection stack to handle\n\t\t\n\t\t/* additionally request the count of servers, to prevent the connection to wait for more servers than necessary */\n\t\t$connectionsSrvCount = array(); // to store the active connections for the server count request\n\t\t$numConnectionsSrvCount = 0; // number of connections for the server count request (number of elements in $this->masterservers)\n\t\t$curConnSrvCount = 0; // next position in the connection stack for the server count request to handle\n\t\t\n\t\t/* loop as long as there are master servers to wait for */\n\t\twhile ($numConnections > 0 || isset($connectionStack[$curConn])) {\n\t\t\t\n\t\t\t/* count request */\n\t\t\t\n\t\t\t/* build up connections until limit is reached */\n\t\t\tfor (; isset($this->masterservers[$curConnSrvCount]) && ($numConnections + $numConnectionsSrvCount) < self::MAX_CONNECTIONS_MASTER; $curConnSrvCount++) {\n\t\t\t\t\n\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffcou2\";\n\t\t\t\t\n\t\t\t\t$authority = $this->masterservers[$curConnSrvCount][0].':'.$this->masterservers[$curConnSrvCount][1];\n\t\t\t\t$connection = self::establishConnection($authority, $data);\n\t\t\t\t\n\t\t\t\t/* add to connection if not failed */\n\t\t\t\tif ($connection) {\n\t\t\t\t\t$connectionsSrvCount[$curConnSrvCount] = array($connection, &$this->masterservers[$curConnSrvCount], self::getTimeInMs());\n\t\t\t\t\t$numConnectionsSrvCount++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* save memory */\n\t\t\t\tunset($authority, $connection);\n\t\t\t}\n\t\t\t\n\t\t\t/* check for responses */\n\t\t\tforeach ($connectionsSrvCount as $n => $connection) {\n\t\t\t\t\n\t\t\t\t/* read data */\n\t\t\t\t$data = fread($connection[0], 16); // size = header_size + 2 = 16\n\t\t\t\t\n\t\t\t\t/* packet length */\n\t\t\t\t$datalen = strlen($data);\n\t\t\t\t\n\t\t\t\t/* check if data is usable, otherwise skip */\n\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffsiz2\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* analyse data */\n\t\t\t\t$connection[1]['num_servers'] = (ord($data[14]) << 8) | ord($data[15]);\n\t\t\t\t\t\t\n\t\t\t\t/* only one packet expected, so drop after one packet */\n\t\t\t\tunset($connectionsSrvCount[$n]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have timed out */\n\t\t\tforeach ($connectionsSrvCount as $n => $connection) {\n\t\t\t\tif ((self::getTimeInMs() - $connection[2]) >= self::TIMEOUT_MASTER) {\n\t\t\t\t\tunset($connectionsSrvCount[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* renew connection counter */\n\t\t\t$numConnectionsSrvCount = count($connectionsSrvCount);\n\t\t\t\n\t\t\t/* server list request */\n\t\t\t\n\t\t\t/* build up connections until limit is reached */\n\t\t\tfor (; isset($connectionStack[$curConn]) && ($numConnections + $numConnectionsSrvCount) < self::MAX_CONNECTIONS_MASTER; $curConn++) {\n\t\t\t\t\n\t\t\t\tswitch ($connectionStack[$curConn][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffreqt\"; break;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xffreq2\"; break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$authority = $connectionStack[$curConn][0][0].':'.$connectionStack[$curConn][0][1];\n\t\t\t\t$connection = self::establishConnection($authority, $data);\n\t\t\t\t\n\t\t\t\t/* set loaded server counter */\n\t\t\t\tif (!isset($connectionStack[$curConn][0]['num_servers_loaded'])) {\n\t\t\t\t\t$connectionStack[$curConn][0]['num_servers_loaded'] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* add to connection if not failed */\n\t\t\t\tif ($connection) {\n\t\t\t\t\t$connections[$curConn] = array($connection, &$connectionStack[$curConn], self::getTimeInMs());\n\t\t\t\t\t$numConnections++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* save memory */\n\t\t\t\tunset($authority, $connection);\n\t\t\t}\n\t\t\t\n\t\t\t/* check for responses */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\t\n\t\t\t\t/* read data */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t$data = fread($connection[0], 464); // size = header_size + max_servers_per_packet * server_size = 14 + 75 * 6 = 464\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t$data = fread($connection[0], 1364); // size = header_size + max_servers_per_packet * server_size = 14 + 75 * 18 = 1364\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* packet length */\n\t\t\t\t$datalen = strlen($data);\n\t\t\t\t\n\t\t\t\t/* check if data is usable, otherwise skip */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfflist\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\tif ($data === false || $datalen < 14 || substr($data, 0, 14) !== \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfflis2\") {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* analyse data */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\t\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($i = 14; ($i + 6) <= $datalen; $i += 6) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* IP */\n\t\t\t\t\t\t\t$ip = inet_ntop(substr($data, $i, 4));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* port (actually an array. the port is in $port[1]) */\n\t\t\t\t\t\t\t$port = unpack(\"v\", substr($data, $i + 4, 2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->addServer($ip, $port[1], self::VERSION_05);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* increment server loaded counter */\n\t\t\t\t\t\t\t$connection[1][0]['num_servers_loaded']++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($i = 14; ($i + 18) <= $datalen; $i += 18) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* switch between IPv4 and IPv6 */\n\t\t\t\t\t\t\tif (substr($data, $i, 12) === \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\") {\n\t\t\t\t\t\t\t\t$ip = inet_ntop(substr($data, $i + 12, 4)); // IPv4\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$ip = \"[\".inet_ntop(substr($data, $i, 16)).\"]\"; // IPv6\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* port (actually an array. the port is in $port[1]) */\n\t\t\t\t\t\t\t$port = unpack(\"n\", substr($data, $i + 16, 2));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->addServer($ip, $port[1], self::VERSION_06);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* increment server loaded counter */\n\t\t\t\t\t\t\t$connection[1][0]['num_servers_loaded']++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* if connection is finished drop it */\n\t\t\t\tswitch ($connection[1][1]) {\n\t\t\t\t\tcase self::VERSION_05:\n\t\t\t\t\t\tif ($datalen < 494) {\n\t\t\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase self::VERSION_06:\n\t\t\t\t\t\tif ($datalen < 1364) {\n\t\t\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have timed out */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\tif ((self::getTimeInMs() - $connection[2]) >= self::TIMEOUT_MASTER) {\n\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* drop connections that have gathered enough servers */\n\t\t\tforeach ($connections as $n => $connection) {\n\t\t\t\tif (!empty($connection[1][0]['num_servers']) && !empty($connection[1][0]['num_servers_loaded']) && $connection[1][0]['num_servers_loaded'] >= $connection[1][0]['num_servers']) {\n\t\t\t\t\tunset($connections[$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* renew connection counter */\n\t\t\t$numConnections = count($connections);\n\t\t\t\n\t\t\t/* sleep a bit */\n\t\t\tusleep(self::REQUEST_SLEEP * 1000);\n\t\t}\n\t\t\n\t}",
"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 addServer($host, $port, $weight = 0) {}",
"public function handle()\n {\n $tmp = $this->client->servers();\n\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Game[] $games */\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Server[] $servers_db */\n /** @var \\Illuminate\\Support\\Collection|\\TruckersMP\\Types\\Server[] $servers_actual */\n $games = Game::all();\n $servers_db = Server::all();\n\n// $new = json_decode('{\"id\":16,\"game\":\"ETS2\",\"ip\":\"43.251.158.210\",\"port\":42860,\"name\":\"Convoy\",\"shortname\":\"Convoy\",\"online\":true,\"players\":4,\"queue\":0,\"maxplayers\":500,\"speedlimiter\":false,\"collisions\":true,\"carsforplayers\":true,\"policecarsforplayers\":false,\"afkenabled\":true,\"syncdelay\":100}',\n// true);\n// $tmp->servers[] = new \\TruckersMP\\Types\\Server($new);\n $servers_actual = collect($tmp);\n\n $existed_servers = [];\n foreach ($servers_actual as $actual) {\n /** @var \\Illuminate\\Support\\Collection|\\App\\Models\\Server[] $db */\n /** @var \\TruckersMP\\Types\\Server $actual */\n $db = $servers_db->where('actual_id', $actual->id)\n ->where('name', $actual->name)\n ->where('shortname', $actual->shortName)\n ->sortByDesc('created_at');\n\n if ($db->isEmpty()) {\n /** @var \\App\\Models\\Server $s */\n $s = Server::create([\n 'actual_id' => $actual->id,\n 'game_id' => $games->where('shortname', $actual->game)->first()->id,\n 'name' => $actual->name,\n 'shortname' => $actual->shortName,\n 'online' => $actual->online,\n ]);\n\n $this->info('New server - ' . $actual->name);\n $existed_servers[] = $s->id;\n continue;\n }\n\n /** @var \\App\\Models\\Server $main */\n if ($db->count() > 1) {\n $main = $db->shift();\n $db->each(function ($server) {\n /** @var \\App\\Models\\Server $server */\n $server->online = false;\n $server->update();\n $server->delete();\n });\n } else {\n $main = $db->first();\n }\n\n if ($main->online !== $actual->online) {\n $actual_online = $actual->online ? 'online' : 'offline';\n $main->online = $actual->online;\n\n $this->comment(\"{$main->shortname} went {$actual_online}\");\n }\n\n $existed_servers[] = $main->id;\n };\n\n $servers_db->each->update();\n Server::whereNotIn('id', $existed_servers)->delete();\n }",
"function getServers() {\n\t\treturn $this->servers;\n\t}",
"public function getMultiHostServers() {\n $publicKey = md5(microtime());\n\n $hosts = array('http://imbo0', 'http://imbo1/prefix', 'http://imbo2:81', 'http://imbo3:81/prefix', 'http://imbo4:80');\n\n return array(\n array($hosts, $publicKey, 'd1afdbe2950dc1e9fa134d8c91cd1a8b', 'http://imbo4'),\n array($hosts, $publicKey, '5fda26a928c9b0b90ef7b2db0031bfcf', 'http://imbo0'),\n array($hosts, $publicKey, '5d028794b32c2b127875a336b1220dab', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, 'f7dc62518f2967dacbc4c0eead5fabe5', 'http://imbo2:81'),\n array($hosts, $publicKey, '7a4cac9e82c06010293cd6d23708e147', 'http://imbo2:81'),\n array($hosts, $publicKey, '609c8d8350d3b6b294a628835b8e9b59', 'http://imbo1/prefix'),\n array($hosts, $publicKey, '1e68c888fbe0a27276141a1e6fb576f4', 'http://imbo0'),\n array($hosts, $publicKey, '67e45db3a472a90a26bda000c0818bfc', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, '3ad35117949c5a17b9df82c343b4f763', 'http://imbo3:81/prefix'),\n );\n }",
"function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\n\t\t$conn_city \t\t= ((in_array(strtolower($this->data_city), $this->dataservers)) ? strtolower($this->data_city) : 'remote');\n\t\t\n\t\t$this->conn_iro \t\t= $db[$conn_city]['iro']['master'];\n\t\t$this->conn_local \t\t= $db[$conn_city]['d_jds']['master'];\n\t\t$this->conn_tme \t\t= $db[$conn_city]['tme_jds']['master'];\n\t\t$this->conn_idc \t\t= $db[$conn_city]['idc']['master'];\n\t\t\n\t\tif(($this->module =='DE') || ($this->module =='CS'))\n\t\t{\n\t\t\t$this->conn_temp\t \t= $this->conn_local;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t}\n\t\telseif($this->module =='TME')\n\t\t{\n\t\t\t$this->conn_temp\t\t= $this->conn_tme;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t\tif((in_array($this->ucode, json_decode(TME_MONGOUSER)) || TME_ALLUSER_MONGO == 1) && in_array(strtolower($conn_city), json_decode(MONGOCITY))){\n\t\t\t\t$this->mongo_tme = 1;\n\t\t\t}\n\n\t\t}\n\t\telseif($this->module =='ME')\n\t\t{\n\t\t\t$this->conn_temp\t\t= $this->conn_idc;\n\t\t\t$this->conn_catmaster \t= $this->conn_local;\n\t\t\tif((in_array($this->ucode, json_decode(MONGOUSER)) || ALLUSER == 1)){\n\t\t\t\t$this->mongo_flag = 1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = \"Invalid Module.\";\n\t\t\techo json_encode($this->send_die_message($message));\n\t\t\tdie();\n\t\t}\t\t\n\t}",
"function addMasterserver($address, $port = self::DEFAULT_PORT_MASTER) {\n\t\t\n\t\t/* cast to right types */\n\t\t$address = (string)$address;\n\t\t$port = (int)$port;\n\t\t\n\t\t/* if address is invalid abort */\n\t\tif (empty($address)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* if port is invalid set to default port */\n\t\tif ($port < 0 || $port > 65535) {\n\t\t\t$port = self::DEFAULT_PORT_MASTER;\n\t\t}\n\t\t\n\t\t/* add if not a duplicate */\n\t\t$server = array($address, $port);\n\t\tif (!in_array($server, $this->masterservers, true)) {\n\t\t\t$this->masterservers[] = $server;\n\t\t}\n\t}",
"public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}",
"function setServers()\n\t{\t\n\t\tglobal $db;\n\t\t\t\t\t\n\t\tif(DEBUG_MODE)\n\t\t{\n\t\t\techo '<pre>db array :: ';\n\t\t\tprint_r($db);\n\t\t}\n\t\t\n\t\t$data_city \t\t\t\t= ((in_array(strtolower($this->params['data_city']), $this->dataservers)) ? strtolower($this->params['data_city']) : 'remote');\n\t\t$this->idc_con\t\t\t= $db[strtolower($data_city)]['idc']['master'];\n\t\t$this->local_tme_conn\t= $db[strtolower($data_city)]['tme_jds']['master'];\n\t\t$this->local_d_jds\t\t= $db[strtolower($data_city)]['d_jds']['master'];\n\t\t$this->local_iro_conn\t= $db[strtolower($data_city)]['db_iro']['master'];\n\t\t$this->fin_con\t\t\t= $db[strtolower($data_city)]['fin']['master'];\n\t\t\n\t}",
"static public function getServers() {\n\t\tself::loadSettings();\n\t\treturn self::$servers;\n\t}",
"public function add(PriorityServer $server)\n\t{\n\t\t$this->server_list->append($server);\n\t}",
"private function createPool($keyspace, $servers=NULL) \n {\n try {\n $this->conn = new ConnectionPool($keyspace, $servers);\n } catch (Exception $e) {\n show_error($e->getMessage());\n }\n }"
]
| [
"0.70336735",
"0.6791217",
"0.64767593",
"0.6223394",
"0.60119027",
"0.5996613",
"0.5981831",
"0.5955893",
"0.59548634",
"0.59018725",
"0.58974683",
"0.57888085",
"0.57670546",
"0.5724056",
"0.57238764",
"0.5692051",
"0.56763506",
"0.5642057",
"0.5618694",
"0.5602624",
"0.5570044",
"0.5552284",
"0.55160636",
"0.5469255",
"0.546002",
"0.54521966",
"0.5445308",
"0.54063576",
"0.5342503",
"0.5330814"
]
| 0.6861925 | 1 |
Delete Multi Delete multiple items from memcached | function deleteMulti($keys, $time=0) {
return $this->memcached->deleteMulti($keys, $time);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wp_cache_delete_multiple(array $keys, $group = '')\n {\n }",
"function multi_delete () {\n\t\t$ids_to_delete = array();\n\t\t// Prepare ids to delete\n\t\tforeach ((array)$_POST[\"items\"] as $_cur_id) {\n\t\t\tif (empty($_cur_id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$ids_to_delete[$_cur_id] = $_cur_id;\n\t\t}\n\t\t// Do delete ids\n\t\tif (!empty($ids_to_delete)) {\n\t\t\tdb()->query(\"DELETE FROM \".db('search_keywords').\" WHERE id IN(\".implode(\",\",$ids_to_delete).\")\");\n\t\t}\n\t\t// Return user back\n\t\treturn js_redirect($_SERVER[\"HTTP_REFERER\"]);\n\t}",
"public function deleteMultiple( $keys )\n\t{\n\t\t$this->getObject()->deleteMultiple( $keys );\n\t}",
"public function deleteAllForKey()\n\t{\n\t\t$keys = $this->getAllKeys();\n return parent::deleteMulti($keys);\n\t}",
"public function testDelete_Multi()\n {\n \t$this->conn->delete('test', array('status'=>'ACTIVE'), DB::MULTIPLE_ROWS);\n \t$result = $this->conn->query(\"SELECT * FROM test\");\n \t$this->assertEquals(array(3, 'three', 'another row', 'PASSIVE'), $result->fetchOrdered());\n \t$this->assertNull($result->fetchOrdered());\n }",
"function messageDeleteBulk(Collection $messages);",
"protected function entityDeleteMultiple($ids) {\n waywire_video_delete_multiple($ids);\n }",
"public function delete_multiple(array $keys, $group = '')\n {\n }",
"static public function deleteMulti($subject, $keys) {\n\t\tforeach($keys as $oneKey)\n\t\t\tself::delete($subject, $oneKey);\n\t}",
"function seminars_delete_multiple($sids, $delete_categories = FALSE, $delete_masters = FALSE) {\n\n foreach($sids as $sid)\n seminars_delete($sid, $delete_categories, $delete_masters);\n \n}",
"public function delMultiple($key)\n {\n return $this->doDelete($key);\n }",
"public function multiDelete()\n {\n if(is_array(request()->item)){\n foreach (request()->item as $id) {\n $tradmark = Tradmark::findOrfail($id);\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n }else{\n $tradmark = Tradmark::findOrfail(request('item'));\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n session()->flash('success', trans('admin.deleted_successfully'));\n return redirect(route('admin.tradmarks.index'));\n }",
"public function deleteMany($ids)\n {\n $placeholders = array_fill(0, count($ids), \"?\");\n $placeholders = implode(\", \", $placeholders);\n\n $sql = \"DELETE FROM `%s` WHERE `%s` IN (%s)\";\n $this->_sql[] = sprintf($sql, $this->_table, $this->_key, $placeholders);\n $parameters = array();\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }",
"abstract public function deleteAll();",
"public function actionBulkDelete() {\n\n if (Yii::$app->request->post('selection')) {\n $where = ['id' => Yii::$app->request->post('selection', []), 'sender_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $where);\n\n $whereVia = ['mailbox_id' => Yii::$app->request->post('selection', []), 'receiver_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $whereVia);\n }\n }",
"public function multiDeleteAction() {\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n //DELETE OFFERS FROM DATABASE AND SCRIBD\n $offer_id = (int) $value;\n\t\t\t\t\tEngine_Api::_()->sitestoreoffer()->deleteContent($offer_id);\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }",
"function deleteMultipleData($tableName,$ids,$fieldName,$flag=SOFT_DELETE){\t\t\r\n\t\tif(!isset($ids) || $ids==''){\r\n\t\t\treturn FALSE;\r\n\t\t}else{\r\n\t\t\tif(isset($tableName)&& trim($tableName)!='' && $fieldName!=''){\r\n\t\t\t\tif($flag==SOFT_DELETE){\r\n\t \t\t\t $query=\"UPDATE \".$tableName.\" SET \".COND_IS_DELETED_TRUE .\" WHERE \". $fieldName .\" IN(\".$ids.\")\";\r\n\t\t\t\t}\r\n\t\t\t\tif($flag==HARD_DELETE){\r\n\t\t\t\t\t$query=\"DELETE FROM \".$tableName.\" WHERE \".$fieldName.\" IN(\".$ids.\")\";\r\n\t\t\t\t}\r\n\t\t\t\treturn mysql_query($query); \r\n\t\t\t}\r\n\t \t}\r\n\t }",
"public function multiDeleteAction() {\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n Engine_Api::_()->getItem('list_listing', (int) $value)->delete();\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }",
"public static function massdelete($items) {\r\n\t\t$retval = Doctrine_Query::create ()->delete ()->from ( 'Wiki w' )->whereIn ( 'w.wiki_id', $items )->execute ();\r\n\t\treturn $retval;\r\n\t}",
"static public function deleteMultiple($ids) {\n return entity_delete_multiple('nuntius_room', $ids);\n }",
"public function testDeleteBatch()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function deleteItemBatch($keys)\n {\n $this->batchRequests = [];\n $response = [];\n\n foreach (array_chunk($keys, $this->batchWriteChunkSize) as $keyChunk) {\n $this->batchRequests[] = Write::make()\n ->addMany(\n $this->from,\n array_map(function ($key) {\n return DeleteRequest::make($key);\n }, $keyChunk)\n );\n }\n\n $queries = $this->grammar->compileBatchWriteItem($this);\n\n foreach ($queries as $query) {\n $response[] = $this->connection->getClient()->batchWriteItem($query);\n }\n\n return $this->processor->processBatchWriteItems($response);\n }",
"protected function entityDeleteMultiple($ids) {\n farm_asset_delete_multiple($ids);\n }",
"public function delete(){\r\n $rsid_array = $this -> uri -> segment_array();\r\n\r\n foreach ($rsid_array as $key => $value) {\r\n \r\n //If the key is greater than 2 i.e is one of the the ids\r\n if ($key > 2) {\r\n\r\n //Run delete\r\n $this -> db -> delete('refSubs', array('id' => $value));\r\n\r\n } \r\n }\r\n\r\n }",
"public function deleteMultiple(Request $request)\n {\n $ids = explode(\",\", $request->ids);\n\n foreach ($ids as $key => $id) {\n $product = Product::with('categories', 'tags', 'attributes')->find($id);\n if (!empty($product)) {\n if (count($product->categories) > 0) {\n foreach ($product->categories as $category) {\n if ($category->total_products > 0) {\n $category->decrement('total_products');\n }\n }\n }\n if (count($product->tags) > 0) {\n foreach ($product->tags as $tag) {\n if ($tag->total_products > 0) {\n $tag->decrement('total_products');\n }\n }\n }\n\n $product->attributes()->detach();\n $product->categories()->detach();\n $this->removeThisCache($product->slug, $product->id);\n\n if ($product->delete() > 0) {\n// return response(1);\n }\n }\n// return response(0);\n }\n return response()->json(['success' => \"Products Multi Deleted successfully.\"]);\n\n }",
"public function deleteMultipleById(array $ids) : int\n {\n }",
"public function deleteMulti(array $keys) {\n return 0;\n }",
"public function delete(array $ids);",
"public function deleteMultiple($keys)\n {\n if (!$this->isEnable) {\n return false;\n }\n\n $this->client->del($keys);\n\n return true;\n }",
"public function deleteAll();"
]
| [
"0.74532646",
"0.7011111",
"0.6802612",
"0.67139",
"0.67039067",
"0.66248745",
"0.6564758",
"0.6493527",
"0.64826375",
"0.647363",
"0.6472628",
"0.6430388",
"0.6361711",
"0.6347832",
"0.63463926",
"0.6343705",
"0.63312817",
"0.63260835",
"0.6324101",
"0.63216925",
"0.63177854",
"0.63079107",
"0.6305744",
"0.6266559",
"0.62648046",
"0.6256363",
"0.625501",
"0.6254654",
"0.6220729",
"0.62104684"
]
| 0.72221875 | 1 |
Get Get an item from memcached | function get($key) {
return $this->memcached->get($key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get ($key) {\n return $this->memcached->get($key);\n }",
"public function get($key){\n if( $value = $this->memcache->get($this->prefix.$key) ) {\n return $value;\n }\n }",
"public function get($key) {\n $value = $this->memcached->get($key);\n\n return $value;\n }",
"function get($key){\n\t\tif ($this->connect_successful) return @$this->memcache->get($key);\n\t\telse return NULL;\n\t}",
"function get($key) {\n $memObj = self::getMemcacheObj();\n return $memObj->get($key);\n }",
"function get($key) {\n $memObj = self::getMemcacheObj();\n return $memObj->get($key);\n }",
"public function get($key)\n\t{\n\t\treturn $this->memcache->get($key);\n\t}",
"public function retrieve($key) {\n $value = $this->_memcache->get($key);\n if ($value === false) $value = null;\n return $value;\n }",
"function get($key) {\n return $this->cacheObj->get($key);\n }",
"public function getCachedItem()\n {\n $data = ['test'];\n $key = 'test';\n $composed = 'cache-bin:test';\n\n $server = $this->getMemcachedMock(['get']);\n $server->expects($this->once())\n ->method('get')\n ->with($composed)\n ->willReturn($data);\n $this->driver->server = $server;\n $item = $this->driver->get($key);\n $this->assertEquals($data, $item->getData());\n $this->assertTrue($item->isValid());\n }",
"public function getFromCache() {}",
"public function get($id)\r\n\t{\t\r\n\t\t$data = $this->_memcached->get($id);\r\n\t\treturn (is_array($data)) ? $data[0] : FALSE;\r\n\t}",
"public function retrieve($key) {\n if ($this->memcache !== NULL) {\n $value = $this->memcache->get($key);\n if ($value !== false) {\n return $value;\n }\n } \n return null;\n }",
"public function cacheGet() {\n }",
"public function read($key) {\n\t\treturn $this->_Memcached->get($key);\n\t}",
"public function getObjFromCache($key);",
"public function get($key) {\n\t\tif ($this->useCache()) {\n\t\t\t$memcache = $this->memcache;\n\t\t\tif ($memcache) {\n\t\t\t\t$result = $this->memcache->get($key);\n\t\t\t\t$result = unserialize($result);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}",
"public function get($key)\r\r\n\t{\t\t\r\r\n\t\t$this->get_count++;\t\t\r\r\n\t\treturn $this->_storage->get($key);\t\t\r\r\n\t}",
"protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }",
"public function get()\n {\n return Cache::get($this->cacheKey);\n }",
"public function getItem($key): CacheItem;",
"protected function _read($var)\n\t{\n\t\treturn $this->memcached->get($this->key_prefix . $var);\n\t}",
"function get($key)\n {\n return $this->cache->get($key, $this->group);\n }",
"function getItem() ;",
"public function getCache($key)\n {\n return $this->memcache->get($key);\n }",
"function cache_get( $key ) {\n\t\t\n\t\tif ( !extension_loaded('apc') || (ini_get('apc.enabled') != 1) ) {\n\t\t\tif ( isset( $this->cache[ $key ] ) ) {\n\t\t\t\treturn $this->cache[ $key ];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn apc_fetch( $key );\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public function get()\n {\n // we hit the cache when we get the item.. so we allways return the value\n return $this->value;\n }",
"public function getItem($key){}",
"public function get($cache_name);",
"abstract function get ($item);"
]
| [
"0.8125201",
"0.76511395",
"0.7639137",
"0.76028705",
"0.7507948",
"0.7507948",
"0.74945104",
"0.71756375",
"0.71737593",
"0.7123712",
"0.7102081",
"0.70858777",
"0.7016214",
"0.70043784",
"0.69775563",
"0.69665724",
"0.6965936",
"0.69190884",
"0.68139684",
"0.6712311",
"0.66960335",
"0.6695856",
"0.66890466",
"0.6685143",
"0.66849625",
"0.6639261",
"0.66389453",
"0.6636076",
"0.66190934",
"0.6582065"
]
| 0.782009 | 1 |
Get All Keys Gets the keys stored on all the servers | function getAllKeys() {
return $this->memcached->getAllKeys();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllKey();",
"public function getKeys() {\n\t\treturn $this->getAllKeys();\n\t}",
"public function retrieveKeys()\n {\n return $this->start()->uri(\"/api/key\")\n ->get()\n ->go();\n }",
"public function getKeys() {}",
"public function getKeys();",
"static function getKeys();",
"private function getAllCacheKeys(){\n $keys = array();\n foreach ($this->storages as $name => $storage){\n $keys[] = $this->getCacheKey($name);\n }\n return $keys;\n }",
"public function getKeys()\n {\n $response = $this->get('user/keys');\n\n return $response['public_keys'];\n }",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"abstract public function getKeys();",
"public function getKeys()\n {\n $private_key = $this->config->getAppValue($this->appName, \"privatekey\");\n $public_key = $this->config->getAppValue($this->appName, \"publickey\");\n\n return [$private_key, $public_key];\n }",
"public function getKeys(){\n\t\treturn $this->keys;\n\t}",
"function getKeys(){\n\t\ttry{\n\t\t\t$db = getConnection();\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"llsec\"));\n\t\t\t$llsec = $stmt->fetch()['network_key'];\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"dtls\"));\n\t\t\t$dtls = $stmt->fetch()['network_key'];\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return array($llsec, $dtls);\n\t}",
"public function getAllItems(){\n\n\t\treturn $this->redis_client->keys(\"*\");\n\t}",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys() {\n\t\treturn $this->config->getKeys();\n\t}",
"public function getKeys()\n {\n $this->prepare();\n\n return $this->_keys;\n }",
"public function GetAllKeys()\n {\n return array_keys($this->_keyValPairs);\n }",
"public function getKeys()\n {\n $catalog = $this->fetch($this->catalog_key);\n $catalog = \\is_array($catalog) ? $catalog : Array();\n \\ksort($catalog);\n return $catalog;\n }",
"public function getKeys() {\n\t\treturn file('/home4/statelib/keys.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t}",
"public static function keys()\n {\n return static::$keys;\n }"
]
| [
"0.79576707",
"0.7618327",
"0.7462499",
"0.7438615",
"0.73016894",
"0.72672427",
"0.7262566",
"0.7222751",
"0.7218719",
"0.7218719",
"0.7218719",
"0.7218719",
"0.7218719",
"0.7218719",
"0.7187886",
"0.71615654",
"0.7138908",
"0.7075611",
"0.70298636",
"0.6984377",
"0.6984377",
"0.6984377",
"0.6984377",
"0.6984377",
"0.69264185",
"0.69040436",
"0.678213",
"0.67715746",
"0.6749052",
"0.6689654"
]
| 0.79591775 | 0 |
Get Multi Get multiple items from memcached | function getMulti($keys) {
return $this->memcached->getMulti($keys);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wp_cache_get_multiple($keys, $group = '', $force = \\false)\n {\n }",
"function wp_cache_get_multiple( $keys, $group = '', $force = false ) {\n\t\t$values = array();\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t$values[ $key ] = wp_cache_get( $key, $group, $force );\n\t\t}\n\n\t\treturn $values;\n\t}",
"public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }",
"public function getMultipleData();",
"public function getMultiple($key)\n {\n return $this->doFetch($key);\n }",
"function wp_cache_get_multi($groups)\n{\n global $wp_object_cache;\n\n return $wp_object_cache->get_multi($groups);\n}",
"public function getMultiple() {}",
"function get_multi( $groups ) {\n\t\t$return = array();\n\t\tforeach ( $groups as $group => $ids ) {\n\t\t\t$mc =& $this->get_mc( $group );\n\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t$key = $this->key( $id, $group );\n\t\t\t\tif ( isset( $this->cache[$key] ) ) {\n\t\t\t\t\tif ( is_object( $this->cache[$key] ) )\n\t\t\t\t\t\t$return[$key] = clone $this->cache[$key];\n\t\t\t\t\telse\n\t\t\t\t\t\t$return[$key] = $this->cache[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if ( in_array( $group, $this->no_mc_groups ) ) {\n\t\t\t\t\t$return[$key] = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t$return[$key] = $mc->get( $key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $to_get ) {\n\t\t\t\t$vals = $mc->get_multi( $to_get );\n\t\t\t\t$return = array_merge( $return, $vals );\n\t\t\t}\n\t\t}\n\t\t@ ++$this->stats['get_multi'];\n\t\t$this->group_ops[$group][] = \"get_multi $id\";\n\t\t$this->cache = array_merge( $this->cache, $return );\n\t\treturn $return;\n\t}",
"public static function handleSetMulti($memcached, $items)\n {\n return [\n 'attributes' => ['key' => implode(',', array_keys($items))],\n 'kind' => Span::KIND_CLIENT\n ];\n }",
"static public function getMulti($subject, $keys) {\n\t\t$cache = self::singleton();\n\t\t$fetchArray = array();\n\t\t$retval = array();\n\t\t\n\t\tforeach($keys as $oneKey) {\n\t\t\t$genKey = self::generateKey($subject, $oneKey);\n\t\t\tif(isset(self::$local[$genKey])) {\n\t\t\t\t$retval[$oneKey] = self::$local[$genKey];\n\t\t\t\tY_Log::debug('cache get local %s', $genKey);\n\t\t\t} else\n\t\t\t\t$fetchArray[] = $genKey;\n\t\t}\n\t\t\n\t\t// Things not found in the local cache are looked up, copied, and returned\n\t\tif(!empty($fetchArray)) {\n\t\t\t$moreStuff = $cache->getMulti( $fetchArray );\n\t\t\tif(!empty($moreStuff)) {\n\t\t\t\tforeach($moreStuff as $genKey=>$value) {\n\t\t\t\t\tself::$local[$genKey] = $value;\n\t\t\t\t\tlist($subject,$key) = self::parseKey($genKey);\n\t\t\t\t\t$retval[$key] = $value;\n\t\t\t\t\tY_Log::debug('cache get remote %s', $genKey);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}",
"public function testReadsMultibulkRepliesAsIterators() {\n\t\t$connection = $this->getConnection ( $profile, true );\n\t\t$connection->getProtocol ()->setOption ( 'iterable_multibulk', true );\n\t\t\n\t\t$connection->executeCommand ( $profile->createCommand ( 'rpush', array (\n\t\t\t\t'metavars',\n\t\t\t\t'foo',\n\t\t\t\t'hoge',\n\t\t\t\t'lol' \n\t\t) ) );\n\t\t$connection->writeCommand ( $profile->createCommand ( 'lrange', array (\n\t\t\t\t'metavars',\n\t\t\t\t0,\n\t\t\t\t- 1 \n\t\t) ) );\n\t\t\n\t\t$this->assertInstanceOf ( 'Predis\\Iterator\\MultiBulkResponse', $iterator = $connection->read () );\n\t\t$this->assertSame ( array (\n\t\t\t\t'foo',\n\t\t\t\t'hoge',\n\t\t\t\t'lol' \n\t\t), iterator_to_array ( $iterator ) );\n\t}",
"public function getMultiple($keys, $keysInResult = false){\n\n if (!$keys || !count($keys)) {\n $keys = array();\n }\n if (is_string($keys)) {\n $keys = array($keys);\n }\n\n $keysArray = array();\n\n foreach ($keys as $numericIndex){\n $keysArray[] = $this->_keyFromId($numericIndex);\n }\n\n /**\n * result array always contains the count of items that equals to requested keys count\n */\n $resFromCache = $this->getAdapter()->getMultiple($keysArray); // returns numeric array from 0 till n\n\n if(!is_array($resFromCache)){\n return array();\n }\n\n $res = array();\n foreach ($resFromCache as $numericIndex=>$item){\n if(empty($item)){// do not return empty results\n continue;\n }\n $res[$this->_getKeyByIndex($keys, $numericIndex, $keysInResult)] = $item;\n }\n return $res;\n }",
"function get ($key) {\n return $this->memcached->get($key);\n }",
"public function getAll($cache = true) {}",
"public function cacheAll()\n {\n $data = $this->resource->get()->wait();\n\n $this->client->pipeline(function ($pipe) use ($data) {\n foreach ( $data->result->result as $k => $v ) {\n $pipe->set($this->keyPrefix . $v->id, serialize($v));\n }\n });\n\n return;\n }",
"public function retrieveAllList()\n {\n if ($list = $this->memcache->get('API::' . $this->numInstance . '::referentiel')) {\n return json_decode($list, true);\n } else {\n $list = $this->refIdRepository->findAllAsArray();\n $this->memcache->set(\n 'API::' . $this->numInstance . '::referentiel',\n json_encode($list),\n 0,\n 86400\n );\n return $list;\n }\n }",
"function setMulti($items, $expire=0) {\n return $this->memcached->setMulti($items, $expire);\n }",
"public function get_multi($groups)\n {\n if (empty($groups) || ! is_array($groups)) {\n return false;\n }\n\n // Retrieve requested caches and reformat results to mimic Memcached Object Cache's output\n $cache = array();\n\n foreach ($groups as $group => $keys) {\n if (in_array($group, $this->ignored_groups) || ! $this->redis_status()) {\n foreach ($keys as $key) {\n $cache[$this->build_key($key, $group)] = $this->get($key, $group);\n }\n } else {\n // Reformat arguments as expected by Redis\n $derived_keys = array();\n\n foreach ($keys as $key) {\n $derived_keys[] = $this->build_key($key, $group);\n }\n\n // Retrieve from cache in a single request\n try {\n $group_cache = $this->redis->mget($derived_keys);\n } catch (Exception $exception) {\n $this->handle_exception($exception);\n $group_cache = array_fill(0, count($derived_keys) - 1, false);\n }\n\n // Build an array of values looked up, keyed by the derived cache key\n $group_cache = array_combine($derived_keys, $group_cache);\n\n // Restores cached data to its original data type\n $group_cache = array_map(array($this, 'maybe_unserialize'), $group_cache);\n\n // Redis returns null for values not found in cache, but expected return value is false in this instance\n $group_cache = array_map(array($this, 'filter_redis_get_multi'), $group_cache);\n\n $cache = array_merge($cache, $group_cache);\n }\n }\n\n // Add to the internal cache the found values from Redis\n foreach ($cache as $key => $value) {\n if ($value) {\n $this->cache_hits++;\n $this->add_to_internal_cache($key, $value);\n } else {\n $this->cache_misses++;\n }\n }\n\n return $cache;\n }",
"function get_multi($keys) {\n\t\t$out = array();\n\t\tforeach($keys as $key)\n\t\t\t$out[$key] = $this->get($key);\n\t\treturn $out;\n\t}",
"public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}",
"function sendMemcacheCommands($command){\n global $MEMCACHE_SERVERS;\n\t$result = array();\n\n\tforeach($MEMCACHE_SERVERS as $server){\n\t\t$strs = explode(':',$server);\n\t\t$host = $strs[0];\n\t\t$port = $strs[1];\n\t\t$result[$server] = sendMemcacheCommand($host,$port,$command);\n\t}\n\treturn $result;\n}",
"public function getMultiple($_ids, $_containerIds = NULL) {\n }",
"public function getAllItems(){\n\n\t\treturn $this->redis_client->keys(\"*\");\n\t}",
"public function mget(string ...$keys): array\r\n\t{\r\n\t\treturn $this->connection->mget($keys);\r\n\t}",
"function sends_get()\n {\n $search = array();\n $response = FALSE; \n \n $cache = Cache::get_instance();\n $response = $cache::get('send' . serialize($this->_args));\n\n if (!$response) {\n $response['_count'] = $this->model->count_results($this->_args);\n\n if ($response['_count'] > 0)\n {\n $response['data'] = $this->model->fetch($this->_args, TRUE)->result();\n } \n\n $response['l'] = $this->db->last_query(); \n }\n\n $this->response($response);\n }",
"function getItems();",
"function getItems();",
"function curl_fetch_multi($urlArr=array(), $options=array()) {\n\t// 创建curl_multi句柄\n\t$mh = curl_multi_init();\n\t\n\t$res = array();\n\t$handleArr = array();\n\t\n\tforeach ($urlArr as $k => $url) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt_array($ch, $options);\n\t\tcurl_multi_add_handle($mh, $ch);\n\t\t$handleArr[$k] = $ch;\n\t}\n\t\n\tdo {\n\t\t$mrc = curl_multi_exec($mh, $active);\n\t} while($mrc == CURLM_CALL_MULTI_PERFORM);\n\t\n\twhile($active && $mrc == CURLM_OK) {\n\t\tif(curl_multi_select($mh) != -1) usleep(100);\n\t\tdo {\n\t\t\t$mrc = curl_multi_exec($mh, $active);\n\t\t} while($mrc == CURLM_CALL_MULTI_PERFORM);\n\t}\n\t\n\tforeach($handleArr as $k => $ch) {\n\t\t$res[$k] = curl_multi_getcontent($ch);\n\t\tcurl_multi_remove_handle($mh, $ch);\n\t\tcurl_close($ch);\n\t}\n\t\n\tcurl_multi_close($mh);\n\t\n\treturn $res;\n}",
"public function batch(array $ids)\n {\n if ( !$this->client ) {\n $result = $this->resource->get($ids)->wait();\n return $result->result->result;\n } // If we don't have the cache available return from api\n\n $result = $this->mget(array_map(function($item) {\n return $this->keyPrefix . $item;\n }, $ids));\n\n\n if ( $result ) return array_map(function($item) {\n return unserialize($item);\n }, $result); // Return if match found\n\n $result = $this->resource->get($ids)->wait();\n\n $this->client->pipeline(function ($pipe) use ($result) {\n foreach ( $result->result->result as $k => $v ) {\n $pipe->set($this->keyPrefix . $v->id, serialize($v));\n }\n }); // Cache batch if nothing was found\n\n return $result->result->result;\n }",
"protected function cacheResult($resultset, $memcache = false) {\r\n\t\t$cached = array();\r\n\t\tforeach ($resultset as $entity) {\r\n\t\t\t$cached[] = $this->cache($entity, $memcache);\r\n\t\t}\r\n\t\treturn $cached;\r\n\t}"
]
| [
"0.6987854",
"0.6728983",
"0.66264516",
"0.6474209",
"0.63721836",
"0.6367221",
"0.6293357",
"0.61977714",
"0.61054945",
"0.6095383",
"0.60721767",
"0.601287",
"0.5991778",
"0.596346",
"0.59350455",
"0.58057207",
"0.578981",
"0.5760802",
"0.5754851",
"0.57528424",
"0.57122463",
"0.568525",
"0.56740564",
"0.5668196",
"0.566227",
"0.5654656",
"0.5654656",
"0.5629102",
"0.56273943",
"0.5607231"
]
| 0.76415044 | 0 |
Construct this object with a strict mode indicator flag. In strict mode, any dynamic properties must be supplied in a call to __setDynamicPropertyKeys. Otherwise in non strict mode, any properties may be set and got on this class with no checking. | public function __construct($strictMode = true)
{
$this->__strictMode = $strictMode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setStrict(bool $strict) : self\n {\n $this->initialized['strict'] = true;\n $this->strict = $strict;\n return $this;\n }",
"public function setStrict($strict)\n {\n $this->strict = (boolean)$strict;\n return $this;\n }",
"public function setStrict(bool $strict);",
"public function strict()\n {\n return true;\n }",
"public function enableStrictVariables()\n {\n $this->strictVariables = true;\n }",
"public function isStrictMode() {\n return isset($this->options['strictMode']);\n }",
"function strict() {\r\n\t\treturn true;\r\n\t}",
"public function isStrict()\n {\n return static::MODE_STRICT === $this->mode;\n }",
"public function isStrict(): bool\n {\n return false;\n }",
"function strict() {\n return false;\n }",
"protected function initSqlStrictMode()\n {\n try {\n $applicationInit = $this->serviceLocator\n ->get('Application\\Model\\ModelManager')\n ->getInstance('Application\\Model\\ApplicationInit')\n ->setStrictSqlMode();\n }\n catch (Exception $e) {\n ApplicationErrorLogger::log($e);\n }\n }",
"public function isStrict()\n {\n return $this->strict;\n }",
"public function getStrict() : bool\n {\n return $this->strict;\n }",
"public function strict($strict = false)\n {\n $this->_STRICT = $strict = ( boolean ) $strict;\n\n if ($this->_isConnected()) {\n $this->_query->strict($strict);\n }\n\n return true;\n }",
"public function runningInStrictMode(): void\n {\n self::assertEquals(true, $this->subject->runningInStrictMode());\n }",
"public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}",
"public function disableStrictVariables()\n {\n $this->strictVariables = false;\n }",
"public function testConstructor()\n\t{\n\t\t$modes = [false,\n\t\t true];\n\t\t$types = [\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t];\n\t\tforeach ($modes as $mode) {\n\t\t\tforeach ($types as $type) {\n\t\t\t\t$builder = new Builder($type, $mode);\n\t\t\t\t$this->assertEquals($type, $this->getProtectedMember($builder, 'recipient_type'));\n\t\t\t\t$this->assertEquals($mode, $this->getProtectedMember($builder, 'strict_mode'));\n\t\t\t}\n\t\t}\n\t}",
"public function willGenerateStrict(): bool;",
"private function construct() {\n\n\t\t$this->is_json_valid = [\n\t\t\t'amp' => true,\n\t\t\t'nonamp' => true,\n\t\t];\n\n\t\t$this->init();\n\t}",
"public function isStrictVariables()\n {\n return $this->strictVariables;\n }",
"final private function __construct()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"public function isStrict()\n {\n return $this->profiler['strict'];\n }",
"public function createObjectCanDoConstructorInjectionWithBooleanValuesAndObjects() {\n\t\t$firstValue = TRUE;\n\t\t$thirdValue = new \\ArrayObject(array('foo' => 'bar'));\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $firstValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(3, $thirdValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($firstValue, $object->argument1, 'The first value (boolean) has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($thirdValue, $object->argument3, 'The third argument (an object) has not been constructor-injected although it should have been.');\n\t}",
"function __construct() {\n if($this->Fields) {\n foreach($this->Fields as $key => $value) {\n $this->$key = null;\n if($value['extra'] === \"auto_increment\") $this->Id = $key;\n if($value['extra'] === \"ref\") $this->Ref = $key;\n }\n }\n }",
"public function allowProperties() {}",
"public function __construct()\n {\n static $Zood_Entity_Null;\n if (is_null($Zood_Entity_Null)) {\n $Zood_Entity_Null = Zood_Entity_Null::getInstance();\n }\n\n if (count($p = $this->getReflectedProperties())) {\n foreach ($p as $propertyName) {\n if (is_null($this->$propertyName)) {\n $this->$propertyName = $Zood_Entity_Null;\n }\n }\n }\n }",
"public function createObjectCanDoSimpleExplicitSetterInjection() {\n\t\t$injectedClassName = uniqid('Injected');\n\t\teval('namespace F3\\Virtual; class ' . $injectedClassName . '{}');\n\t\t$injectedClassName = 'F3\\Virtual\\\\' .$injectedClassName;\n\t\t$injectedClass = new $injectedClassName();\n\t\t$this->mockObjectManager->expects($this->any())->method('getObject')->with($injectedClassName)->will($this->returnValue($injectedClass));\n\n\t\t$objectName = 'F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass';\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration($objectName);\n\t\t$objectConfiguration->setLifecycleInitializationMethodName('initializeAfterPropertiesSet');\n\t\t$objectConfiguration->setProperties(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty('firstDependency', $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_OBJECT),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty('secondDependency', $injectedClassName, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_OBJECT),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty('injectOrSetMethod', 'dummy', \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\BasicClass', $objectConfiguration);\n\n\t\t$this->assertSame($object->getFirstDependency(), $injectedClass, 'The class ' . $injectedClassName . ' (first dependency) has not been setter-injected although it should have been.' . get_class($object->getFirstDependency()));\n\t}",
"protected function populateAttributes($options, $strict)\n {\n if ($strict) {\n $validateAgainst = $this->validSet();\n $badKeys = array_keys(array_diff_key($options, $validateAgainst));\n if ($badKeys) {\n $message = \"Unsupported \" . get_class($this) . \" keys in options: \" . implode(\", \", $badKeys);\n $message .= \"; have: \" . implode(\", \", array_keys($validateAgainst));\n throw new \\RuntimeException($message);\n }\n }\n $remap = $this->keyToAttributeMapping();\n foreach ($remap as $arrayKey => $attributeName) {\n if (isset($options[$arrayKey])) {\n $options[$attributeName] = $options[$arrayKey];\n unset($options[$arrayKey]);\n }\n }\n foreach ($options as $key => $value) {\n $this->{$key} = $value;\n }\n }",
"static function make(array $fields, array $rules, bool $strict = false) {\n return (new static($fields, $rules, $strict));\n }"
]
| [
"0.62233335",
"0.6041506",
"0.5979815",
"0.59623474",
"0.5950186",
"0.5514565",
"0.5476406",
"0.54540604",
"0.5423375",
"0.53907245",
"0.5325056",
"0.5299977",
"0.5281213",
"0.52127254",
"0.51778907",
"0.5172225",
"0.5045656",
"0.49394467",
"0.4938116",
"0.48707926",
"0.48586142",
"0.48401672",
"0.4794926",
"0.4783038",
"0.47537017",
"0.47371483",
"0.47195622",
"0.46988425",
"0.46820617",
"0.4671394"
]
| 0.7034262 | 0 |
Set the array of dynamic property keys permissable for mapping in strict mode. | public function __setDynamicPropertyKeys($keys)
{
$this->__dynamicPropertyKeys = $keys;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function ensure_keys($src, $props, $fill_on_missing=null){\n\t\t$props = Arrays::from($props);\n\t\tforeach($props as $prop){\n\t\t\tif(!self::is_set($src, $prop)){\n\t\t\t\t$src[$prop] = $fill_on_missing;\n\t\t\t}\n\t\t}\n\t\treturn $src;\n\t}",
"public function allowAllProperties() {}",
"function setExtraVarKeys($extra_keys)\n\t{\n\t\tif(!is_array($extra_keys) || count($extra_keys) < 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tforeach($extra_keys as $val)\n\t\t{\n\t\t\t$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid);\n\t\t\t$this->keys[$val->idx] = $obj;\n\t\t}\n\t}",
"function set_keys($keys)\n\t{\n\t\tif(!is_array($keys)) $keys = explode(',', $keys);\n\t\tforeach($keys as $key) $this->set_key($key);\n\t}",
"public function explicitKeys(): array\n {\n return $this->getAttribute('explicit_keys') ?: [];\n }",
"protected function property_map() { return array(); }",
"protected function setKeyMapping(): array\n {\n return ['node-meta' => 'node_meta'];\n }",
"protected static function setKeys($options, $keys, $cmdname, \\BaseObject $propelitem) {\r\n foreach ($keys as $key => $data) {\r\n if (!isset($data['colname']) || !isset($data['actions']) || !isset($data['actions'][$cmdname]))\r\n continue;\r\n if ($data['actions'][$cmdname] == 'required' || $data['actions'][$cmdname] == 'internal')\r\n $propelitem->{\"set\" . $data['colname']}($options[$key]);\r\n else if ($data['actions'][$cmdname] == 'optional' && isset($options[$key]))\r\n $propelitem->{\"set\" . $data['colname']}($options[$key]);\r\n }\r\n }",
"public function allowProperties() {}",
"public function actionSetKeys()\n {\n $this->setKeys($this->generateKeysPaths);\n }",
"public function get_property_keys() {\n $data = $this->get_data();\n $data_keys = $this->get_data_keys();\n\n foreach ( $data_keys as $data_key ) {\n if ( isset( $data[$data_key] ) && is_array( $data[$data_key] ) ) {\n $data_key_index = array_search( $data_key, $data_keys );\n if ( $data_key_index !== false ) {\n unset( $data_keys[$data_key_index] );\n }\n }\n }\n\n $include_db_keys = false;\n if ( has_filter( \"nwsi_include_order_item_keys_from_database\" ) ) {\n $include_db_keys = (bool) apply_filters( \"nwsi_include_order_item_keys_from_database\" );\n }\n\n if ( $include_db_keys ) {\n // combine with order meta keys from the database\n require_once( NWSI_DIR_PATH . \"includes/controllers/core/class-nwsi-db.php\" );\n $db = new NWSI_DB();\n $keys = array_merge( $data_keys, $db->get_order_item_meta_keys() );\n } else {\n $keys = $data_keys;\n }\n\n $unique_keys = array_unique( $keys );\n sort( $unique_keys, SORT_STRING );\n\n if ( has_filter( \"nwsi_order_item_property_keys\" ) ) {\n $unique_keys = (array) apply_filters( \"nwsi_order_item_property_keys\", $unique_keys );\n }\n\n return $unique_keys;\n }",
"protected abstract function loadKeys(array $keys);",
"public function setKeys($keys)\n {\n $this->_keys = $keys;\n }",
"public static function keysAreSet(array $keys, array $array, &$missing, bool $strict = false): bool\n {\n $missing = [];\n\n if (is_object($array)) {\n self::sanitizer($array);\n }\n\n foreach ($keys as $key) {\n if (!in_array($key, $array, $strict)) {\n $missing[] = $key;\n }\n }\n\n return (empty($missing)) ? true : false;\n }",
"public function __setSerialisablePropertyMap($propertyMap, $ignoreNoneWritableProperties = false)\n {\n\n\n // Always ignore any unknown properties in parent as we need to capture these for dynamic purposes\n $dynamicProperties = parent::__setSerialisablePropertyMap($propertyMap, true);\n\n // If none strict, simply merge all properties in the property map into the dynamic property map.\n if (!$this->__strictMode) {\n $this->__dynamicPropertyMap = array_merge($this->__dynamicPropertyMap, $dynamicProperties);\n } else {\n\n foreach ($dynamicProperties as $propertyName => $propertyValue) {\n try {\n $this->__set($propertyName, $propertyValue);\n } catch (PropertyNotWritableException $e) {\n if (!$ignoreNoneWritableProperties)\n throw $e;\n }\n }\n\n }\n\n }",
"protected function _setupMapperArray()\n\t{\n\t\t$this->mapperArray = array();\n\t\t\n\t\t$this->mapperArray['property_id'] = 'properties_id';\n\t\t$this->mapperArray['sort_order'] = 'sort_order';\n\t\t\n\t\t$this->mapperArray['name'] = 'properties_name';\n\t\t$this->mapperArray['admin_name'] = 'properties_admin_name';\n\t}",
"public function setExplicitKeys(array $keys): MenuPresenceInterface\n {\n // Filter out any keys that don't belong in this object\n $keys = array_intersect($keys, [\n 'action',\n 'children',\n 'html',\n 'icon',\n 'id',\n 'label',\n 'label_translated',\n 'mode',\n 'parameters',\n 'permissions',\n 'type',\n ]);\n\n $this->setAttribute('explicit_keys', $keys);\n\n return $this;\n }",
"public function set_keys( $keys )\n\t{\n\t\t$this->keys = $keys;\n\t}",
"public function set_key_names($keys) {\n\t\t$this->keys = $keys;\n\t}",
"public function testUnknownConfigurationKeyForSet()\n {\n AbstractConfigurationInstance::$allowedKeys = ['asemoqTU'];\n (new AbstractConfigurationInstance())->set('JDsUJLrq', '84VUPgAS2i');\n }",
"private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }",
"protected function getKeysMap(): array\n {\n return [\n 'baz' => 'greet',\n ];\n }",
"abstract protected function prepareKeys($models);",
"final protected function getKeysProperty(): ArrObject\n {\n return arr(array_keys($this->items));\n }",
"public function __getSerialisablePropertyMap()\n {\n\n $serialisableProperties = parent::__getSerialisablePropertyMap();\n $dynamicProperties = $this->__dynamicPropertyMap;\n\n $map = array();\n foreach ($dynamicProperties as $key => $value) {\n $map[$key] = $value;\n }\n foreach ($serialisableProperties as $key => $value) {\n $map[$key] = $value;\n }\n\n // Merge our dynamic properties in and return.\n return $map;\n\n }",
"protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }",
"public function allowAllPropertiesExcept() {}",
"protected function ResolveExternalKeys()\n\t{\n\t\tforeach($this->m_aObjectsCache as $sClass => $oObjList)\n\t\t{\n\t\t\tforeach($oObjList as $oTargetObj)\n\t\t\t{\t\n\t\t\t\t$bChanged = false;\n\t\t\t\t$sClass = get_class($oTargetObj);\n\t\t\t\tforeach(MetaModel::ListAttributeDefs($sClass) as $sAttCode=>$oAttDef)\n\t\t\t\t{\n\t\t\t\t\tif ( ($oAttDef->IsExternalKey()) && ($oTargetObj->Get($sAttCode) < 0) ) // Convention unresolved key = negative\n\t\t\t\t\t{\n\t\t\t\t\t\t$sTargetClass = $oAttDef->GetTargetClass();\n\t\t\t\t\t\t$iTempKey = $oTargetObj->Get($sAttCode);\n\n\t\t\t\t\t\t$iExtKey = $this->GetObjectKey($sTargetClass, -$iTempKey);\n\t\t\t\t\t\tif ($iExtKey == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sMsg = \"unresolved extkey in $sClass::\".$oTargetObj->GetKey().\"(\".$oTargetObj->GetName().\")::$sAttCode=$sTargetClass::$iTempKey\";\n\t\t\t\t\t\t\tSetupPage::log_warning($sMsg);\n\t\t\t\t\t\t\t$this->m_aWarnings[] = $sMsg;\n\t\t\t\t\t\t\t//echo \"<pre>aKeys[\".$sTargetClass.\"]:\\n\";\n\t\t\t\t\t\t\t//print_r($this->m_aKeys[$sTargetClass]);\n\t\t\t\t\t\t\t//echo \"</pre>\\n\";\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$bChanged = true;\n\t\t\t\t\t\t\t$oTargetObj->Set($sAttCode, $iExtKey);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($bChanged)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_subclass_of($oTargetObj, 'CMDBObject'))\n\t\t\t\t\t\t{\n\t\t\t\t\t $oTargetObj->DBUpdateTracked($this->m_oChange);\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 $oTargetObj->DBUpdate();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->m_aErrors[] = \"The object changes could not be tracked - $sClass/$iExtKey - \".$e->getMessage();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn true;\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 ensureDefaultKeys() {}"
]
| [
"0.5784002",
"0.56098765",
"0.5584173",
"0.5450173",
"0.5423237",
"0.5415303",
"0.5394008",
"0.53550315",
"0.5334094",
"0.528714",
"0.5285188",
"0.52774864",
"0.5257326",
"0.5248365",
"0.5243046",
"0.52347535",
"0.52344483",
"0.5212014",
"0.52098143",
"0.51787007",
"0.51677835",
"0.5151197",
"0.5144936",
"0.51408786",
"0.51141053",
"0.51045597",
"0.5103257",
"0.5101479",
"0.50902754",
"0.5072733"
]
| 0.7049758 | 0 |
Handle user check events. | public function onUserCheck($event)
{
$this->setPermissions($event->user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function check()\n {\n if(!empty($this->user)) {\n // If you need to check users online list in every page load, check this TRUE in config file\n if($this->config->item('check_users_on_page_load', 'online')) {\n $this->checkOnlineList();\n }\n\n $this->addUser();\n }\n }",
"public static function checkUser($user_id);",
"function logged_user_check() {\n if(is_user_logged())\n launch_error(\"You are already logged in.\");\n}",
"function run()\r\n {\r\n $id = Request :: get(UserManager :: PARAM_USER_USER_ID);\r\n if ($id)\r\n {\r\n \tif (!UserRights :: is_allowed_in_users_subtree(UserRights :: EDIT_RIGHT, $id))\r\n\t\t {\r\n\t\t \t$this->display_header();\r\n\t\t Display :: error_message(Translation :: get(\"NotAllowed\", null, Utilities :: COMMON_LIBRARIES));\r\n\t\t $this->display_footer();\r\n\t\t exit();\r\n\t\t }\r\n\r\n\t\t $checkurl = Session :: retrieve('checkChamiloURL');\r\n\t\t Session :: clear();\r\n Session :: register('_uid', $id);\r\n Session :: register('_as_admin', $this->get_user_id());\r\n Session :: register('checkChamiloURL', $checkurl);\r\n header('Location: index.php');\r\n\r\n }\r\n else\r\n {\r\n $this->display_error_page(htmlentities(Translation :: get('NoObjectSelected', array('OBJECT'=> Translation :: get('User')), Utilities :: COMMON_LIBRARIES)));\r\n }\r\n }",
"public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }",
"function check_user($user)\n\t\t{\n\n\t\t}",
"public function performChecks(){\n\t\t\n\t}",
"public function CheckUser(){\n $emailSignup = $_POST[\"emailSignup\"];\n $this->LogModel->Check_User($emailSignup);\n }",
"public function tryUserLevelCheck(){\n if( $this->checkSessionSet() ){\n if($this->userLevelCheck()){\n\n }\n else{\n //TODO: log the user_id and activity\n redirect_invalid_user();\n }\n }\n else{\n //TODO: log the user IP information\n\n redirect_invalid_user();\n }\n }",
"public function check(IUser $user);",
"public function documentcheck() {\n $user = User::load(\\Drupal::currentUser()->id());\n bhge_user_registration_user_login($user);\n }",
"public static function checkUser()\n\t{\n\n\t\tif (!User::verifyLogin())\n\t\t{\n\n\t\t\theader(\"Location: /admin/login\");\n\t\t\texit;\n\n\t\t}\n\n\t}",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"protected function checkSchedulerUser() {}",
"public function checkbox_handler() {\n\t\tif ( !isset( $_REQUEST['ucc_ucn_checkbox'] ) )\n\t\t\treturn;\n\n\t\t// Define local variables\n\t\t$user_id = $post_id = 0;\n\t\t$action = '';\n\t\t$errors = array();\n\n\t\t/** User Details **********************************************/\n\t\t// Is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\t$user_id = get_current_user_id();\n\n\t\t// Not allowed\n\t\t} else {\n\t\t\t$errors[] = __( 'You do not have permission to do that.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Post ID ***************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_pid'] ) ) {\n\t\t\t$post_id = (int) $_REQUEST['ucc_ucn_pid'];\n\t\t} else {\n\t\t\t$errors[] = __( 'No post id specified.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Action ****************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_acn'] ) && 'subscribe' == $_REQUEST['ucc_ucn_acn'] ) {\n\t\t\t$action = 'subscribe';\n\t\t} else {\n\t\t\t$action = 'unsubscribe';\n\t\t}\n\n\t\t/** No Errors *************************************************/\n\n\t\tif ( empty( $errors ) ) {\n\n\t\t\t// Process action\n\t\t\tswitch( $action ) {\n\t\t\t\tcase 'subscribe':\n\t\t\t\t\t$this->subscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'unsubscribe':\n\t\t\t\t\t$this->unsubscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }",
"function checkUser(){\n\t\t// Check for request forgeries\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\t\n\t\t$app \t = JFactory::getApplication();\n\t\t$db \t = JFactory::getDbo();\n\t\t$inputstr = $app->input->get('inputstr', '', 'string');\n\t\t$name \t = $app->input->get('name', '', 'string');\n\t\n\t\tif($name == 'username'){\n\t\t\t$query \t = \"SELECT COUNT(*) FROM #__users WHERE username=\".$db->quote($inputstr);\n\t\t\t$msg = 'COM_JBLANCE_USERNAME_EXISTS';\n\t\t}\n\t\telseif($name == 'email'){\n\t\t\t$query \t = \"SELECT COUNT(*) FROM #__users WHERE email=\".$db->quote($inputstr);\n\t\t\t$msg = 'COM_JBLANCE_EMAIL_EXISTS';\n\t\t}\n\t\n\t\t$db->setQuery($query);\n\t\tif($db->loadResult()){\n\t\t\techo JText::sprintf($msg, $inputstr);\n\t\t}\n\t\telse {\n\t\t\techo 'OK';\n\t\t}\n\t\texit;\n\t}",
"public function checkuser($user) {\r\n// if ($userbd) { \r\n// $this->set('users', $userbd); \r\n// }else {\r\n// $userbd=0;\r\n// $this->set('users', $userbd); \r\n// }\r\n $userbd=0;\r\n $this->set('users', $userbd);\r\n $this->layout = 'ajax';\r\n }",
"public function check_insta_user() {\n \n }",
"function uservalidationbyadmin_page_handler($page) {\n\n\tif (isset($page[0]) && $page[0] == 'confirm') {\n\t\t$code = sanitise_string(get_input('c', FALSE));\n\t\t$user_guid = get_input('u', FALSE);\n\t\t// new users are not enabled by default.\n\t\t$access_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\t\t$user = get_entity($user_guid);\n\t\tif ($code && $user) {\n\t\t\tif (uservalidationbyadmin_validate_email($user_guid, $code)) {\n\t\t\t\telgg_push_context('uservalidationbyadmin_validate_user');\n\t\t\t\tsystem_message(elgg_echo('email:confirm:success'));\n\t\t\t\t$user = get_entity($user_guid);\n\t\t\t\t$user->enable();\n\t\t\t\telgg_pop_context();\n\t\t\t\t$site = elgg_get_site_entity();\n\t\t\t\t$subject = elgg_echo('user:validate:subject', array($user->name));\n\t\t\t\t$body = elgg_echo('user:validate:body', array($user->name, $site->name, $user->username, $site->name, $site->url));\n\t\t\t\t$result = notify_user($user->guid, $site->guid, $subject, $body, NULL, 'email');\t\n\t\t\t//\tlogin($user);\n\t\t\t} else {\n\t\t\t\tregister_error(elgg_echo('email:confirm:fail'));\n\t\t\t}\n\t\t} else {\n\t\t\tregister_error(elgg_echo('email:confirm:fail'));\n\t\t}\n\t\taccess_show_hidden_entities($access_status);\n\t} else {\n\t\tregister_error(elgg_echo('email:confirm:fail'));\n\t}\n\t// forward to front page\n\tforward('');\n}",
"public function userHandler(){\n $data = [\n 'main_title' => 'Felhasználók kezelése'\n ];\n if (isAdmin($_SESSION[\"jog\"])) {\n $userInfo = $this->userModel->showUserInfo();\n $users = $this->userModel->showUsers();\n $checkedUsers = [];\n foreach($users as $user){\n if ($this->userModel->checkUserData($user->email) == null) {\n array_push($checkedUsers,$user);\n }\n }\n $data = [\n 'main_title' => 'Felhasználók kezelése',\n 'userinfo' => $userInfo,\n 'noDataUsers' => $checkedUsers\n ];\n $this->view('admin/userHandling', $data); \n }else{\n redirect(\"index\");\n } \n }",
"function login_check($render_error_on_fail = true, $ukey = 'user_id') {\n\n\tif ( dev && $ukey == 'user_id') {\n\n\t\t$user_id = queryparam_fetch_int('user_id'); // for test, implicit login\n\t\tif ( !session_GET('user_id') && $user_id ) {\n\t\t\t$tb = new TxnBlock();\n\n\t\t\t$query = \"SELECT * FROM user WHERE user_id = $user_id\";\n\t\t\tif ( !($rs = $tb->query($query)) )\n\t\t\t\trender_error();\n\t\t\t$user = ms_fetch_one($rs);\n\n\t\t\t$general = general::select($tb, null, \"user_id = $user_id\");\n\n\t\t\tif ( !$tb->end_txn() )\n\t\t\t\trender_error();\n\n\t\t\t$_SESSION['user_id'] = $user['user_id'];\n\t\t\t$_SESSION['general_id'] = $general['general_id'];\n\t\t\t$_SESSION['user'] = $user;\n\t\t\t$_SESSION['general'] = $general;\n\t\t\t$_SESSION['country'] = $general['country'];\n\t\t}\n\t}\n\n\tglobal $SYSTEM_EVENT_SOURCE_IPS;\n\n\t$remote_addr = @$_SERVER['REMOTE_ADDR'] ?: null;\n\n\tif ( !($user_id = session_GET($ukey)) ) {\n\t\tif ( empty($user_id) && in_array($remote_addr, $SYSTEM_EVENT_SOURCE_IPS) ) {\n\t\t\telog(\"REMOTE_ADDR: [$remote_addr], bypassed authentication\");\n\n\t\t\t$acl = queryparam_fetch('acl');\n\t\t\tif ( !empty($acl) ) {\n\t\t\t\telog(\"granting [$acl] tokens to acl...\");\n\n\t\t\t\t$tokens = explode(',', $acl);\n\t\t\t\t$old_tokens = empty($_SESSION['acl']) ? [] : explode(',', $_SESSION['acl']);\n\t\t\t\t$new_tokens = array_unique(array_merge($tokens, $old_tokens));\n\t\t\t\t$_SESSION['acl'] = implode(',', $new_tokens) ;\n\t\t\t}\n\n\t\t\telog(\"complete acl: \" . $_SESSION['acl']);\n\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( $render_error_on_fail )\n\t\t\trender_error(\"login first: $remote_addr\", FCODE(30109));\n\t}\n\n\t// \tif ( dev ) elog(\"REQUEST: \" . $_SERVER['REQUEST_URI']);\n\n\treturn $user_id;\n}",
"public function checkUser() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n \n // we use the given id to get the right post and delete from the database\n $post = Users::find($_GET['id']);\n require_once('view/pages/home.php');\n }",
"public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }",
"function run()\r\n {\r\n\r\n $ids = Request :: get(CasUserManager :: PARAM_REQUEST_ID);\r\n $failures = 0;\r\n\r\n if (! empty($ids))\r\n {\r\n if (! is_array($ids))\r\n {\r\n $ids = array($ids);\r\n }\r\n\r\n foreach ($ids as $id)\r\n {\r\n $cas_user_request = $cas_user_request = CasUserDataManager :: get_instance()->retrieve_cas_user_request($id);\r\n $cas_user_request->set_status(CasUserRequest :: STATUS_REJECTED);\r\n if (! $cas_user_request->update())\r\n {\r\n $failures ++;\r\n }\r\n }\r\n\r\n if ($failures)\r\n {\r\n if (count($ids) == 1)\r\n {\r\n $message = 'SelectedCasUserRequestNotRejected';\r\n }\r\n else\r\n {\r\n $message = 'SelectedCasUserRequestsNotRejected';\r\n }\r\n }\r\n else\r\n {\r\n if (count($ids) == 1)\r\n {\r\n $message = 'SelectedCasUserRequestRejected';\r\n }\r\n else\r\n {\r\n $message = 'SelectedCasUserRequestsRejected';\r\n }\r\n }\r\n\r\n $this->redirect(Translation :: get($message, null, Utilities::COMMON_LIBRARIES), ($failures ? true : false), array(CasUserManager :: PARAM_ACTION => CasUserManager :: ACTION_BROWSE));\r\n }\r\n else\r\n {\r\n $this->display_error_page(htmlentities(Translation :: get('NoCasUserRequestSelected', null, Utilities::COMMON_LIBRARIES)));\r\n }\r\n }",
"private function checkValidUser() {\n return;\n if(!($this->getData('key') == $this->sessionId && isset($_SESSION['user']) && isset($_SESSION['valid']) && $_SESSION['valid'] === true)) {\n $this->output = array(\n 'success' => false,\n 'key' => 'kMIvl'\n );\n\n // Terminate the call now, user isn't allowed to perform this action\n $this->renderOutput(true);\n }\n }",
"public function checkPreAuth(UserInterface $user);",
"public function handle($event)\n {\n $checker = $event->checker;\n\n if (!$checker instanceof CheckerSendsNotifications) {\n return;\n }\n\n $state = new CheckerState($checker);\n\n if (!$state->shouldSentFailedNotification()) {\n return;\n }\n\n $notificationClass = $checker->failedNotificationClass();\n\n $notification = $this->sendNotification(\n new $notificationClass($checker, $event->exception, $event->failedData)\n );\n\n $notification ? $state->markSentFailedNotification($notification) : null;\n }",
"function process_event($event, $userid, $handle, $cookieid, $params)\n\t\t{\n\t\t\t$loggeduserid = qa_get_logged_in_userid();\n\t\t\t$dolog=true;\n\t\t\t$postid = @$params['postid'];\n\t\t\t// grab all preferences for notifying users \n\t\t\t$all_preferences = qw_get_all_notification_settings();\n\t\t\tswitch($event){\n\t\t\t\tcase 'a_post': // user's question had been answered\n\t\t\t\t\t\n\t\t\t\t\tif ($loggeduserid != $params['parent']['userid']){\n\t\t\t\t\t\t$effecteduserid = $params['parent']['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c_post': // user's answer had been commented\n\t\t\t\t\t\n\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t$thread = $params['thread'];\n\t\t\t\t\t$already_notified = \"\" ;\n\t\t\t\t\tunset($params['thread']);\n\t\t\t\t\tif ($loggeduserid != $params['parent']['userid']){\n\t\t\t\t\t\t$effecteduserid = $params['parent']['userid'];\n\t\t\t\t\t\t$this->AddEvent($postid, $userid, $params['parent']['userid'], $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$already_notified = $effecteduserid ;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(count($thread) > 0){\n\t\t\t\t\t\t$user_array = array();\n\t\t\t\t\t\tforeach ($thread as $t){\n\t\t\t\t\t\t\tif ($loggeduserid != $t['userid'])\n\t\t\t\t\t\t\t\t$user_array[] = $t['userid'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$user_array = array_unique($user_array, SORT_REGULAR);\n\t\t\t\t\t\tforeach ($user_array as $user){\t\n\t\t\t\t\t\t\tif ($user == $already_notified) continue ;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->AddEvent($postid, $userid, $user, $params, $event);\t\n\t\t\t\t\t\t\t$effecteduserid = $user ; //for this scenario the $user_array contains all user ids in the current commented thread \n\t\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'q_reshow':\t\t\t\t\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\tif ($loggeduserid != $post['userid']){\n\t\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a_reshow':\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\tif ($loggeduserid != $post['userid']){\n\t\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\tunset($params['oldanswer']);\n\t\t\t\t\t\tunset($params['content']);\n\t\t\t\t\t\tunset($params['text']);\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c_reshow':\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\tif ($loggeduserid != $post['userid']){\n\t\t\t\t\t\tunset($params['oldcomment']);\n\t\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t/* case 'a_unselect':\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\tqa_db_query_sub(\n\t\t\t\t\t\t\"DELETE FROM ^ra_userevent WHERE effecteduserid=$ AND event=$ AND postid=$\",\n\t\t\t\t\t\t$effecteduserid, 'a_select', $postid\n\t\t\t\t\t);\n\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak; */\n\t\t\t\tcase 'a_select':\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\tif ($loggeduserid != $post['userid']){\n\t\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'q_vote_up':\n\t\t\t\t\t$this->UpdateVote('q_vote_up', $postid,$userid, $params, 'q_vote_up', 1);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a_vote_up':\n\t\t\t\t\t$this->UpdateVote('a_vote_up', $postid,$userid, $params, 'a_vote_up', 1);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'q_vote_down':\n\t\t\t\t\t$this->UpdateVote('q_vote_down', $postid,$userid, $params, 'q_vote_down', -1);\t\t\t\t\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a_vote_down':\n\t\t\t\t\t$this->UpdateVote('a_vote_down', $postid,$userid, $params, 'a_vote_down', -1);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'q_vote_nil':\n\t\t\t\t\t$this->UpdateVote('q_vote_nil', $postid,$userid, $params, 'q_vote_nil', 0);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a_vote_nil':\n\t\t\t\t\t$this->UpdateVote('a_vote_nil', $postid,$userid, $params, 'a_vote_nil', 0);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'q_approve':\n\t\t\t\tcase 'a_approve':\n\t\t\t\tcase 'c_approve':\n\t\t\t\tcase 'q_reject':\n\t\t\t\tcase 'a_reject':\n\t\t\t\tcase 'c_reject':\n\t\t\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t\t\t$post = qa_post_get_full($postid);\n\t\t\t\t\tif ($loggeduserid != $post['userid']){\n\t\t\t\t\t\t$effecteduserid = $post['userid'];\n\t\t\t\t\t\t$question = $this->GetQuestion($params);\n\t\t\t\t\t\t$params['qtitle'] = $question['title'];\n\t\t\t\t\t\t$params['qid'] = $question['postid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tcase 'q_favorite':\n\t\t\t\t\t$this->UpdateVote('q_favorite', $postid,$userid, $params, 'favorite', 1);\n\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t}\n\t\t\t\t\t$dolog=false;\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t/* case 'q_unfavorite':\n\t\t\t\t\t$this->UpdateVote('q_unfavorite', $postid,$userid, $params, 'unfavorite', -1);\n\t\t\t\t\t$dolog=false;\t\t\t\t\t\n\t\t\t\t\tbreak; */\n\t\t\t\tcase 'q_post':\n\t\t\t\t\t\n\t\t\t\t\t$already_notified = \"\" ;\n\t\t\t\t\tif ($params['parent']['type']=='A') // related question\n\t\t\t\t\t{\n\t\t\t\t\t\t$effecteduserid = $params['parent']['userid'];\n\t\t\t\t\t\tif ($loggeduserid != $effecteduserid){\n\t\t\t\t\t\t\t$event = 'related';\n\t\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$already_notified = $effecteduserid ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// for social postings \n\t\t\t\t\tif (qw_check_pref_for_event(@$effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\tqw_do_action('user_event_q_post_social', $postid,$userid, null , $params, 'q_post');\n\t\t\t\t\t}\n\t\t\t\t\t$categoryid = isset($params['categoryid']) ? $params['categoryid'] : '' ;\n $tags = isset($params['tags']) ? $params['tags'] : '' ;\n\t\t\t\t\t$user_datas = $this->qw_get_users_details_notify_email($userid , $tags , $categoryid );\n\t\t\t\t\tif (count($user_datas)) {\n\t\t\t\t\t\tforeach ($user_datas as $user_data ) {\n\t\t\t\t\t\t\t$effecteduserid = $user_data['userid'] ;\n\t\t\t\t\t\t\t$event = $user_data['event'] ; \n\n\t\t\t\t\t\t\tif ( $effecteduserid != $already_notified ) {\n\t\t\t\t\t\t\t\t// $this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'u_favorite':\n\t\t\t\t\tif ($loggeduserid != $params['userid']){\n\t\t\t\t\t\t$this->UpdateUserFavorite($postid,$userid, $params, 'u_favorite', 1);\n\t\t\t\t\t\t$effecteduserid = $params['userid'];\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dolog=false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t/* case 'u_unfavorite':\n\t\t\t\t\t$this->UpdateUserFavorite($postid,$userid, $params, 'u_unfavorite', -1);\n\t\t\t\t\t$dolog=false;\n\t\t\t\t\tbreak; */\n\t\t\t\tcase 'u_message':\n\t\t\t\t\tif ($loggeduserid != $params['userid']){\n\t\t\t\t\t\t$effecteduserid = $params['userid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'u_wall_post':\n\t\t\t\t\tif ($loggeduserid != $params['userid']){\n\t\t\t\t\t\t$effecteduserid = $params['userid'];\n\t\t\t\t\t\t$params['message'] = $params['content'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'u_level':\n\t\t\t\t\t$old_level = $params['oldlevel'];\n $new_level = $params['level'];\n if ( $new_level > $old_level ) {\n \t//add the event only if the level increases \n\t $effecteduserid = $params['userid'];\n\t\t\t\t\t\t$this->AddEvent($postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\tif (qw_check_pref_for_event($effecteduserid , $event , $all_preferences )) {\n\t\t\t\t\t\t\tqw_do_action('user_event_'.$event, $postid,$userid, $effecteduserid, $params, $event);\n\t\t\t\t\t\t}\n }\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$dolog=false;\n\t\t\t\n\t\t\t}\n\t\t}",
"function onUserLogin($user,$option)\n\t{\t\n\t\t$this->afterLogin($user, $option);\n\t}"
]
| [
"0.65602386",
"0.6133399",
"0.60771954",
"0.5979248",
"0.5978918",
"0.59740734",
"0.5880663",
"0.587252",
"0.58474576",
"0.5812375",
"0.58063495",
"0.5749939",
"0.5716132",
"0.56953496",
"0.56855094",
"0.5664958",
"0.5651741",
"0.56449246",
"0.5638396",
"0.56306547",
"0.5622487",
"0.5566582",
"0.5548035",
"0.5520341",
"0.5478604",
"0.54734254",
"0.54618806",
"0.54435897",
"0.5432103",
"0.5416317"
]
| 0.70812285 | 0 |
BizForm::GetHistoryInfo() get history info array | public function GetHistoryInfo()
{
if ($this->m_Stateless == "Y")
return;
if (!$this->m_NoHistoryInfo)
{
$histInfo[] = $this->m_RecordId;
$histInfo[] = $this->m_CurrentPage;
$histInfo[] = $this->m_SearchRule;
$histInfo[] = $this->m_SortRule;
return $histInfo;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHistory(): array\n {\n return $this->history;\n }",
"public function getHistory(): array\n {\n return $this->history;\n }",
"public function fetchHistory(): array;",
"public function getHistory()\r\r\n {\r\r\n return $this->history;\r\r\n }",
"function get_history() {\n\t\treturn $this->history;\n\t}",
"public function getHistory()\n {\n return $this->_history;\n }",
"public function getHistory()\n {\n return $this->history;\n }",
"public function getQueryHistory(): array\n {\n return $this->History;\n }",
"public function event_history(/* ... */)\n {\n return $this->_event_history;\n }",
"private function getHistory()\n {\n $history = [];\n\n foreach ($this->getResponse()->data as $k => $v) {\n $history[$k]['tanggal'] = Utils::setDate($v->Tanggal);\n\n switch ($v->StatusInternal) {\n case 'Baru':\n $history[$k]['posisi'] = preg_replace('/Diterima di Sales Counter (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Manifest Pickup':\n $posisi = preg_replace('/Di pickup oleh petugas (.*)/', '$1', $v->TrackStatusNama);\n $history[$k]['posisi'] = $posisi;\n $this->kotaPengirim = strtoupper($posisi);\n break;\n\n case 'Serah Terima Pickup':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Moda Angkutan':\n $history[$k]['posisi'] = preg_replace('/Pengiriman dari (.*) ke (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Surat Muatan':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Manifest':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Surat Jalan Kurir':\n $history[$k]['posisi'] = preg_replace('/Proses pengantaran oleh kurir (.*), (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Terkirim/Diterima':\n $history[$k]['posisi'] = 'Diterima';\n $this->tanggalTerima = $v->Tanggal;\n $this->namaPenerima = preg_replace('/Diterima oleh (.*)\\((.*)/', '$1', $v->TrackStatusNama);\n break;\n\n default:\n $history[$k]['posisi'] = null;\n break;\n }\n\n $history[$k]['message'] = $v->TrackStatusNama;\n }\n\n return $history;\n }",
"public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }",
"public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}",
"public function get_history()\n\t{\n return array(\n 'result' => array(\n 'error' => array(\n 'code' => '404',\n 'message' => 'Not Found'\n )\n )\n );\n\t}",
"public function getHistoryFields()\n {\n $owner = $this->owner;\n if (!$owner->isLatestVersion()) {\n return null;\n }\n\n $config = GridFieldConfig_RecordViewer::create()\n ->removeComponentsByType([\n GridFieldToolbarHeader::class,\n GridFieldSortableHeader::class,\n GridFieldPaginator::class,\n GridFieldPageCount::class,\n GridFieldViewButton::class\n ])\n ->addComponent(new GridFieldTitleHeader)\n ->addComponent(new GridFieldHistoryButton);\n $config->getComponentByType(GridFieldDetailForm::class)\n ->setItemRequestClass(HistoryGridFieldItemRequest::class);\n $config->getComponentByType(GridFieldDataColumns::class)\n ->setDisplayFields([\n 'Version' => '#',\n 'LastEdited.Nice' => _t(__CLASS__ . '.WHEN', 'When'),\n 'Title' => _t(__CLASS__ . '.TITLE', 'Title'),\n 'Author.Name' => _t(__CLASS__ . '.AUTHOR', 'Author')\n ]);\n\n return FieldList::create(\n GridField::create(\n 'History',\n '',\n Versioned::get_all_versions(\n $owner->ClassName,\n $owner->ID\n )\n ->sort('Version', 'DESC'),\n $config\n )\n ->addExtraClass('grid-field--history')\n );\n }",
"public function getQueryHistory(): array;",
"public function getHistory()\n\t{\n\t\t$log = $this->getLog();\n\t\t$history = array($this->initial);\n\t\t/* if our log is empty (or incorrect), then we cannot walk it at all */\n\t\tif (!isset($log[$this->initial]))\n\t\t\treturn $history;\n\t\t$next = $log[$this->initial]->next_action_id;\n\t\t/* log always has the latest entry,\n\t\t\t so build it walking to the next item,\n\t\t\t starting from the initial step */\n\t\twhile (!is_null($next)) {\n\t\t\t$history[] = $next;\n\t\t\tif (isset($log[$next])) {\n\t\t\t\t$next = $log[$next]->next_action_id;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $history;\n\t}",
"public function getUserHistory()\n {\n try {\n $history = array();\n $hasHistory = $this->coreSession->getHistory();\n if (!$hasHistory) {\n $history['productHistory'] = array();\n $history['lastVisitedCategory'] = array(\n 'name' => null,\n 'link' => null\n );\n } else {\n $latestViewedProducts = $this->coreSession->getUserViewedProducts();\n $productHistory = array();\n if (!empty($latestViewedProducts)) {\n $productList = array_unique(explode(',', $latestViewedProducts));\n foreach ($productList as $productId) {\n $productHistory[] = $this->getProductInformation($productId);\n }\n }\n\n $history['productHistory'] = $productHistory;\n $history['lastVisitedCategory'] = $this->getLastVisitedcategory();\n }\n\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n $history = array(\n 'productHistory' => array(),\n 'lastVisitedCategory' => array(\n 'name' => null,\n 'link' => null\n )\n );\n }\n\n return $history;\n }",
"public static function getAllHistory()\n\t{\n\t\tglobal $mysql;\n\t\t$output = array();\n\t\t\n\t\t$result = $mysql->query(\"SELECT * FROM `history`\");\n\t\twhile ( $d = mysqli_fetch_array($result) )\n\t\t{\n\t\t\tif ( !empty($d) )\n\t\t\t\t$output[] = $d;\n\t\t}\n\t\treturn $output;\n\t}",
"public function getHistoryStrings(): array\n {\n return $this->historyAsStrings;\n }",
"function getHistory() {\n\t\treturn db_query_params ('SELECT * FROM artifact_history_user_vw WHERE artifact_id=$1 ORDER BY entrydate DESC, id ASC',\n\t\t\t\t\tarray ($this->getID())) ;\n\t}",
"public function getHistoryEventDescriptionData()\n {\n return array(\n 'trx_method' => static::t($this->getPaymentMethod()->getName()),\n 'trx_type' => static::t($this->getType()),\n 'trx_value' => $this->getOrder()->getCurrency()->roundValue($this->getValue()),\n 'trx_status' => static::t($this->getReadableStatus()),\n );\n }",
"public function getStatusHistory()\n\t\t{\n\t\t\t$list = ECash::getFactory()->getModel(\"StatusHistoryList\");\n\t\t\t$list->loadBy(array(\"application_id\" => $this->application_id));\n\n\t\t\treturn $list->toList();\n\t\t}",
"function getHistory()\n\t{\n\t\tif (intval($this->id)==0) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// $db = Zend_Registry::get('db');\n\t\t// $sql = sprintf('select * from object_history where link_to=%d and link_id=%d order by cts desc',$ot,$id);\n\t\t// $rs = $db->fetch_all($sql);\n\t\t// return $rs;\n\n\t\t$s = 'select id,auth_user_id,ctime,link,f,v0,v1 from base_diff ';\n\t\t$s.= sprintf(' where link = \\'%s\\' ',$this->link() );\n\t\t// $s.= ' order by ctime ';\n\t\t$s.= ' union all ';\n\t\t$s.= 'select id,auth_user_id,cts,link,\\'-None-\\',message,null from object_history ';\n\t\t$s.= sprintf(' where link = \\'%s\\' ',$this->link() );\n\t\t$s.= ' order by ctime desc ';\n\n\t\t// $s = $d->select();\n\t\t// $s->from('object_history');\n\t\t// $s->where('link = ?', $this->link() );\n\t\t// $s->order('cts');\n\t\t$r = SQL::fetch_all($s);\n\t\treturn $r;\n\t}",
"#[Pure]\n public function getHistory() {}",
"public function getStepHistory();",
"public function getLogHistory() {\n\t\treturn $this->log;\n\t}",
"protected function _getHistory($addressHistoryMode = FALSE){\n $result = array(\n 'operations' => array()\n );\n $address = $this->getParam(0, FALSE);\n if($address){\n $address = strtolower($address);\n }\n if((!$address && $addressHistoryMode) || ((FALSE !== $address) && (!$this->db->isValidAddress($address)))){\n $this->sendError(104, 'Invalid address format');\n }\n $maxLimit = is_array($this->defaults) && isset($this->defaults['limit']) ? $this->defaults['limit'] : 10;\n $options = array(\n 'type' => $this->getRequest('type', FALSE),\n 'limit' => min(abs((int)$this->getRequest('limit', 10)), $maxLimit),\n );\n if(FALSE !== $address){\n $options['address'] = $address;\n }\n if(FALSE !== $this->getRequest('timestamp', FALSE)){\n $options['timestamp'] = (int)$this->getRequest('timestamp');\n }\n if($addressHistoryMode){\n $token = $this->getRequest('token', FALSE);\n if(FALSE !== $token){\n $token = strtolower($token);\n if(!$this->db->isValidAddress($token)){\n $this->sendError(104, 'Invalid token address format');\n }\n $options['token'] = $token;\n }\n $options['history'] = TRUE;\n }\n $operations = $this->db->getLastTransfers($options);\n if(is_array($operations) && count($operations)){\n for($i = 0; $i < count($operations); $i++){\n $operation = $operations[$i];\n $res = array(\n 'timestamp' => $operation['timestamp'],\n 'transactionHash' => $operation['transactionHash'],\n 'tokenInfo' => $operation['token'],\n 'type' => $operation['type'],\n 'value' => $operation['value'],\n );\n if(isset($operation['address'])){\n $res['address'] = $operation['address'];\n }\n if(isset($operation['from'])){\n $res['from'] = $operation['from'];\n $res['to'] = $operation['to'];\n }\n $result['operations'][] = $res;\n }\n }\n return $result;\n }",
"public function getRawHistory()\n {\n return $this->raw_history;\n }",
"public function getOrderHistory($orderId) {\n\n $info = array();\n $postion = 0;\n\n $result = $this->db->query(\"SELECT os.order_status_id, date_added, os.name AS status, oh.comment, oh.notify \n FROM \" . DB_PREFIX . \"order_history oh LEFT JOIN \" . DB_PREFIX . \"order_status os ON oh.order_status_id = os.order_status_id \n WHERE oh.order_id = '\" . (int) $orderId . \"' AND oh.notify = '1' AND os.language_id = '\" . (int) $this->config->get('config_language_id') . \"' ORDER BY oh.date_added\");\n\n foreach ($result->rows as $row) {\n $info[] = array('status_id' => $row['order_status_id'],\n 'status_name' => $row['status'],\n 'display_text' => $row['status'],\n 'language_id' => $this->config->get('config_language_id'),\n 'date_added' => $row['date_added'],\n 'comments' => nl2br($row['comment']),\n 'position' => $postion++);\n }\n\n return $info;\n }",
"public function getAllHistoricFilterEntries() {\n $historicFilterDataClass = new HistoricFilterData();\n $allHistoricFilterDataObjects = $historicFilterDataClass -> readHistoricFilter();\n $allHistoricFilterData = array();\n\n foreach ($allHistoricFilterDataObjects as $historicFilterArray) {\n $historicFilterObject = new HistoricFilter($historicFilterArray['idHistoricFilter'], stripcslashes($historicFilterArray['historicFilterName']), $historicFilterArray['dateStart'], $historicFilterArray['dateEnd'], stripcslashes($historicFilterArray['description']), $historicFilterArray['buttonColor']);\n\n array_push($allHistoricFilterData, $historicFilterObject);\n }\n return $allHistoricFilterData;\n }"
]
| [
"0.7213989",
"0.7213989",
"0.704268",
"0.7001648",
"0.69104946",
"0.68325",
"0.6822492",
"0.6822385",
"0.67672783",
"0.6668098",
"0.6651414",
"0.66363794",
"0.6574956",
"0.65746075",
"0.6556228",
"0.65172684",
"0.65127873",
"0.65068936",
"0.6471042",
"0.6470608",
"0.6461782",
"0.6298845",
"0.6297943",
"0.62921447",
"0.625591",
"0.61981404",
"0.61943376",
"0.6157976",
"0.6157289",
"0.6117648"
]
| 0.77324784 | 0 |
BizForm::CleanHistoryInfo() clear history info so that the data set is fresh | public function CleanHistoryInfo()
{
$this->m_RecordId = null;
$this->m_CurrentPage = 1;
$this->m_SearchRule = null;
$this->m_SortRule = null;
$this->m_NoHistoryInfo = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function cleanHistory()\n\t{\n\t\t$this->taskHistoryRepository->deleteOlderThanDays($this->maxHistoryDays);\n\t\t$this->taskHistoryRepository->deleteOverCount($this->maxHistoryRecords);\n\t}",
"public function clearHistory()\r\r\n {\r\r\n $this->history = array();\r\r\n }",
"public function clearHistorys()\n\t{\n\t\t$this->collHistorys = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function cleanHistory()\n\t\t{\n\t\t\t$result = pg_query(\n\t\t\t\t\t$this->connection,\n\t\t\t\t\t'delete from history where date_from < (CURRENT_TIMESTAMP - interval \\'1 month\\')');\n\t\t}",
"public function clearHistory() {}",
"public function reset()\n {\n $this->values[self::_ITEM_HISTORYS] = array();\n }",
"public function reset()\n {\n $this->values[self::_EXCAVATE_HISTORY] = array();\n }",
"protected function cleanHistory()\n {\n $createdAt = new \\DateTime();\n $logs = $this->instance->getLogs();\n foreach($logs as $log) {\n if(($createdAt->getTimestamp() - $log->getCreatedAt()->getTimestamp()) > $this->expiredTimestamp) {\n $this->instance->removeLog($log);\n }\n }\n }",
"public function erase_history()\n {\n $this->_event_history = [];\n }",
"public function reset()\n {\n $this->values[self::_ACTIVITY_INFO] = array();\n }",
"public function reset()\n {\n $this->values[self::_INFO] = null;\n }",
"function removeHistory()\n {\n $db = eZDB::instance();\n $orderID = (int)$this->OrderNr;\n $db->query( \"DELETE FROM ezorder_status_history WHERE order_id=$orderID\" );\n }",
"function clean($history = false)\n{\n return XPSPL::instance()->clean($history);\n}",
"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 }",
"public function clean($history = false)\n {\n $storages = [\n self::HASH_STORAGE, self::COMPLEX_STORAGE, self::INTERRUPT_STORAGE\n ];\n foreach ($storages as $_storage) {\n if (count($this->_storage[$_storage]) == 0) continue;\n foreach ($this->_storage[$_storage] as $_index => $_node) {\n if ($_node[1] instanceof Handle && $_node[1]->is_exhausted() ||\n $_node[1] instanceof Queue && $this->queue_exhausted($_node[1])) {\n unset($this->_storage[$_storage][$_index]);\n if ($history) {\n $this->erase_signal_history(\n ($_node[0] instanceof signal\\Complex) ?\n $_node[0] : $_node[0]->info()\n );\n }\n }\n }\n }\n }",
"public function reset()\n {\n $this->values[self::_LAST_CHANGE] = null;\n $this->values[self::_TODAY_TIMES] = null;\n }",
"public function cleanCurrent() {}",
"public function actionHistory()\n {\n /*$auditdata = AuditTrailSearch::find()\n ->select(['entry_id', 'model_id', 'user_id', 'created', 'old_value'])\n ->where([\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event',\n ])\n ->andFilterWhere(['>', 'old_value', \"''\"])\n ->orderBy(['model_id' => SORT_DESC])\n ->all();*/\n// $historyData = \\yii\\helpers\\ArrayHelper::map($auditdata, 'model_id', 'old_value');\n// \\yii\\helpers\\VarDumper::dump($historyData);\n\n $searchModel = new AuditTrailSearch;\n $searchFilter = [\n 'AuditTrailSearch' => [\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event'\n ]\n ];\n $dataProvider = $searchModel->search(\\yii\\helpers\\ArrayHelper::merge(Yii::$app->request->get(), $searchFilter));\n //var_dump(Yii::$app->request->get());\n //\\yii\\helpers\\VarDumper::dump($searchModel);\n $message = \"<ol>恢复操作指引<li><删除内容>中输入内容筛选</li><li>点击复选框选中需要恢复的记录</li><li>点击<恢复记录>按钮</li></ol>\";\n Yii::$app->session->setFlash('info', $message);\n return $this->render('history', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }",
"public function clearState()\n {\n $this->fields = array();\n }",
"public function initHistorys()\n\t{\n\t\t$this->collHistorys = array();\n\t}",
"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 }",
"public function reset() {\n $this->values[self::ERROR] = null;\n $this->values[self::LINE_INFO_LIST] = array();\n $this->values[self::TICKET_ORDER_INFO] = null;\n }",
"function erase_history()\n{\n return XPSPL::instance()->erase_history();\n}",
"public function clearMemo()\n {\n $this->listMemo = [];\n }",
"function clearSearchHistoryProcess($request) {\n \n session_start();\n \n $actionToken = isset($_SESSION[\"actionToken\"]) ? $_SESSION[\"actionToken\"] : Null;\n unset($_SESSION[\"actionToken\"]);\n \n $hours = $request->form->get(\"hours\", \"int\", 0);\n \n if ($hours && ($actionToken === $request->form->get(\"actionToken\", \"str\", \"\"))) {\n $searchHistory = new SearchLogList($request->config->mysqlConnection);\n $searchHistory->removeByHours($hours);\n }\n return Leolos\\Status\\Status::REDIRECT($request->config->control->baseURL.\"/historie-hledani\");\n}",
"public function clearlogAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true); \n $bizlogModel = new Core_Model_Bizlog;\n $bizlogModel->deleteAllEntries();\n $this->_helper->FlashMessenger('Cleared log');\n $this->_helper->redirector('viewlog', 'status', 'admin');\n }",
"function clearHistoryData(){\n\tdeleteAllFiles('/home/dingz/exp5/output/ubm_gmm/scores/nonorm/eval/*');\n\t$scoresevalfile = '/home/dingz/exp5/output/ubm_gmm/scores/nonorm/scores-eval';\n\tif(file_exists($scoresevalfile))\n\t\tunlink($scoresevalfile);\n\t#echo \"delete scores-eval file\";\n\tdeleteAllFiles('/home/dingz/exp5/tmp/ubm_gmm/models/eval/*');\n\tdeleteAllFiles('/home/dingz/exp5/tmp/ubm_gmm/scores/zt_norm_A/eval/*');\n}",
"public function cleanOldLog() {\n\t\t// not yet implemented\n\t}",
"public function reset() {\n $this->values[self::LINE_INFO] = null;\n }",
"public function reset()\n {\n $this->values[self::_CURRENT] = null;\n $this->values[self::_LASTCHANGE] = null;\n $this->values[self::_TODAYBUY] = null;\n $this->values[self::_LASTBUY] = null;\n }"
]
| [
"0.7207973",
"0.7076254",
"0.70105743",
"0.69758177",
"0.6813846",
"0.67562217",
"0.6553826",
"0.6543943",
"0.6513098",
"0.6394953",
"0.6274233",
"0.61279833",
"0.6124794",
"0.595381",
"0.5849656",
"0.58413136",
"0.57977116",
"0.5762119",
"0.5758686",
"0.5718108",
"0.57034814",
"0.5688034",
"0.56492287",
"0.56338227",
"0.55876625",
"0.55837834",
"0.5572352",
"0.55498147",
"0.554727",
"0.55421984"
]
| 0.8270328 | 0 |
BizForm::UpdateActiveRecord() update the active record with given record array | final public function UpdateActiveRecord($recArr)
{
$this->m_ActiveRecord = $recArr;
$this->m_RecordRow->SetRecordArr($this->m_ActiveRecord); // needed ???
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }",
"function Update($array){\n\n }",
"public function update($record);",
"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 update(array $update);",
"function update(array $values)\n{\n\tforeach ($this as $model) {\n\t\t$model->setValues($values);\n\t\t$model->save();\n\t}\n}",
"public function update(array $data);",
"public function update(array $data);",
"public function update(array $data);",
"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 }",
"public function update(array $data,$id);",
"public function update($table, array $fields_arr, $where) {\n }",
"public function update(array $array)\r\n {\r\n $sql = \"UPDATE $this->table \";\r\n foreach ($array as $key => $value) {\r\n $sql .= \"SET $key = $value \";\r\n }\r\n $sql .= \"WHERE id = \" . $array['id'];\r\n return $this->conn->prepare($sql)->execute();\r\n }",
"function adv_update($table, array $data, array $where);",
"abstract protected function updateModel();",
"public function update($data,$model=false){\n\n if(is_array($data)){\n $data=(array_key_exists(0,$data)) ? $data[0] : $data;\n return $this->allMethodProcess(function() use($data,$model){\n return $this->querySqlFormatter->getUpdateQueryFormatter($data,['where'=>$this->where,'execute'=>$this->execute,\n 'model'=>$this->subClassOf,'bool'=>$this->bool,'detail'=>$model]);\n },\"no--autoscope\");\n\n }\n\n }",
"public function update(array $attributes);",
"function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\t{\n\t\t\t$this->_data[$key] = $record;\n\t\t\t$this->store();\n\t\t}\n\t}",
"public function update($array, $id)\n {\n\n $sql = \"update $this->table set \";\n $fields = '';\n $values = '';\n foreach ($array as $key => $value) {\n if ($key != 'id') {\n $fields .= $key . '=' . \"'$value',\";\n }\n }\n $fields = rtrim($fields, ',');\n $sql .= $fields . \" where id=\" . $id;\n\n //echo $sql;exit;\n $this->conn->exec($sql);\n\n }",
"function updateContact($sfConn, $dataArray){\n\t\techo(\"<P> updateContact \");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\t\t\techo(\"<P> Set records to Contact \");\n $sObject = new sObject();\n $sObject->type = 'Contact'; \n $sObject->fields = $fieldset;\n \t$sObject->Id = $fieldset[iaa_id];\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll \");\n $success = update_objects($sfConn, $sObjects);\n return $success; \n }",
"public function update()\n {\n $arg = func_get_args();\n\n foreach ($this->group as $form) {\n if (! is_object($form)) {\n $form = new $form();\n }\n\n if (method_exists($form, 'update')) {\n $form->save(...$arg);\n }\n }\n }",
"function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }",
"public function update($update_array){\n $date = new DateTime(\"now\",new DateTimeZone(DATETIMEZONE));\n $update_array['last_updated'] = $date->format('c');\n $this->db->update('use_case', $update_array, array('usecase_id' => $update_array['usecase_id']));\n return $this->db->affected_rows();\n }",
"function update($table, $object) {\t\t\r\n\t\t$query = \"update $table set \";\t\t\t\t\r\n\t\tforeach ($object as $name => $value) {\r\n\t\t\t$value = mysql_escape_string($value);\r\n\t\t\t$query .= \"$name = '$value',\";\r\n\t\t}\r\n\t\t$query[strlen($query) - 1] = \" \";\r\n\t\t$query .= 'where id = '.$object['id'];\t\t\r\n\t\treturn $this->query($query);\t\t\r\n\t}",
"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 update( array $params );",
"public function update(array $data, array $where);",
"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 }",
"function updateAccount($sfConn, $dataArray){\n\t\techo(\"<P> updateAccount \");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\t\t\techo(\"<P> Set records to Account \");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll \");\n $success = update_objects($sfConn, $sObjects);\n return $success; \n }",
"public function update(array $array, $data = array()) {\n $this->sql = 'UPDATE `' . static::$tableName . '` SET ';\n $properties = (!empty($data) && count($data) > 0) ? $data : $this->properties;\n foreach ($properties as $key => $value) {\n $this->sql.=\"`$key`=\" . $this->db->quote($value); //PDO quote is wrap the value within signle quotes 'value'\n }\n $this->sql = trim($this->sql, \",\");\n $this->where($array);\n return $this->execute();\n }"
]
| [
"0.69247204",
"0.6782369",
"0.67564327",
"0.6736067",
"0.6734445",
"0.6721066",
"0.66294426",
"0.66294426",
"0.66294426",
"0.6604887",
"0.6569594",
"0.6562268",
"0.6474667",
"0.64558935",
"0.6454816",
"0.6434433",
"0.64241546",
"0.6395014",
"0.6356877",
"0.6356488",
"0.63504696",
"0.6345566",
"0.63433135",
"0.6336073",
"0.63317376",
"0.63289666",
"0.6321739",
"0.6321625",
"0.63154227",
"0.63127476"
]
| 0.73341864 | 0 |
BizForm::RunSearch() Run search on query mode, then go read mode | public function RunSearch()
{
BizSystem::log(LOG_DEBUG,"FORMOBJ",$this->m_Name."::RunSearch()");
global $g_BizSystem;
$this->m_SearchRule = "";
foreach ($this->m_RecordRow as $fldCtrl) {
$value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);
if ($value) {
$searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);
if ($this->m_SearchRule == "")
$this->m_SearchRule .= $searchStr;
else
$this->m_SearchRule .= " AND " . $searchStr;
}
}
$this->SetDisplayMode (MODE_R);
$this->GotoPage(1);
$this->m_RecordId = null; // clean the current record id
$this->m_ClearSearchRule = true;
return $this->ReRender();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search(){}",
"function showquery() {\r\n #~ echo '<td align=right>'; // see nav.inc.php for reason\r\n echo '<form name=\"search\" method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n #~ echo '<img src=\"images/b_search.png\" border=\"0\">';\r\n echo lang('Search').' ';\r\n echo '<input type=hidden name=m value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=act value=\"browse\">';\r\n echo '<input type=text name=query value=\"'.$this->_query.'\" size=10>';\r\n echo ' '.lang('in').' ';\r\n echo '<select name=\"qf\">';\r\n #~ echo '<option value=\"\">With selected:</option>';\r\n echo '<option value=\"*\">'.lang('All fields').'</option>';\r\n echo \"<option value=''>______________</option>\";\r\n foreach ($this->properties as $key=>$col) {\r\n if (!$col->queryable or $col->colname=='') continue;\r\n $key == $_REQUEST['qf']? $ischecked = 'selected': $ischecked = '';\r\n echo \"<option value='$key' $ischecked>{$col->label}</option>\";\r\n }\r\n echo '</select>';\r\n #~ echo '<input type=submit value=\"Query\">';\r\n echo '</form>';\r\n #~ echo '</td>'; // see nav.inc.php for reason\r\n\r\n #~ echo '</td></tr></table>';\r\n }",
"public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }",
"function do_performSearch() {\n $datavars = KTUtil::arrayGet($_REQUEST, 'boolean_search');\n if (!is_array($datavars)) {\n $datavars = unserialize($datavars);\n }\n \n if (empty($datavars)) {\n $this->errorRedirectToMain(_kt('You need to have at least 1 condition.'));\n }\n\n $sName = $this->oValidator->validateEntityName(\n 'KTSavedSearch', \n KTUtil::arrayGet($_REQUEST, 'name'), \n array('extra_condition' => 'is_condition', 'redirect_to' => array('new'))\n );\n \n $sNamespace = KTUtil::nameToLocalNamespace('Saved searches', $sName);\n\n $oSearch = KTSavedSearch::createFromArray(array(\n 'name' => $sName,\n 'namespace' => $sNamespace,\n 'iscondition' => true,\n 'iscomplete' => true,\n 'userid' => null,\n 'search' => $datavars,\n ));\n\n $this->oValidator->notError($oSearch, array(\n 'redirect_to' => 'main',\n 'message' => _kt('Search not saved'),\n ));\n $this->successRedirectToMain(_kt('Dynamic condition saved'));\n }",
"public function search()\n\t{\n\t\t\n\t}",
"function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }",
"public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n \n if ($this->formFilters)\n {\n foreach ($this->formFilters as $filterKey => $formFilter)\n {\n $operator = isset($this->operators[$filterKey]) ? $this->operators[$filterKey] : 'like';\n $filterField = isset($this->filterFields[$filterKey]) ? $this->filterFields[$filterKey] : $formFilter;\n $filterFunction = isset($this->filterTransformers[$filterKey]) ? $this->filterTransformers[$filterKey] : null;\n \n // check if the user has filled the form\n if (isset($data->{$formFilter}) AND $data->{$formFilter})\n {\n // $this->filterTransformers\n if ($filterFunction)\n {\n $fieldData = $filterFunction($data->{$formFilter});\n }\n else\n {\n $fieldData = $data->{$formFilter};\n }\n \n // creates a filter using what the user has typed\n if (stristr($operator, 'like'))\n {\n $filter = new TFilter($filterField, $operator, \"%{$fieldData}%\");\n }\n else\n {\n $filter = new TFilter($filterField, $operator, $fieldData);\n }\n \n // stores the filter in the session\n TSession::setValue($this->activeRecord.'_filter', $filter); // BC compatibility\n TSession::setValue($this->activeRecord.'_filter_'.$formFilter, $filter);\n TSession::setValue($this->activeRecord.'_'.$formFilter, $data->{$formFilter});\n }\n else\n {\n TSession::setValue($this->activeRecord.'_filter', NULL); // BC compatibility\n TSession::setValue($this->activeRecord.'_filter_'.$formFilter, NULL);\n TSession::setValue($this->activeRecord.'_'.$formFilter, '');\n }\n }\n }\n \n TSession::setValue($this->activeRecord.'_filter_data', $data);\n TSession::setValue(get_class($this).'_filter_data', $data);\n \n // fill the form with data again\n $this->form->setData($data);\n \n $param=array();\n $param['offset'] =0;\n $param['first_page']=1;\n $this->onReload($param);\n }",
"public function search();",
"public function search();",
"public function action_search()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// What can we search for?\n\t\t$subActions = array(\n\t\t\t'internal' => array($this, 'action_search_internal', 'permission' => 'admin_forum'),\n\t\t\t'online' => array($this, 'action_search_doc', 'permission' => 'admin_forum'),\n\t\t\t'member' => array($this, 'action_search_member', 'permission' => 'admin_forum'),\n\t\t);\n\n\t\t// Set the subaction\n\t\t$action = new Action('admin_search');\n\t\t$subAction = $action->initialize($subActions, 'internal');\n\n\t\t// Keep track of what the admin wants in terms of advanced or not\n\t\tif (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $subAction)\n\t\t{\n\t\t\t$context['admin_preferences']['sb'] = $subAction;\n\n\t\t\t// Update the preferences.\n\t\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\t\t\tupdateAdminPreferences();\n\t\t}\n\n\t\t// Setup for the template\n\t\t$context['search_type'] = $subAction;\n\t\t$context['search_term'] = $this->_req->getPost('search_term', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars[ENT_QUOTES]');\n\t\t$context['sub_template'] = 'admin_search_results';\n\t\t$context['page_title'] = $txt['admin_search_results'];\n\n\t\t// You did remember to enter something to search for, otherwise its easy\n\t\tif ($context['search_term'] === '')\n\t\t{\n\t\t\t$context['search_results'] = array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action->dispatch($subAction);\n\t\t}\n\t}",
"function Search()\n{\n\tglobal $txt, $settings, $context;\n\n\t// Search may be disabled if they're softly banned.\n\tsoft_ban('search');\n\n\t// Is the load average too high to allow searching just now?\n\tif (!empty($context['load_average']) && !empty($settings['loadavg_search']) && $context['load_average'] >= $settings['loadavg_search'])\n\t\tfatal_lang_error('loadavg_search_disabled', false);\n\n\tloadLanguage('Search');\n\tloadTemplate('Search');\n\n\t// Popup mode?\n\tif (AJAX)\n\t{\n\t\twetem::load('search_ajax');\n\t\treturn;\n\t}\n\n\t// Check the user's permissions.\n\tisAllowedTo('search_posts');\n\n\t// Link tree....\n\t// !!! If we've come back here because of an error, we're going to have: Site > Search > Search Results > Search in the linktree. Is this what we want?\n\tadd_linktree($txt['search'], '<URL>?action=search');\n\n\t// This is hard coded maximum string length.\n\t$context['search_string_limit'] = 100;\n\n\t$context['require_verification'] = we::$is_guest && !empty($settings['search_enable_captcha']) && empty($_SESSION['ss_vv_passed']);\n\tif ($context['require_verification'])\n\t{\n\t\tloadSource('Subs-Editor');\n\t\t$verificationOptions = array(\n\t\t\t'id' => 'search',\n\t\t);\n\t\t$context['require_verification'] = create_control_verification($verificationOptions);\n\t\t$context['visual_verification_id'] = $verificationOptions['id'];\n\t}\n\n\t// If you got back from search2 by using the linktree, you get your original search parameters back.\n\tif (isset($_REQUEST['params']))\n\t{\n\t\t// Due to IE's 2083 character limit, we have to compress long search strings\n\t\t$temp_params = base64_decode(str_replace(array('-', '_', '.'), array('+', '/', '='), $_REQUEST['params']));\n\t\t// Test for gzuncompress failing\n\t\t$temp_params2 = @gzuncompress($temp_params);\n\t\t$temp_params = explode('|\"|', !empty($temp_params2) ? $temp_params2 : $temp_params);\n\n\t\t$context['search_params'] = array();\n\t\tforeach ($temp_params as $i => $data)\n\t\t{\n\t\t\t@list ($k, $v) = explode('|\\'|', $data);\n\t\t\t$context['search_params'][$k] = $v;\n\t\t}\n\t\tif (!empty($context['search_params']['brd']))\n\t\t\tloadSource('Search2');\n\t\t$context['search_params']['brd'] = empty($context['search_params']['brd']) ? array() : wedge_ranged_explode(',', $context['search_params']['brd']);\n\t}\n\n\tif (isset($_REQUEST['search']))\n\t\t$context['search_params']['search'] = un_htmlspecialchars($_REQUEST['search']);\n\n\tif (isset($context['search_params']['search']))\n\t\t$context['search_params']['search'] = westr::htmlspecialchars($context['search_params']['search']);\n\tif (isset($context['search_params']['userspec']))\n\t\t$context['search_params']['userspec'] = htmlspecialchars($context['search_params']['userspec']);\n\tif (!empty($context['search_params']['searchtype']))\n\t\t$context['search_params']['searchtype'] = 2;\n\tif (!empty($context['search_params']['minage']))\n\t\t$context['search_params']['minage'] = (int) $context['search_params']['minage'];\n\tif (!empty($context['search_params']['maxage']))\n\t\t$context['search_params']['maxage'] = (int) $context['search_params']['maxage'];\n\n\t$context['search_params']['show_complete'] = !empty($context['search_params']['show_complete']);\n\t$context['search_params']['subject_only'] = !empty($context['search_params']['subject_only']);\n\n\t// Load the error text strings if there were errors in the search.\n\tif (!empty($context['search_errors']))\n\t{\n\t\tloadLanguage('Errors');\n\t\t$context['search_errors']['messages'] = array();\n\t\tforeach ($context['search_errors'] as $search_error => $dummy)\n\t\t{\n\t\t\tif ($search_error === 'messages')\n\t\t\t\tcontinue;\n\n\t\t\t$context['search_errors']['messages'][] = $txt['error_' . $search_error];\n\t\t}\n\t}\n\n\t// Find all the boards this user is allowed to see.\n\t$request = wesql::query('\n\t\tSELECT b.id_cat, c.name AS cat_name, b.id_board, b.name, b.child_level\n\t\tFROM {db_prefix}boards AS b\n\t\t\tLEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)\n\t\tWHERE {query_see_board}\n\t\t\tAND redirect = {string:empty_string}\n\t\tORDER BY b.board_order',\n\t\tarray(\n\t\t\t'empty_string' => '',\n\t\t)\n\t);\n\t$context['num_boards'] = wesql::num_rows($request);\n\t$context['boards_check_all'] = true;\n\t$context['categories'] = array();\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t// This category hasn't been set up yet...\n\t\tif (!isset($context['categories'][$row['id_cat']]))\n\t\t\t$context['categories'][$row['id_cat']] = array(\n\t\t\t\t'id' => $row['id_cat'],\n\t\t\t\t'name' => $row['cat_name'],\n\t\t\t\t'boards' => array()\n\t\t\t);\n\n\t\t// Set this board up, and let the template know when it's a child, so it can indent them.\n\t\t$context['categories'][$row['id_cat']]['boards'][$row['id_board']] = array(\n\t\t\t'id' => $row['id_board'],\n\t\t\t'name' => $row['name'],\n\t\t\t'child_level' => $row['child_level'],\n\t\t\t'selected' => (empty($context['search_params']['brd']) && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']) && !in_array($row['id_board'], we::$user['ignoreboards'])) || (!empty($context['search_params']['brd']) && in_array($row['id_board'], $context['search_params']['brd']))\n\t\t);\n\n\t\t// If a board wasn't checked that probably should have been, ensure the board selection is selected!\n\t\tif (!$context['categories'][$row['id_cat']]['boards'][$row['id_board']]['selected'] && (empty($settings['recycle_enable']) || $row['id_board'] != $settings['recycle_board']))\n\t\t\t$context['boards_check_all'] = false;\n\t}\n\twesql::free_result($request);\n\n\t// Now, let's sort the list of categories into the boards for templates that like that.\n\t$temp_boards = array();\n\tforeach ($context['categories'] as $category)\n\t{\n\t\t$temp_boards[] = array(\n\t\t\t'name' => $category['name'],\n\t\t\t'child_ids' => array_keys($category['boards'])\n\t\t);\n\t\t$temp_boards = array_merge($temp_boards, array_values($category['boards']));\n\n\t\t// Include a list of boards per category for easy toggling.\n\t\t$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);\n\t}\n\n\t$max_boards = ceil(count($temp_boards) / 2);\n\tif ($max_boards == 1)\n\t\t$max_boards = 2;\n\n\t// Now, alternate them so they can be shown left and right ;).\n\t$context['board_columns'] = array();\n\tfor ($i = 0; $i < $max_boards; $i++)\n\t{\n\t\t$context['board_columns'][] = $temp_boards[$i];\n\t\tif (isset($temp_boards[$i + $max_boards]))\n\t\t\t$context['board_columns'][] = $temp_boards[$i + $max_boards];\n\t\telse\n\t\t\t$context['board_columns'][] = array();\n\t}\n\n\tif (!empty($_REQUEST['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $_REQUEST['topic'];\n\t\t$context['search_params']['show_complete'] = true;\n\t}\n\tif (!empty($context['search_params']['topic']))\n\t{\n\t\t$context['search_params']['topic'] = (int) $context['search_params']['topic'];\n\n\t\t$context['search_topic'] = array(\n\t\t\t'id' => $context['search_params']['topic'],\n\t\t\t'href' => '<URL>?topic=' . $context['search_params']['topic'] . '.0',\n\t\t);\n\n\t\t$request = wesql::query('\n\t\t\tSELECT ms.subject\n\t\t\tFROM {db_prefix}topics AS t\n\t\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)\n\t\t\t\tINNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)\n\t\t\tWHERE t.id_topic = {int:search_topic_id}\n\t\t\t\tAND {query_see_board}\n\t\t\t\tAND {query_see_topic}\n\t\t\tLIMIT 1',\n\t\t\tarray(\n\t\t\t\t'search_topic_id' => $context['search_params']['topic'],\n\t\t\t)\n\t\t);\n\n\t\tif (wesql::num_rows($request) == 0)\n\t\t\tfatal_lang_error('topic_gone', false);\n\n\t\tlist ($context['search_topic']['subject']) = wesql::fetch_row($request);\n\t\twesql::free_result($request);\n\n\t\t$context['search_topic']['link'] = '<a href=\"' . $context['search_topic']['href'] . '\">' . $context['search_topic']['subject'] . '</a>';\n\t}\n\n\t$context['page_title'] = $txt['search'];\n}",
"public function execute_search()\n {\n\n $search_term = $this->input->post('search');\n\n $v_data = array(\"results\" => $this->Manage_roles_model->get_role($search_term));\n\n $data = array(\n \"title\" => $this->site_model->display_page_title(),\n \"content\" => $this->load->view(\"backoffice/execute_search\", $v_data, true),\n );\n $this->load->view(\"site/layouts/layout\", $data);\n\n }",
"function search() {}",
"public function SearchRecord()\n {\n $this->UpdateActiveRecord(null);\n $this->m_QueryONRender = false;\n $this->SetDisplayMode(MODE_Q);\n return $this->ReRender(true,false);\n }",
"function search()\n\t{}",
"function search()\n\t{}",
"public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"protected function quicksearch()\n {\n $words = $this->getWords();\n $logged_in = APP_User::isBWLoggedIn('NeedMore,Pending');\n if (!$logged_in) {\n $request = PRequest::get()->request;\n if (!isset($request[0])) {\n $login_url = 'login';\n } else switch ($request[0]) {\n case 'login':\n case 'main':\n case 'start':\n $login_url = 'login';\n break;\n default:\n $login_url = 'login/'.htmlspecialchars(implode('/', $request), ENT_QUOTES);\n }\n } else {\n $username = isset($_SESSION['Username']) ? $_SESSION['Username'] : '';\n }\n\n if (class_exists('MOD_online')) {\n $who_is_online_count = MOD_online::get()->howManyMembersOnline();\n } else {\n // echo 'MOD_online not active';\n if (isset($_SESSION['WhoIsOnlineCount'])) {\n $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount();\n } else {\n $who_is_online_count = 0;\n }\n }\n PPostHandler::setCallback('quicksearch_callbackId', 'SearchmembersController', 'index');\n\n require TEMPLATE_DIR . 'shared/roxpage/quicksearch.php';\n }",
"public function run()\r\r\n\t{\r\r\n\t\t$arrPages = array();\r\r\n\t\t$strCache = md5('search_index' . session_id());\r\r\n\r\r\n\t\t// Get cache file\r\r\n\t\tif (file_exists(TL_ROOT . '/system/tmp/' . $strCache))\r\r\n\t\t{\r\r\n\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\r\r\n\t\t\tif ($objFile->mtime < time() + 3600)\r\r\n\t\t\t{\r\r\n\t\t\t\t$arrPages = deserialize($objFile->getContent());\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\r\r\n\t\t// Get all searchable pages\r\r\n\t\tif (count($arrPages) < 1)\r\r\n\t\t{\r\r\n\t\t\t$arrPages = $this->getSearchablePages();\r\r\n\r\r\n\t\t\t// HOOK: take additional pages\r\r\n\t\t\tif (array_key_exists('getSearchablePages', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['getSearchablePages']))\r\r\n\t\t\t{\r\r\n\t\t\t\tforeach ($GLOBALS['TL_HOOKS']['getSearchablePages'] as $callback)\r\r\n\t\t\t\t{\r\r\n\t\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t\t$arrPages = $this->$callback[0]->$callback[1]($arrPages);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\t\t\t$objFile->write(serialize($arrPages));\r\r\n\t\t\t$objFile->close();\r\r\n\t\t}\r\r\n\r\r\n\t\t$intStart = $this->Input->get('start') ? $this->Input->get('start') : 0;\r\r\n\t\t$intPages = $this->Input->get('ppc') ? $this->Input->get('ppc') : 10;\r\r\n\r\r\n\t\t// Rebuild search index\r\r\n\t\tif ($intPages && count($arrPages))\r\r\n\t\t{\r\r\n\t\t\t$this->import('Search');\r\r\n\r\r\n\t\t\tif ($intStart < 1)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_search\");\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_search_index\");\r\r\n\t\t\t\t$this->Database->execute(\"TRUNCATE TABLE tl_cache\");\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '<div style=\"font-family:Verdana, sans-serif; font-size:11px; line-height:16px; margin-bottom:12px;\">';\r\r\n\r\r\n\t\t\tfor ($i=$intStart; $i<$intStart+$intPages && $i<count($arrPages); $i++)\r\r\n\t\t\t{\r\r\n\t\t\t\techo 'File <strong>' . $arrPages[$i] . '</strong> has been indexed<br />';\r\r\n\r\r\n\t\t\t\t$objRequest = new Request();\r\r\n\t\t\t\t$objRequest->send($this->Environment->base . $arrPages[$i]);\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '<div style=\"margin-top:12px;\">';\r\r\n\r\r\n\t\t\t// Redirect to the next cycle\r\r\n\t\t\tif ($i < (count($arrPages) - 1))\r\r\n\t\t\t{\r\r\n\t\t\t\t$url = $this->Environment->base . 'typolight/indexer.php?start=' . ($intStart + $intPages) . '&ppc=' . $intPages;\r\r\n\r\r\n\t\t\t\techo '<script type=\"text/javascript\">setTimeout(\\'window.location=\"' . $url . '\"\\', 1000);</script>';\r\r\n\t\t\t\techo '<a href=\"' . $url . '\">Please click here to proceed if you are not using JavaScript</a>';\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t// Redirect back home\r\r\n\t\t\telse\r\r\n\t\t\t{\r\r\n\t\t\t\t$url = $this->Environment->base . 'typolight/main.php?do=maintenance';\r\r\n\r\r\n\t\t\t\t// Delete temporary file\r\r\n\t\t\t\t$objFile = new File('system/tmp/' . $strCache);\r\r\n\t\t\t\t$objFile->delete();\r\r\n\t\t\t\t$objFile->close();\r\r\n\r\r\n\t\t\t\techo '<script type=\"text/javascript\">setTimeout(\\'window.location=\"' . $url . '\"\\', 1000);</script>';\r\r\n\t\t\t\techo '<a href=\"' . $url . '\">Please click here to proceed if you are not using JavaScript</a>';\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\techo '</div></div>';\r\r\n\t\t}\r\r\n\t}",
"public function search($query);",
"public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }",
"public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}",
"public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields, $branch);\n }",
"function _admin_search_query()\n {\n }",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Invoices::grid() )->search ();\n\t}",
"public function searchWithCriteria(){\n\n\n //change default message for required rule\n $this->unsetSessionData();\n $this->setSessionData();\n\n\n if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])){\n $this->searchByLocationAndDay();\n }else if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])==FALSE){\n $this->searchByLocation();\n }else if(isset($_SESSION['searchKeyword'])==FALSE && isset($_SESSION['timecon'])){\n $this->searchByCalendar();\n }\n }",
"public function search() {\n include 'views/search-form.php';\n }",
"public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}",
"public function PerformSearch(){\r\n\t\t\r\n\t\t// get all our search requirements\r\n\t\t$query = self::get_query($mysqlSafe = true);\r\n\t\t$types = self::get_mapped_types();\r\n\t\t$filters = self::get_mapped_filters();\r\n\t\t\r\n\t\t// prepare our final result object\r\n\t\t$allResults = ArrayList::create();\r\n\t\t\r\n\t\t// loop all the records we need to lookup\r\n\t\tforeach ($types as $type){\r\n\t\t\t\r\n\t\t\t$sql = '';\r\n\t\t\t$joins = '';\r\n\t\t\t$where = '';\r\n\t\t\t$sort = '';\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Result selection\r\n\t\t\t * We only need ClassName and ID to fetch the full object (using the SilverStripe ORM)\r\n\t\t\t * once we've got our results\r\n\t\t\t **/\r\n\t\t\t$sql.= \"SELECT \\\"\".$type['Table'].\"\\\".\\\"ID\\\" AS \\\"ResultObject_ID\\\" FROM \\\"\".$type['Table'].\"\\\" \";\r\n\t\t\t\r\n\t\t\t// Join this type with any dependent tables (if applicable)\r\n\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\tforeach ($type['JoinTables'] as $joinTable){\r\n\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$joinTable.\"\\\" ON \\\"\".$joinTable.\"\\\".\\\"ID\\\" = \\\"\".$type['Table'].\"\\\".\\\"ID\\\" \";\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Query term\r\n\t\t\t * We search each column for this type for the provided query string\r\n\t\t\t */\r\n\t\t\t$where .= ' WHERE (';\r\n\t\t\tforeach ($type['Columns'] as $i => $column){\r\n\t\t\t\t$column = explode('.',$column);\r\n\t\t\t\tif ($i > 0){\r\n\t\t\t\t\t$where .= ' OR ';\r\n\t\t\t\t}\r\n\t\t\t\t$where .= \"\\\"\".$column[0].\"\\\".\\\"\".$column[1].\"\\\" LIKE CONCAT('%','\".$query.\"','%')\";\r\n\t\t\t}\r\n\t\t\t$where.= ')';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Apply our type-level filters (if applicable)\r\n\t\t\t **/\t\t\r\n\t\t\tif (isset($type['Filters'])){\r\n\t\t\t\tforeach ($type['Filters'] as $key => $value){\r\n\t\t\t\t\t$where.= ' AND ('.$key.' = '.$value.')';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Apply filtering\r\n\t\t\t **/\r\n\t\t\t$relations_sql = '';\r\n\r\n\t\t\tif ($filters){\r\n\t\t\t\tforeach ($filters as $filter){\r\n\r\n\t\t\t\t\t// Apply filters, based on filter structure\r\n\t\t\t\t\tswitch ($filter['Structure']){\r\n\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Simple column value filter\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'db':\r\n\r\n\t\t\t\t\t\t\t// Identify which table has the column which we're trying to filter by\r\n\t\t\t\t\t\t\t$table_with_column = null;\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\t$tables_to_check = $type['JoinTables'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$tables_to_check = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$tables_to_check[] = $type['Table'];\r\n\r\n\t\t\t\t\t\t\tforeach ($tables_to_check as $table_to_check){\r\n\t\t\t\t\t\t\t\t$column_exists_query = DB::query( \"SHOW COLUMNS FROM \\\"\".$table_to_check.\"\\\" LIKE '\".$filter['Column'].\"'\" );\r\n\r\n\t\t\t\t\t\t\t\tforeach ($column_exists_query as $column){\r\n\t\t\t\t\t\t\t\t\t$table_with_column = $table_to_check;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Not anywhere in this type's table joins, so we can't search this particular type\r\n\t\t\t\t\t\t\tif (!$table_with_column){\r\n\t\t\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t// open our wrapper\r\n\t\t\t\t\t\t\t$where.= ' AND (';\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\t * This particular type needs to join with other parent tables to\r\n\t\t\t\t\t\t\t * form a complete, and searchable row\r\n\t\t\t\t\t\t\t **/\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\tforeach ($type['JoinTables'] as $join_table){\r\n\t\t\t\t\t\t\t\t\t//$joins.= \"LEFT JOIN \\\"\".$type['Table'].\"\\\" ON \\\"\".$join_table.\"\\\".\\\"ID\\\" = \\\"\".$type['Table'].\"\\\".\\\"ID\\\"\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t$valuesString = '';\r\n\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $value){\r\n\t\t\t\t\t\t\t\t\tif ($valuesString != ''){\r\n\t\t\t\t\t\t\t\t\t\t$valuesString.= ',';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$valuesString.= \"'\".$value.\"'\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$valuesString = $filter['Value'];\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\t$where.= \"\\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\" \".$filter['Operator'].\" '\".$valuesString .\"'\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// close our wrapper\r\n\t\t\t\t\t\t\t$where.= ')';\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Simple relational filter (ie Page.Author)\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'has_one':\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Identify which table has the column which we're trying to filter by\r\n\t\t\t\t\t\t\t$table_with_column = null;\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\t$tables_to_check = $type['JoinTables'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$tables_to_check = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$tables_to_check[] = $type['Table'];\r\n\r\n\t\t\t\t\t\t\tforeach ($tables_to_check as $table_to_check){\r\n\t\t\t\t\t\t\t\t$column_exists_query = DB::query( \"SHOW COLUMNS FROM \\\"\".$table_to_check.\"\\\" LIKE '\".$filter['Column'].\"'\" );\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tforeach ($column_exists_query as $column){\r\n\t\t\t\t\t\t\t\t\t$table_with_column = $table_to_check;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Not anywhere in this type's table joins, so we can't search this particular type\r\n\t\t\t\t\t\t\tif (!$table_with_column){\r\n\t\t\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// join the relationship table to our record(s)\r\n\t\t\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$filter['Table'].\"\\\" ON \\\"\".$filter['Table'].\"\\\".\\\"ID\\\" = \\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\"\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($filter['Value'])){\r\n\t\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\t$ids = '';\r\n\t\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $id){\r\n\t\t\t\t\t\t\t\t\t\tif ($ids != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t$ids.= ',';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t$ids.= \"'\".$id.\"'\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$ids = $filter['Value'];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$where.= ' AND ('.\"\\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\" IN (\". $ids .\")\".')';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Complex relational filter (ie Page.Tags)\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'many_many':\r\n\r\n\t\t\t\t\t\t\t// Make sure this type has a relationship to this filter object\r\n\t\t\t\t\t\t\tif (isset($filter['JoinTables'][$type['Key']])){\r\n\r\n\t\t\t\t\t\t\t\t$filter_join = $filter['JoinTables'][$type['Key']];\r\n\r\n\t\t\t\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$filter_join['Table'].\"\\\" ON \\\"\".$type['Table'].\"\\\".\\\"ID\\\" = \\\"\".$filter_join['Table'].\"\\\".\\\"\".$filter_join['Column'].\"\\\"\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!empty($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\t\t$ids = '';\r\n\t\t\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $id){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ids != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ids.= ',';\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t$ids.= \"'\".$id.\"'\";\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$ids = $filter['Value'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif ($relations_sql !== ''){\r\n\t\t\t\t\t\t\t\t\t\t$relations_sql.= \" AND \";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$relations_sql.= \"\\\"\".$filter_join['Table'].\"\\\".\\\"\".$filter['Table'].\"ID\\\" IN (\". $ids .\")\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Append any required relations SQL\r\n\t\t\t\tif ($relations_sql !== ''){\r\n\t\t\t\t\t$where.= ' AND ('.$relations_sql.')';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Compile our sql string\r\n\t\t\t$sql.= $joins;\r\n\t\t\t$sql.= $where;\r\n\r\n\t\t\t// Debugging\r\n\t\t\t//echo '<h3 style=\"position: relative; padding: 20px; background: #EEEEEE; z-index: 999;\">'.str_replace('\"', '`', $sql).'</h3>';\r\n\r\n\t\t\t// Eexecutioner enter stage left\r\n\t\t\t$results = DB::query($sql);\r\n\t\t\t$resultIDs = array();\r\n\r\n\t\t\t// Add all the result ids to our array\r\n\t\t\tforeach ($results as $result){\r\n\r\n\t\t\t\t// Make sure we're not already a result\r\n\t\t\t\tif (!isset($resultIDs[$result['ResultObject_ID']])){\r\n\t\t\t\t\t$resultIDs[$result['ResultObject_ID']] = $result['ResultObject_ID'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Convert our SQL results into SilverStripe objects of the appropriate class\r\n\t\t\tif ($resultIDs){\r\n\t\t\t\t$resultObjects = $type['ClassName']::get()->filter(['ID' => $resultIDs]);\r\n\t\t\t\t$allResults->merge($resultObjects);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sort = false;\r\n\t\t// Sorting applied throug form submission\r\n\t\tif(isset(self::get_mapped_sort()['Sort'])){\r\n\t\t\t$sort = self::get_mapped_sort()['Sort'];\t\t\r\n\t\t\t$sort = str_replace(\"'\", \"\\'\", $sort);\r\n\t\t\t$sort = str_replace('\"', '\\\"', $sort);\r\n\t\t\t$sort = str_replace('`', '\\`', $sort);\r\n\t\t}\r\n\t\t// Default sort defined in config\r\n\t\telseif(isset(self::get_mapped_defaults()['sort'])){\r\n\t\t\t$sort = self::get_mapped_defaults()['sort'];\r\n\t\t}\r\n\t\tif($sort){\r\n\t\t\t$allResults = $allResults->Sort($sort);\r\n\t\t}\r\n\r\n\t\t// Remove duplicates\r\n\t\t$allResults->removeDuplicates('ID');\r\n\r\n\t\t// filter by permission\r\n\t\tif($allResults) foreach($allResults as $result) {\r\n\t\t\tif(!$result->canView()) $allResults->remove($result);\r\n\t\t}\r\n\t\t\r\n\t\t// load into a paginated list. To change the items per page, set via the template (ie Results.setPageLength(20))\r\n\t\t$paginatedItems = PaginatedList::create($allResults, $this->request);\r\n\t\t\r\n\t\treturn $paginatedItems;\r\n\t}",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }"
]
| [
"0.66389984",
"0.6605083",
"0.6596757",
"0.65945494",
"0.65843254",
"0.6575047",
"0.6552156",
"0.6533281",
"0.6533281",
"0.6381002",
"0.6374229",
"0.6369271",
"0.6341935",
"0.6319149",
"0.628871",
"0.628871",
"0.6275875",
"0.6262573",
"0.62455803",
"0.6244874",
"0.62211096",
"0.6205078",
"0.6199856",
"0.6181558",
"0.616443",
"0.61449087",
"0.6139063",
"0.61384296",
"0.61252713",
"0.6122137"
]
| 0.7503704 | 0 |
BizForm::SortRecord() sort record on given column | public function SortRecord($sort_col)
{
$pos = strpos($sort_col, ",");
if ($pos > 0)
$reverse_flag = substr($sort_col, $pos + 1);
$sortflag = ($reverse_flag == 1) ? "DESC" : "ASC";
$sort_col = substr($sort_col, 0, $pos);
// change the OnSortField
$this->m_OnSortField = $sort_col;
$this->m_OnSortFlag = $sortflag;
// turn off the OnSort flag of the old onsort field
$this->SetSortFieldFlag($this->m_OnSortField, null);
// turn on the OnSort flag of the new onsort field
$this->SetSortFieldFlag($this->m_OnSortField, $sortflag);
// change the sort rule and issue the query
$this->GetDataObj()->SetSortRule("[" . $this->GetControl($this->m_OnSortField)->m_BizFieldName . "] " . $sortflag);
// move to 1st page
$this->m_CurrentPage = 1;
return $this->ReRender();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function record_sort($records, $field, $reverse=false){\n\n $hash = array();\n \n foreach($records as $key => $record){\n $hash[$record[$field].$key] = $record;\n }\n \n ($reverse)? krsort($hash) : ksort($hash);\n \n $records = array();\n \n foreach($hash as $record){\n $records []= $record;\n }\n \n return $records;\n}",
"function sort($fieldname, $direction = \"ASC\")\n\t{\n\t\t$this->table->sort = $fieldname;\n\t\t$this->table->direction = $direction;\n\t}",
"public function getSortColumn();",
"function SortBy ( $cField )\n{\n $cField = $this->_FixCase_($cField);\n $cValue = '';\n if ( empty($this->_SortNameList) ) {\n if ( $this->_SortAllFields )\n $cValue = empty($this->_PrimaryKeyStr) ? $cField : $cField.','.$this->_PrimaryKeyStr;\n } else {\n $cValue = $this->_SortNameList[$cField];\n if ( empty($cVAlue) && $this->_SortAllFields )\n $cValue = empty($this->_PrimaryKeyStr) ? $cField : $cField.','.$this->_PrimaryKeyStr;\n }\n if ( empty($cValue) ) return false;\n\n $this->KeyName($cValue);\n return $this->SearchCurr();\n}",
"function sort(&$datatable, $field=0, $direct=0) {\n\t\t$comp = ($direct)? '$b,$a':'$a,$b';\n\t\t$code = '$result=';\n\t\t$code.= ($field===2||$field===3||$field===6)?\t// folder name/image title, description or file name\n\t\t\t\t 'strnatcasecmp($a['.$field.'],$b['.$field.']);'\n\t\t\t\t :\n\t\t\t\t '(int)$a['.$field.'] - (int)$b['.$field.'];';\n\t\t$code.= 'return ($result===0)? $a[0]-$b[0]:$result;';\n\t\t$comp_func = create_function($comp, $code);\n\t\tusort($datatable, $comp_func);\n\t}",
"public function getSortField ()\r\n\t{\r\n\t\treturn $this->sortField;\r\n\t}",
"private function _orderByField($sql, $bind)\r\n {\r\n preg_match('/ order by field\\((.*)\\)$/si', $sql, $matches);\r\n $oldClause = $matches[0];\r\n $values = explode(',', $matches[1]);\r\n\r\n $field = array_shift($values);\r\n\r\n $newClause = \" order by case $field\";\r\n for ($i = 0, $size = count($values); $i < $size; $i++)\r\n {\r\n $newClause .= \" when {$values[$i]} then $i\";\r\n }\r\n $newClause .= ' end';\r\n\r\n $sql = str_replace($oldClause, $newClause, $sql);\r\n\r\n return array($sql, $bind);\r\n }",
"function click_sort($order) {\n if (isset($this->real_field)) {\n // Since fields should always have themselves already added, just\n // add a sort on the field.\n $params = array('type' => 'numeric');\n $this->query->add_orderby($this->table_alias, $this->real_field, $order, $this->field_alias, $params);\n }\n }",
"function asort2d($records, $field, $reverse=false) {\n\t $hash = array();\n\t foreach($records as $key => $record) {\n\t\t$hash[$record[$field].$key] = $record;\n\t }\n\t ($reverse)? krsort($hash) : ksort($hash);\n\t $records = array();\n\t foreach($hash as $record) {\n\t\t$records []= $record;\n\t }\n\t return $records;\n\t}",
"private function GetSortField()\r\n\t\t{\r\n\t\t\tif (isset($_GET['sort'])) {\r\n\t\t\t\t$this->_sort = $_GET['sort'];\r\n\t\t\t} else {\r\n\t\t\t\t$this->_sort = \"featured\";\r\n\t\t\t}\r\n\r\n\t\t\t$priceColumn = 'p.prodcalculatedprice';\r\n\r\n\t\t\tswitch ($this->_sort) {\r\n\t\t\t\tcase \"featured\": {\r\n\t\t\t\t\t$GLOBALS['SortFeaturedSelected'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"p.prodsortorder asc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"newest\": {\r\n\t\t\t\t\t$GLOBALS['SortNewestSelected'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"p.productid desc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"bestselling\": {\r\n\t\t\t\t\t$GLOBALS['SortBestSellingSelected'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"p.prodnumsold desc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"alphaasc\": {\r\n\t\t\t\t\t$GLOBALS['SortAlphaAsc'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"p.prodname asc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"alphadesc\": {\r\n\t\t\t\t\t$GLOBALS['SortAlphaDesc'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"p.prodname desc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"avgcustomerreview\": {\r\n\t\t\t\t\t$GLOBALS['SortAvgReview'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn \"prodavgrating desc\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"priceasc\": {\r\n\t\t\t\t\t$GLOBALS['SortPriceAsc'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn $priceColumn.' ASC';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase \"pricedesc\": {\r\n\t\t\t\t\t$GLOBALS['SortPriceDesc'] = 'selected=\"selected\"';\r\n\t\t\t\t\treturn $priceColumn.' DESC';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"function sort ($block,$field,$dir = \"\") {\n\t\t$sort = [];\n\n\t\tforeach ($this->data as $event) {\n\t\t\t$sortval = $event->get($block,$field);\n\n\t\t\tif (is_array ($sortval))\n\t\t\t\t$sortval = $sortval[0];\n\n\t\t\t$sort[$sortval] = $event;\n\t\t}\n\n\t\t# choose sort direction\n\t\tif (strtoupper($dir) == \"DESC\")\n\t\t\tkrsort ($sort);\n\t\telse\n\t\t\tksort($sort);\n\n\t\t$this->data = $sort;\n\t}",
"public function setSortField ($value)\r\n\t{\r\n\t\t$this->sortField = $value;\r\n\t}",
"function sort_field($ci_obj, $using_search, $default_sort = 0, $default_sortby = 'desc') {\n $sort_segment = (!$using_search) ? 3 : 5;\n $sorttype_segment = (!$using_search) ? 4 : 6;\n $page_segment = (!$using_search) ? 6 : 8;\n\n // sorting & order\n $sortseq = ($ci_obj->uri->segment($sort_segment) != '') ? $ci_obj->uri->segment($sort_segment) : $default_sort;\n $sortseq = (array_key_exists($sortseq, $ci_obj->fieldseq) ? $sortseq : $default_sort);\n $sort = $ci_obj->fieldseq[$sortseq];\n $sorttype = ($ci_obj->uri->segment($sorttype_segment) != '') ? $ci_obj->uri->segment($sorttype_segment) : $default_sortby;\n $sorttypev = ($sorttype == 'asc' ? 'desc' : 'asc');\n $orderby = ($sort != '') ? $sort . ' ' . $sorttype : '';\n\n return array($orderby, $sort, $sorttypev, $sortseq, $sorttype, $page_segment);\n}",
"function get_sort_sql($fieldname) {\n return '';\n }",
"function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}",
"function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}",
"function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}",
"function sort_field(&$object, $lang) {\n return null;\n }",
"function sortBy($field, &$array, $direction = 'asc')\n{\n usort($array, create_function('$a, $b', '\n $a = $a[\"' . $field . '\"];\n $b = $b[\"' . $field . '\"];\n\n if ($a == $b) return 0;\n\n $direction = strtolower(trim($direction));\n\n return ($a ' . ($direction == 'desc' ? '>' : '<') . ' $b) ? -1 : 1;\n '));\n\n return true;\n}",
"protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}",
"public function getSortBy();",
"private function sort_field_order(&$result, $select)\n {\n if (empty($select))\n return;\n \n $order = explode(\",\", str_replace(\" \", \"\", $select));\n \n $new_row = array();\n \n foreach ($result as &$row)\n { \n foreach ($order as $key)\n {\n $new_row[$key] = $row[$key];\n }\n \n $row = $new_row;\n }\n }",
"function getSortColumn($argVarSortOrder) {\n\n $objCore = new Core();\n //Default order by setting\n if ($argVarSortOrder['orderBy'] == '') {\n $varOrderBy = 'DESC';\n } else {\n $varOrderBy = $argVarSortOrder['orderBy'];\n }\n //Default sort by setting\n if ($argVarSortOrder['sortBy'] == '') {\n $varSortBy = 'UserDateAdded';\n } else {\n $varSortBy = $argVarSortOrder['sortBy'];\n }\n //Create sort class object\n $objOrder = new CreateOrder($varSortBy, $varOrderBy);\n unset($argVarSortOrder['PHPSESSID']);\n //This function return query string. When we will array.\n $varQryStr = $objCore->sortQryStr($argVarSortOrder, $varOrderBy, $varSortBy);\n //print_r($varQryStr);\n //Pass query string in extra function for add in sorting\n $objOrder->extra($varQryStr);\n //Prepage sorting heading\n $objOrder->append(' ');\n $objOrder->addColumn('Name', 'UserFirstName');\n//\t\t\t$objOrder->addColumn('User Type', 'UserType');\n $objOrder->addColumn('Email', 'UserEmail');\n $objOrder->addColumn('Role & Permission');\n $objOrder->addColumn('Status', 'AdminUserStatus');\n $this->orderOptions = $objOrder->orderOptions();\n\n //This string column name with link.\n $varStrLnkSrtClmn = $objOrder->orderBlock();\n return $varStrLnkSrtClmn;\n }",
"public function andThenAscendingBy(string $field): ExtensibleSorting;",
"public function Sort_Click($strFormId, $strControlId, $strParameter) {\r\n\t\t\tif (strlen($strParameter)) {\r\n\t\t\t\t// Sorting\r\n\t\t\t\t$intColumnIndex = QType::Cast($strParameter, QType::Integer);\r\n\t\t\t\t$objColumn = $this->objColumnArray[$intColumnIndex];\r\n\t\t\t\t\r\n\t\t\t\t// First, reset pagination (if applicable)\r\n\t\t\t\tif ($this->objPaginator)\r\n\t\t\t\t\t$this->PageNumber = 1;\r\n\r\n\t\t\t\t// First, make sure the Column is Sortable\r\n\t\t\t\tif ($objColumn->SortByCommand) {\r\n\t\t\t\t\t// It is\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Are we currently sorting by this column?\r\n\t\t\t\t\tif ($this->intSortColumnIndex == $intColumnIndex) {\r\n\t\t\t\t\t\t// Yes we are currently sorting by this column\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// In Reverse?\r\n\t\t\t\t\t\tif ($this->intSortDirection == 1) {\r\n\t\t\t\t\t\t\t// Yep -- unreverse the sort\r\n\t\t\t\t\t\t\t$this->intSortDirection = 0;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// Nope -- can we reverse?\r\n\t\t\t\t\t\t\tif ($objColumn->ReverseSortByCommand)\r\n\t\t\t\t\t\t\t\t$this->intSortDirection = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Nope -- so let's set it to this column\r\n\t\t\t\t\t\t$this->intSortColumnIndex = $intColumnIndex;\r\n\t\t\t\t\t\t$this->intSortDirection = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->blnPersistent) {\r\n\t\t\t\t\t\tif ($this->objParentControl)\r\n\t\t\t\t\t\t\t$this->objParentControl->MarkAsModified();\r\n\t\t\t\t\t\t$this->objDataSource = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// It isn't -- clear all sort properties\r\n\t\t\t\t\t$this->intSortDirection = 0;\r\n\t\t\t\t\t$this->intSortColumnIndex = -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public function sortable(string $column, string $cast);",
"abstract public function prepareSort();",
"function sortArray( $data, $field ) {\r\n\t$field = (array) $field;\r\n\tuasort( $data, function($a, $b) use($field) {\r\n\t\t$retval = 0;\r\n\t\tforeach( $field as $fieldname ) {\r\n\t\t\tif( $retval == 0 ) $retval = strnatcmp( $a[$fieldname], $b[$fieldname] );\r\n\t\t}\r\n\t\treturn $retval;\r\n\t} );\r\n\treturn $data;\r\n}",
"public function sort()\n {\n $column_id = $this->request->getIntegerParam('column_id');\n $project = $this->getProject();\n $search = $this->helper->projectHeader->getSearchQuery($project);\n\n $this->taskVoteModel->sortByVoting($column_id);\n\n $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $search)), true);\n }",
"public function order($field, $order = 'desc');"
]
| [
"0.6891809",
"0.6803265",
"0.66187114",
"0.6335731",
"0.6194742",
"0.61785924",
"0.61240643",
"0.61168146",
"0.6114137",
"0.6057699",
"0.6035701",
"0.5988249",
"0.59495664",
"0.5938796",
"0.5880614",
"0.5880614",
"0.5880614",
"0.58648545",
"0.586276",
"0.5841891",
"0.5838168",
"0.5824731",
"0.58136153",
"0.5804774",
"0.58000886",
"0.57980734",
"0.5788601",
"0.57876545",
"0.576949",
"0.57489324"
]
| 0.7645261 | 0 |
BizForm::SelectRecord() Select the record to selected row (if form show list of records) | public function SelectRecord($recId)
{
$this->m_RecordId = $recId;
return $this->ReRender(false); // not redraw the this form, but draw the subforms
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function select($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t $this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('select'); // what we want to do (select records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t\t$row = $dbo->loadObjectList(); //get list of all returned values as assoc array\r\n\t\t\r\n\t\t\treturn $row;\r\n\t\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\t\n\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\t\n\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function Recordset_Selecting(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function selectRecord($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.'<br>';exit;\n $res = $this->execute($query);\n \treturn $this->fetchRow($res);\n }",
"public function selectRow($row);",
"function set_current_record($recordVar, Omeka_Record_AbstractRecord $record, $setPreviousRecord = false)\n{\n get_view()->setCurrentRecord($recordVar, $record, $setPreviousRecord);\n}",
"function viewRecord($idMedicalRecord)\r\n\t\t{\r\n\t\t\t$this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\r\n\t\t\t// Execute select query on database giving current object data values\r\n\t\t\t$data = $this->select($idMedicalRecord);\r\n\r\n\t\t\treturn $data; // list of all returned values as assoc array\r\n\t\t}",
"public function selectSingle() {\n $suffix = $this->formQuerySuffix();\n $arr = $this->table->selectSingle($suffix);\n $class = $this->className;\n $result = null;\n\n DBRecord::$fromPostData = false;\n if ($arr) $result = new $class($arr);\n DBRecord::$fromPostData = true;\n\n return $result;\n }",
"public function Do_select_Example1(){\n\n\t}",
"public function DeleteRecord()\n {\n // TODO: support delete multiple records\n // read the id array from the check box list _REQUEST['row_selections']\n global $g_BizSystem;\n $values = $g_BizSystem->GetClientProxy()->GetFormInputs('row_selections',false);\n if ($values)\n {\n foreach ($values as $id)\n {\n $recArray = $this->GetDataObj()->FetchById($id);\n $dataRec = new DataRecord($recArray, $this->GetDataObj());\n // take care of exception\n try {\n $dataRec->Delete();\n }\n catch (BDOException $e)\n {\n // call $this->ProcessBDOException($e);\n $this->ProcessBDOException($e);\n return;\n }\n }\n }\n else // delete current focused record\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n global $g_BizSystem;\n //$recId = $this->m_ActiveRecord[\"Id\"];\n $ok = $this->GetDataObj()->DeleteRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n }\n $this->m_RecordId = null; // clean the current record id\n // TODO: adjust current page. if current page return no record, goto prev page\n \n return $this->ReRender();\n }",
"function getSelectedFieldsRecordByField($selectedFields, $fieldName, $searchKey, $searchStatus='', $orderByField='', $orderByValue='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getSelectedTableRecordByField($this->table, $selectedFields, $fieldName , $searchKey, $searchStatus, $orderByField, $orderByValue );\r\n\t\t\treturn $sqlRecord;\r\n\t\t\t\r\n\t\t}",
"function SelectEntry() {\n\t\t\n //Select all contacts in the addressbook\n $data['display_block'] = $this->AddressBook->selectContacts();\n\n //Render the View SelectEntry with the contact list. \n $this->load->view('SelectEntry', $data);\t\n\t}",
"public function dsp_single_record()\n {\n $v_record_id = get_post_var('hdn_item_id',0);\n $VIEW_DATA['arr_single_record'] = $this->model->qry_single_record($v_record_id);\n $this->view->render('dsp_single_record',$VIEW_DATA);\n }",
"public function selectRecord()\n {\n $sql = \"SELECT * FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n }",
"function getSelectedFieldsRecordByField($selectedFields, $fieldName, $searchKey, $orderByField='', $orderByValue='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getSelectedTableRecordByField($this->table, $selectedFields, $fieldName , $searchKey, $orderByField, $orderByValue );\r\n\t\t\treturn $sqlRecord;\r\n\t\t\t\r\n\t\t}",
"public function select() {\r\n\t\t//$src = Dbi_Source::GetModelSource($this);\r\n\t\t//return $src->select($this);\r\n\t\treturn $this->source->select($this);\r\n\t}",
"function viewrec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n\t$customercode = $row[\"comp_id\"];\r\n\t$field=\"comp_id\";\r\n\t//echo \"View : OutletCode :\".$customercode;\r\n \tshowrecnav(\"view\", $recid, $count);\r\n?>\r\n\t<br>\r\n<?php\r\n\tshowrow($row, $recid); \r\n\t\r\n\t\r\n?>\r\n\t<br>\r\n\r\n\t<hr size=\"1\" noshade>\r\n\t<table class=\"bd\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\r\n\t\t<tr>\r\n\t\t\t<td><input type=\"button\" name=\"btnEdit\" value=\"Edit Record\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','company/company.php?status=true&a=edit&filter=<?php echo $customercode ?>&filter_field=<?php echo $field ?>')\"></td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<?php\r\n \t\tmysqli_free_result($res);\r\n\t}",
"public function show(Record $record)\n {\n return $record;\n }",
"public function DropDown_Records() {\n\treturn $this->SelectRecords(NULL,'IFNULL(Sort,NameSng)');\t// sort by Name\n }",
"function get_current_record($recordVar, $throwException = true)\n{\n return get_view()->getCurrentRecord($recordVar, $throwException);\n}",
"function getSelectedFieldsRecordListByField($selectedFields, $fieldName, $searchKey, $searchStatus = '', $orderByField='', $orderByValue='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getSelectedTableRecordListByField($this->table, $selectedFields, $fieldName , $searchKey, $searchStatus, $orderByField, $orderByValue );\r\n\t\t\treturn $sqlRecord;\r\n\t\t\t\r\n\t\t}",
"function SelectedContact() {\n\t\t\n\t\t$data['display_block2'] = \"\";\n\t\t\t\n\t\t//Get the master id of the selected contact from the Post variable\n $master_id = $this->input->post('master_id');\n\n\t\t//Get the contact details for this master_id from all tables\n $data['display_block2'] .= $this->AddressBook->getSelectedContactDetails($master_id);\n\n //Fill the select box again - better to save this off but do like this for the moment\n $data['display_block'] = $this->AddressBook->selectContacts();\n\n //View the selected contacts dropdown and the details for the selected contact \n $this->load->view('SelectEntry', $data);\n }",
"function getSelectedFieldsRecordListArray($selectedFields, $fieldName, $searchKey, $searchStatus='', $orderByField='', $orderByValue='', $offset='', $limit='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getSelectedTableRecordListArray($this->table, $selectedFields, $fieldName , $searchKey,$searchStatus, $orderByField, $orderByValue );\r\n\t\t\treturn $sqlRecord;\r\n\t\t\t\r\n\t\t}",
"function select()\r\n{\r\n\tglobal $a;\r\n \tglobal $showrecs;\r\n \tglobal $page;\r\n \tglobal $filter;\r\n \tglobal $filterfield;\r\n \tglobal $wholeonly;\r\n \tglobal $order;\r\n \tglobal $ordtype;\r\n\tglobal $categoryList;\r\n\tglobal $catId;\r\n\tglobal $pagerange;\r\n\t//echo \"Show Rec :\".$showrecs.\"<br>\";\r\n \tif ($a == \"reset\") {\r\n \t$filter = \"\";\r\n \t$filterfield = \"\";\r\n \t$wholeonly = \"\";\r\n \t$order = \"\";\r\n \t$ordtype = \"\";\r\n\t\t$catId=\"\";\r\n \t}\r\n\r\n \t$checkstr = \"\";\r\n \t\r\n \tif ($ordtype == \"asc\") { $ordtypestr = \"desc\"; } else { $ordtypestr = \"asc\"; }\r\n \t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n\t//echo \"Count =\".$count;\r\n \tif ($count % $showrecs != 0) {\r\n \t$pagecount = intval($count / $showrecs) + 1;\r\n \t}\r\n \telse {\r\n \t$pagecount = intval($count / $showrecs);\r\n \t}\r\n \r\n\t$startrec = $showrecs * ($page - 1);\r\n \tif ($startrec < $count) {mysqli_data_seek($res, $startrec);}\r\n \t$reccount = min($showrecs * $page, $count);\r\n\t\r\n\t$categoryList = buildCategoryOptions($catId);\r\n?>\r\n\t<form name=\"frmListProduct\" action=\"\" method=\"post\">\r\n\t\t<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\" bgcolor=\"#EAEAEA\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"5\" align=\"left\"><b>Custom Filter</b> \r\n\t\t\t\t<input type=\"text\" name=\"filter\" class=\"uppercase\" value=\"<?php echo $filter ?>\">\r\n\t\t\t\t\r\n <select name=\"filter_field\">\r\n\t\t\t\t\t<option value=\"\">All Fields</option>\r\n <option value=\"<?php echo \"part_code\" ?>\"<?php if ($filterfield == \"part_code\") { echo \"selected\"; } ?>>\r\n\t\t\t\t\t\t<?php echo htmlspecialchars(\"Part Number\")?>\r\n </option>\r\n\t\t\t\t\t<option value=\"<?php echo \"prod_name\" ?>\"<?php if ($filterfield == \"prod_name\") { echo \"selected\"; } ?>>\r\n\t\t\t\t\t\t<?php echo htmlspecialchars(\"Product Name\")?>\r\n </option>\r\n\t\t\t\t\r\n <option value=\"<?php echo \"prod_price1\" ?>\"<?php if ($filterfield == \"prod_price1\") { echo \"selected\"; } ?>>\r\n\t\t\t\t\t\t<?php echo htmlspecialchars(\"Selling Price\") ?>\r\n </option>\r\n <option value=\"<?php echo \"prod_tax\" ?>\"<?php if ($filterfield == \"prod_tax\") { echo \"selected\"; } ?>>\r\n\t\t\t\t\t\t<?php echo htmlspecialchars(\"Tax\") ?>\r\n </option>\r\n <option value=\"<?php echo \"prod_discount\" ?>\"<?php if ($filterfield == \"prod_discount\") { echo \"selected\"; } ?>>\r\n\t\t\t\t\t\t<?php echo htmlspecialchars(\"Discount\") ?>\r\n </option>\r\n \r\n \r\n\t\t\t\t </select>\r\n \r\n\t\t\t\t<input type=\"button\" name=\"action\" value=\"Apply\" onClick=\"javascript:SearchData(this.form,'stock/stock.php?status=true&a=filter')\" >\r\n\t\t\t\t<input type=\"button\" name=\"action\" value=\"Reset\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=reset')\">\r\n </td>\r\n\t\t\t\t\r\n </tr>\r\n\t\t\t\r\n\t\t</table>\r\n\t</form>\r\n\t<hr size=\"1\" noshade>\r\n <form name=\"frmProduct\" id=\"frmProduct\" action=\"stock/stock.php?status=true&a=del\" method=\"post\">\r\n\t<table class=\"bd\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\">\r\n\t\t<tr>\r\n\t\t\t\r\n <td align=\"right\">Rows Per Page\r\n \t <select name=\"pageperrecord\" onChange=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&pageId='+this.value)\">\r\n\t\t\t\t<?php echo pageRangeList($showrecs); ?>\r\n </select>\r\n\t\t\t</td>\r\n <td align=\"right\">View products in : \r\n \t\t\t<select name=\"cboCategory\" class=\"box\" id=\"cboCategory\" onChange=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&catId='+this.value)\">\r\n \t\t\t\t<option selected>All Category</option>\r\n\t\t\t\t\t\t<?php echo $categoryList; ?>\r\n \t\t\t\t</select>\r\n \t\t\t</td>\r\n\t\t</tr>\r\n\t</table>\r\n\r\n\t<table class=\"tbl\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\"width=\"100%\">\r\n \t<tr>\r\n\t\t\t<td class=\"hr\"><input name=\"CheckAll\" type=\"checkbox\" id=\"CheckAll\" value=\"Y\" onClick=\"javascript:ClickCheckAll(this.form);\"></td>\r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"part_code\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Part Number\") ?>\r\n </a>\r\n </td>\r\n\t\t\t<td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"prod_name\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Product Name\") ?>\r\n </a>\r\n </td>\r\n \r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"prod_price\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Purchased Price\") ?>\r\n </a>\r\n </td>\r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"prod_price1\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Selling Price\") ?>\r\n </a>\r\n </td>\r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"unit_name\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Unit\") ?>\r\n </a>\r\n </td>\r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"prod_obal_qty\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Product OB\") ?>\r\n </a>\r\n </td>\r\n <td class=\"hr\">\r\n \t<a class=\"hr\" href=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&order=<?php echo \"prod_qty\" ?>&type=<?php echo $ordtypestr ?>')\">\r\n\t\t\t\t\t<?php echo htmlspecialchars(\"Available Qty\") ?>\r\n </a>\r\n </td>\r\n \r\n\t\t</tr>\r\n\t<?php\r\n\t$prev=\"\";\r\n \tfor ($i = $startrec; $i < $reccount; $i++)\r\n \t{\r\n \t$row = mysqli_fetch_assoc($res);\r\n \t$style = \"dr\";\r\n \tif ($i % 2 != 0) {\r\n \t\t$style = \"sr\";\r\n \t}\r\n\t\tif($prev != $row[\"cat_name\"]){\r\n\t\t\t$prev =$row[\"cat_name\"];\r\n\t?>\r\n \t<tr class='srhighlight2'>\r\n <td align='left' colspan=\"11\">\r\n \t<?php echo $row[\"cat_name\"]; ?>\r\n </td>\r\n </tr>\r\n <?php\r\n\t\t}\r\n\t\tif($row[\"prod_name\"] != \"\"){\r\n\t\t$pcode = $row[\"prod_code\"];\r\n\t\t$field = \"prod_code\";\r\n\t\t//$prod_dis_amt = (float) $row[\"prod_price\"] * ((float) $row[\"prod_discount\"] / 100) ;\r\n\t?>\r\n \r\n\t<tr class=\"<?php echo $style ?>\" style=\"cursor:pointer\">\r\n \t<td align=\"left\">\r\n \t<input name=\"userbox[]\" type=\"checkbox\" id=\"userbox<?php echo $i;?>\" value=\"<?php echo $row['prod_code']; ?>\">\r\n </td>\r\n <td align=\"left\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&recid=<?php echo $i ?>')\">\r\n \r\n\t\t <?php echo htmlspecialchars(strtoupper($row[\"part_code\"])) ?>\r\n \t\r\n </td>\r\n\t\t<td align=\"left\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&recid=<?php echo $i ?>')\">\r\n \r\n\t\t <?php echo htmlspecialchars(strtoupper($row[\"prod_name\"])) ?>\r\n \t\r\n </td>\r\n \r\n\t\t\r\n <td align=\"right\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&filter=<?php echo $pcode ?>&filter_field=<?php echo $field ?>')\">\r\n \t\r\n\t\t\t\t<?php echo number_format($row[\"prod_price\"],2,'.',',') ?>\r\n \r\n </td>\r\n <td align=\"right\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&filter=<?php echo $pcode ?>&filter_field=<?php echo $field ?>')\">\r\n \t\r\n\t\t\t\t<?php echo number_format($row[\"prod_price1\"],2,'.',',') ?>\r\n \r\n </td>\r\n <td align=\"right\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&filter=<?php echo $pcode ?>&filter_field=<?php echo $field ?>')\">\r\n \t\r\n\t\t\t\t<?php echo $row[\"unit_name\"] ?>\r\n \r\n </td>\r\n <td align=\"right\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&filter=<?php echo $pcode ?>&filter_field=<?php echo $field ?>')\">\r\n \t\r\n\t\t\t\t<?php echo $row[\"prod_obal_qty\"] ?>\r\n \r\n </td>\r\n <td align=\"right\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','stock/stock.php?status=true&a=view&filter=<?php echo $pcode ?>&filter_field=<?php echo $field ?>')\">\r\n \t\r\n\t\t\t\t<?php echo $row[\"prod_qty\"] ?>\r\n \r\n </td>\r\n \r\n\t</tr>\r\n\t<?php\r\n\t\t}\r\n \t}//for loop\r\n \tmysqli_free_result($res);\r\n\t?>\r\n\t <input type=\"hidden\" name=\"hdnCount\" id=\"hdnCount\" value=\"<?php echo $i; ?>\">\r\n\t</table>\r\n </form>\r\n\t<br><center>\r\n\t<?php \r\n\t\t//showpagenav($page, $pagecount); \r\n\t\tshowpagenav($page, $pagecount,$pagerange,'stock/stock.php'); \r\n}",
"public function select() {\n return $this->getActionByName('Select');\n }",
"public static function doSelect($params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->select(self::TABLE_NAME, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}",
"public function show_record() {\n return $this->show_record;\n }"
]
| [
"0.6614141",
"0.619571",
"0.619571",
"0.61350375",
"0.61350375",
"0.61350375",
"0.59989446",
"0.59615946",
"0.5892473",
"0.57773936",
"0.56467754",
"0.5639115",
"0.5635424",
"0.5584868",
"0.55797106",
"0.5569013",
"0.55659354",
"0.5551983",
"0.5535125",
"0.5521067",
"0.5484545",
"0.5455362",
"0.54333854",
"0.542276",
"0.54072297",
"0.5358211",
"0.5356791",
"0.533821",
"0.5335369",
"0.5328215"
]
| 0.6660076 | 0 |
BizForm::SearchRecord() show the query record mode | public function SearchRecord()
{
$this->UpdateActiveRecord(null);
$this->m_QueryONRender = false;
$this->SetDisplayMode(MODE_Q);
return $this->ReRender(true,false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showRecordInSearch()\n {\n return !($this->owner->hasField('ShowInSearch') AND false == $this->owner->ShowInSearch);\n }",
"function showquery() {\r\n #~ echo '<td align=right>'; // see nav.inc.php for reason\r\n echo '<form name=\"search\" method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n #~ echo '<img src=\"images/b_search.png\" border=\"0\">';\r\n echo lang('Search').' ';\r\n echo '<input type=hidden name=m value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=act value=\"browse\">';\r\n echo '<input type=text name=query value=\"'.$this->_query.'\" size=10>';\r\n echo ' '.lang('in').' ';\r\n echo '<select name=\"qf\">';\r\n #~ echo '<option value=\"\">With selected:</option>';\r\n echo '<option value=\"*\">'.lang('All fields').'</option>';\r\n echo \"<option value=''>______________</option>\";\r\n foreach ($this->properties as $key=>$col) {\r\n if (!$col->queryable or $col->colname=='') continue;\r\n $key == $_REQUEST['qf']? $ischecked = 'selected': $ischecked = '';\r\n echo \"<option value='$key' $ischecked>{$col->label}</option>\";\r\n }\r\n echo '</select>';\r\n #~ echo '<input type=submit value=\"Query\">';\r\n echo '</form>';\r\n #~ echo '</td>'; // see nav.inc.php for reason\r\n\r\n #~ echo '</td></tr></table>';\r\n }",
"public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }",
"function clsRecorditemsSearch()\r\n {\r\n\r\n global $FileName;\r\n $this->Visible = true;\r\n $this->Errors = new clsErrors();\r\n $this->InsertAllowed = false;\r\n $this->UpdateAllowed = false;\r\n $this->DeleteAllowed = false;\r\n if($this->Visible)\r\n {\r\n $this->ComponentName = \"itemsSearch\";\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->s_title = new clsControl(ccsTextBox, \"s_title\", \"s_title\", ccsText, \"\", CCGetRequestParam(\"s_title\", $Method));\r\n $this->s_description = new clsControl(ccsTextBox, \"s_description\", \"s_description\", ccsMemo, \"\", CCGetRequestParam(\"s_description\", $Method));\r\n $this->CatID = new clsControl(ccsCheckBox, \"CatID\", \"CatID\", ccsInteger, \"\", CCGetRequestParam(\"CatID\", $Method));\r\n $this->CatID->CheckedValue = 1;\r\n $this->CatID->UncheckedValue = 0;\r\n $this->DoSearch = new clsButton(\"DoSearch\");\r\n }\r\n }",
"function Search_show()\n{\n global $db;\n global $tpl;\n global $sForm;\n $sFormTitle = \"Zoek nieuwsbericht\";\n $sActionFileName = \"nieuwsRecord.php\";\n\n//-------------------------------\n// Search Open Event begin\n// Search Open Event end\n//-------------------------------\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n $tpl->set_var(\"ActionPage\", $sActionFileName);\n//-------------------------------\n// Set variables with search parameters\n//-------------------------------\n $flds_titel = strip(get_param(\"s_titel\"));\n $flds_datum = strip(get_param(\"s_datum\"));\n\n//-------------------------------\n// Search Show begin\n//-------------------------------\n\n\n//-------------------------------\n// Search Show Event begin\n// Search Show Event end\n//-------------------------------\n $tpl->set_var(\"s_titel\", tohtml($flds_titel));\n $tpl->set_var(\"s_datum\", tohtml($flds_datum));\n\n//-------------------------------\n// Search Show end\n//-------------------------------\n\n//-------------------------------\n// Search Close Event begin\n// Search Close Event end\n//-------------------------------\n $tpl->parse(\"FormSearch\", false);\n//===============================\n}",
"public function show_record() {\n return $this->show_record;\n }",
"public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}",
"function print_search_form(){\n global $cfg, $db, $libhtml;\n\n $html = $libhtml->form_start();\n $html .= open_table();\n $html .= $libhtml->render_form_table_row(\"keyword\", my_request(\"keyword\"), \"Keyword\", \"keyword\");\n $html .= close_table();\n $html .= $libhtml->render_form_table_row_hidden(\"search\", \"Search\");\n $html .= $libhtml->render_form_table_row_hidden(\"move_to_get\", true);\n\n $html .= $libhtml->render_actions(\n array(\n $libhtml->render_button(\"search_button\", \"Search\"),\n ),\n array(\n \"show_prompt\"=>false,\n \"show_cancel\"=>false,\n \"pause\"=>false,\n )\n );\n\n $html .= $libhtml->form_end();\n $html .= '<div class=\"clear\"></div><br/>';\n return $html;\n }",
"function search($record=\"\", $extended=false, $fieldprefix=\"\")\n {\n $languages = $this->getLanguages();\n\n $id = $this->getSearchFieldName($prefix);\n $id .= !$this->isMlNode()?'_'.$languages[0]:'';\n\n $result= '<input type=\"text\" name=\"'.$id.'\"'.\n ' value=\"'.$record[$this->fieldName().(!$this->isMlNode()?'_'.$languages[0]:'')].'\"'.\n ($this->m_searchsize > 0 ? ' size=\"'.$this->m_searchsize.'\"' : '').\n ($this->m_maxsize > 0 ? ' maxlength=\"'.$this->m_maxsize.'\"' : '').'>';\n\n return $result;\n }",
"public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }",
"public function searchForm() {\n $search = $this->object->infoSearch();\n $searchQuery = $this->object->infoSearchQuery();\n $searchValue = urldecode($this->id);\n if ($search!='' || $searchQuery!='') {\n $fieldsSearch = FormField_Text::create(array('name'=>'search', 'value'=>$searchValue));\n $searchInfo = '';\n if ($this->id!='') {\n $searchInfo = '<div class=\"button buttonBack\">\n <a href=\"'.url($this->type.'/listAdmin', true).'\">'.__('viewAllItems').'</a>\n </div>\n <h2>'.__('resultsFor').': \"'.$searchValue.'\"'.'</h2>';\n }\n return '<div class=\"formAdminSearchWrapper\">\n '.Form::createForm($fieldsSearch, array('action'=>url($this->type.'/search', true),\n 'submit'=>__('search'),\n 'class'=>'formAdminSearch')).'\n '.$searchInfo.'\n </div>';\n }\n }",
"function show()\r\n {\r\n $script = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&sort='.$this->sort.'&fltr='.$this->fltr.'&fln='.$this->fln;\r\n $script = $_SERVER['PHP_SELF'].\"?$script\";\r\n\r\n if( !$this->sort ) $this->sort='id';\r\n\t\tif($this->sort=='result') $this->sort='`result` desc';\r\n //if( strstr( $this->sort, 'seria' ) )$this->sort = $this->sort.' desc';\r\n $q = \"SELECT * FROM \".TblModSearchResult.\" where 1 order by \".$this->sort.\"\";\r\n //if( $this->srch ) $q = $q.\" and (name LIKE '%$this->srch%' OR email LIKE '%$this->srch%')\";\r\n if( $this->fltr ) $q = $q.\" and $this->fltr\";\r\n $res = $this->Right->Query( $q, $this->user_id, $this->module );\r\n //echo '<br>$q='.$q.' $res='.$res.'$this->Right->result='.$this->Right->result.' $this->user_id='.$this->user_id;\r\n if( !$res )return false;\r\n $rows = $this->Right->db_GetNumRows();\r\n\r\n /* Write Form Header */\r\n $this->Form->WriteHeader( $script );\r\n\r\n /* Write Table Part */\r\n AdminHTML::TablePartH();\r\n\r\n /* Write Links on Pages */\r\n echo '<TR><TD COLSPAN=17>';\r\n $script1 = 'module='.$this->module.'&fltr='.$this->fltr;\r\n $script1 = $_SERVER['PHP_SELF'].\"?$script1\";\r\n\t\tif( !$this->display ) $this->display = 20;\r\n //$this->Form->WriteLinkPages( $script1, $rows, $this->display, $this->start, $this->sort );\r\n\t\t$this->Form->WriteLinkPages( $script1.'&fltr='.$this->fltr, $rows, $this->display, $this->start, $this->sort );\r\n\r\n echo '<TR><TD COLSPAN=5>';\r\n $this->Form->WriteTopPanel( $script );\r\n\r\n echo '<td colspan=5>';\r\n echo $this->Form->TextBox('srch', $this->srch, 25);\r\n echo '<input type=submit value='.$this->Msg->show_text('_BUTTON_SEARCH',TblSysTxt).'>';\r\n\r\n /*\r\n echo '<td><td><td><td><td colspan=2>';\r\n $this->Form->WriteSelectLangChange( $script, $this->fln);\r\n */\r\n\r\n $script2 = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&task=show&fltr='.$this->fltr;\r\n $script2 = $_SERVER['PHP_SELF'].\"?$script2\";\r\n ?>\r\n <TR>\r\n <td class=\"THead\">*</Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=id><?=$this->Msg->show_text('FLD_ID')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=query><?=$this->Msg->show_text('FLD_QUERY')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=ip><?=$this->Msg->show_text('FLD_IP')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=date><?=$this->Msg->show_text('FLD_DATE')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=time><?=$this->Msg->show_text('FLD_TIME')?></A></Th>\r\n \r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=result><?=$this->Msg->show_text('FLD_RESULT')?></A></Th>\r\n \r\n <?\r\n\r\n $up = 0;\r\n $down = 0;\r\n $a = $rows;\r\n $j = 0;\r\n $row_arr = NULL;\r\n for( $i = 0; $i < $rows; $i++ )\r\n {\r\n $row = $this->Right->db_FetchAssoc();\r\n if( $i >= $this->start && $i < ( $this->start+$this->display ) )\r\n {\r\n $row_arr[$j] = $row;\r\n $j = $j + 1;\r\n }\r\n }\r\n\r\n $style1 = 'TR1';\r\n $style2 = 'TR2';\r\n for( $i = 0; $i < count( $row_arr ); $i++ )\r\n {\r\n $row = $row_arr[$i];\r\n\r\n if ( (float)$i/2 == round( $i/2 ) )\r\n {\r\n echo '<TR CLASS=\"'.$style1.'\">';\r\n }\r\n else echo '<TR CLASS=\"'.$style2.'\">';\r\n\r\n echo '<TD>';\r\n $this->Form->CheckBox( \"id_del[]\", $row['id'] );\r\n\r\n echo '<TD>';\r\n $this->Form->Link( $script.\"&task=edit&id=\".$row['id'], stripslashes( $row['id'] ) );\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['query'] )!='' ) echo $row['query'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['ip'] )!='' ) echo $row['ip'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['date'] )!='' ) echo $row['date'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['time'] )!='' ) echo $row['time'];\r\n\r\n echo '<TD align=center>';\r\n if( trim($row['result'])!='' ) echo $row['result'];\r\n\r\n } //-- end for\r\n\r\n AdminHTML::TablePartF();\r\n $this->Form->WriteFooter();\r\n return true;\r\n\r\n \r\n}",
"public function ShowSearchFormAtAll(): bool\n {\n return true;\n }",
"public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}",
"function search($record=\"\")\n {\n return \" \";\n }",
"function nscm_show_search_form() {\n\treturn get_search_form();\n}",
"public function searchPrint()\n {\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\t\t$criteria->compare('belibrgdetail_id',$this->belibrgdetail_id);\n\t\t$criteria->compare('pembelianbarang_id',$this->pembelianbarang_id);\n\t\t$criteria->compare('barang_id',$this->barang_id);\n\t\t$criteria->compare('hargabeli',$this->hargabeli);\n\t\t$criteria->compare('hargasatuan',$this->hargasatuan);\n\t\t$criteria->compare('jmlbeli',$this->jmlbeli);\n\t\t$criteria->compare('jmldlmkemasan',$this->jmldlmkemasan);\n\t\t$criteria->compare('LOWER(satuanbeli)',strtolower($this->satuanbeli),true);\n // Klo limit lebih kecil dari nol itu berarti ga ada limit \n $criteria->limit=-1; \n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination'=>false,\n ));\n }",
"public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"function show_search_result($records, $searchTimeElapsed){\r\n\t//Check if records were returned\r\n\tif ($records) {\r\n try { \t\r\n print \"<a name='sr'></a><div style='clear: both;'><br/><h2>Search Results</h2>\\n\";\r\n print \"<p>Returned \" . count($records) . \" total record\";\r\n if (count($records) !== 1) print 's';\r\n print \" in \";\r\n\tprintf (\"%01.3f\", $searchTimeElapsed);\r\n\tprint \" seconds:</p>\";\r\n\t\r\n\t$searchResultArray = array();\r\n\tforeach($records as $record){\r\n\t\t$recordObject = new Sobject($record->record);\r\n\t\t$searchResultArray[$recordObject->type][] = $recordObject;\r\n\t}\r\n\r\n\r\n\tforeach($searchResultArray as $recordSetName=>$records){\r\n\t\techo \"<h3 style='color: #0046ad;'>$recordSetName</h3>\";\r\n\t\t\r\n\t print \"<table class='data_table'>\\n\";\r\n\t\t//Print the header row on screen\r\n\t\t$record0 = $records[0];\r\n\t\tprint \"<tr><td>1</td>\";\r\n\t\t//If the user queried for the Salesforce ID, this special method is nessisary\r\n\t\t//to export it from the nested SOAP message. This will always be displayed\r\n\t\t//in the first column regardless of search order\r\n\t\tif ($record0->Id){\r\n\t\t\tprint \"<th>Id</th>\";\r\n\t\t}\r\n\t\tif ($record0->fields){\r\n\t\t\tforeach($record0->fields->children() as $field){\r\n\t\t \t\t\tprint \"<th>\";\r\n\t\t \tprint htmlspecialchars($field->getName(),ENT_QUOTES,'UTF-8');\r\n\t\t \tprint \"</th>\";\r\n\t\t }\r\n\t\t}else {\r\n\t\t\tprint \"</td></tr>\";\r\n\t\t}\r\n\t print \"</tr>\\n\";\r\n\t\r\n\t\t\t//Print the remaining rows in the body\r\n\t\t\t$rowNum = 2;\r\n\t foreach ($records as $record) {\t\r\n\t print \"<tr><td>$rowNum</td>\";\r\n\t $rowNum++;\r\n\t //Another check if there are ID columns in the body\r\n\t if (isset($record->Id)){\r\n\t \tprint \"<td>$record->Id</td>\";\r\n\t }\r\n\t //Print the non-ID fields\r\n\t if (isset($record->fields)){\r\n\t\t\tforeach($record->fields as $datum){\r\n\t\t\t\tprint \"<td>\";\r\n\t\t\t\tif($datum){\r\n\t\t\t\tprint htmlspecialchars($datum,ENT_QUOTES,'UTF-8');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprint \" \";\r\n\t\t\t\t}\r\n\t\t\t\tprint \"</td>\";\r\n\t\t\t}\r\n\t\t\tprint \"</tr>\\n\";\r\n\t } else{\r\n\t \tprint \"</td></tr>\\n\";\r\n\t }\r\n\t }\r\n\t print \"</table><p/>\";\r\n\t}\r\n\t print\t\"</div>\\n\";\r\n } catch (Exception $e) {\r\n \t$errors = null;\r\n\t\t$errors = $e->getMessage();\r\n\t\tprint \"<p />\";\r\n\t\tshow_error($errors);\r\n\t\tinclude_once('footer.php');\r\n\t\texit;\r\n }\r\n } else {\r\n \tprint \"<p><a name='sr'> </a></p>\";\r\n \tshow_error(\"Sorry, no records returned.\");\r\n }\r\n include_once('footer.php');\r\n}",
"function showSearchResult() {\t\t\t\t\t\n\t\t$this->setWhereArray();\n\t\t\n\t\tif(empty($_GET['order'])) {\n\t\t\t$order = \"size\";\n\t\t} else {\n\t\t\t$order = $_GET['order'];\n\t\t}\n\t\t\n\t\tif(empty($_GET['pageLimit'])) {\n\t\t\t$pl = 5;\n\t\t} else {\n\t\t\t$pl = $_GET['pageLimit'];\n\t\t}\n\t\t\n\t\tif(empty($_GET['page'])) {\n\t\t\t$currentPage = 0;\n\t\t\t$currentFinds = 1;\n\t\t} else {\n\t\t\t$currentPage = $_GET['page'];\n\t\t\t$currentFinds = (($currentPage - 1) * $pl) + 1;\n\t\t}\n\t\t\n\t\t$advsAll = \\App\\SearchModel::where($this->whereArray);\n\t\t$all = $advsAll->count();\n\t\t$advs=$advsAll->orderBy('Highlighted','desc')->orderBy($order,'desc')->paginate($pl);\n\t\t\n\t\t$currentFindsMax = $this->getCurrentMaxPage($all, $pl, $currentPage);\n\t\t\n\t\treturn view('search',['in'=>$advs, 'order'=>$order, 'pageLimit'=>$pl, 'finds'=>$all, 'cf'=>$currentFinds, 'cfm'=>$currentFindsMax, 'linkArray' => $this->linkArray]);\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function display_search_field() {\n return $this->display_field(0, 'asearchtemplate');\n }",
"public function InitializeSearch($cn) {\r\n //SetDisplayValues($attributes) \r\n\r\n /* Campos de busqueda */\r\n $this->m_obj->GetField(\"cap_code\")->SetDisplayValues(Array(\"Name\"=>\"cap_code\", \"Label\"=>\"Capacitación Nro\", \"Type\"=>\"int\", \"IsPK\"=>true, \"IsForDB\"=>true, \"Order\"=>101, \"Presentation\"=>\"INT\", \"IsNullable\"=>false));\r\n $this->m_obj->GetField(\"mon_code\")->SetDisplayValues(Array(\"Name\"=>\"mon_code\", \"Label\"=>\"Monitoreo Nro\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>102, \"Presentation\"=>\"INT\"));\r\n $this->m_obj->GetField(\"cir_code\")->SetDisplayValues(Array(\"Name\"=>\"cir_code\", \"Label\"=>\"Circuito\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>103, \"Presentation\"=>\"CIRCUITO_ACTIVO\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_operador\")->SetDisplayValues(Array(\"Name\"=>\"use_code_operador\", \"Label\"=>\"Operador\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>104, \"Presentation\"=>\"OPERADOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_supervisor\")->SetDisplayValues(Array(\"Name\"=>\"use_code_supervisor\", \"Label\"=>\"Supervisor Asignado\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>105, \"Presentation\"=>\"SUPERVISOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"cap_status\")->SetDisplayValues(Array(\"Name\"=>\"cap_status\", \"Label\"=>\"Estado\", \"Size\"=>20, \"IsForDB\"=>true, \"Order\"=>107, \"Presentation\"=>\"CAP_STATUS\", \"InitialValue\"=>\"PENDIENTE\"));\r\n }",
"protected static function display_search_form() {\n $locale = self::$locale;\n add_to_title($locale['global_202']);\n $form_elements = self::$form_config['form_elements'];\n /*\n * Search Areas\n */\n $options_table = \"<p><strong>\".$locale['405'].\"</strong></p><table style='width:100%'>\\n\";\n if (!empty(self::$form_config['radio_button'])) {\n foreach (self::$form_config['radio_button'] as $key => $value) {\n $options_table .= \"<tr>\\n<td>\".$value.\"</td>\\n</tr>\\n\";\n }\n }\n $options_table .= \"<tr>\\n<td>\\n\n \".form_checkbox('stype', $locale['407'], self::get_param('stype'), [\n 'type' => 'radio',\n 'value' => 'all',\n 'onclick' => 'display(this.value)',\n 'reverse_label' => TRUE\n ]\n ).\"</td>\\n</tr>\\n</table>\\n\";\n\n /*\n * Date limit\n */\n $date_opts = [\n '0' => $locale['421'],\n '86400' => $locale['422'],\n '604800' => $locale['423'],\n '1209600' => $locale['424'],\n '2419200' => $locale['425'],\n '7257600' => $locale['426'],\n '14515200' => $locale['427']\n ];\n\n $disabled_status = FALSE;\n if (isset($form_elements[self::get_param('stype')]['disabled'])) {\n $disabled_status = !empty($form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n if (self::get_param('stype') != 'all') {\n $disabled_status = in_array(\"datelimit\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE;\n }\n }\n\n if (self::get_param('stype') == \"all\") {\n $disabled_status = TRUE;\n }\n\n $search_areas = \"<div class='row'>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['420'].\"</div>\";\n $search_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $search_areas .= form_select('datelimit', '', self::get_param('datelimit'),\n [\n 'inner_width' => '150px',\n 'options' => $date_opts,\n 'deactivate' => $disabled_status\n ]);\n $search_areas .= form_checkbox('fields', $locale['430'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '2',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields1\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['431'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= form_checkbox('fields', $locale['432'], self::get_param('fields'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'fields3',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"fields3\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $search_areas .= \"</div></div>\";\n\n /*\n * Sort\n */\n $sort_opts = [\n 'datestamp' => $locale['441'],\n 'subject' => $locale['442'],\n 'author' => $locale['443']\n ];\n\n $sort = \"<div class='row'>\";\n $sort .= \"<div class='col-xs-12 col-sm-3'>\".$locale['440'].\"</div>\";\n $sort .= \"<div class='col-xs-12 col-sm-9'>\";\n $sort .= form_select('sort', '', self::get_param('sort'), [\n 'inner_width' => '150px',\n 'options' => $sort_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"sort\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]);\n $sort .= form_checkbox('order', $locale['450'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '0',\n 'reverse_label' => TRUE,\n 'input_id' => 'order1',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order1\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= form_checkbox('order', $locale['451'], self::get_param('order'),\n [\n 'type' => 'radio',\n 'value' => '1',\n 'reverse_label' => TRUE,\n 'input_id' => 'order2',\n 'class' => 'm-b-0',\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"order2\", $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $sort .= \"</div></div>\";\n\n /*\n * Char list\n */\n $char_opts = [\n '50' => '50',\n '100' => '100',\n '150' => '150',\n '200' => '200'\n ];\n\n $char_areas = \"<div class='row'>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-3'>\".$locale['460'].\"</div>\";\n $char_areas .= \"<div class='col-xs-12 col-sm-9'>\";\n $char_areas .= form_select('chars', '', self::get_param('chars'), [\n 'inner_width' => '150px',\n 'options' => $char_opts,\n 'deactivate' => (self::get_param('stype') != \"all\" ? (isset($form_elements[self::get_param('stype')]) && in_array(\"chars\",\n $form_elements[self::get_param('stype')]['disabled']) ? TRUE : FALSE) : FALSE)\n ]\n );\n $char_areas .= \"</div></div>\";\n\n /*\n * Bind\n */\n $info = [\n 'openform' => openform('advanced_search_form', 'post', BASEDIR.'search.php'),\n 'closeform' => closeform(),\n 'search_form_stext' => form_text('stext', str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']), urldecode(self::get_param('stext')), ['inline' => FALSE, 'placeholder' => $locale['401']]),\n 'search_form_button' => form_button('search', $locale['402'], $locale['402'], ['class' => 'btn-primary']),\n 'search_form_method' => form_checkbox('method', '', self::get_param('method'),\n [\n \"options\" => [\n 'OR' => $locale['403'],\n 'AND' => $locale['404']\n ],\n 'type' => 'radio',\n 'reverse_label' => TRUE,\n ]),\n 'search_form_sources' => $options_table,\n 'search_areas' => $search_areas,\n 'sort_areas' => $sort,\n 'char_areas' => $char_areas\n ];\n /*\n * Replace\n */\n echo $info['openform'];\n echo strtr(Search::render_search(), [\n '{%title%}' => str_replace('[SITENAME]', fusion_get_settings('sitename'), self::$locale['400']),\n '{%search_text%}' => $info['search_form_stext'],\n '{%search_button%}' => $info['search_form_button'],\n '{%search_method%}' => $info['search_form_method'],\n '{%search_sources%}' => $info['search_form_sources'],\n '{%search_areas%}' => $info['search_areas'],\n '{%sort_areas%}' => $info['sort_areas'],\n '{%char_areas%}' => $info['char_areas'],\n ]);\n echo $info['closeform'];\n /*\n * Javascript\n */\n $search_js = \"function display(val) {\\nswitch (val) {\\n\";\n foreach ($form_elements as $type => $array1) {\n $search_js .= \"case '\".$type.\"':\\n\";\n foreach ($array1 as $what => $array2) {\n foreach ($array2 as $elements => $value) {\n if ($what == \"enabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = false;\\n\";\n } else {\n if ($what == \"disabled\") {\n $search_js .= \"document.getElementById('\".$value.\"').disabled = true;\\n\";\n } else {\n if ($what == \"display\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'block';\\n\";\n } else {\n if ($what == \"nodisplay\") {\n $search_js .= \"document.getElementById('\".$value.\"').style.display = 'none';\\n\";\n }\n }\n }\n }\n }\n }\n $search_js .= \"break;\\n\";\n }\n $search_js .= \"case 'all':\\n\";\n $search_js .= \"document.getElementById('datelimit').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('fields3').disabled = false;\\n\";\n $search_js .= \"document.getElementById('sort').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order1').disabled = false;\\n\";\n $search_js .= \"document.getElementById('order2').disabled = false;\\n\";\n $search_js .= \"document.getElementById('chars').disabled = false;\\n\";\n $search_js .= \"break;}}\";\n add_to_footer(\"<script type='text/javascript'>\".jsminify($search_js).\"</script>\");\n }",
"public function modelReadSearchFlash($key,$recordPerPage){\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"SELECT * FROM products WHERE MATCH name against('$key' IN NATURAL LANGUAGE MODE) order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\t$result = $query->fetchAll();\t\t\t\n\t\t\t//---\n\t\t\treturn $result;\n\t\t}",
"public function searchPrint()\n {\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('shift_id',$this->shift_id);\n\t\t$criteria->compare('LOWER(shift_nama)',strtolower($this->shift_nama),true);\n\t\t$criteria->compare('LOWER(shift_namalainnya)',strtolower($this->shift_namalainnya),true);\n\n\t\tif((!empty($this->shift_jamawal))&&(strlen($this->shift_jamawal)>3)){\n\t\t\t$criteria->addCondition(\"shift_jamawal = '\".$this->shift_jamawal.\"'\");\n\t\t}\n\t\tif((!empty($this->shift_jamakhir))&&(strlen($this->shift_jamakhir)>3)){\n\t\t\t$criteria->addCondition(\"shift_jamakhir = '\".$this->shift_jamakhir.\"'\");\n\t\t}\n\t\t$criteria->compare('shift_aktif',isset($this->shift_aktif)?$this->shift_aktif:true);\n $criteria->limit=-1; \n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination'=>false,\n ));\n }",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}"
]
| [
"0.73144567",
"0.7003529",
"0.662968",
"0.6529221",
"0.6477767",
"0.6463561",
"0.6332839",
"0.6292002",
"0.62812436",
"0.627197",
"0.6210324",
"0.6180011",
"0.61651844",
"0.61642087",
"0.61187065",
"0.60652727",
"0.6026988",
"0.6022407",
"0.5994263",
"0.59770226",
"0.5973414",
"0.5953558",
"0.5950072",
"0.5918657",
"0.5912769",
"0.5911051",
"0.5905266",
"0.5905266",
"0.5905266",
"0.5905266"
]
| 0.76463497 | 0 |
BizForm::RefreshQuery() clear the search rule and do the original query when view first loaded | public function RefreshQuery()
{
if ($this->m_OnSortField) {
$this->SetSortFieldFlag($this->m_OnSortField, null);
$this->m_OnSortField = null;
$this->GetDataObj()->ClearSortRule();
}
$this->SetDisplayMode (MODE_R);
$this->m_ClearSearchRule = true;
return $this->ReRender();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function resetQuery() {\r\n\t\tunset($this->query);\r\n\t\t$this->query = $this->createQuery();\r\n\t\tunset($this->queryConstraints);\r\n\t\t$this->queryConstraints = array();\r\n\t}",
"public function updatingSearch()\n {\n $this->resetPage();\n }",
"protected function resetQuery()\n {\n $this->bindings = [];\n $this->types = [];\n }",
"public function resetFilterSearch() {\n\t\t$this->table->resetOffset();\n\t\t$this->table->resetFilter();\n\t\t$this->ctrl->redirect($this, self::CMD_SEARCH);\n\t}",
"protected function resetQuery()\n {\n array_forget($this->query, ['start', 'end']);\n }",
"public function resetQuery(): void\n\t{\n\t\t$this->state = new State();\n\t\t$this->explain = FALSE;\n\t}",
"public function clearSearch(): void {}",
"function ResetSearchParms() {\n\t\tglobal $tbl_slide;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$tbl_slide->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"function ResetSearchParms() {\r\n\t\tglobal $fs_multijoin_v;\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->sSrchWhere = \"\";\r\n\t\t$fs_multijoin_v->setSearchWhere($this->sSrchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\t}",
"public function resetQuery()\n {\n $_GET = array();\n return $this;\n }",
"protected function resetLastQuery(): void\n {\n $this->lastQuery = null;\n }",
"function ResetSearchParms() {\r\n\r\n\t\t// Clear search WHERE clause\r\n\t\t$this->SearchWhere = \"\";\r\n\t\t$this->setSearchWhere($this->SearchWhere);\r\n\r\n\t\t// Clear basic search parameters\r\n\t\t$this->ResetBasicSearchParms();\r\n\t}",
"function ResetSearchParms() {\n\t\tglobal $t_tinbai_mainsite;\n\n\t\t// Clear search WHERE clause\n\t\t$this->sSrchWhere = \"\";\n\t\t$t_tinbai_mainsite->setSearchWhere($this->sSrchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\t}",
"public function flushQuery()\n\t{\n\t\t$this->cur_query = \"\";\n\t}",
"private function reset() {\n\t\t$this->conditions = array();\n\t\t$this->setFormByConditions();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear basic search parameters\n\t\t$this->ResetBasicSearchParms();\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}",
"public static function ClearParamsQuery(){\n \tself::SetParam('limit', 0);\n \tself::SetParam('sort', '');\n \tself::SetParam('dir', '');\n }",
"public function clearWhere()\n {\n \t$this->_where = null;\n }",
"private function resetQuery()\n {\n $this->cols('*');\n }",
"public function clearQueries();",
"private function resetShowQueries(): void\n {\n if ($this->showQueries === self::SHOW_QUERIES_RESET) {\n return;\n }\n if ($this->showQueries) {\n $_REQUEST['showqueries'] = $this->showQueries;\n } else {\n unset($_REQUEST['showqueries']);\n }\n $this->showQueries = self::SHOW_QUERIES_RESET;\n }",
"public function resetCriteria();",
"function clearQuery($inparms){\n unset($this->_query);\n $this->_query = new booleanQuery();\n $this->selectedNode = -1;\n $this->selectedOperator = -1;\n\n return $this->output(NULL);\n }",
"public function clearSearchParams()\n {\n $this->GoogleApi->clearSearchParams();\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }"
]
| [
"0.698625",
"0.6736528",
"0.66738003",
"0.6599311",
"0.6552379",
"0.65205246",
"0.6426771",
"0.6267148",
"0.6260573",
"0.6220055",
"0.6219238",
"0.61949193",
"0.6187037",
"0.61685497",
"0.616151",
"0.616151",
"0.616151",
"0.6148903",
"0.61411893",
"0.6131697",
"0.6131697",
"0.6131697",
"0.60917366",
"0.608452",
"0.60820043",
"0.60525835",
"0.6047132",
"0.60329175",
"0.60074806",
"0.5979586"
]
| 0.79245067 | 0 |
BizForm::Cancel() Cancel current edit or query, then go read mode | public function Cancel()
{
$prevMode = $this->m_Mode;
$this->SetDisplayMode(MODE_R);
if ($prevMode == MODE_N) // NEW mode to READ mode, has record change, need to refresh the subforms
return $this->ReRender(true, true);
// EDIT to READ, no record change
return $this->ReRender(true,false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }",
"public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }",
"public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }",
"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 actionCancel()\n {\n }",
"public function cancel();",
"protected function cancelEdit()\n {\n if ($this->backup == NULL && $this->current) {\n $this->plugins[$this->current] = new $this->current($this->dn, $this);\n $this->plugins[$this->current]->set_acl_base($this->acl_base);\n $this->plugins[$this->current]->set_acl_category(preg_replace(\"/\\/$/\", \"\", $this->acl_category));\n\n } elseif (is_array($this->backup)) {\n foreach ($this->backup as $name => $value) {\n $this->plugins[$this->current]->$name = $value;\n }\n }\n $this->backup = NULL;\n $this->current = \"\";\n $this->closeDialogs();\n }",
"public function cancelEdit($data) {\n\t\t\n\t\t// Redirect back to the edit page\n\t\treturn $this->redirect(\"budgeting/edit\");\n\t}",
"public function cancel()\n {\n }",
"public function cancel()\n {\n }",
"function cancel()\n\t{\n\t\tif ($_GET[\"obj_id\"] != 0)\n\t\t{\n\t\t\tif ($_GET[\"new_type\"] == \"pg\")\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"view\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"subchap\");\n\t\t\t}\n\t\t}\n\t}",
"public function actionCancel()\n {\n $this->render('cancel');\n }",
"public function cancel(): void;",
"protected function cancel(): void\n {\n }",
"public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }",
"function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}",
"function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t}\n\n\t\t$this->setRedirect($url);\n\n\t}",
"public function handleCancel() {\n // logit('HC: ' . print_r($this->data, true));\n if ($this->data['submit_button'] == 'Cancel') {\n $this->data = array();\n $this->error = array();\n $this->_redirector->gotoUrl($this->mainpage);\n }\n }",
"public function cancel()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the user edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));\n\t}",
"public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }",
"function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}",
"public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}",
"function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }",
"protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}",
"protected function _cancelOperation() {}",
"public function cancel(): int;",
"function cancelar()\r\n\t{\r\n\t\t$this->_log->debug( $this->get_txt() . \"[ cancelar ]\", 'toba');\r\n\t\t$this->limpiar_memoria();\r\n\t}",
"public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }",
"public function cancel() {\n $this->__lastActions__[] = array();\n $this->__dbo__->rollback($this->__instanceId__);\n return $this;\n }",
"function cancelObject($in_rep = false)\n\t{\n\t\tilUtil::sendInfo($this->lng->txt('msg_cancel'), true);\n\t\t// TODO: check this\n\t\tilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);\n\t}"
]
| [
"0.7546945",
"0.7546945",
"0.7259913",
"0.71052265",
"0.69750965",
"0.6943742",
"0.6938777",
"0.69354075",
"0.68767154",
"0.68767154",
"0.6688513",
"0.66838574",
"0.6611698",
"0.6577655",
"0.64540774",
"0.64490914",
"0.6412394",
"0.6385865",
"0.63772994",
"0.63671595",
"0.63006026",
"0.6289871",
"0.6268275",
"0.62630343",
"0.6249187",
"0.6222542",
"0.6213817",
"0.61947614",
"0.6134057",
"0.613111"
]
| 0.8167068 | 0 |
BizForm::NewRecord() show the new record mode | public function NewRecord()
{
global $g_BizSystem;
$this->SetDisplayMode(MODE_N);
$recArr = $this->GetNewRecord();
if (!$recArr)
return $this->ProcessDataObjError();
$this->UpdateActiveRecord($recArr);
// TODO: popup message of new record successful created
return $this->ReRender();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&act=new&go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }",
"function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\n }",
"public function create()\n {\n\t\treturn view('pages.record.create');\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function newAction(): void\n {\n $this->view->form = new AnaForm(null, ['edit' => true]);\n }",
"function is_new_record() {\n\t\t\treturn $this->new_record;\n\t\t}",
"abstract protected function _setNewForm();",
"protected function actionNew() {\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n /** @var $objEdit interface_model|class_model */\r\n $objEdit = new $strType();\r\n\r\n\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->getObjSourceobject()->setSystemid($this->getParam(\"systemid\"));\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"new\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\" . $this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error creating new entry current object type not known \", class_exception::$level_ERROR);\r\n }",
"public function showAddNewRecordPage() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-add-show') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $this->data['message'] = $this->session->flashdata('message');\n $this->set_view('user/add_new_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"protected function SaveNewRecord()\n\t{\n\t\t//class\n\t\treturn false;\n\t}",
"function create()\n\t{\n\t\tif ($_GET[\"obj_id\"] != \"\")\n\t\t{\n\t\t\t$this->setTabs();\n\t\t}\n\t\tparent::create();\n\t}",
"public function newAction()\n\t{\n\t\t// the same form is used to create and edit\n\t\t$this->_forward('edit');\n\t}",
"protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }",
"function lb_show_add_record_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'add',\n\t\t)\n\t);\n}",
"public function newAction()\n {\n //the same form is used to create and edit\n $this->_forward('edit');\n }",
"public function action_create()\n {\n $this->action_edit(FALSE);\n }",
"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}",
"private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}",
"public function newAction()\n {\n $reflection = new FormReflectionManager($this->flash);\n\n $url = new Url;\n $url->id = $reflection->get('id');\n $url->address = $reflection->get('address');\n \n $this->view->url = $url;\n \n #$this->view->disable(); \n }",
"public function new()\n {\n $this->setStatus(self::STATUS_NEW);\n }",
"public function newAction()\n {\n global $config;\n\n if(empty($this->crumbs->crumbs['new']['label']))\n $this->crumbs->add('New', '/', 'New', false); \n\n $form = new ItemsTypeForm(new ItemsType(), array('new' => true));\n $this->view->setVar(\"form\", $form);\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function actionCreate()\n {\n $model = new Gl2010idid();\n\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 CreateForm();",
"public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n {\n $this->resetInputFields();\n $this->openModal();\n }",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }"
]
| [
"0.7946851",
"0.6933514",
"0.67558354",
"0.6745736",
"0.6730596",
"0.66538525",
"0.6578435",
"0.65660226",
"0.6497715",
"0.6455896",
"0.6417721",
"0.63568246",
"0.6356494",
"0.63383865",
"0.6324872",
"0.6310433",
"0.6301497",
"0.63014144",
"0.62962127",
"0.6290102",
"0.6274701",
"0.6274304",
"0.62634164",
"0.625591",
"0.6253319",
"0.62336725",
"0.62336725",
"0.62336725",
"0.62336725",
"0.62315285"
]
| 0.799912 | 0 |
default form validation do nothing. developers need to override this method to implement their logic | protected function ValidateForm()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function form_backend_validation()\r\n {\r\n return true ;\r\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"protected function preValidate() {}",
"protected function _validate() {\n\t}",
"protected function validate()\n {\n }",
"protected function performValidation()\n {\n // no required arguments\n }",
"public abstract function validation();",
"private function validate() {\n\t\n\t\t\treturn false;\n\t}",
"abstract protected function fieldValidation($submittedData);",
"public function validation();",
"public function validate() {\n\t\treturn false;\n\t}",
"public function validate()\n {\n $result = parent::validate();\n \n if ($result === true)\n $this->setErrorMessage('');\n else\n $this->setErrorMessage(Resources::getValue(Resources::SRK_FORM_ERRORGENERIC));\n \n return $result;\n }",
"protected function additionalValidation() {\n return true;\n }",
"protected function prepareForValidation()\n {\n // no default action\n }",
"public function validate_fields() {\n \n\t\t\n \n\t\t}",
"public function beforeValidate() {\n return parent::beforeValidate();\n }",
"function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}",
"function beforeValidate()\n\t{\n\t\t$this->sanitizeFields();\n\t\treturn true;\n\t}",
"function ValidateBeforeAdd(){\n $this->validator->ValidateForm($this->_data, true);\n }",
"function validate_user_form()\n {\n }",
"public function ignoreValidationErrors()\n {\n $this->ignoreValidationErrors = true;\n }",
"function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}",
"public function validation()\n\t{\n\t\t//\n\t\t\t\n\t\t\t\treturn true;\n\t\t\t\n\t}",
"public function validate_fields() {\n \n\t\t//...\n \n }",
"public function backendExtraValidate(){\n \n }",
"function __formValidation($form = '')\n {\n //----------------------------------validate a form--------------------------------------\n //nothing specified - return false & error message\n $this->form_processor->error_message = $this->data['lang']['lang_form_validation_error'];\n return false;\n }",
"public function runValidation() {\n if ($this->formSubmitted()) {\n $this->_runValidation();\n }\n return;\n }",
"function pdfbulletin_settings_form_validate(&$form, &$form_state) {\n // @todo SERIOUSLY\n}"
]
| [
"0.7409651",
"0.73257524",
"0.73257524",
"0.72906363",
"0.7247742",
"0.7065774",
"0.70466435",
"0.70052785",
"0.6993785",
"0.6974428",
"0.6966024",
"0.69583064",
"0.68987995",
"0.68730235",
"0.6852881",
"0.6847783",
"0.6795811",
"0.6794152",
"0.67883754",
"0.6783952",
"0.6780838",
"0.6768567",
"0.67539316",
"0.6747237",
"0.6740028",
"0.673803",
"0.6712391",
"0.67087954",
"0.669077",
"0.66895103"
]
| 0.73816526 | 1 |
BizForm::SaveRecord() Save current edited record with input | public function SaveRecord()
{
// call ValidateForm()
if ($this->ValidateForm() == false)
return;
$recArr = array();
if ($this->ReadInputRecord($recArr) == false)
return;
if ($this->m_Mode == MODE_N)
$dataRec = new DataRecord(null, $this->GetDataObj());
else if ($this->m_Mode == MODE_E)
$dataRec = new DataRecord($this->GetActiveRecord(), $this->GetDataObj());
foreach ($recArr as $k=>$v)
$dataRec[$k] = $v; // or $dataRec->$k = $v;
$ok = $dataRec->save();
if (!$ok)
return $this->ProcessDataObjError($ok);
$this->UpdateActiveRecord($this->GetDataObj()->GetActiveRecord());
$this->SetDisplayMode (MODE_R);
// TODO: popup message of new record successful saved
return $this->ReRender();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"function save()\n {\n $this->form_validation->set_rules($this->_get_rules());\n\n if($this->form_validation->run()){\n $entity = $this->_from_form();\n $this->data['save'] = $this->model->insert_entry($entity);\n $this->data['action_performed'] = 'save';\n $this->success($entity);\n }\n else {\n $this->create();\n }\n }",
"function saveRecord($POST = false)\n\t{\n\t\tif (!isset($this->id))\n\t\t\ttrigger_error(\"Forms2 does not have a current record to save\");\n\t\tif ($POST === false)\n\t\t\t$POST = POST::get();\n\n\t\t$this->form->setvaluesfrompost($POST);\n\t\t$this->id = $this->form->storeRecord($this->tablename, $this->id);\n\t\treturn $this->id;\n\t}",
"function save() {\n //save the added fields\n }",
"public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }",
"function editRecord($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new updated values to table in database to location of given Primary key\r\n\t\t\t$this->update($rec[0]);\r\n\t\t}",
"public function saveAction()\n {\n $field = '';\n $this->_initOrder();\n if (Mage::registry('current_order')->getCustomerId() != Mage::getSingleton('customer/session')->getCustomerId()) {\n $this->getResponse()->setBody('Error');\n exit;\n }\n\n /*\n * decide what form submitted: product field || order field\n * product fields have field names like: \"amProduct_%orderItemID%_%fieldID%\"\n */\n $productSubmit = strpos($this->getRequest()->getPost('field'), 'amProduct_') !== FALSE ? 1 : 0;\n // process product fields\n if ($productSubmit) {\n // extract all data from POST (stored value like \"xyz_orderItemID_FieldCode\"\n $itemData = explode('_', $this->getRequest()->getPost('field'), 3);\n $itemId = $itemData[1];\n $code = $itemData[2];\n\n // load product item data\n $fieldModel = Mage::getModel('amorderattach/field')->load($code, 'code');\n $field = Mage::getModel('amorderattach/order_products')->load($itemId, 'order_item_id');\n\n if ($fieldModel->getId()) {\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderItemId()) {\n $field->setOrderItemId($itemId);\n }\n\n $this->itemCode = $fieldModel->getItemCode($itemId);\n } else {\n die('Error on filed load: no such field found');\n }\n } else {\n $fieldModel = Mage::getModel('amorderattach/field')->load($this->getRequest()->getPost('field'), 'code');\n if ($fieldModel->getId()) {\n // load order item data\n $field = Mage::getModel('amorderattach/order_field')->load(Mage::registry('current_order')->getId(), 'order_id');\n $code = $this->getRequest()->getPost('field');\n $this->itemCode = $code;\n\n // triggering on save new row if OrderItemId is not set\n if (!$field->getOrderId()) {\n $field->setOrderId(Mage::registry('current_order')->getId());\n }\n } else {\n die('Error on filed load: no such field found');\n }\n }\n\n if ('date' == $code) {\n if ($this->getRequest()->getPost('value')) {\n $data = $this->getRequest()->getPost();\n $valueToFilter = $this->_filterDates($data, array('value'));\n $itemValue = date('Y-m-d', strtotime($valueToFilter['value']));\n } else {\n $itemValue = null;\n }\n } else {\n $itemValue = $this->getRequest()->getPost('value');\n }\n // set data\n $this->itemValue = $itemValue;\n $field->setData($code, $itemValue);\n\n // save if customer can edit\n if ('edit' == $fieldModel->getCustomerVisibility()) {\n $field->save();\n } else {\n die('Error on field save: no privileges for action');\n }\n\n\n Mage::register('current_attachment_order_field', $field); // required for renderer\n $this->_sendResponse($fieldModel);\n }",
"public function onSave()\n {\n try\n {\n TTransaction::open($this->database);\n\n $data = $this->form->getData();\n\n $object = new Format;\n $object->id = $data->id;\n $object->name = $data->name;\n $object->format_key = $data->format_key;\n\n $this->form->validate();\n $object->store();\n $data->id = $object->id;\n $this->form->setData($data);\n\n TTransaction::close();\n\n new TMessage('info', AdiantiCoreTranslator::translate('Record saved'));\n\n return $object;\n\n } catch (Exception $e) //in case of exception\n {\n //Get the form data\n $object = $this->form->getData($this->activeRecord);\n $this->form->setData($object);\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save() {\n\t\t\t\n\t\t}",
"function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }",
"private function saveRecord(Application $app, $record, $api_key)\n {\n // Build Insert or Update Query\n $insert = false;\n if (isset($record['id'])) {\n $sql = 'UPDATE records SET label = :label, num_value = :num_value, category = :category, active = :active, date_value = :date_value, comment = :comment WHERE id = :id AND api_key = :api_key';\n } else {\n $sql = 'INSERT INTO records (api_key, label, num_value, category, active, date_value, comment) VALUES (:api_key, :label, :num_value, :category, :active, :date_value, :comment)';\n $insert = true;\n // Remove key to prevent errors with extra keys for parameterized query\n if (array_key_exists('id', $record)) {\n unset($record['id']);\n }\n }\n\n // Save Record\n $record['api_key'] = $api_key;\n $rows_affected = $app->entryFormDb->execute($sql, $record);\n return $rows_affected;\n }"
]
| [
"0.67028517",
"0.6472436",
"0.645022",
"0.6365255",
"0.63632566",
"0.6351433",
"0.6314028",
"0.6313097",
"0.6283938",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.627577",
"0.6196494",
"0.61943144",
"0.6181376"
]
| 0.7478445 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.